net: exit IBD to tip follow when catch-up is actually done - #270
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
getdatais dropped sopath_drainedcan become true and IBD logscatch-up complete/ enters tip follow. Tip+1 and reorg-need hashes stay inflight. Mainnet 08:16:23 sat attip=horizon,ordered=0,h2h=0,inflight=7,headers_doneuntil SIGINT.path_drainedis stillorderedempty and inflight empty. Mid-chain on-path inflight (and the old tip=0 / 161k-vs-958k cases) still refuse tip mode.lag > 2) before we have exited,headers_doneunlatches even when inflight is non-empty sogetheadersresumes.lag ≤ 2stays latched (no tip storm).Confirm
loadq/scriptqoccupancy leak is out of scope.Test plan
cargo test -p rbitcoin-net prune_off_path_inflightcargo test -p rbitcoin-net ibd::assign(includescover_tip_holes_*)cargo test -p rbitcoin-net ibd::exit(08:16:23 matrix +should_unlatch_headers_done)fmt,deny,clippy,ast-grep,test,windows,macos,multinode,coverage)Made with Cursor