Skip to content

[kyoto-hardening][btc-monitor] Resume Kyoto near the tip on restart#670

Draft
0xsiddharthks wants to merge 1 commit into
siddharth/btc-monitor-start-checkpointfrom
siddharth/btc-monitor-resume-checkpoint
Draft

[kyoto-hardening][btc-monitor] Resume Kyoto near the tip on restart#670
0xsiddharthks wants to merge 1 commit into
siddharth/btc-monitor-start-checkpointfrom
siddharth/btc-monitor-resume-checkpoint

Conversation

@0xsiddharthks

Copy link
Copy Markdown
Contributor

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-anchor KYOTO_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.

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.
@0xsiddharthks 0xsiddharthks changed the title [btc-monitor] Resume Kyoto near the tip on restart [kyoto-hardening][btc-monitor] Resume Kyoto near the tip on restart Jun 7, 2026
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