You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
dash-spv: the supervisor swaps out a "slow" peer while idle at the tip #1330
All paths are under dash-spv/src/ at c15bdbfc7 (dev).
The peer supervisor swaps out a "slow" peer while the client is synced and idle at the tip. underserving_peer (network/manager.rs:929) compares each peer's serving_rate, which keeps updating from whatever small requests a peer serves after sync (a mempool getdata, one CFHeaders, one MnListDiff). Those replies are a few KB and their speed is set by round-trip latency, not bandwidth, so the comparison says nothing about which peer is better.
Evidence. A testnet run at 2d28ac4d5, 14 minutes after sync completed:
10:56:16.515 68.67.122.25:19999 serving at 0.01 MB/s vs best 0.05 MB/s — a replacement is worth probing for
10:56:17.895 peer supervisor: swapped out slow 68.67.122.25:19999 for 85.209.243.6:19999
The peer_speed lines from the same idle period show round-trip estimates of base=14812ms and base=155498ms, which are Little's law artifacts of near-zero rates (see #1220). The replacement peer was later kicked by #1329.
The "replacement is worth probing for" debug line also prints on every 250 ms tick while the condition holds (7 times in 1.5 s here), because it sits inside underserving_peer, which runs every tick.
Fix. Only sample serving_rate while a peer is bandwidth bound (for example while bind is global or peers, or above a minimum in-flight size), and move the debug line to where the supervisor is woken.
Activity