Skip to content

net: exit IBD to tip follow when catch-up is actually done - #270

Merged
reardencode merged 3 commits into
masterfrom
ibd/tip-follow-exit
Aug 26, 2026
Merged

net: exit IBD to tip follow when catch-up is actually done#270
reardencode merged 3 commits into
masterfrom
ibd/tip-follow-exit

Conversation

@rearden-grok

@rearden-grok rearden-grok Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • At the peer horizon, leftover off-path getdata is dropped so path_drained can become true and IBD logs catch-up complete / enters tip follow. Tip+1 and reorg-need hashes stay inflight. Mainnet 08:16:23 sat at tip=horizon, ordered=0, h2h=0, inflight=7, headers_done until SIGINT.
  • path_drained is still ordered empty and inflight empty. Mid-chain on-path inflight (and the old tip=0 / 161k-vs-958k cases) still refuse tip mode.
  • If peers advertise a higher tip (lag > 2) before we have exited, headers_done unlatches even when inflight is non-empty so getheaders resumes. lag ≤ 2 stays latched (no tip storm).

Confirm loadq/scriptq occupancy leak is out of scope.

Test plan

  • cargo test -p rbitcoin-net prune_off_path_inflight
  • cargo test -p rbitcoin-net ibd::assign (includes cover_tip_holes_*)
  • cargo test -p rbitcoin-net ibd::exit (08:16:23 matrix + should_unlatch_headers_done)
  • Required GitHub Actions green (fmt, deny, clippy, ast-grep, test, windows, macos, multinode, coverage)

Made with Cursor

rearden-grok Bot and others added 3 commits August 26, 2026 06:30
Leftover orphan hashes kept path_drained false at the peer horizon
(mainnet 08:16:23: ordered empty, h2h=0, inflight=7) so catch-up never
exited to tip follow. Tip+1 and reorg-need hashes stay inflight.

Co-authored-by: Cursor <cursoragent@cursor.com>
The 08:16:23 matrix (tip at peer horizon, headers_done, seven orphan
getdata) completes only after prune_off_path_inflight. Mid-chain on-path
inflight still refuses tip mode. path_drained stays ordered+inflight empty.

Co-authored-by: Cursor <cursoragent@cursor.com>
The latch used to clear only after path_drained, so leftover getdata
blocked getheaders when peers moved first. lag ≤ 2 stays latched to
avoid the tip storm. Changelog notes the horizon exit.

Co-authored-by: Cursor <cursoragent@cursor.com>
@reardencode
reardencode merged commit deb1bdf into master Aug 26, 2026
13 checks passed
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