Repository navigation
kona,op-reth: pin the fork-boundary execution rules op-e2e/opgeth tested - #24193
Conversation
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>
sebastianst
left a comment
There was a problem hiding this comment.
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
sebastianst
left a comment
There was a problem hiding this comment.
Two more suggestions on the Canyon case, both small enough for this PR.
🤖 Co-created with Claude Opus 5.5
|
🤖 Opus 5.5 says: @nonsense I filed #24248 for two more probe sets that fit |
- 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
left a comment
There was a problem hiding this comment.
🤖 Opus 5.5 says: Thanks, all review threads are addressed. One doc nit inline, non-blocking.
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>
The
op-e2e/opgethtests 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.TestPreregolithUnusedGasConsumed,TestRegolithReturnUnusedGasToPoolTestDepositGasParityalready 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.TestRegolithIncludeGasRefundstest_consume_gas_with_refundpins 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,TestCanyonPUSH0is 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. ThePUSH0probe also runs in the activation block, which catches an engine that takes its rules from the parent block's timestamp.TestPreEcotone,TestEcotoneTSTOREis 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.TestPreFjordp256Verifyfixture inTestPrecompiles. It returns no output at Ecotone, and1at every fork from Fjord to Karst.TestFjordRIP7212_ActivateAfterGenesis1; an invalid one returns no output.TestForkActivationEVMRules, Fjord case.TestIsthmusEIP2537_*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.
TestInvalidDepositInFCUTestDepositGasParity, newOrdinaryDepositUnfundedvariant. 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-38003.ensure_well_formed_payload_attributes_rejects_each_rulealready covers it, and op-node always sets the gas limit. Error code: op-reth keeps-32602. The new comment onensure_well_formed_payload_attributesgives the reason.TestPreregolithDepositNonce,TestRegolithDepositNonceCorrectdepositNoncebefore Regolith. From Regolith it is the sender's nonce before the deposit.TestDepositGasParitynow checks the values ofdepositNonceanddepositReceiptVersion, the nonce increment, and from Regolith the deposit's RPCnonce, 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
contractAddressquirk 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
TestForkActivationEVMRulesfail, 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
TestPrecompilealso 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:
deposit-reviewer and kona-sp1-cost-reviewer were skipped: the diff changes only tests and a comment.
Closes #24088
🤖 Generated with Claude Code