Repository navigation
fix(dash-spv): rank a stalled peer last when routing - #1375
xdustinface wants to merge 1 commit into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## fix/peer-exploration #1375 +/- ##
========================================================
+ Coverage 79.99% 85.99% +6.00%
========================================================
Files 66 268 +202
Lines 27816 71713 +43897
========================================================
+ Hits 22251 61671 +39420
- Misses 5565 10042 +4477
|
af7ed75 to
30b3af3
Compare
|
This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them. |
e1ff95c to
36ddbe3
Compare
36ddbe3 to
92741dc
Compare
30b3af3 to
259d131
Compare
A peer that stopped delivering kept the rates it had earned, so shortest-queue routing kept picking it. In a mainnet run one peer serving 2 to 3 MB/s stalled with blocks owed, received 51 more block requests within 4 s, and each was hedged after 10 s. Its 30 s serving rate, which routing reads first, was sampled only while the peer was bound, so it stayed near 2.5 MB/s for over a minute. A peer that owes replies and delivers under 8 KB/s for `HEDGE_AFTER` is now stalled. Routing and hedges pick a stalled peer only when every candidate is stalled. The flag clears with the first tick of real delivery, so a fast peer computing one reply for less than `HEDGE_AFTER` keeps its rank, and one computing longer is passed over only until the reply streams in. The serving rate is now sampled whenever the peer serves all it can, as its served rate is, not only while bound.
92741dc to
c54619d
Compare
259d131 to
9402114
Compare
|
Follow-up from the #1345 review: a culprit that |
A peer that stopped delivering kept the rates it had earned, so shortest-queue routing kept picking it. In a mainnet run one peer serving 2 to 3 MB/s stalled with blocks owed, received 51 more block requests within 4 s, and each was hedged after 10 s.
A peer that owes replies and delivers under 8 KB/s for
HEDGE_AFTERis now stalled, and routing and hedges pick a stalled peer only when every candidate is stalled. The flag clears with the first tick of real delivery, so a fast peer computing one reply keeps its rank. The serving rate is now sampled whenever the peer serves all it can, not only while it is bound to its cap. This change does not depend on #1374.Stacked on #1373, and will be retargeted to
devwhen that one merges.