Skip to content

[kyoto-hardening] resolve chain checkpoint from start_height#561

Closed
0xsiddharthks wants to merge 2 commits into
mainfrom
siddharth/kyoto-hardening-checkpoint
Closed

[kyoto-hardening] resolve chain checkpoint from start_height#561
0xsiddharthks wants to merge 2 commits into
mainfrom
siddharth/kyoto-hardening-checkpoint

Conversation

@0xsiddharthks
Copy link
Copy Markdown
Contributor

Kyoto seeds its header / compact-filter sync from a HeaderCheckpoint. The old code had two hard-coded mainnet activation checkpoints and a genesis fallback for everything else, so signet / testnet pods re-walked ~300k headers on every Kyoto rebuild.

Resolve the checkpoint once at monitor startup: keep the mainnet activation fast-path, otherwise call bitcoind getblockhash(start_height) and use that as the checkpoint. Store the result on the Monitor so the supervision loop reuses it across rebuilds without re-RPC.

Stacked on #560 (jitter).

When the trusted bitcoind peer blips, every Kyoto BIP-157 client across
the fleet reconnects on the same fixed 5s timer, creating a thundering
herd that overwhelms the peer and cascades into more disconnects.

Replace the constant 5s sleep with a base + uniform random jitter in
[0, 30s]. Each pod picks an independent restart instant, spreading the
reconnect load across the upstream node.
@0xsiddharthks 0xsiddharthks force-pushed the siddharth/kyoto-hardening-jitter branch from 4fa2ee2 to 36057ee Compare May 18, 2026 00:51
Kyoto seeds its header / compact-filter sync from a HeaderCheckpoint.
We had two hard-coded mainnet activation checkpoints and a genesis
fallback for everything else, so signet / testnet pods re-walked ~300k
headers on every rebuild. Combined with the supervisor restart loop,
that meant each Kyoto bounce cost several minutes of catch-up before
deposits could be confirmed again.

Resolve the checkpoint once at monitor startup: keep the mainnet
activation fast-path, otherwise call bitcoind getblockhash(start_height)
and use that as the checkpoint. Store the result on the Monitor so the
supervision loop reuses it across rebuilds without re-RPC.
@0xsiddharthks 0xsiddharthks force-pushed the siddharth/kyoto-hardening-checkpoint branch from a221357 to d89401f Compare May 18, 2026 00:54
Base automatically changed from siddharth/kyoto-hardening-jitter to main May 18, 2026 17:08
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