[kyoto-hardening][btc-monitor] Resume Kyoto near the tip on restart#670
Draft
0xsiddharthks wants to merge 1 commit into
Draft
Conversation
Once we've synced at least once we know the chain tip, so rebuilding the Kyoto node on a supervision restart no longer re-anchors at the start height (which re-downloads everything since deployment). Instead we anchor KYOTO_RESTART_CHECKPOINT_DEPTH (2016) blocks below the last known tip. That depth is far above bitcoin_confirmation_threshold, so any deposit still awaiting confirmation stays within the resynced range (pending deposits sit within the threshold of the tip); deeper deposits are already final. Falls back to the start checkpoint before the first sync, when the tip is too close to the start, or if the hash can't be fetched.
This was referenced Jun 7, 2026
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.
Stacked on #669.
Even after anchoring at
start_height(#669), every supervision restart re-downloads everything since deployment. But once we've synced we already know the chain tip, so on rebuild we re-anchorKYOTO_RESTART_CHECKPOINT_DEPTH(2016) blocks below the last known tip instead.2016 blocks is far above
bitcoin_confirmation_threshold(=6 on devnet), so any deposit still awaiting confirmation stays within the resynced range — pending deposits sit within the threshold of the tip; deeper deposits are already final. Falls back to the start checkpoint before the first sync, when the tip is within one depth of the start, or if the hash can't be fetched.Net effect: a restart resyncs ~2k blocks (seconds) instead of every block since
start_height.Second of three btc-monitor efficiency PRs.