Skip to content

fix(dash-spv): retry a refused request at another peer - #1374

Draft
xdustinface wants to merge 1 commit into
fix/peer-explorationfrom
fix/retry-refused-requests
Draft

xdustinface wants to merge 1 commit into
fix/peer-explorationfrom
fix/retry-refused-requests

Conversation

@xdustinface

Copy link
Copy Markdown
Collaborator

Dash Core sends nothing for a getcfheaders or getcfilters whose range its filter index lacks, nor for a block it does not have. The byte charge of such a request stayed on the peer, a skipped getcfilters stopped every later filter batch of that peer from settling, and the retry could go straight back to the same peer. A testnet run sent three filter header batches to such peers 45 to 47 times each over 9 minutes.

Peers answer in request order, so a filter header, filter or block reply now settles the charge of every earlier request of those kinds still awaited. A skipped request, an expired one and a block the peer sent notfound for are retried at a peer that has not refused them in the last REFUSAL_HELD. While every connected peer refused a queued request, the supervisor swaps the slowest one out. Refusals lapse, so a node whose index was only catching up is asked again.

Stacked on #1373, and will be retargeted to dev when that one merges.

@coderabbitai

coderabbitai Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@codecov

codecov Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.70690% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.02%. Comparing base (9402114) to head (2bda02a).

Files with missing lines Patch % Lines
dash-spv/src/network/broker.rs 98.50% 2 Missing ⚠️
dash-spv/src/network/manager.rs 96.55% 1 Missing ⚠️
Additional details and impacted files
@@                   Coverage Diff                    @@
##           fix/peer-exploration    #1374      +/-   ##
========================================================
+ Coverage                 81.11%   86.02%   +4.91%     
========================================================
  Files                       171      268      +97     
  Lines                     46147    71820   +25673     
========================================================
+ Hits                      37430    61783   +24353     
- Misses                     8717    10037    +1320     
Flag Coverage Δ
core 82.80% <ø> (ø)
rpc 52.10% <ø> (ø)
spv 94.85% <98.70%> (?)
wallet 83.53% <ø> (ø)
Files with missing lines Coverage Δ
dash-spv/src/network/costs.rs 97.16% <100.00%> (ø)
dash-spv/src/network/manager.rs 94.88% <96.55%> (ø)
dash-spv/src/network/broker.rs 98.52% <98.50%> (ø)

... and 94 files with indirect coverage changes

@github-actions github-actions Bot added the merge-conflict The PR conflicts with the target branch. label Nov 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them.

@xdustinface
xdustinface force-pushed the fix/retry-refused-requests branch from b58028c to 983e28b Compare November 10, 2026 06:26
@github-actions github-actions Bot removed the merge-conflict The PR conflicts with the target branch. label Nov 10, 2026
@xdustinface
xdustinface force-pushed the fix/retry-refused-requests branch from 983e28b to 467c455 Compare November 10, 2026 14:27
Dash Core sends nothing for a `getcfheaders` or `getcfilters` whose range its filter index lacks, nor for a block it does not have. The byte charge of such a request stayed on the peer, a skipped `getcfilters` stopped every later filter batch of that peer from settling, and a skipped request at a busy peer never expired, since any answer refreshed all its requests. Once it did expire, the retry could go straight back to the same peer. A dev testnet run sent three filter header batches to three such peers 45 to 47 times each over 9 minutes.

- Peers answer in request order, so a filter header, filter or block reply settles the charge of every earlier request of those kinds still awaited, and a `cfilter` settles the batch whose stop hash it carries.
- Such a skipped request, one that expired without a kick and a block the peer sent `notfound` for are retried at a peer that did not refuse them in the last `REFUSAL_HELD` (10 s).
- While every connected peer refused a queued request, the supervisor swaps the slowest one out through the existing swap path.
- Refusals lapse, so a node whose index was only catching up, or a lone configured peer, is asked again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant