Repository navigation
Conversation
Claude review status
✅ Review clean Last reviewed: New this round: 0 finding(s), 0 question(s) · Resolved this round: 0 · Open questions: 0 |
🧬 Spec-gate mutation — ✅ PASSNothing to test — no mutants were generated on the changed lines. |
Codecov Report❌ Patch coverage is
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will degrade performance by 7.87%3 warnings, 1 note
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
🧬 Mutation testing — ✅ PASSDiff mutation score: 100.0% (6/6 viable mutants killed)
No new test gaps introduced by this change. 🎉 |
|
Moving to draft: mega-evm stays on revm 40 for now, with selected revm fixes picked onto that line. This branch stays as the revm 43 port for when the node moves to a newer reth / op-reth. |
Summary
f67d87cdtof84988888034, whose Rust workspace pins rethop-v2.7.0-1; alloy 2.x resolves to 2.5.0.nightly-2026-04-23→nightly-2026-07-06(rustc 1.99) inrust-toolchain.toml; MSRV 1.94 → 1.99 inCargo.toml(rust-version) andclippy.toml, required by the OP crates at that commit. The workspace lintfrom_iter_instead_of_collectis dropped because this Clippy no longer has it.Code changes
run_without_catch_errorandinspect_run_without_catch_errorshare onerun_transaction, built onGasTracker;validate_against_state_and_deduct_caller) move from the start ofpre_executionto the end ofvalidate; only gas arithmetic (tx_gas) runs in between, so the order of state changes is unchanged;mega-evmeapplies one transaction-type rule to raw and synthetic input; raw post-execution (type0x7D) transactions are rejected.Execution differences outside canonical blocks
0x7D) — tested. Supplied directly to the block executor, the revm 40 build accepts one at nonce 0 when the zero address can pay the L1 data fee, as a zero-price call from the zero address (measured, not observed on chain); this build rejects it as an invalid transaction on all 11 specs. The current node line cannot decode the type.GASPRICEnow returns the deposit's gas price instead of an EIP-1559 effective price. Tested: deposits from blocks carry no fee fields and seeGASPRICE0; promoted system transactions see 0 on the nine specs with MINI_REX behaviour or later (EQUIVALENCE and MINI_REX_1 run them as legacy transactions at the signed price); the fee-free keyless-deploy sandbox from REX5 sees 0 (earlier specs use the signed legacy price).Trace (inspector) output changes
These can appear when tracing ordinary transactions:
stack underflow,invalid opcode,write protection,return data out of bounds).onlyTopCalltraces omit the synthetic child frame even for a genuine SELFDESTRUCT.stateDiffreports setting or clearing an EIP-7702 delegation as a code change of the authority; revm-inspectors 0.40.1 reported a code change only for accounts created in the transaction and showed=here.flatCallTracerrender a reverted CREATE as a call result (gasUsedand the revert data asoutput) with no address, instead of acreateresult carrying the would-be address and the revert data ascode.enableMemoryis set, or when it is absent anddisableMemoryisfalse, and honourslimit, recording and returning at most that many steps per transaction; 0.40.1 ignoredlimit.DebugInspector::get_resultrecovers the root frame (caller, destination and error) of a transaction that runs out of gas before its first frame, for the call tracer andmuxTracer, and sets the transaction's gas limit and caller on themuxTracerroot as it already did for the call tracer.Verification
f67d87cd..f8498888that touch the Rust crates MegaEVM uses (plus 5 later commits considered and not taken), and every dependency version change inCargo.lock. Beyond the differences above, no change is needed for canonical block replay.main(revm 40) and this branch:no_stdbuild uses: 2,231,056 compared records, identical.mega-evme replay --block <n> --verify-block --verify-receipt: 231 recorded blocks (200 consecutive REX6 blocks from 26,400,000 and 31 blocks across MINI_REX to REX5) give byte-identical output on both builds.mega-evmehandles since fix(mega-evme): replay repeated transaction hashes by block index #427;cargo fmt,cargo clippy,cargo sort, the RISC-Vno_stdcheck, release tests with-D warnings(2,327 passed, 16 ignored), all eight bench targets in test mode, docs lint and the suppression orphan check pass. A diff-scoped mutation run (cargo-mutants 27.1.0, as the PR gate runs it) kills 17 of 17 viable mutants; the spec-gate pack generates no mutants on the changed lines.Commands to reproduce the local checks
Benchmarks
CodSpeed reports a regression on this PR, largest in
transfer_multi_1000and the storage benchmarks.mainand this branch were measured with CodSpeed's simulation instrument on one x86 Linux host, so hardware and environment are the same for both:mainbuilt with the old and the new nightly differs by a median of 0.00% (largest +0.93%).main→ this branch changes instruction counts by a median of +3.83%, with 145 of 343 benchmarks above +5%. The plain revm and op-revm lanes regress as much as the MegaEVM lanes, and MegaEVM's own code accounts for under 2% of the increase in the REX6 transfer benchmark.AddressMap,U256Map,B256Map) from unseeded FxHash to randomly seeded foldhash. revm 43 uses these maps for the journal's accounts and storage and forCacheDB. The number of lookups is unchanged, but each costs more: a journal storage lookup goes from 145 to 254 instructions. A build of this branch with only those maps switched back to FxHash recovers 93–98% of eachsstore_heavyregression and brings the median to +0.46%.transfer_multi_1000recovers only 39–46% in that build. The remaining +8% to +13%, in the plain revm lane as well, runs in revm's own transaction code; the per-transactionGasTrackerand journal checkpoint added in revm 43 are the likely source.^1.6.1.Notes for embedders
op-v2.7.0-1).MegaHandler::validatenow settles the caller's upfront cost and, for calls, bumps the caller nonce.pre_executiontakes aGasTrackerand returnsResult<Option<PreExecutionOutput>, _>;executiontakes the checkpoint and aGasTrackerand returnsResult<Option<FrameResult>, _>;first_frame_inputtakes the tracker and returnsResult<Option<FrameInit>, _>;last_frame_resulttakes the tracker;refundreturnsResult;tx_gasis a new hook that builds the transaction'sGasTracker.OnStateHook::on_statetakesEvmStateby value and runs after the state cache update.PrecompilesMap/DynPrecompileare no longerClone,SendorSync;Evm::BlockEnvandEvmFactory::BlockEnvmust beBlockEnvironment + Clone.Cfgimplementations needis_amsterdam_eip2780_enabledand the renamedis_eip8246_delayed_clear_disabled;CfgEnvgainsenable_amsterdam_eip2780and renames the delayed-burn field toamsterdam_eip8246_delayed_clear_disabled. Struct literals need the newInputsImpl.depthandCreateOutcome.charged_create_state_gas.OpSpecId::INTEROPis nowLAGOON.transact_commit,inspect,inspect_tx,inspect_tx_commitandinspect_commitfinalize the journal on error, and the mainnet EVM'sreplayfinalizes on both outcomes; the_onemethods keep the caller's journal, and the upstreamsystem_call_with_callerstill returns early on error (MegaEVM's override finalizes).GasParamstable still loads but has no refund quotient and makes refund settlement divide by zero, and a wholeCfgEnvJSON needs the new and renamed fields; rebuild both from the spec."isSystemTx":"0x0"must now be a JSON boolean (false may still be omitted);TxDeposit::fallback_decoderejects an untagged deposit envelope, while plain RLP decoding of a deposit body still works; op-alloy-consensus adds a strictdecode_2718_canonicalhelper.0x7D) transactions; keep them out at decode or admission.eth_createAccessListapplies the discovered list to legacy requests, which can change the gas estimate even when the returned access list is identical.alloy-rpc-types-traceaddsGethDebugBuiltInTracerType::StateGasTracerandGethTrace::StateGasTracer; exhaustive matches need an arm. ItsTraceFilterModedefault changes fromUniontoIntersection, so atrace_filterrequest that sets both address lists and omitsmodematches fewer traces.GethDefaultTracingOptions::is_memory_enabled()and the per-transactionlimit. Renderers that callMuxInspector::try_into_mux_framedirectly skip the new root finalization, whichDebugInspector::get_resultapplies.Not in this PR
ruintstays at 1.19.0; its shift-operation advisory (RUSTSEC-2026-0220) predates this change and is not reachable through the EVM shift opcodes, which bound the shift below 256.