Skip to content

kona,op-reth: pin the fork-boundary execution rules op-e2e/opgeth tested - #24193

Merged
nonsense merged 3 commits into
developfrom
ae/kona-fork-boundary-tests
Nov 18, 2026
Merged

nonsense merged 3 commits into
developfrom
ae/kona-fork-boundary-tests

Conversation

@nonsense

@nonsense nonsense commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

The op-e2e/opgeth tests deleted in #23864 pinned fork-boundary execution rules on op-geth. Several of them had no op-reth or kona equivalent, although op-reth now syncs, and kona proves, the history those rules govern. This adds the missing coverage. Nothing changes for users.

op-geth test Rule How this PR handles it
TestPreregolith UnusedGasConsumed, TestRegolith ReturnUnusedGasToPool Before Regolith a deposit takes its whole gas limit from the block gas pool. From Regolith its unused gas returns to the pool. No new test. TestDepositGasParity already pins the gas each deposit reports at Bedrock, Regolith and Karst, and the gas pool is the block gas limit minus that sum. No registry chain has a pre-Regolith block.
TestRegolith IncludeGasRefunds From Regolith a deposit gets gas refunds, such as for clearing a storage slot. No new test. op-revm's test_consume_gas_with_refund pins it: at Regolith a deposit's refund is capped at a fifth of the gas it spent. Disabling refunds for every deposit fails that test. Before Regolith a deposit reports its whole gas limit, so a refund cannot show in its receipt.
TestPreCanyon, TestCanyon Blocks have no withdrawals before Canyon and empty withdrawals from Canyon. PUSH0 is rejected before Canyon and accepted from Canyon. TestForkActivationEVMRules, Canyon case. It checks the withdrawals hash of the blocks before, at and after the activation block. The PUSH0 probe also runs in the activation block, which catches an engine that takes its rules from the parent block's timestamp.
TestPreEcotone, TestEcotone TSTORE is rejected before Ecotone and accepted after. Blocks have no parent beacon block root before Ecotone. From Ecotone each block has the root of its L1 origin. TestForkActivationEVMRules, Ecotone case. It checks both rules, and also that a KZG input whose proof does not verify succeeds before Ecotone and halts after.
TestPreFjord P256VERIFY is absent before Fjord. New p256Verify fixture in TestPrecompiles. It returns no output at Ecotone, and 1 at every fork from Fjord to Karst.
TestFjord RIP7212_ActivateAfterGenesis P256VERIFY appears when Fjord activates after genesis. A valid signature returns 1; an invalid one returns no output. TestForkActivationEVMRules, Fjord case.
TestIsthmus EIP2537_* From Isthmus each BLS12-381 precompile rejects malformed input, also when Isthmus activates after genesis. TestForkActivationEVMRules, Isthmus case. It checks valid outputs, plus one EIP-2537 failure vector per precompile, which must halt and spend the whole gas limit.

A new kona-client unit test sends the same vectors, an off-curve bn254 point and a failing KZG proof through the precompiles that kona asks the host to compute. It runs at every spec and compares each result with the provider op-reth runs. Before this PR, no test reached the path where the host rejects an input.
TestInvalidDepositInFCU A failing deposit still yields a block. TestDepositGasParity, new OrdinaryDepositUnfunded variant. A portal deposit whose value exceeds the sender's balance plus mint must fail, keep the mint, bump the nonce and report its whole gas limit. It runs at Bedrock, Regolith and Karst.
TestMissingGasLimit Payload attributes without a gas limit are rejected; op-geth answers -38003. Rejection: no new test. ensure_well_formed_payload_attributes_rejects_each_rule already covers it, and op-node always sets the gas limit. Error code: op-reth keeps -32602. The new comment on ensure_well_formed_payload_attributes gives the reason.
TestPreregolith DepositNonce, TestRegolith DepositNonceCorrect No depositNonce before Regolith. From Regolith it is the sender's nonce before the deposit. TestDepositGasParity now checks the values of depositNonce and depositReceiptVersion, the nonce increment, and from Regolith the deposit's RPC nonce, with a nonzero sender nonce. op-reth and kona build these receipts with shared code, so a proof alone cannot catch a mistake that both make.

Not covered: the pre-Regolith contractAddress quirk and Regolith activating after genesis. No registry chain has a pre-Regolith block.

The Canyon case also checks a rule the op-geth tests did not: Canyon's activation block force-deploys the create2 deployer. The test genesis preinstalls that contract, so the case first removes it from the genesis.

Mapping Canyon to the pre-Shanghai spec in op-revm makes TestForkActivationEVMRules fail, although op-reth and kona still agree with each other. Making kona-client treat a host rejection as empty output makes the new kona-client test fail.

op-e2e's TestPrecompile also picks up the new P256VERIFY fixture. It runs only in the fault-proof CI jobs and was not run locally. The kona proof job gains 17 subtests, about 2% of its CPU time.

