Repository navigation
kona-engine,kona-node-service: keep a stale delegated safe head from moving safe below finality - #24004
Conversation
97cb015 to
c1116cd
Compare
50000d6 to
499e320
Compare
joshklop
left a comment
There was a problem hiding this comment.
I went through this in depth: read the code across the stack, ran the tests and clippy, and mutation-tested the new logic. The finality fix itself holds. I couldn't find a path that moves safe below finalized, and the below/at/conflicting cases are well covered. Most of my concerns are with the code around the fix: the resend memo, the label-order check, the warning dedup and the new forkchoice flag. Dropping some of that would also fix the liveness issues I've noted inline.
Test gaps from mutation testing (all 475 tests in kona-engine and kona-node-service pass on the head):
- Deleting either assignment of
el_applied_last_forkchoiceinsynchronizestill passes (see inline). - Making
lagging_safe_head_to_rememberignoreis_consistentstill passes, because every actor test has unsafe ≥ safe. Could you add an unsafe < safe case? - Untested: a reset between the send and the task running,
FailedToFetchDelegatedSafeBlock, an FCU RPC failure after the EL applied the reorg, andlast_rejectionwarn/debug.
Scope: the FinalizeTaskError variant merge, the L1-lookup dedup in validate_sync_status, and the initial_safe_head test-helper rename aren't needed for the fix. Could they go in a separate PR? Also, engine_l2_safe_head in the delegated actor is written but never read.
…moving safe below finality A stale delegate snapshot can report a safe head below kona-node's finalized head, and kona-node applies it, moving safe behind its own finality. Kona-node now drops a delegate status whose labels are out of order (a zero local-safe head counts as unreported) or that breaks the engine's applied finality, and the engine skips a delegated safe head below, or conflicting with, established finality. A delegated safe head below safe is ignored, and forwarded only once per engine view, unless an EL that applied the last forkchoice holds a different block at that height, which proves divergence and reorgs the engine above finality. Labels left with unsafe below safe are repaired by the next delegated head above finality. Repeated rejection warnings are deduplicated. A rejected delegated forkchoice update resets the engine as on develop; recovery is #24065 (#24061). Known window: after a delegate L1 reorg whose fork point is above its new safe head, safe stays on the old fork until the delegate passes it. Closes #23910. BREAKING CHANGE: `ConsolidateTaskError` gains `BreaksFinality` and `FailedToFetchDelegatedSafeBlock`; `FinalizeTaskError::{BehindFinalizedHead, ConflictsWithFinalizedHead}` become `BreaksFinality(FinalityViolation)`; `FinalityViolation` is exported; `EngineState` gains `el_applied_last_forkchoice`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
499e320 to
7bdee17
Compare
joshklop
left a comment
There was a problem hiding this comment.
🤖 Claude, for @joshklop: Review of 7bdee17022, which is this PR rebased onto #23947's head; the rebase only changes API calls. The finality fix holds. I found no path that moves safe or finalized below finality or onto a conflicting block, because the engine re-checks the delegated head against finality when the task runs, and synchronize only changes labels after the EL accepts the update. My earlier comments still apply. New points are below, plus two test gaps: nothing exercises FailedToFetchDelegatedSafeBlock, and nothing covers el_applied_last_forkchoice being set or cleared in synchronize/helper.rs.
|
@op-centaur re-approve |
|
otto-op-centaur[bot] did not re-approve this pull request: there is no dismissed approval from an eligible human reviewer. |
Why
A stale delegate snapshot can report a safe head below kona-node's finalized head, and kona-node applies it, moving safe behind its own finality.
What
Breakdown
Closes
Part of ethereum-optimism/protocol-team#545. Stack, in merge order: #23900 → #23899 → #23908 → #23947 → #24004 → #24005 → #24007 → #24065.
AI Reviews
BREAKING CHANGE:
ConsolidateTaskErrorgainsBreaksFinalityandFailedToFetchDelegatedSafeBlock;FinalizeTaskError::{BehindFinalizedHead, ConflictsWithFinalizedHead}becomeBreaksFinality(FinalityViolation);FinalityViolationis exported;EngineStategainsel_applied_last_forkchoice.🤖 Generated with Claude Code