Skip to content

op-node,op-acceptance-tests: run the gap_clp2p INVALID-payload test on any EL and CL - #24073

Merged
joshklop merged 2 commits into
developfrom
joshklop/remove-gap-clp2p-invalid-test
Nov 12, 2026
Merged

joshklop merged 2 commits into
developfrom
joshklop/remove-gap-clp2p-invalid-test

Conversation

@joshklop

@joshklop joshklop commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #23827.

TestCLUnsafeNotRewoundOnInvalidDuringELSync forced an INVALID response by sending the EL a payload with malformed extraData whose parent the EL does not have. Only op-geth rejects that payload before it looks up the parent, through an OP-specific check of its own; neither the Engine API nor the OP specs require that check before answering SYNCING. op-reth buffers the payload and returns SYNCING, so the test could never pass on op-reth, and op-geth skips every Karst chain, so it ran in no CI configuration. This removes one of the op-reth skips listed in #23317.

It is replaced by TestCLUnsafeKeptOnInvalidPayloadDuringELSync, which checks the same CL behaviour and now runs on op-reth with both op-node and kona-node: an INVALID newPayload during EL sync neither moves the unsafe head onto the payload nor rewinds it, and the valid block at that height is still accepted afterwards. The payload is invalidated with an undecodable transaction, which the Engine API lists as INVALID and which op-geth and op-reth both reject before looking for the parent; the test asks the EL directly to confirm it answers INVALID, not SYNCING. A zero-length transaction, the case the spec names, cannot be used: go-ethereum and alloy compute different transaction roots for an empty entry, so kona-node's admin API rejects the block hash. Making op-node accept INVALID during EL sync makes the new test fail. An op-node unit test also covers the decision, including that no forkchoice update is sent, which the acceptance test cannot observe. No effect on users.

This also settles #18125, which asked whether op-node should rewind its unsafe head after an INVALID during EL sync. Both CLs keep the current behaviour: an INVALID for one payload says nothing about the payloads before it, which the EL may still be syncing toward, and the specs do not ask the rollup node to rewind.

Closes #18125

go-code-reviewer ran on both commits and its findings are applied, except one: it expected kona-node to retry the INVALID insert forever and block the valid payload. kona drops an insert that gets INVALID (EngineTask::execute_inner in rust/kona/crates/node/engine/src/task_queue/tasks/task.rs), and the kona run shows the drop and then the valid block being accepted. deletion-reviewer was not run: the only deleted name is a test function, and a whole-tree search finds no other reference to it. op-geth was not run, because these chains activate Karst.

🤖 Generated with Claude Code

@joshklop
joshklop requested a review from a team as a code owner November 11, 2026 19:31
@joshklop joshklop changed the title op-node,op-acceptance-tests: replace gap_clp2p INVALID test with a unit test op-node,op-acceptance-tests: run the gap_clp2p INVALID-payload test on any EL and CL Nov 11, 2026
@joshklop
joshklop force-pushed the joshklop/remove-gap-clp2p-invalid-test branch from 75cb1e2 to a5bf7d8 Compare November 11, 2026 19:55
@joshklop
joshklop added this pull request to stack #24079 November 11, 2026 21:24
@joshklop
joshklop force-pushed the joshklop/remove-gap-clp2p-invalid-test branch from a5bf7d8 to 0dc90ba Compare November 12, 2026 14:38
@sebastianst sebastianst self-assigned this Nov 12, 2026
@einar-oplabs
einar-oplabs force-pushed the joshklop/remove-gap-clp2p-invalid-test branch 2 times, most recently from 49a39e8 to 44f786d Compare November 12, 2026 15:12
sebastianst
sebastianst previously approved these changes Nov 12, 2026

@sebastianst sebastianst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. Both CL lanes pass the new test on op-reth, and their logs show the EL answering INVALID (Unexpected type flag, latestValidHash null) and the CL keeping its unsafe head, then taking the valid block. Mutating insertUnsafePayload three ways (accept INVALID, rewind on rejection, drop the PayloadInvalidEvent) makes the unit test fail each time. Not checked: the test was not run on op-geth, so its decode-before-parent-lookup order is taken from the description.

The earlier red memory-all-opn-op-reth-fusaka on this PR was safedb_parity's TestSafeHeadRecordsMatchAfterKonaCLRestart (an EOF from the kona-node RPC after its restart), which this stack doesn't touch.

On closing #18125: agreed for latestValidHash: null. An INVALID whose latestValidHash points below the unsafe head is the part op-node still ignores. I think that's acceptable with signed gossip; the inline comment asks to scope the wording.

🤖 Co-created with Claude Opus 5.5 and Claude Fable 5.2

Base automatically changed from joshklop/reth-safedb-resync-tests to develop November 12, 2026 15:42
@joshklop
joshklop force-pushed the joshklop/remove-gap-clp2p-invalid-test branch from 44f786d to ad67b36 Compare November 12, 2026 15:42

@sebastianst sebastianst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-approving after the rebase onto develop: both commits are unchanged (git range-diff shows =). The three inline comments from the previous review are non-blocking.

🤖 Co-created with Claude Fable 5.2

joshklop and others added 2 commits November 12, 2026 15:09
…it test

TestCLUnsafeNotRewoundOnInvalidDuringELSync relied on op-geth rejecting a
payload with malformed extraData before looking up its parent. Neither the
Engine API nor the OP specs require that check before SYNCING, and op-reth
buffers the payload and returns SYNCING instead. The test was skipped on
op-reth, and op-geth skips Karst chains, so it ran in no configuration.

Cover the op-node behaviour it asserted with a unit test that does not
depend on the EL: an INVALID newPayload during EL sync leaves the unsafe
head in place, sends no forkchoice update, and reports the payload invalid.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add TestCLUnsafeKeptOnInvalidPayloadDuringELSync, which checks the same
behaviour as the op-node unit test against a running verifier, so it also
covers kona-node.

The payload is invalidated with an undecodable transaction. The Engine API
lists INVALID as the response for invalid transaction entries, and op-geth
and op-reth both decode the transactions before looking for the parent, so
they answer INVALID without it; the test also asks the EL directly to
confirm. A zero-length transaction is not usable: go-ethereum and alloy
compute different transaction roots for an empty entry, so kona-node's
admin API rejects the block hash op-node computes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joshklop
joshklop force-pushed the joshklop/remove-gap-clp2p-invalid-test branch from ad67b36 to 89b3e9e Compare November 12, 2026 23:09
@joshklop
joshklop enabled stacked auto-merge November 12, 2026 23:09
@joshklop
joshklop added this pull request to the merge queue Nov 12, 2026
Merged via the queue into develop with commit 95872d2 Nov 12, 2026
67 checks passed
@joshklop
joshklop deleted the joshklop/remove-gap-clp2p-invalid-test branch November 12, 2026 23:39
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.

op-node: Unsafe not rewound while INVALID during EL Sync

2 participants