Repository navigation
kona-engine: prevent delegated finalized-head regression - #23899
einar-oplabs merged 7 commits into
Conversation
bd0e82a to
ddeaacc
Compare
8c89b2b to
bb36509
Compare
|
GPT-6.1-Sol (xhigh): Reviewed Checked stale targets, same-height conflicts for both identifier kinds, identical and advancing targets, genesis initialization, and rejection of responses at an unrequested height.
The initial review covered this PR independently; combined validation is recorded below. Combined validation update (2026-11-06): locally merged the current heads of #23899 ( The merge preserves both sets of finalization guards and their regression tests. Test fixtures account for the acknowledged forkchoice status and the new identity-mismatch error.
Nextest flagged an open output handle in one passing, unchanged attribute-format test; its isolated rerun passed without the flag. The first acceptance attempts stopped at setup because the new checkout lacked the Cannon helper fixture; the complete runs above passed after restoring that fixture. |
bb36509 to
0e0cdf7
Compare
einar-oplabs
left a comment
There was a problem hiding this comment.
GPT-6.1-Sol (xhigh): Reviewed 0e0cdf7c305abd6f5c2dc0b5e38f30351d979906 against 7a290fc5579c87f7f9f13fe2a45adac92baf34cc. No actionable findings.
Checked monotonic finalization, same-height hash conflicts, canonical-by-number lookup while preserving the caller's pinned hash, default/genesis handling, skipped-task removal and actor recovery, and rejection of subsequent regressing delegate statuses. Also checked the catch-up behavior supplied by the next PR in this stack, #23908.
Validation: all 435 tests in kona-engine and kona-node-service passed at stack tip 454481f562f45c8c93022a6ed6090a226d12ce3c. This is validation of the combined stack; full acceptance devnets were not rerun during this review.
einar-oplabs
left a comment
There was a problem hiding this comment.
Fable 5.1 (xhigh): Reviewed 0e0cdf7c30. One gap in the new delegate guard (no baseline on the first poll, so a delegate that starts behind kona can still move the safe label under the finalized one), the land-together caveat shared with #23900, a design question on the by-number conflict case, and nits.
A delegated safe head below the unsafe head was treated like an intermediate span-batch block: it moved the consensus labels without a forkchoice update. An update that left the labels unchanged was also skipped, but a SYNCING answer moves the labels, so an identical retry never reached the execution layer. And while the execution layer was still syncing and lacked the delegated safe block, consolidation reset the engine, which restarted the sync (the delegated case of #23931). Only derived attributes inside a span batch now defer the update. The delegated consolidation paths and the reset always send their forkchoice, so each delegate poll is the retry after a SYNCING answer or an execution-layer restart. A delegated safe head whose block the syncing execution layer does not have yet moves only the safe labels, as in op-node's follow-source mode, instead of resetting; the missing block is logged at warn. One helper applies a delegated safe head with or without the unsafe head. The finalize that follows such a poll still fails on the same syncing execution layer until #23908 skips it, so this lands together with #23899 and #23908. `test_utils::l1_info_deposit` replaces three inline copies of the L1-info deposit, and the delegated consolidation table asserts what reaches the block sink. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
bf83ae6 to
c1c8522
Compare
1cdca29 to
cb2fc8d
Compare
A lagging delegate could move finality backward, and a delegate on another fork could name a finalized block that is not the execution layer's canonical block. The first is irreversible. The second either stopped the node or failed every forkchoice update and reset the engine on each poll. The finalize task now looks the target up by number and finalizes a pinned hash only when it is the canonical block at that height. A target behind the finalized head, a different block at the finalized height, or a pinned hash that is not canonical fails with an error of the new `Skip` severity: the engine drops the task, counts it as a failure, and the engine actor warns once per distinct error until a reset. A target equal to the finalized head needs no lookup or forkchoice update, and each finality guard runs once per kind of target. A block served at another height is a distinct `BlockNumberMismatch`. The delegate actor also rejects a whole sync status whose finalized L2 block is behind, or conflicts with, the engine's, so a lagging or diverged delegate's safe head does not reach the engine either. The baseline is the finalized head the engine applied, read from the state it publishes, not the last target forwarded to it: a target the engine skipped must not make the canonical block at its height look like a conflict, which would stop the delegate's safe head too. BREAKING CHANGE: `EngineTaskErrorSeverity` has a new `Skip` variant, and `FinalizeTaskError` has new variants `BehindFinalizedHead`, `BlockNumberMismatch`, `ConflictsWithFinalizedHead` and `NotCanonical`; exhaustive matches must handle them. A block served at another height is now `BlockNumberMismatch` instead of `BlockNotFound`. `DerivationActorRequest::ProcessEngineSyncCompletionRequest` carries an `EngineSyncState`, and `EngineDerivationClient::notify_sync_completed` takes one. `DelegateDerivationActor::new` takes the engine's state receiver. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
cb2fc8d to
3ca8583
Compare
`ensure_not_behind_finalized_head` and `ensure_no_conflict_with_finalized_head` each had one caller, so their checks move inline. A new test pins a target above the safe head: it fails with `BlockNotSafe` before any lookup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`ProcessEngineSyncCompletionRequest` and `notify_sync_completed` carry the local-safe head again instead of the whole `EngineSyncState`. Both consumers only read the local-safe head; the delegate actor takes its finalized baseline from the engine's published state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…its safe Such a snapshot is inconsistent: the engine would refuse to finalize it. op-node's follow mode rejects it the same way. A test also pins that any finalized block, genesis included, is accepted before the engine establishes finality, and the doc on the finality check now states that it only catches a fork at the engine's finalized height. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test sends stale finalizations through the actor: it keeps running, an identical repeat keeps the same skip in memory, and a reset forgets it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
e199d51
into
einar/23676-delegated-forkchoice
Why
A stale delegate could move kona's finalized head backward, and a delegate on another fork could name a finalized block that is not canonical in the EL, which stopped kona or reset it on every poll.
What
Skipseverity that the queue drops and the actor warns about once.BlockNotFoundandBlockNotSafestay Critical here and delegate-induced transients can reach them; kona-engine: keep delegated finalization pending during EL catch-up #23908 makes both skips.Breakdown
Closes
Part of ethereum-optimism/protocol-team#545; follows up on #23679. Stack, in merge order: #23900 → #23899 → #23908 → #23947 → #24004 → #24005 → #24006 → #24007 → #24065.
AI Reviews
BREAKING CHANGE:
EngineTaskErrorSeverity::SkipandFinalizeTaskError::{BehindFinalizedHead, BlockNumberMismatch, ConflictsWithFinalizedHead, NotCanonical}are new; exhaustive matches must handle them. A wrong-height block is no longerBlockNotFound.DelegateDerivationActor::newtakes the engine's state receiver.🤖 Generated with Claude Code