ibd: ignore less-work high-height forks when finding tip - #315
Merged
Conversation
Restart-at-tip treated max(version.start_height) / off-path header height as the horizon. Empty getheaders at the most-work path then never counted as EOF (lag≈900), so IBD stayed in catch-up. Off-path headers still register_explore. They no longer raise max_peer_height. Empty replies with a drained work path mark headers_done even when advertised height is far ahead; catch-up completes. A 1–2 block connecting hole still unlatches.
rearden-grok
Bot
force-pushed
the
ibd/most-work-tip-horizon
branch
from
September 3, 2026 03:54
e6d5ee2 to
452ecb7
Compare
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.
Why
Restart at mainnet tip 965251 immediately sat in empty-
headerswithlag=993behindmax_peer_height=966244. Honest peers and explorerswere at ~965249.
60.228.121.28(andversion.start_heightmax) advertised~900 extra height. That is not more work on our path.
We were not on a minority fork we failed to reorg. Confirm followed
most-work to the real tip. Catch-up then refused to finish because lag is
max_peer_height − path HWM, and empty replies with lag>2 never setheaders_done.Change
register_exploreonly (potential future path). Donot raise
max_peer_height/max_ordered_height.headerswith a drained work path is EOF even if advertisedheight is hundreds ahead.
ibd_caught_up:headers_doneat the most-work path completes; lag>2is not a tip we chase. A 2-block connecting hole still holds exit.
should_unlatch_headers_done: only a 1–2 block hole, not a 900-blockless-work claim.
Related: #314 (reseed CPU). This is the actual stuck-at-tip latch.