Skip to content

fix(dash-spv): hedge a request once it waited twice its queue - #1474

Merged
ZocoLini merged 8 commits into
devfrom
fix/hedge-overdue
Nov 30, 2026
Merged

ZocoLini merged 8 commits into
devfrom
fix/hedge-overdue

Conversation

@xdustinface

@xdustinface xdustinface commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

A hedge, the second copy of a request sent to another peer, fired only once the request's peer answered nothing for HEDGE_AFTER. A peer that keeps trickling other replies never goes silent, and one held a frontier filter batch for 118 s in a testnet run. A fixed 10 s bound instead hedged the mainnet frontier batch 20 to 76 times per sync, mostly while the batch merely waited in a long queue.

The frontier filter batch and the lowest endgame block now also get a second copy once they have been on the wire for twice the queue they were sent behind, their own reply included. The queue is measured from the peer's serving rate at send, and the copy never goes before 10 s. A peer whose serving rate is not measured yet gets the 10 s.

The copy goes to the answering peer that finishes the reply soonest at its rate, since an idle slow peer used to win the second copy. A peer with a measured serving rate goes first. A frozen peer keeps its serving rate, so a block is no longer hedged to a silent peer either.

Running the hedges outside the flow controller is split out into #1531.

PR Hygiene · a64e87d

  • Bots — coderabbitai ✓, 1 thread unresolved — resolve it
  • Self-review — post /self-reviewed
  • Build green
  • Approvals — you own every area touched; none needed

When every merge requirement is met, the PR Hygiene check passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.

Summary by CodeRabbit

  • Improvements
    • Block and filter requests can be retried after a response is overdue, even if the original peer is still delivering other responses.
    • Retry selection favors recently responsive peers that are expected to finish sooner.
    • Retry timing accounts for estimated peer workload and delivery progress.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-self-review Waiting for the author to post /self-reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants