Skip to content

kona-engine!: retain completed safe checkpoints across resets - #23673

Closed
joshklop wants to merge 3 commits into
codex/kona-safe-reset-checkpointsfrom
codex/kona-retain-safe-checkpoints
Closed

joshklop wants to merge 3 commits into
codex/kona-safe-reset-checkpointsfrom
codex/kona-retain-safe-checkpoints

Conversation

@joshklop

@joshklop joshklop commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

A same-height L1 replacement can rewind Kona’s safe head by roughly 70,000 L2 blocks even when its batch inputs remain canonical. Retain the newest completed safe checkpoint whose inherited L1 inputs and L2 ancestry still match, with fresh execution validation and chain-anchor rechecks. Resets retaining the confirmed safe head resume derivation immediately. Execution responses of SYNCING retry; INVALID and unexpected statuses stop recovery with execution diagnostics instead of retrying indefinitely.

Stacked on #23548; review this diff against that PR. Merge #23548 first, then restack this PR onto develop. The base provides op-node’s normal recovery rules. This PR adds only the checkpoint optimization, its replay/span safeguards, and its regression tests. Tracking stays inside the engine; SafeDB attribution is unchanged. Startup and unavailable history retain conservative recovery.

Closes https://github.com/ethereum-optimism/protocol-team/issues/328.

Validation: all 396 affected/dependent Rust tests pass with all features and zero skips. Full Rust workspace lint passes. Independent Rust/reorg reviews find no remaining issues. The combined implementation is preserved across the split.

BREAKING CHANGE: Exhaustive SyncStartError matches must handle CheckpointNotValidated by retrying while execution is syncing, and CheckpointRejected as a non-retryable execution failure carrying the full payload status. The public recovery function’s signature is unchanged.

Match op-node's normal FindL2Heads recovery rules for plausible L1 origins,
epoch and sequence consistency, safe epoch boundaries, finality bounds,
Alt-DA lookback and maximum reorg depth. Retry if a canonical L1 parent
vanishes during the walk. Keep checkpoint retention in a follow-up change.

Related to ethereum-optimism/protocol-team#328.

BREAKING CHANGE: Exhaustive SyncStartError matches must handle
ChainViewChanged by retrying with a fresh L1 view, and ReorgTooDeep when
recovery exceeds five sync lookback windows.
Avoid full-window safe-head rewinds after shallow L1 replacements when a
completed checkpoint's inherited L1 inputs and L2 ancestry remain canonical.
Validate execution and chain anchors before reuse. Preserve parent inputs
across replay and incomplete spans and resume derivation when the confirmed
safe head is unchanged. Keep history private to the engine.

Closes ethereum-optimism/protocol-team#328.

BREAKING CHANGE: Exhaustive SyncStartError matches must handle
CheckpointNotValidated by retrying recovery until execution validates the
retained checkpoint.
@joshklop
joshklop marked this pull request as ready for review October 27, 2026 04:08
@joshklop
joshklop requested a review from a team as a code owner October 27, 2026 04:08
@joshklop
joshklop added this pull request to stack #23674 October 27, 2026 04:11
Retry checkpoint validation only when execution returns SYNCING. Surface
INVALID and unexpected statuses as non-retryable errors, preserving the
validation message and latest valid hash. Add regression coverage for
rejected responses and the existing SYNCING retry policy.

BREAKING CHANGE: Exhaustive SyncStartError matches must handle
CheckpointRejected as a non-retryable execution failure.
@joshklop
joshklop force-pushed the codex/kona-safe-reset-checkpoints branch from 3998dd1 to 0fa061e Compare October 27, 2026 17:40
@joshklop

Copy link
Copy Markdown
Contributor Author

Closing the checkpoint-retention optimization in favor of op-node-compatible verifier L1 confirmation depth. Immediate derivation resumption when a reset retains the confirmed safe head is preserved in #23548, which keeps the recovery-correctness alignment. The independent replacement adds --verifier.l1-confs with default 0, matching op-node. Its Go/Kona acceptance test passes on develop without this stack: both clients reset at depth 0, and neither resets for the shallow tip replacement at depth 4.

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