Skip to content

ibd: drain-rank tip+1 race; later holes stay solo - #625

Merged
reardencode merged 1 commit into
masterfrom
ibd/tip-hole-race
Sep 18, 2026
Merged

reardencode merged 1 commit into
masterfrom
ibd/tip-hole-race

Conversation

@rearden-grok

@rearden-grok rearden-grok Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Mainnet ~912k sat hole=1 / conf blks=0 while leftover densify FIFO kept four slow short-queue racers "live" on 64KiB ticks. Getdata cannot be cancelled; peer-level ticks are not progress on the hole hash.

  • Tip+1 only gets the 4-peer race. Later contiguous fetch holes in that gap get one racer until the prefix is in hand.
  • Rank by expected drain time (queue+1)/EWMA, not inflight count, so a fast peer with leftover densify beats an idle slow peer.
  • Drop a fifo-blocked owner (in_flight.len() > 1) even with recent rx, when another live peer exists, so a peer that can start the hole can race.

Densify cap 0 while a tip hole is open is unchanged. Pre-hole (when hole= is 0) is unchanged.

Test plan

  • cargo test -p rbitcoin-net --lib assign::tests
  • cargo clippy --workspace --all-targets -- -D warnings
  • Required CI: fmt, deny, clippy, ast-grep, test, windows, macos, coverage, nixos-module-eval
  • Do not merge unless asked

Made with Cursor

At ~912k leftover densify FIFO plus short-queue ranking left four
slow racers on tip+1 (64KiB ticks are not hole progress). Race four
peers on tip+1 only, pick by expected drain wait, and drop an owner
that still has other inflight so a peer that can start the hash can race.

Co-authored-by: Cursor <cursoragent@cursor.com>
@reardencode
reardencode merged commit 78676c4 into master Sep 18, 2026
16 checks passed
@rearden-grok
rearden-grok Bot deleted the ibd/tip-hole-race branch September 19, 2026 14:03
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