The go-code-reviewer and rust-code-reviewer findings are fixed, except for four that were dismissed:

  • A Karst CLZ probe. It is outside what the op-geth tests covered.
  • Driving the BLS vectors from the in-tree EIP-2537 JSON files. That needs a cross-crate testdata path.
  • A shared constant for the host-failure message. The existing Lagoon limits test matches its message the same way.
  • Dropping an assertion that repeats another. It stays for its clearer failure message.

deposit-reviewer and kona-sp1-cost-reviewer were skipped: the diff changes only tests and a comment.

Closes #24088

🤖 Generated with Claude Code

The deleted op-e2e/opgeth tests pinned fork-boundary execution rules on
op-geth. Several had no op-reth or kona equivalent:

- TestForkActivationEVMRules activates Canyon, Ecotone, Fjord and
  Isthmus after genesis and checks PUSH0, TSTORE, a failing KZG proof,
  P256VERIFY and valid and malformed BLS12-381 inputs before and after
  the activation block, then proves the blocks with kona.
- A kona-client test checks that a precompile input the host rejects
  gives the same halt as the provider op-reth runs, at every spec.
- TestDepositGasParity checks depositNonce, depositReceiptVersion and
  the nonce increment, and adds a deposit whose value exceeds the
  sender's balance plus mint.
- TestPrecompiles gains P256VERIFY.

The op-reth doc comment records why the OP payload-attribute checks
answer -32602 rather than op-geth's -38003.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nonsense
nonsense marked this pull request as ready for review November 16, 2026 15:18
@nonsense
nonsense requested a review from a team as a code owner November 16, 2026 15:18
@nonsense
nonsense requested a review from sebastianst November 16, 2026 16:32
@sebastianst sebastianst self-assigned this Nov 16, 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.

I checked every case of the deleted op_geth_test.go against the new coverage. The rows #24088 listed are all covered. Several assertions go further than op-geth did, most of all the kona-client host-rejection test, which checks that kona and op-reth halt identically. The suggestions inline are optional and cheap. Two of them cover op-geth cases that neither #24088 nor the table here mentions.

The rest of the unlisted cases are covered or don't apply. AllowSystemTx/RejectSystemTx have an op-revm unit test. TestTxGasSameAsBlockGasLimit is reth txpool behaviour. TestGethOnlyPendingBlockIsLatest was op-geth-only, and op-reth deliberately differs (#24078).

The same deletion PR, #23864, also removed conditional_tx_test.go, which neither #24088 nor this PR covers. It's out of scope here, so I filed #24247.

🤖 Co-created with Claude Opus 5.5

Comment thread rust/op-reth/crates/node/src/engine.rs Resolved

@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.

Two more suggestions on the Canyon case, both small enough for this PR.

🤖 Co-created with Claude Opus 5.5

@sebastianst

Copy link
Copy Markdown
Member

🤖 Opus 5.5 says: @nonsense I filed #24248 for two more probe sets that fit TestForkActivationEVMRules: a Karst case (CLZ and the MODEXP input bound), and the EIP-4788 and EIP-2935 system-call contracts at their activation blocks. They go beyond the op-geth scope, so I'd suggest a follow-up PR rather than growing this one. I assigned it to you.

- TestDepositGasParity checks that from Regolith the RPC transaction
  reports the deposit nonce as its nonce.
- TestForkActivationEVMRules, Canyon case: blocks have no withdrawals
  before Canyon and empty withdrawals from its activation block on. The
  activation block force-deploys the create2 deployer. The case removes
  the genesis preinstall, which would otherwise hide the deployment. The
  PUSH0 probe also runs in the activation block, which catches an engine
  that takes its rules from the parent block's timestamp.
- Ecotone case: blocks have no parent beacon block root before Ecotone,
  and the root of their L1 origin from its activation block on. The test
  first mines an L1 block, because the L1 genesis has a zero root.
- The comment on ensure_well_formed_payload_attributes now gives only the
  error-code mapping.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sebastianst
sebastianst previously approved these changes Nov 18, 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.

🤖 Opus 5.5 says: Thanks, all review threads are addressed. One doc nit inline, non-blocking.

Comment thread rust/op-reth/crates/node/src/engine.rs Resolved
op-node retries only on -32602. The version-specific checks answer with
-38003, which makes op-node drop the attributes and build a deposits-only
block, or with -38005, which makes it reset. So only a mismatch in the
Holocene or Jovian checks stalls op-node.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nonsense
nonsense added this pull request to the merge queue Nov 18, 2026
Merged via the queue into develop with commit 3eaed8d Nov 18, 2026
127 checks passed
@nonsense
nonsense deleted the ae/kona-fork-boundary-tests branch November 18, 2026 14:36
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-reth, kona: cover the historical fork-boundary execution rules that op-e2e/opgeth tested

2 participants