Commit 7485468
committed
fix(network): remove destructive subscription cycling from ReformMesh (TM-B2)
Log analysis from chaos test TM-A1 revealed that subscription cycling
(unsubscribe/subscribe) in ReformMesh was destroying ALL existing gossipsub
meshes, not just the mesh for the reconnecting peer.
Timeline from logs:
- 23:22:18: Node1 receiving gossip from Node2 AND Node3 normally
- 23:22:19: ReformMesh triggered with subscription cycling
- 23:22:19+: ZERO gossip messages received from ANY peer
Root cause: When you unsubscribe() from a topic, gossipsub sends LEAVE
messages to ALL mesh peers for that topic. When you resubscribe(), the
mesh must be rebuilt via GRAFT - which is not guaranteed to happen.
Fix: Remove subscription cycling entirely. Only use add_explicit_peer()
which marks the peer for mesh inclusion without affecting other meshes.
Gossipsub will GRAFT the explicit peer during its next heartbeat (1s).
This preserves existing working meshes with other peers while still
ensuring the reconnecting peer is added to the mesh.1 parent ebbc200 commit 7485468
1 file changed
+22
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2630 | 2630 | | |
2631 | 2631 | | |
2632 | 2632 | | |
2633 | | - | |
2634 | | - | |
2635 | | - | |
2636 | | - | |
2637 | | - | |
2638 | | - | |
| 2633 | + | |
2639 | 2634 | | |
2640 | | - | |
2641 | | - | |
2642 | | - | |
2643 | | - | |
2644 | | - | |
2645 | | - | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
| 2638 | + | |
| 2639 | + | |
| 2640 | + | |
| 2641 | + | |
| 2642 | + | |
| 2643 | + | |
| 2644 | + | |
| 2645 | + | |
| 2646 | + | |
| 2647 | + | |
| 2648 | + | |
| 2649 | + | |
2646 | 2650 | | |
2647 | 2651 | | |
2648 | 2652 | | |
2649 | | - | |
2650 | | - | |
| 2653 | + | |
2651 | 2654 | | |
2652 | 2655 | | |
2653 | 2656 | | |
| |||
2656 | 2659 | | |
2657 | 2660 | | |
2658 | 2661 | | |
2659 | | - | |
2660 | 2662 | | |
2661 | 2663 | | |
2662 | 2664 | | |
2663 | 2665 | | |
2664 | | - | |
| 2666 | + | |
2665 | 2667 | | |
2666 | 2668 | | |
2667 | | - | |
2668 | 2669 | | |
2669 | | - | |
| 2670 | + | |
2670 | 2671 | | |
2671 | | - | |
2672 | | - | |
2673 | | - | |
2674 | | - | |
2675 | | - | |
2676 | | - | |
2677 | | - | |
2678 | 2672 | | |
2679 | 2673 | | |
2680 | 2674 | | |
2681 | 2675 | | |
2682 | 2676 | | |
2683 | 2677 | | |
2684 | 2678 | | |
2685 | | - | |
| 2679 | + | |
| 2680 | + | |
| 2681 | + | |
2686 | 2682 | | |
2687 | 2683 | | |
2688 | 2684 | | |
| |||
0 commit comments