From 72603efdb0c30b6559dfd5729b6fd95110910663 Mon Sep 17 00:00:00 2001 From: Einar Rasmussen Date: Fri, 6 Nov 2026 06:47:15 -0800 Subject: [PATCH 1/6] op-reth: pin the executor-routing reth fork and lock SDM-settled RPC replay Pins reth to the fork tag op-v2.6.0-4, which replays every block transaction through the block executor (ethereum-optimism/reth#37, a backport of paradigmxyz/reth#28266), so debug, trace and otterscan replays report SDM-settled gas and balances with no override in op-reth. Related to ethereum-optimism/protocol-team#485. Adds the integration tests that pin the behavior on a sequenced Lagoon block with refunded, unrefunded, refund-dependent and reverting transactions: per-transaction gas against receipts, prestate and parity state diffs against `debug_accountAt`, intermediate roots per boundary, the post-exec transaction as a replay target, a synthetic call at an index that earns no refund, call-many on the settled prefix, `trace_filter`, `traceChain` with its per-block error shape, and otterscan revert data. Raw blocks trace with settled gas, and a raw block the executor rejects returns the executor's error. An alloy-op-evm unit test pins that a Verify-mode result is settled before commit with an inspector enabled. Shared fixtures and node helpers live in the Lagoon fixture module. The reth update guide documents the carried patch and the fork tagging rules. Co-Authored-By: Claude Fable 5.1 --- rust/Cargo.lock | 212 +++--- rust/Cargo.toml | 146 ++-- rust/UPDATING-RETH.md | 38 +- .../src/block/tests/structural_tests.rs | 54 ++ .../node/tests/it/debug_trace_post_exec.rs | 151 +++-- .../crates/node/tests/it/invalid_post_exec.rs | 26 +- rust/op-reth/crates/node/tests/it/lagoon.rs | 113 ++++ rust/op-reth/crates/node/tests/it/main.rs | 4 + .../node/tests/it/rpc_replay_settlement.rs | 635 ++++++++++++++++++ 9 files changed, 1120 insertions(+), 259 deletions(-) create mode 100644 rust/op-reth/crates/node/tests/it/lagoon.rs create mode 100644 rust/op-reth/crates/node/tests/it/rpc_replay_settlement.rs diff --git a/rust/Cargo.lock b/rust/Cargo.lock index acca24289b5..add8d3e5b1a 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -11971,7 +11971,7 @@ checksum = "1e061d1b48cb8d38042de4ae0a7a6401009d6143dc80d2e2d6f31f0bdd6470c7" [[package]] name = "reth-basic-payload-builder" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eips 2.5.0", @@ -11998,7 +11998,7 @@ dependencies = [ [[package]] name = "reth-chain-state" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eips 2.5.0", @@ -12029,7 +12029,7 @@ dependencies = [ [[package]] name = "reth-chainspec" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-chains", "alloy-consensus 2.4.2", @@ -12049,7 +12049,7 @@ dependencies = [ [[package]] name = "reth-cli" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-genesis", "clap", @@ -12062,7 +12062,7 @@ dependencies = [ [[package]] name = "reth-cli-commands" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-chains", "alloy-consensus 2.4.2", @@ -12152,7 +12152,7 @@ dependencies = [ [[package]] name = "reth-cli-runner" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "reth-tasks", "tokio", @@ -12162,7 +12162,7 @@ dependencies = [ [[package]] name = "reth-cli-util" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-eips 2.5.0", "alloy-primitives", @@ -12215,7 +12215,7 @@ dependencies = [ [[package]] name = "reth-config" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "eyre", "humantime-serde", @@ -12232,7 +12232,7 @@ dependencies = [ [[package]] name = "reth-consensus" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eip7928 0.4.10", @@ -12246,7 +12246,7 @@ dependencies = [ [[package]] name = "reth-consensus-common" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eips 2.5.0", @@ -12259,7 +12259,7 @@ dependencies = [ [[package]] name = "reth-consensus-debug-client" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eips 2.5.0", @@ -12284,7 +12284,7 @@ dependencies = [ [[package]] name = "reth-db" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-primitives", "derive_more 2.1.1", @@ -12313,7 +12313,7 @@ dependencies = [ [[package]] name = "reth-db-api" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eips 2.5.0", @@ -12340,7 +12340,7 @@ dependencies = [ [[package]] name = "reth-db-common" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-genesis", @@ -12370,7 +12370,7 @@ dependencies = [ [[package]] name = "reth-db-models" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-eips 2.5.0", "alloy-primitives", @@ -12385,7 +12385,7 @@ dependencies = [ [[package]] name = "reth-discv4" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -12410,7 +12410,7 @@ dependencies = [ [[package]] name = "reth-discv5" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -12434,7 +12434,7 @@ dependencies = [ [[package]] name = "reth-dns-discovery" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-primitives", "dashmap", @@ -12458,7 +12458,7 @@ dependencies = [ [[package]] name = "reth-downloaders" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eips 2.5.0", @@ -12495,7 +12495,7 @@ dependencies = [ [[package]] name = "reth-e2e-test-utils" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eips 2.5.0", @@ -12554,7 +12554,7 @@ dependencies = [ [[package]] name = "reth-ecies" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "aes 0.8.4", "alloy-primitives", @@ -12581,7 +12581,7 @@ dependencies = [ [[package]] name = "reth-engine-local" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-primitives", @@ -12604,7 +12604,7 @@ dependencies = [ [[package]] name = "reth-engine-primitives" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eips 2.5.0", @@ -12631,7 +12631,7 @@ dependencies = [ [[package]] name = "reth-engine-tree" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eip7928 0.4.10", @@ -12687,7 +12687,7 @@ dependencies = [ [[package]] name = "reth-engine-util" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-primitives", @@ -12717,7 +12717,7 @@ dependencies = [ [[package]] name = "reth-era" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eips 2.5.0", @@ -12735,7 +12735,7 @@ dependencies = [ [[package]] name = "reth-era-downloader" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-primitives", "bytes", @@ -12751,7 +12751,7 @@ dependencies = [ [[package]] name = "reth-era-utils" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-primitives", @@ -12775,7 +12775,7 @@ dependencies = [ [[package]] name = "reth-errors" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "reth-consensus", "reth-execution-errors", @@ -12786,7 +12786,7 @@ dependencies = [ [[package]] name = "reth-eth-wire" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-chains", "alloy-primitives", @@ -12815,7 +12815,7 @@ dependencies = [ [[package]] name = "reth-eth-wire-types" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-chains", "alloy-consensus 2.4.2", @@ -12841,7 +12841,7 @@ dependencies = [ [[package]] name = "reth-ethereum" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-rpc-types-engine", "alloy-rpc-types-eth 2.4.2", @@ -12882,7 +12882,7 @@ dependencies = [ [[package]] name = "reth-ethereum-cli" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "clap", "eyre", @@ -12905,7 +12905,7 @@ dependencies = [ [[package]] name = "reth-ethereum-consensus" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eips 2.5.0", @@ -12921,7 +12921,7 @@ dependencies = [ [[package]] name = "reth-ethereum-engine-primitives" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-eips 2.5.0", "alloy-primitives", @@ -12937,7 +12937,7 @@ dependencies = [ [[package]] name = "reth-ethereum-forks" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-eip2124", "alloy-hardforks", @@ -12951,7 +12951,7 @@ dependencies = [ [[package]] name = "reth-ethereum-payload-builder" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eips 2.5.0", @@ -12981,7 +12981,7 @@ dependencies = [ [[package]] name = "reth-ethereum-primitives" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eips 2.5.0", @@ -12994,7 +12994,7 @@ dependencies = [ [[package]] name = "reth-etl" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "rayon", "reth-db-api", @@ -13004,7 +13004,7 @@ dependencies = [ [[package]] name = "reth-evm" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eip7928 0.4.10", @@ -13030,7 +13030,7 @@ dependencies = [ [[package]] name = "reth-evm-ethereum" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eips 2.5.0", @@ -13050,7 +13050,7 @@ dependencies = [ [[package]] name = "reth-execution-cache" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-primitives", "fixed-cache", @@ -13068,7 +13068,7 @@ dependencies = [ [[package]] name = "reth-execution-errors" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-evm", "alloy-primitives", @@ -13081,7 +13081,7 @@ dependencies = [ [[package]] name = "reth-execution-types" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eips 2.5.0", @@ -13100,7 +13100,7 @@ dependencies = [ [[package]] name = "reth-exex" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eips 2.5.0", @@ -13138,7 +13138,7 @@ dependencies = [ [[package]] name = "reth-exex-test-utils" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-eips 2.5.0", "eyre", @@ -13170,7 +13170,7 @@ dependencies = [ [[package]] name = "reth-exex-types" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-eips 2.5.0", "alloy-primitives", @@ -13184,7 +13184,7 @@ dependencies = [ [[package]] name = "reth-fs-util" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "serde", "serde_json", @@ -13194,7 +13194,7 @@ dependencies = [ [[package]] name = "reth-invalid-block-hooks" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-primitives", @@ -13220,7 +13220,7 @@ dependencies = [ [[package]] name = "reth-ipc" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "bytes", "futures", @@ -13240,7 +13240,7 @@ dependencies = [ [[package]] name = "reth-libmdbx" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "bitflags 2.11.1", "byteorder", @@ -13257,7 +13257,7 @@ dependencies = [ [[package]] name = "reth-mdbx-sys" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "bindgen", "cc", @@ -13266,7 +13266,7 @@ dependencies = [ [[package]] name = "reth-metrics" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "futures", "libc", @@ -13280,7 +13280,7 @@ dependencies = [ [[package]] name = "reth-net-banlist" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-primitives", "ipnet", @@ -13289,7 +13289,7 @@ dependencies = [ [[package]] name = "reth-net-nat" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "futures-util", "if-addrs 0.14.0", @@ -13303,7 +13303,7 @@ dependencies = [ [[package]] name = "reth-network" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eips 2.5.0", @@ -13362,7 +13362,7 @@ dependencies = [ [[package]] name = "reth-network-api" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-primitives", @@ -13387,7 +13387,7 @@ dependencies = [ [[package]] name = "reth-network-p2p" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eip7928 0.4.10", @@ -13411,7 +13411,7 @@ dependencies = [ [[package]] name = "reth-network-peers" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -13426,7 +13426,7 @@ dependencies = [ [[package]] name = "reth-network-types" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-eip2124", "humantime-serde", @@ -13440,7 +13440,7 @@ dependencies = [ [[package]] name = "reth-nippy-jar" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "anyhow", "bincode 1.3.3", @@ -13458,7 +13458,7 @@ dependencies = [ [[package]] name = "reth-node-api" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-rpc-types-engine", "eyre", @@ -13482,7 +13482,7 @@ dependencies = [ [[package]] name = "reth-node-builder" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eips 2.5.0", @@ -13550,7 +13550,7 @@ dependencies = [ [[package]] name = "reth-node-core" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eips 2.5.0", @@ -13605,7 +13605,7 @@ dependencies = [ [[package]] name = "reth-node-ethereum" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eips 2.5.0", @@ -13658,7 +13658,7 @@ dependencies = [ [[package]] name = "reth-node-ethstats" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-primitives", @@ -13682,7 +13682,7 @@ dependencies = [ [[package]] name = "reth-node-events" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eips 2.5.0", @@ -13706,7 +13706,7 @@ dependencies = [ [[package]] name = "reth-node-metrics" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "bytes", "eyre", @@ -13736,7 +13736,7 @@ dependencies = [ [[package]] name = "reth-node-types" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "reth-chainspec", "reth-db-api", @@ -14379,7 +14379,7 @@ dependencies = [ [[package]] name = "reth-payload-builder" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-primitives", @@ -14403,7 +14403,7 @@ dependencies = [ [[package]] name = "reth-payload-builder-primitives" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "pin-project", "reth-payload-primitives", @@ -14415,7 +14415,7 @@ dependencies = [ [[package]] name = "reth-payload-primitives" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eips 2.5.0", @@ -14438,7 +14438,7 @@ dependencies = [ [[package]] name = "reth-payload-util" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-primitives", @@ -14448,7 +14448,7 @@ dependencies = [ [[package]] name = "reth-payload-validator" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-rpc-types-engine", @@ -14492,7 +14492,7 @@ dependencies = [ [[package]] name = "reth-provider" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eip7928 0.4.10", @@ -14542,7 +14542,7 @@ dependencies = [ [[package]] name = "reth-prune" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-primitives", @@ -14569,7 +14569,7 @@ dependencies = [ [[package]] name = "reth-prune-types" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-primitives", "arbitrary", @@ -14585,7 +14585,7 @@ dependencies = [ [[package]] name = "reth-revm" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -14600,7 +14600,7 @@ dependencies = [ [[package]] name = "reth-rpc" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-dyn-abi", @@ -14676,7 +14676,7 @@ dependencies = [ [[package]] name = "reth-rpc-api" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-eips 2.5.0", "alloy-genesis", @@ -14706,7 +14706,7 @@ dependencies = [ [[package]] name = "reth-rpc-builder" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-network 2.4.2", "alloy-provider", @@ -14749,7 +14749,7 @@ dependencies = [ [[package]] name = "reth-rpc-convert" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-evm", @@ -14769,7 +14769,7 @@ dependencies = [ [[package]] name = "reth-rpc-engine-api" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-eips 2.5.0", "alloy-primitives", @@ -14800,7 +14800,7 @@ dependencies = [ [[package]] name = "reth-rpc-eth-api" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-dyn-abi", @@ -14847,7 +14847,7 @@ dependencies = [ [[package]] name = "reth-rpc-eth-types" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-chains", "alloy-consensus 2.4.2", @@ -14897,7 +14897,7 @@ dependencies = [ [[package]] name = "reth-rpc-layer" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-rpc-types-engine", "http 1.4.0", @@ -14913,7 +14913,7 @@ dependencies = [ [[package]] name = "reth-rpc-server-types" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-primitives", "alloy-rpc-types-engine", @@ -14943,7 +14943,7 @@ dependencies = [ [[package]] name = "reth-stages" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eip7928 0.4.10", @@ -14995,7 +14995,7 @@ dependencies = [ [[package]] name = "reth-stages-api" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-eips 2.5.0", "alloy-primitives", @@ -15023,7 +15023,7 @@ dependencies = [ [[package]] name = "reth-stages-types" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-primitives", "arbitrary", @@ -15037,7 +15037,7 @@ dependencies = [ [[package]] name = "reth-static-file" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-primitives", "parking_lot", @@ -15057,7 +15057,7 @@ dependencies = [ [[package]] name = "reth-static-file-types" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-primitives", "clap", @@ -15072,7 +15072,7 @@ dependencies = [ [[package]] name = "reth-storage-api" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eip7928 0.4.10", @@ -15098,7 +15098,7 @@ dependencies = [ [[package]] name = "reth-storage-errors" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-eips 2.5.0", "alloy-primitives", @@ -15115,7 +15115,7 @@ dependencies = [ [[package]] name = "reth-storage-overlay" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-eips 2.5.0", "alloy-primitives", @@ -15143,7 +15143,7 @@ dependencies = [ [[package]] name = "reth-tasks" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "crossbeam-utils", "dashmap", @@ -15164,7 +15164,7 @@ dependencies = [ [[package]] name = "reth-testing-utils" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eips 2.5.0", @@ -15180,7 +15180,7 @@ dependencies = [ [[package]] name = "reth-tokio-util" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "tokio", "tokio-stream", @@ -15190,7 +15190,7 @@ dependencies = [ [[package]] name = "reth-tracing" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "clap", "eyre", @@ -15210,7 +15210,7 @@ dependencies = [ [[package]] name = "reth-tracing-otlp" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "base64 0.22.1", "clap", @@ -15229,7 +15229,7 @@ dependencies = [ [[package]] name = "reth-transaction-pool" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eips 2.5.0", @@ -15274,7 +15274,7 @@ dependencies = [ [[package]] name = "reth-trie" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-eips 2.5.0", @@ -15300,7 +15300,7 @@ dependencies = [ [[package]] name = "reth-trie-common" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-consensus 2.4.2", "alloy-primitives", @@ -15328,7 +15328,7 @@ dependencies = [ [[package]] name = "reth-trie-db" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-primitives", "reth-db-api", @@ -15344,7 +15344,7 @@ dependencies = [ [[package]] name = "reth-trie-parallel" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-evm", "alloy-primitives", @@ -15367,7 +15367,7 @@ dependencies = [ [[package]] name = "reth-trie-sparse" version = "2.6.0" -source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-2#3c5f2f11c4e5a5647e6e911cd131ccf1bada4f25" +source = "git+https://github.com/ethereum-optimism/reth?tag=op-v2.6.0-4#58c6608d33acce0460c7f0aba253566b41b2a3eb" dependencies = [ "alloy-primitives", "alloy-trie", diff --git a/rust/Cargo.toml b/rust/Cargo.toml index ca19d03a0dc..f247791024f 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -364,79 +364,79 @@ reth-rpc-traits = { version = "0.7.0", default-features = false } reth-zstd-compressors = { version = "0.7.0", default-features = false } # ==================== RETH CRATES (git) ==================== -reth = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-basic-payload-builder = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-chain-state = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-chainspec = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2", default-features = false } -reth-cli = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-cli-commands = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-cli-runner = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-cli-util = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-consensus = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2", default-features = false } -reth-consensus-common = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2", default-features = false } -reth-db = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2", default-features = false } -reth-db-api = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-db-common = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-downloaders = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-e2e-test-utils = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-engine-local = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-engine-primitives = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2", default-features = false } -reth-engine-tree = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-errors = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-eth-wire = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-eth-wire-types = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-ethereum = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-ethereum-cli = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-ethereum-consensus = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2", default-features = false } -reth-ethereum-forks = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2", default-features = false } -reth-ethereum-primitives = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-evm = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2", default-features = false } -reth-evm-ethereum = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-exex = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-exex-test-utils = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-execution-errors = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2", default-features = false } -reth-execution-types = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2", default-features = false } -reth-fs-util = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-ipc = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-metrics = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-network = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-network-api = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-network-peers = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2", default-features = false } -reth-node-api = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-node-builder = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-node-core = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-node-ethereum = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-node-events = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-node-metrics = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-payload-builder = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-payload-builder-primitives = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-payload-primitives = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-payload-util = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-payload-validator = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-provider = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-prune = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-prune-types = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2", default-features = false } -reth-revm = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2", default-features = false } -reth-rpc = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-rpc-api = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-rpc-builder = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-rpc-engine-api = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-rpc-eth-api = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-rpc-eth-types = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2", default-features = false } -reth-rpc-server-types = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-stages = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-stages-types = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2", default-features = false } -reth-static-file = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-static-file-types = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2", default-features = false } -reth-storage-api = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2", default-features = false } -reth-storage-errors = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2", default-features = false } -reth-storage-overlay = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-tasks = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-tracing = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2", default-features = false } -reth-transaction-pool = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-trie = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } -reth-trie-common = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2", default-features = false } -reth-trie-db = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-2" } +reth = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-basic-payload-builder = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-chain-state = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-chainspec = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4", default-features = false } +reth-cli = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-cli-commands = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-cli-runner = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-cli-util = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-consensus = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4", default-features = false } +reth-consensus-common = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4", default-features = false } +reth-db = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4", default-features = false } +reth-db-api = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-db-common = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-downloaders = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-e2e-test-utils = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-engine-local = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-engine-primitives = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4", default-features = false } +reth-engine-tree = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-errors = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-eth-wire = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-eth-wire-types = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-ethereum = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-ethereum-cli = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-ethereum-consensus = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4", default-features = false } +reth-ethereum-forks = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4", default-features = false } +reth-ethereum-primitives = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-evm = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4", default-features = false } +reth-evm-ethereum = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-exex = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-exex-test-utils = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-execution-errors = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4", default-features = false } +reth-execution-types = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4", default-features = false } +reth-fs-util = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-ipc = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-metrics = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-network = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-network-api = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-network-peers = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4", default-features = false } +reth-node-api = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-node-builder = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-node-core = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-node-ethereum = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-node-events = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-node-metrics = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-payload-builder = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-payload-builder-primitives = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-payload-primitives = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-payload-util = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-payload-validator = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-provider = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-prune = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-prune-types = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4", default-features = false } +reth-revm = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4", default-features = false } +reth-rpc = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-rpc-api = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-rpc-builder = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-rpc-engine-api = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-rpc-eth-api = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-rpc-eth-types = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4", default-features = false } +reth-rpc-server-types = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-stages = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-stages-types = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4", default-features = false } +reth-static-file = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-static-file-types = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4", default-features = false } +reth-storage-api = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4", default-features = false } +reth-storage-errors = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4", default-features = false } +reth-storage-overlay = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-tasks = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-tracing = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4", default-features = false } +reth-transaction-pool = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-trie = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } +reth-trie-common = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4", default-features = false } +reth-trie-db = { git = "https://github.com/ethereum-optimism/reth", tag = "op-v2.6.0-4" } # ==================== REVM (latest: op-reth versions) ==================== revm = { version = "43.0.2", default-features = false } diff --git a/rust/UPDATING-RETH.md b/rust/UPDATING-RETH.md index 0224523256b..671f57fa3fe 100644 --- a/rust/UPDATING-RETH.md +++ b/rust/UPDATING-RETH.md @@ -300,12 +300,48 @@ git tag -a op-v- -m "..." git push git@github.com:ethereum-optimism/reth.git op-v- ``` -Tags are immutable, so a tag pin is as reproducible as a rev pin. +Tags are immutable, so a tag pin is as reproducible as a rev pin. The org's +tag ruleset also forbids deleting or re-annotating one, so a tag on the wrong +commit stays forever with its misleading annotation (`op-v2.6.0-3` is one). +Tag only after the PR that carries the change is merged, and take the commit +from the PR, never from the branch tip: + +```bash +gh pr view --repo ethereum-optimism/reth --json state,mergeCommit \ + --jq '"\(.state) \(.mergeCommit.oid)"' +``` + +Before pushing, compare the commit's subject with the annotation you wrote. +Do not chain the tag push after a merge command in one script: a failed merge +must stop the script, not leave the tag pointing at the old tip. + +Always use the full 40-character commit id, in `rev = "..."` pins, in +`git tag -a`, and in `gh` flags such as `--match-head-commit`, which rejects +abbreviated ids. **Maintain** the branch until the next update: later backports to the same base are PRs into it, tagged when the monorepo pins them. Keep old branches as a historical record. +### Carried patches + +Patches the current branch carries beyond upstream, and what to do with each +on the next base: + +- **RPC replay through the block executor** (ethereum-optimism/reth#37, a + backport of paradigmxyz/reth#28266). Op-reth's SDM refund settlement is only + visible to `debug_*`, `trace_*` and `ots_*` replays through it, and + `rust/op-reth/crates/node/tests/it/rpc_replay_settlement.rs` fails without + it. On a base that still uses alloy-evm 0.39 (`v2.7.0`, `v2.8.0`), + cherry-pick the backport and resolve conflicts in `helpers/call.rs`, + `helpers/trace.rs` and `rpc/src/debug.rs`. On an evm2 base (`v2.9.0` and + later), drop the backport and cherry-pick #28266 itself until a release + contains it; there, upstream's `inspect_transaction_without_commit` installs + the tracer through the EVM's inspector slot, which op-reth's + `PostExecCompositeInspector` occupies, so `OpBlockExecutor` needs an override + or composition for it. Upstream's BAL branch skips per-transaction + settlement; op-reth rejects computed BALs, keep that invariant under test. + ### Pinning a fork change This applies to any monorepo PR that needs a fork change, in a reth update or diff --git a/rust/alloy-op-evm/src/block/tests/structural_tests.rs b/rust/alloy-op-evm/src/block/tests/structural_tests.rs index b75c1a22cf7..5a5f09b6acd 100644 --- a/rust/alloy-op-evm/src/block/tests/structural_tests.rs +++ b/rust/alloy-op-evm/src/block/tests/structural_tests.rs @@ -184,6 +184,60 @@ fn canonicalized_result_gas_applies_refund_exactly_once() { assert_eq!(executor.gas_used, canonical_gas_used, "block must accumulate canonical gas"); } +/// A replay of an imported block runs in Verify mode with a tracer attached and reads each +/// transaction's result before committing it, so that result must already carry the recorded +/// refund in both its gas and its state. +#[test] +fn verify_mode_result_is_settled_before_commit_with_inspector() { + let receipt_builder = OpAlloyReceiptBuilder::default(); + let hardforks = OpChainHardforks::op_mainnet(); + let payload = PostExecPayload { + version: 1, + block_number: 0, + gas_refund_entries: vec![SDMGasEntry { index: 0, gas_refund: 1 }], + }; + let priced_tx = legacy_tx_with_price(0, OBSERVER_TEST_CONTRACT, 200_000, 1); + + let mut committed_db = prepare_observer_db(); + let mut committing = build_policy_executor_with::( + &mut committed_db, + &receipt_builder, + &hardforks, + 1, + Address::ZERO, + Inspect::Enabled, + ); + committing.set_post_exec_mode(PostExecMode::Verify(payload.clone())); + committing.execute_transaction(&priced_tx).expect("refunded transaction commits"); + drop(committing); + let committed_balance = revm::Database::basic(&mut committed_db, Address::ZERO) + .expect("sender is readable") + .expect("sender exists") + .balance; + + let mut db = prepare_observer_db(); + let mut executor = build_policy_executor_with::( + &mut db, + &receipt_builder, + &hardforks, + 1, + Address::ZERO, + Inspect::Enabled, + ); + executor.set_post_exec_mode(PostExecMode::Verify(payload)); + let output = executor + .execute_transaction_without_commit(&priced_tx) + .expect("refunded transaction executes"); + + assert_eq!(output.canonical_gas_used, output.evm_gas_used - 1); + assert_eq!(output.inner.result.result.gas().tx_gas_used(), output.canonical_gas_used); + assert_eq!( + output.inner.result.state[&Address::ZERO].info.balance, + committed_balance, + "uncommitted state must already carry the refund" + ); +} + #[test] fn sdm_refund_can_reduce_canonical_gas_across_eip7623_floor() { let tx = calldata_floor_test_tx(); diff --git a/rust/op-reth/crates/node/tests/it/debug_trace_post_exec.rs b/rust/op-reth/crates/node/tests/it/debug_trace_post_exec.rs index 0cbcd40ea85..86af9c45867 100644 --- a/rust/op-reth/crates/node/tests/it/debug_trace_post_exec.rs +++ b/rust/op-reth/crates/node/tests/it/debug_trace_post_exec.rs @@ -1,72 +1,126 @@ -//! `debug_trace*` over blocks containing an SDM post-exec (0x7d) transaction. +//! `debug_traceBlock` over raw blocks containing an SDM post-exec (0x7d) transaction. //! -//! The RPC trace path replays each transaction directly through the EVM instead of going through -//! the block executor, so it only works on post-exec transactions because `OpEvm::transact_raw` -//! short-circuits them with the consensus-defined no-op result. Without that, tracing any block -//! that carries a 0x7d tx fails whole-block ([the bug]): the replayed post-exec tx env inherited -//! revm's mainnet default chain id, and no honest env for a zero-gas-limit transaction passes -//! validation either. +//! A raw block replays through the block executor like a canonical one, so its traces carry the +//! payload's refund settled and a block the executor rejects does not trace ([#485]). Tracing must +//! also not fail whole-block on the 0x7d tx itself ([premium#163]): the block executor and +//! `OpEvm::transact_raw` both give it the consensus-defined no-op result. //! -//! [the bug]: https://github.com/ethereum-optimism/optimism-premium/issues/163 +//! [#485]: https://github.com/ethereum-optimism/protocol-team/issues/485 +//! [premium#163]: https://github.com/ethereum-optimism/optimism-premium/issues/163 -use alloy_consensus::{Block, BlockBody, Header, Sealable, SignableTransaction, TxEip1559}; +use crate::lagoon::{TRANSFER_GAS, default_trace_gas, rpc_node_config}; +use alloy_consensus::{ + Block, BlockBody, EMPTY_ROOT_HASH, Header, Sealable, SignableTransaction, TxEip1559, +}; use alloy_primitives::{Address, B256, Bytes, Signature, TxKind, U256}; use alloy_rpc_types_eth::TransactionRequest; use alloy_rpc_types_trace::{common::TraceResult, geth::GethDebugTracingOptions}; +use jsonrpsee::http_client::HttpClient; use op_alloy_consensus::{OpTxEnvelope, SDMGasEntry, TxDeposit, build_post_exec_tx}; use reth_chainspec::EthChainSpec; use reth_node_builder::{NodeBuilder, NodeHandle}; -use reth_node_core::{ - args::{NetworkArgs, RpcServerArgs}, - node_config::NodeConfig, -}; -use reth_optimism_chainspec::OpChainSpecBuilder; +use reth_optimism_chainspec::{OpChainSpec, OpChainSpecBuilder}; use reth_optimism_node::OpNode; use reth_rpc_api::clients::DebugApiClient; -use reth_rpc_server_types::RpcModuleSelection; use reth_tasks::Runtime; +use std::sync::Arc; -/// `debug_traceBlock` over a raw block that ends in a post-exec (0x7d) transaction must return -/// one successful trace per transaction. Before the `transact_raw` short-circuit this failed for -/// the whole block with `-32000: invalid chain ID`. +/// `debug_traceBlock` over a raw block that ends in a post-exec (0x7d) transaction returns one +/// trace per transaction, including the post-exec one, with the payload's refund settled. Before +/// the `transact_raw` short-circuit this failed for the whole block with `-32000: invalid chain +/// ID`. +/// +/// The refund takes the transfer below the EIP-7623 floor: the producer never refunds that far, +/// but a verifier applies whatever refund the payload carries. #[tokio::test] async fn test_debug_trace_block_with_post_exec_tx() -> eyre::Result<()> { reth_tracing::init_test_tracing(); - let chain_spec = OpChainSpecBuilder::optimism_sepolia().lagoon_activated().build(); + let chain_spec = Arc::new(OpChainSpecBuilder::optimism_sepolia().lagoon_activated().build()); + let (_node, client) = launch_rpc_client(&chain_spec).await?; + let block = raw_sdm_block(&chain_spec, 30_000_000)?; - let exec = Runtime::test(); - let mut network_args = NetworkArgs::default().with_unused_ports(); - network_args.discovery.discv5_port = Some(0); - network_args.discovery.discv5_port_ipv6 = Some(0); - let node_config = - NodeConfig::test().map_chain(chain_spec.clone()).with_network(network_args).with_rpc( - RpcServerArgs::default() - .with_unused_ports() - .with_http() - // `debug_*` is not part of the default HTTP module selection. - .with_http_api(RpcModuleSelection::All), + let traces = DebugApiClient::::debug_trace_block( + &client, + alloy_rlp::encode(&block).into(), + Some(GethDebugTracingOptions::default()), + ) + .await?; + + assert_eq!(traces.len(), 3, "one trace per transaction, including the post-exec tx"); + for (index, trace) in traces.iter().enumerate() { + assert!( + matches!(trace, TraceResult::Success { .. }), + "transaction {index} must trace successfully, got {trace:?}", ); + } + assert_eq!(default_trace_gas(&traces[1]), TRANSFER_GAS - 1, "debug_traceBlock gas is settled"); + + Ok(()) +} + +/// A raw block the block executor rejects does not trace: with the block budget exhausted by the +/// deposit, replaying the transfer fails block gas accounting and the error names the shortfall. +#[tokio::test] +async fn test_debug_trace_block_rejects_exhausted_budget() -> eyre::Result<()> { + reth_tracing::init_test_tracing(); + + let chain_spec = Arc::new(OpChainSpecBuilder::optimism_sepolia().lagoon_activated().build()); + let (_node, client) = launch_rpc_client(&chain_spec).await?; + let block = raw_sdm_block(&chain_spec, TRANSFER_GAS)?; + + let error = DebugApiClient::::debug_trace_block( + &client, + alloy_rlp::encode(&block).into(), + Some(GethDebugTracingOptions::default()), + ) + .await + .expect_err("debug_traceBlock must reject the transfer"); - let NodeHandle { node, node_exit_future: _ } = - NodeBuilder::new(node_config).testing_node(exec).node(OpNode::default()).launch().await?; + assert_eq!( + error.to_string(), + "ErrorObject { code: InternalError, message: \"transaction gas limit 21000 is more than \ + blocks available gas 0\", data: None }", + "debug_traceBlock error for an executor-rejected block", + ); + + Ok(()) +} + +/// Launches a node on `chain_spec` and returns it with its HTTP RPC client; the node shuts down +/// when the returned handle drops. +async fn launch_rpc_client( + chain_spec: &Arc, +) -> eyre::Result<(impl Sized, HttpClient)> { + let NodeHandle { node, node_exit_future: _ } = NodeBuilder::new(rpc_node_config(chain_spec)) + .testing_node(Runtime::test()) + .node(OpNode::default()) + .launch() + .await?; let client = node.add_ons_handle.rpc_server_handles().rpc.http_client().unwrap(); + Ok((node, client)) +} - // `debug_traceBlock` replays a caller-supplied raw block on its parent's state, so the block - // only has to decode and recover senders — consensus fields like the state root are never - // validated. Replaying on genesis state keeps the fixture self-contained: no SDM production - // machinery is needed to put a 0x7d tx in a block. +/// Builds block 1 on genesis state: a funding deposit, a refunded transfer and the post-exec +/// transaction carrying that refund, under the given block gas limit. +/// +/// `debug_traceBlock` replays a caller-supplied raw block on its parent's state, so the block only +/// has to decode and recover senders; consensus fields like the state root are never validated. +fn raw_sdm_block( + chain_spec: &OpChainSpec, + block_gas_limit: u64, +) -> eyre::Result> { let genesis = chain_spec.genesis_header(); let header = Header { parent_hash: chain_spec.genesis_hash(), number: 1, timestamp: genesis.timestamp + 2, - gas_limit: genesis.gas_limit, + gas_limit: block_gas_limit, base_fee_per_gas: genesis.base_fee_per_gas, // Post-Ecotone replay runs the EIP-4788 pre-block system call, which requires a parent // beacon block root; the blob-gas and withdrawals fields must be present for the later // optionals to round-trip through RLP. - withdrawals_root: Some(alloy_consensus::EMPTY_ROOT_HASH), + withdrawals_root: Some(EMPTY_ROOT_HASH), blob_gas_used: Some(0), excess_blob_gas: Some(0), parent_beacon_block_root: Some(B256::ZERO), @@ -79,7 +133,7 @@ async fn test_debug_trace_block_with_post_exec_tx() -> eyre::Result<()> { chain_id: chain_spec.chain_id(), // The preceding deposit increments the depositor nonce after Regolith. nonce: 1, - gas_limit: 21_000, + gas_limit: TRANSFER_GAS, max_fee_per_gas: u128::from(header.base_fee_per_gas.unwrap_or_default()), to: TxKind::Call(Address::with_last_byte(1)), ..Default::default() @@ -103,22 +157,5 @@ async fn test_debug_trace_block_with_post_exec_tx() -> eyre::Result<()> { build_post_exec_tx(1, vec![SDMGasEntry { index: 1, gas_refund: 1 }]).seal_slow(), ), ]; - let block = Block::new(header, BlockBody { transactions, ommers: vec![], withdrawals: None }); - - let traces = DebugApiClient::::debug_trace_block( - &client, - alloy_rlp::encode(&block).into(), - Some(GethDebugTracingOptions::default()), - ) - .await?; - - assert_eq!(traces.len(), 3, "one trace per transaction, including the post-exec tx"); - for (index, trace) in traces.iter().enumerate() { - assert!( - matches!(trace, TraceResult::Success { .. }), - "transaction {index} must trace successfully, got {trace:?}", - ); - } - - Ok(()) + Ok(Block::new(header, BlockBody { transactions, ommers: vec![], withdrawals: None })) } diff --git a/rust/op-reth/crates/node/tests/it/invalid_post_exec.rs b/rust/op-reth/crates/node/tests/it/invalid_post_exec.rs index d0db3438858..9b796859947 100644 --- a/rust/op-reth/crates/node/tests/it/invalid_post_exec.rs +++ b/rust/op-reth/crates/node/tests/it/invalid_post_exec.rs @@ -6,20 +6,14 @@ //! [SDM-M1]: https://github.com/ethereum-optimism/protocol-team/issues/371 use alloy_consensus::{Sealable, proofs::calculate_transaction_root}; -use alloy_genesis::Genesis; -use alloy_primitives::B64; use alloy_rpc_types_engine::{PayloadStatus, PayloadStatusEnum, PayloadValidationError}; -use op_alloy_consensus::{ - PostExecPayloadValidationError, SDMGasEntry, build_post_exec_tx, encode_jovian_extra_data, -}; +use op_alloy_consensus::{PostExecPayloadValidationError, SDMGasEntry, build_post_exec_tx}; use op_alloy_rpc_types_engine::{OpExecutionData, OpExecutionPayload}; -use reth_chainspec::BaseFeeParams; use reth_e2e_test_utils::{NodeHelperType, setup_engine_with_connection, wallet::Wallet}; -use reth_optimism_chainspec::OpChainSpecBuilder; use reth_optimism_node::{ OpBuiltPayload, OpNode, payload::OpExecData, - utils::{advance_chain, optimism_payload_attributes, setup}, + utils::{advance_chain, setup}, }; use reth_optimism_primitives::OpTransactionSigned; use std::sync::Arc; @@ -27,24 +21,12 @@ use tokio::sync::Mutex; /// Creates Lagoon-active nodes without changing the shared Ecotone fixture. async fn setup_lagoon(num_nodes: usize) -> eyre::Result<(Vec>, Wallet)> { - let mut genesis: Genesis = serde_json::from_str(include_str!("../assets/genesis.json"))?; - // Lagoon is active at genesis, so the first child's base fee uses Jovian extra data. - genesis.extra_data = encode_jovian_extra_data(B64::ZERO, BaseFeeParams::optimism(), 0)?; - genesis.base_fee_per_gas = Some(1_000_000_000); - let chain_spec = Arc::new( - OpChainSpecBuilder::optimism_sepolia().genesis(genesis).lagoon_activated().build(), - ); setup_engine_with_connection( num_nodes, - chain_spec, + crate::lagoon::chain_spec()?, false, Default::default(), - |timestamp| { - let mut attributes = optimism_payload_attributes(timestamp); - attributes.0.eip_1559_params = Some(B64::ZERO); - attributes.0.min_base_fee = Some(0); - attributes - }, + crate::lagoon::payload_attributes, // The buffered-child test must learn the parent only through its explicit newPayload. false, ) diff --git a/rust/op-reth/crates/node/tests/it/lagoon.rs b/rust/op-reth/crates/node/tests/it/lagoon.rs new file mode 100644 index 00000000000..edc1bec96bd --- /dev/null +++ b/rust/op-reth/crates/node/tests/it/lagoon.rs @@ -0,0 +1,113 @@ +//! Lagoon-at-genesis fixtures and SDM node helpers shared by the integration tests. + +use alloy_genesis::Genesis; +use alloy_primitives::B64; +use alloy_rpc_types_trace::{ + common::TraceResult, + geth::{ + GethDebugBuiltInTracerType, GethDebugTracerConfig, GethDebugTracerType, + GethDebugTracingOptions, GethTrace, PreStateConfig, + }, +}; +use op_alloy_consensus::encode_jovian_extra_data; +use reth_chainspec::BaseFeeParams; +use reth_e2e_test_utils::{NodeHelperType, node::NodeTestContext}; +use reth_node_builder::{NodeBuilder, NodeHandle}; +use reth_node_core::{ + args::{NetworkArgs, RpcServerArgs}, + node_config::NodeConfig, +}; +use reth_optimism_chainspec::{OpChainSpec, OpChainSpecBuilder}; +use reth_optimism_node::{OpNode, args::RollupArgs, utils::optimism_payload_attributes}; +use reth_optimism_payload_builder::OpPayloadAttrs; +use reth_rpc_server_types::RpcModuleSelection; +use reth_tasks::Runtime; +use std::sync::Arc; + +/// Gas used by a plain transfer before the SDM refund. +pub(crate) const TRANSFER_GAS: u64 = 21_000; + +/// Gas used before the SDM refund by a deployment of the one-byte init code `STOP`: intrinsic +/// 21000, CREATE 32000, one zero calldata byte 4, one init code word 2, and no code deposit. +pub(crate) const DEPLOY_GAS: u64 = 53_006; + +/// Builds a Lagoon-at-genesis spec that funds the e2e test wallet. +pub(crate) fn chain_spec() -> eyre::Result> { + chain_spec_with(|_| {}) +} + +/// Builds a Lagoon-at-genesis spec that funds the e2e test wallet, with `customize` applied to the +/// genesis before the spec is built. +pub(crate) fn chain_spec_with( + customize: impl FnOnce(&mut Genesis), +) -> eyre::Result> { + let mut genesis: Genesis = serde_json::from_str(include_str!("../assets/genesis.json"))?; + // Lagoon is active at genesis, so the first child's base fee uses Jovian extra data. + genesis.extra_data = encode_jovian_extra_data(B64::ZERO, BaseFeeParams::optimism(), 0)?; + genesis.base_fee_per_gas = Some(1_000_000_000); + customize(&mut genesis); + Ok(Arc::new(OpChainSpecBuilder::optimism_sepolia().genesis(genesis).lagoon_activated().build())) +} + +/// Payload attributes carrying the Jovian fields a Lagoon block requires. +pub(crate) const fn payload_attributes(timestamp: u64) -> OpPayloadAttrs { + let mut attributes = optimism_payload_attributes(timestamp); + attributes.0.eip_1559_params = Some(B64::ZERO); + attributes.0.min_base_fee = Some(0); + attributes +} + +/// Returns a test node config serving every RPC module over HTTP and `WebSocket` on unused ports. +pub(crate) fn rpc_node_config(chain_spec: &Arc) -> NodeConfig { + let network_args = NetworkArgs::default().with_unused_ports(); + NodeConfig::test().map_chain(chain_spec.clone()).with_network(network_args).with_rpc( + RpcServerArgs::default() + .with_unused_ports() + .with_http() + // `debug_*` is not part of the default HTTP module selection. + .with_http_api(RpcModuleSelection::All) + // debug_subscribe is WebSocket-only. + .with_ws() + .with_ws_api(RpcModuleSelection::All), + ) +} + +/// Launches a Lagoon node that opts into SDM and sequences one refund per regular transaction. +pub(crate) async fn launch_sdm_node( + chain_spec: &Arc, +) -> eyre::Result> { + launch_sdm_node_with_attributes(chain_spec, payload_attributes).await +} + +/// Like [`launch_sdm_node`], with the payload attributes supplied per block timestamp. +pub(crate) async fn launch_sdm_node_with_attributes( + chain_spec: &Arc, + attributes: impl Fn(u64) -> OpPayloadAttrs + Send + Sync + 'static, +) -> eyre::Result> { + let op_node = OpNode::new(RollupArgs { + operator_sdm_opt_in: true, + testing_sdm_fixed_policy: Some(None), + ..Default::default() + }); + let NodeHandle { node, node_exit_future: _ } = NodeBuilder::new(rpc_node_config(chain_spec)) + .testing_node(Runtime::test()) + .node(op_node) + .launch() + .await?; + NodeTestContext::new(node, attributes).await +} + +/// Returns tracing options selecting the prestate tracer with the given config. +pub(crate) fn prestate_tracer(config: PreStateConfig) -> GethDebugTracingOptions { + GethDebugTracingOptions::default() + .with_tracer(GethDebugTracerType::BuiltInTracer(GethDebugBuiltInTracerType::PreStateTracer)) + .with_config(GethDebugTracerConfig::from(config)) +} + +/// Returns the gas reported by a successful default (struct logger) trace. +pub(crate) fn default_trace_gas(trace: &TraceResult) -> u64 { + match trace { + TraceResult::Success { result: GethTrace::Default(frame), .. } => frame.gas, + other => panic!("unexpected trace shape: {other:?}"), + } +} diff --git a/rust/op-reth/crates/node/tests/it/main.rs b/rust/op-reth/crates/node/tests/it/main.rs index c849c74e424..b34c45dbdca 100644 --- a/rust/op-reth/crates/node/tests/it/main.rs +++ b/rust/op-reth/crates/node/tests/it/main.rs @@ -16,6 +16,10 @@ mod debug_trace_post_exec; mod invalid_post_exec; +mod lagoon; + +mod rpc_replay_settlement; + mod estimate_gas_7825; mod p2p_version; diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement.rs new file mode 100644 index 00000000000..019e8dd2e10 --- /dev/null +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement.rs @@ -0,0 +1,635 @@ +//! RPC replay over a sequenced Lagoon block whose transactions carry SDM refunds. +//! +//! The settlement of an SDM refund (canonical gas, sender credit, fee-vault debits) only happens +//! inside the block executor, so every RPC path that replays block transactions must go through it. +//! A replay on the bare EVM reports pre-refund gas and unsettled balances ([#485]). +//! +//! [#485]: https://github.com/ethereum-optimism/protocol-team/issues/485 + +use crate::lagoon::{ + self, DEPLOY_GAS, default_trace_gas, launch_sdm_node, launch_sdm_node_with_attributes, + prestate_tracer, +}; +use alloy_consensus::{BlockHeader, TxReceipt}; +use alloy_network::eip2718::Encodable2718; +use alloy_primitives::{Address, B256, Bytes, TxKind, U256, map::HashSet}; +use alloy_rpc_types_eth::{ + BlockNumberOrTag, EthCallResponse, TransactionInput, TransactionRequest, +}; +use alloy_rpc_types_trace::{ + common::TraceResult, + filter::TraceFilter, + geth::{ + ChainBlockTraceResult, GethDebugTracingCallOptions, GethDebugTracingOptions, GethTrace, + PreStateConfig, PreStateFrame, + }, + parity::{Delta, StateDiff, TraceType}, +}; +use jsonrpsee::{ + core::client::{ClientT, Subscription, SubscriptionClientT}, + http_client::HttpClient, + rpc_params, +}; +use reth_chainspec::EthChainSpec; +use reth_e2e_test_utils::{NodeHelperType, transaction::TransactionTestContext, wallet::Wallet}; +use reth_optimism_node::OpNode; +use reth_optimism_payload_builder::OpBuiltPayload; +use reth_optimism_primitives::OpTransactionSigned; +use reth_provider::{ReceiptProvider, StateProviderFactory}; +use reth_rpc_api::clients::{DebugApiClient, TraceApiClient}; +use serde_json::json; +use std::time::Duration; + +/// Index of the post-exec transaction in a [`SettledBlock`]. +const POST_EXEC_INDEX: usize = 4; + +/// Revert data returned by the reverting deployment in a [`SettledBlock`]. +const REVERT_OUTPUT: U256 = U256::from_limbs([42, 0, 0, 0]); + +/// A Lagoon block sequenced by a node running the fixed test policy, which refunds every regular +/// transaction one gas: a real, imported block with a 0x7d transaction and a settled state. +/// +/// The sender submits four transactions: a deployment of the init code `STOP` (refunded), a plain +/// transfer (not refunded, since it already sits on the EIP-7623 floor), a second deployment +/// (refunded) and a deployment whose init code reverts with [`REVERT_OUTPUT`]. +struct SettledBlock { + node: NodeHelperType, + client: HttpClient, + payload: OpBuiltPayload, + sender: Address, +} + +impl SettledBlock { + async fn sequence() -> eyre::Result { + let chain_spec = lagoon::chain_spec()?; + let mut node = launch_sdm_node(&chain_spec).await?; + let client = node.inner.add_ons_handle.rpc_server_handles().rpc.http_client().unwrap(); + let wallet = Wallet::default().with_chain_id(chain_spec.chain_id()); + let sender = wallet.inner.address(); + let deployments = [ + (TxKind::Create, Bytes::from_static(&[0x00])), + (TxKind::Call(Address::repeat_byte(0x99)), Bytes::new()), + (TxKind::Create, Bytes::from_static(&[0x00])), + // PUSH1 42 PUSH1 0 MSTORE PUSH1 32 PUSH1 0 REVERT + ( + TxKind::Create, + Bytes::from_static(&[0x60, 0x2a, 0x60, 0x00, 0x52, 0x60, 0x20, 0x60, 0x00, 0xfd]), + ), + ]; + for (nonce, (to, init_code)) in deployments.into_iter().enumerate() { + let transaction = TransactionRequest { + chain_id: Some(wallet.chain_id), + gas: Some(if matches!(to, TxKind::Call(_)) { 21_000 } else { 100_000 }), + input: TransactionInput::new(init_code), + max_fee_per_gas: Some(20_000_000_000), + max_priority_fee_per_gas: Some(1_000_000_000), + nonce: Some(nonce as u64), + to: Some(to), + ..Default::default() + }; + let signed = TransactionTestContext::sign_tx(wallet.inner.clone(), transaction).await; + node.rpc.inject_tx(signed.encoded_2718().into()).await?; + } + let payload = node.advance_block().await?; + + let fixture = Self { node, client, payload, sender }; + let transactions = fixture.transactions(); + assert_eq!(transactions.len(), 5, "four regular transactions and the post-exec tx"); + let OpTransactionSigned::PostExec(post_exec) = &transactions[POST_EXEC_INDEX] else { + panic!("block must end in a post-exec tx, got {:?}", transactions[POST_EXEC_INDEX]); + }; + let refund_entries = &post_exec.inner().payload.gas_refund_entries; + assert!( + refund_entries.iter().any(|entry| entry.index == 2 && entry.gas_refund > 0), + "the second deployment must be refunded: {refund_entries:?}", + ); + assert!( + !refund_entries.iter().any(|entry| entry.index == 1), + "the transfer must not be refunded: {refund_entries:?}", + ); + Ok(fixture) + } + + fn block_hash(&self) -> B256 { + self.payload.block().hash() + } + + fn block_number(&self) -> u64 { + self.payload.block().number() + } + + fn transactions(&self) -> &[OpTransactionSigned] { + &self.payload.block().body().transactions + } + + /// Gas each regular transaction used according to its receipt. + fn receipt_gas(&self) -> eyre::Result> { + let mut cumulative_gas = 0; + self.transactions() + .iter() + .map(|transaction| { + let receipt = + self.node.inner.provider.receipt_by_hash(transaction.tx_hash())?.unwrap(); + let gas_used = receipt.cumulative_gas_used() - cumulative_gas; + cumulative_gas = receipt.cumulative_gas_used(); + Ok(gas_used) + }) + .collect() + } + + /// Balance of `address` in the state the node committed for the block. + fn committed_balance(&self, address: Address) -> eyre::Result { + let state = self.node.inner.provider.state_by_block_hash(self.block_hash())?; + Ok(state.account_balance(&address)?.unwrap_or_default()) + } + + /// Balance of `address` right after the transaction at `index`, as `debug_accountAt` replays + /// it. + async fn replayed_balance(&self, index: usize, address: Address) -> eyre::Result { + let account = DebugApiClient::::debug_account_info_at( + &self.client, + self.block_hash().into(), + index.into(), + address, + ) + .await? + .unwrap_or_default(); + Ok(account.balance) + } + + async fn block_traces(&self) -> eyre::Result>> { + Ok(DebugApiClient::::debug_trace_block_by_hash( + &self.client, + self.block_hash(), + None, + ) + .await?) + } + + async fn trace_transaction( + &self, + index: usize, + options: Option, + ) -> eyre::Result { + Ok(DebugApiClient::::debug_trace_transaction( + &self.client, + self.transactions()[index].tx_hash(), + options, + ) + .await?) + } + + async fn prestate_diff( + &self, + index: usize, + ) -> eyre::Result { + let options = + prestate_tracer(PreStateConfig { diff_mode: Some(true), ..Default::default() }); + match self.trace_transaction(index, Some(options)).await? { + GethTrace::PreStateTracer(PreStateFrame::Diff(diff)) => Ok(diff), + other => panic!("unexpected prestate trace of transaction {index}: {other:?}"), + } + } +} + +/// Every RPC path that replays the block's own transactions agrees with what the node committed: +/// the receipts' canonical gas, the balances after each transaction, and the header's state root. +#[tokio::test] +async fn replays_match_sdm_settlement() -> eyre::Result<()> { + reth_tracing::init_test_tracing(); + let fixture = SettledBlock::sequence().await?; + let SettledBlock { client, sender, .. } = &fixture; + let client = client.clone(); + let sender = *sender; + let transactions = fixture.transactions().to_vec(); + let block_hash = fixture.block_hash(); + let receipt_gas = fixture.receipt_gas()?; + + // Pins the settlement itself: every check below compares a replay with what the node committed. + assert_eq!(receipt_gas[0], DEPLOY_GAS - 1, "receipt holds canonical gas"); + + let block_traces = fixture.block_traces().await?; + assert_eq!(block_traces.len(), transactions.len(), "debug_traceBlockByHash trace count"); + + for index in 0..POST_EXEC_INDEX { + let hash = transactions[index].tx_hash(); + let gas_used = receipt_gas[index]; + + let GethTrace::Default(frame) = fixture.trace_transaction(index, None).await? else { + panic!("unexpected default trace of transaction {index}"); + }; + assert_eq!(frame.gas, gas_used, "debug_traceTransaction gas of transaction {index}"); + assert_eq!( + default_trace_gas(&block_traces[index]), + gas_used, + "debug_traceBlockByHash gas of transaction {index}", + ); + let call: GethTrace = client + .request("debug_traceTransaction", rpc_params![hash, json!({"tracer": "callTracer"})]) + .await?; + let GethTrace::CallTracer(call_frame) = call else { + panic!("unexpected call trace of transaction {index}: {call:?}"); + }; + assert_eq!( + call_frame.gas_used, + U256::from(gas_used), + "callTracer gas of transaction {index}", + ); + + // Every balance the prestate diff ends on is the balance debug_accountAt replays at that + // index, for the sender as well as the fee vaults. + let diff = fixture.prestate_diff(index).await?; + assert!( + diff.post.contains_key(&sender), + "prestate diff of transaction {index} lacks sender" + ); + for (address, account) in &diff.post { + if let Some(balance) = account.balance { + assert_eq!( + balance, + fixture.replayed_balance(index, *address).await?, + "prestate diff balance of {address} after transaction {index}", + ); + } + } + + let replay = TraceApiClient::::replay_transaction( + &client, + hash, + HashSet::from_iter([TraceType::StateDiff, TraceType::Trace]), + ) + .await?; + assert_eq!( + settled_balance(replay.state_diff.as_ref(), sender), + fixture.replayed_balance(index, sender).await?, + "trace_replayTransaction state diff of transaction {index}", + ); + } + + // The last regular transaction leaves the committed state, since the post-exec transaction + // changes nothing; this anchors the replayed balances above to the provider. + let last_regular = POST_EXEC_INDEX - 1; + let committed = fixture.committed_balance(sender)?; + assert_eq!( + fixture.replayed_balance(last_regular, sender).await?, + committed, + "debug_accountAt after the last regular transaction", + ); + assert_eq!( + fixture.replayed_balance(POST_EXEC_INDEX, sender).await?, + committed, + "debug_accountAt after the post-exec transaction", + ); + for (address, account) in &fixture.prestate_diff(last_regular).await?.post { + if let Some(balance) = account.balance { + assert_eq!( + balance, + fixture.committed_balance(*address)?, + "committed balance of {address} after transaction {last_regular}", + ); + } + } + + let replays = TraceApiClient::::replay_block_transactions( + &client, + block_hash.into(), + HashSet::from_iter([TraceType::StateDiff]), + ) + .await? + .expect("block exists"); + assert_eq!(replays.len(), transactions.len(), "trace_replayBlockTransactions replay count"); + for (index, replay) in replays.iter().take(POST_EXEC_INDEX).enumerate() { + assert_eq!( + settled_balance(replay.full_trace.state_diff.as_ref(), sender), + fixture.replayed_balance(index, sender).await?, + "trace_replayBlockTransactions state diff of transaction {index}", + ); + } + + // debug_traceCall at an index runs on the settled prefix but earns no refund itself. + let prefix_call = DebugApiClient::::debug_trace_call( + &client, + TransactionRequest::default().from(sender).to(Address::with_last_byte(1)), + Some(block_hash.into()), + Some(GethDebugTracingCallOptions { + tracing_options: prestate_tracer(PreStateConfig::default()), + tx_index: Some(1), + ..Default::default() + }), + ) + .await?; + let GethTrace::PreStateTracer(PreStateFrame::Default(prestate)) = prefix_call else { + panic!("unexpected debug_traceCall prestate: {prefix_call:?}"); + }; + assert_eq!( + prestate.0[&sender].balance, + Some(fixture.replayed_balance(0, sender).await?), + "debug_traceCall prestate after the first deployment", + ); + let recipient = Address::repeat_byte(0x55); + let synthetic_transfer = DebugApiClient::::debug_trace_call( + &client, + TransactionRequest::default().from(sender).to(recipient).value(U256::from(1)), + Some(block_hash.into()), + Some(GethDebugTracingCallOptions { + tx_index: Some(POST_EXEC_INDEX as u64), + ..Default::default() + }), + ) + .await?; + let GethTrace::Default(synthetic_frame) = synthetic_transfer else { + panic!("unexpected debug_traceCall trace: {synthetic_transfer:?}"); + }; + assert_eq!(synthetic_frame.gas, 21_000, "debug_traceCall gas of a synthetic transfer"); + + // The post-exec transaction is its own replay target: an empty trace at its receipt gas. + let GethTrace::Default(post_exec_frame) = + fixture.trace_transaction(POST_EXEC_INDEX, None).await? + else { + panic!("unexpected default trace of the post-exec transaction"); + }; + assert!(post_exec_frame.struct_logs.is_empty(), "debug_traceTransaction of the post-exec tx"); + assert_eq!( + post_exec_frame.gas, receipt_gas[POST_EXEC_INDEX], + "debug_traceTransaction gas of the post-exec tx", + ); + let post_exec_call: GethTrace = client + .request( + "debug_traceTransaction", + rpc_params![transactions[POST_EXEC_INDEX].tx_hash(), json!({"tracer": "callTracer"})], + ) + .await?; + let GethTrace::CallTracer(post_exec_call_frame) = post_exec_call else { + panic!("unexpected call trace of the post-exec tx: {post_exec_call:?}"); + }; + assert_eq!(post_exec_call_frame.gas_used, U256::ZERO, "callTracer gas of the post-exec tx"); + let post_exec_diff = fixture.prestate_diff(POST_EXEC_INDEX).await?; + assert!( + post_exec_diff.pre.is_empty() && post_exec_diff.post.is_empty(), + "prestate diff of the post-exec tx must be empty: {post_exec_diff:?}", + ); + let GethTrace::Default(transfer_frame) = fixture.trace_transaction(1, None).await? else { + panic!("unexpected default trace of the transfer"); + }; + assert!(transfer_frame.struct_logs.is_empty(), "debug_traceTransaction of the transfer"); + + // Each regular transaction moves the state root; the post-exec transaction does not, and the + // last root is the header's. + let roots = + DebugApiClient::::debug_intermediate_roots(&client, block_hash, None) + .await?; + assert_eq!(roots.len(), transactions.len(), "debug_intermediateRoots root count"); + for index in 0..last_regular { + assert_ne!( + roots[index], + roots[index + 1], + "debug_intermediateRoots after tx {}", + index + 1 + ); + } + assert_eq!(roots[last_regular], roots[POST_EXEC_INDEX], "debug_intermediateRoots after 0x7d"); + assert_eq!( + roots.last(), + Some(&fixture.payload.block().state_root()), + "debug_intermediateRoots" + ); + + let filtered = TraceApiClient::::trace_filter( + &client, + TraceFilter { + from_block: Some(fixture.block_number()), + to_block: Some(fixture.block_number()), + ..Default::default() + }, + ) + .await?; + let filtered_hashes: HashSet<_> = + filtered.iter().filter_map(|trace| trace.transaction_hash).collect(); + let block_hashes: HashSet<_> = transactions.iter().map(|tx| tx.tx_hash()).collect(); + assert_eq!(filtered_hashes, block_hashes, "trace_filter covers every transaction"); + + // eth_callMany and debug_traceCallMany run on the settled prefix: a contract reading the + // sender's balance after the whole block sees the committed one. + let balance_reader = Address::repeat_byte(0x77); + let mut balance_code = vec![0x73]; + balance_code.extend_from_slice(sender.as_slice()); + // BALANCE PUSH1 0 MSTORE PUSH1 32 PUSH1 0 RETURN + balance_code.extend_from_slice(&[0x31, 0x60, 0x00, 0x52, 0x60, 0x20, 0x60, 0x00, 0xf3]); + let bundles = json!([{ + "transactions": [{"from": Address::ZERO, "gasPrice": "0x4a817c800", "to": balance_reader}] + }]); + let context = json!({"blockNumber": block_hash, "transactionIndex": POST_EXEC_INDEX}); + let overrides = json!({ + balance_reader.to_string(): {"code": Bytes::from(balance_code)}, + Address::ZERO.to_string(): {"balance": "0xffffffffffffffff"}, + }); + let output: Vec> = client + .request("eth_callMany", rpc_params![bundles.clone(), context.clone(), overrides.clone()]) + .await?; + assert_eq!( + U256::from_be_slice(output[0][0].value.as_ref().unwrap()), + committed, + "eth_callMany balance read", + ); + let traces: Vec> = client + .request( + "debug_traceCallMany", + rpc_params![bundles, context, json!({"stateOverrides": overrides})], + ) + .await?; + let GethTrace::Default(frame) = &traces[0][0] else { + panic!("unexpected debug_traceCallMany trace: {:?}", traces[0][0]); + }; + assert_eq!( + U256::from_be_slice(&frame.return_value), + committed, + "debug_traceCallMany balance read", + ); + + Ok(()) +} + +/// `traceChain` streams the same settled traces as `debug_traceBlockByHash`. +#[tokio::test] +async fn trace_chain_matches_block_traces() -> eyre::Result<()> { + reth_tracing::init_test_tracing(); + let fixture = SettledBlock::sequence().await?; + let block_traces = fixture.block_traces().await?; + + let ws = fixture.node.inner.add_ons_handle.rpc_server_handles().rpc.ws_client().await.unwrap(); + let mut subscription: Subscription = ws + .subscribe( + "debug_subscribe", + rpc_params![ + "traceChain", + BlockNumberOrTag::Number(0), + BlockNumberOrTag::Number(fixture.block_number()), + GethDebugTracingOptions::default() + ], + "debug_unsubscribe", + ) + .await?; + let traced = + tokio::time::timeout(Duration::from_secs(10), subscription.next()).await?.unwrap()?; + subscription.unsubscribe().await?; + + assert_eq!( + traced.traces, + block_traces.into_iter().map(Some).collect::>(), + "traceChain traces of the block", + ); + Ok(()) +} + +/// A tracer configuration the tracer rejects fails `traceChain` per block, not per subscription: +/// the first transaction carries the error and the rest of the block is left untraced. +#[tokio::test] +async fn trace_chain_reports_tracer_config_errors_per_block() -> eyre::Result<()> { + reth_tracing::init_test_tracing(); + let fixture = SettledBlock::sequence().await?; + + let ws = fixture.node.inner.add_ons_handle.rpc_server_handles().rpc.ws_client().await.unwrap(); + let mut subscription: Subscription = ws + .subscribe( + "debug_subscribe", + rpc_params![ + "traceChain", + BlockNumberOrTag::Number(0), + BlockNumberOrTag::Number(fixture.block_number()), + json!({"tracer": "callTracer", "tracerConfig": {"onlyTopCall": "invalid"}}) + ], + "debug_unsubscribe", + ) + .await?; + let failed = + tokio::time::timeout(Duration::from_secs(10), subscription.next()).await?.unwrap()?; + subscription.unsubscribe().await?; + + assert_eq!(failed.traces.len(), fixture.transactions().len(), "traceChain trace count"); + assert!( + matches!(failed.traces[0], Some(TraceResult::Error { .. })), + "traceChain must report the tracer error on the first transaction: {:?}", + failed.traces[0], + ); + assert!( + failed.traces[1..].iter().all(Option::is_none), + "traceChain must leave the rest of the block untraced: {:?}", + failed.traces, + ); + Ok(()) +} + +/// Otterscan replays a reverted transaction on an SDM block and returns its revert data. +#[tokio::test] +async fn otterscan_returns_revert_output_on_sdm_block() -> eyre::Result<()> { + reth_tracing::init_test_tracing(); + let fixture = SettledBlock::sequence().await?; + + let revert: Option = fixture + .client + .request("ots_getTransactionError", rpc_params![fixture.transactions()[3].tx_hash()]) + .await?; + + assert_eq!( + revert, + Some(Bytes::copy_from_slice(&REVERT_OUTPUT.to_be_bytes::<32>())), + "ots_getTransactionError revert data", + ); + Ok(()) +} + +/// The sender starts with exactly the settled cost of the first deployment plus the second +/// transaction's upfront `gas_limit * max_fee`, so the second transaction replays only if the +/// first one's refund was credited; a bare-EVM replay fails with insufficient funds. +#[tokio::test] +async fn later_transaction_affordability_depends_on_prior_refund() -> eyre::Result<()> { + reth_tracing::init_test_tracing(); + let wallet = Wallet::default(); + let sender = wallet.inner.address(); + let gas_price = 20_000_000_000u128; + let settled_deploy_gas = DEPLOY_GAS - 1; + let transaction_gas_limit = 100_000u64; + let initial_balance = + U256::from(settled_deploy_gas + transaction_gas_limit) * U256::from(gas_price); + let chain_spec = lagoon::chain_spec_with(|genesis| { + genesis.alloc.entry(sender).or_default().balance = initial_balance; + })?; + let wallet = wallet.with_chain_id(chain_spec.chain_id()); + + let mut forced_transactions = Vec::new(); + for nonce in 0..2 { + let transaction = TransactionRequest { + chain_id: Some(wallet.chain_id), + gas: Some(transaction_gas_limit), + input: TransactionInput::new(Bytes::from_static(&[0x00])), + max_fee_per_gas: Some(gas_price), + max_priority_fee_per_gas: Some(gas_price), + nonce: Some(nonce), + to: Some(TxKind::Create), + ..Default::default() + }; + let signed = TransactionTestContext::sign_tx(wallet.inner.clone(), transaction).await; + forced_transactions.push(signed.encoded_2718().into()); + } + let mut node = launch_sdm_node_with_attributes(&chain_spec, move |timestamp| { + let mut attributes = lagoon::payload_attributes(timestamp); + // Local sequencing produces refunds; derived mode only verifies embedded refunds. The + // transactions are forced through attributes because the pool's balance check does not + // know about refunds and would reject the second one. + attributes.0.no_tx_pool = Some(false); + attributes.0.transactions = Some(forced_transactions.clone()); + attributes + }) + .await?; + let payload = node.advance_block().await?; + let block = payload.block(); + assert_eq!(block.body().transactions.len(), 3, "two deployments and the post-exec tx"); + let client = node.inner.add_ons_handle.rpc_server_handles().rpc.http_client().unwrap(); + + let sender_before_second = DebugApiClient::::debug_account_info_at( + &client, + block.hash().into(), + 0usize.into(), + sender, + ) + .await? + .unwrap(); + assert_eq!( + sender_before_second.balance, + U256::from(transaction_gas_limit) * U256::from(gas_price), + "debug_accountAt balance after the first deployment", + ); + let second = block.body().transactions[1].tx_hash(); + let trace = + DebugApiClient::::debug_trace_transaction(&client, second, None) + .await?; + let GethTrace::Default(frame) = trace else { + panic!("unexpected trace of the second deployment: {trace:?}"); + }; + assert_eq!( + frame.gas, settled_deploy_gas, + "debug_traceTransaction gas of the second deployment" + ); + let traces = DebugApiClient::::debug_trace_block_by_number( + &client, + BlockNumberOrTag::Number(block.number()), + None, + ) + .await?; + assert_eq!( + default_trace_gas(&traces[1]), + settled_deploy_gas, + "debug_traceBlockByNumber gas of the second deployment", + ); + Ok(()) +} + +/// The balance a parity state diff leaves `address` with. +fn settled_balance(state_diff: Option<&StateDiff>, address: Address) -> U256 { + let state_diff = state_diff.expect("state diff requested"); + match &state_diff[&address].balance { + Delta::Changed(changed) => changed.to, + Delta::Added(to) => *to, + other => panic!("balance of {address} must change: {other:?}"), + } +} From 5e3d04bd85d97022ee5bed2d13e6857453ff1b04 Mon Sep 17 00:00:00 2001 From: Einar Rasmussen Date: Fri, 6 Nov 2026 07:35:43 -0800 Subject: [PATCH 2/6] op-reth: split the SDM replay tests by RPC family and tighten the fixtures Turns `rpc_replay_settlement` into a directory module with the sequenced block in `fixture.rs` and one file per family: debug tracers against receipts and committed state, parity replays and `trace_filter` against `debug_accountAt`, synthetic calls on the settled prefix, the post-exec transaction as a no-op target with intermediate roots, `traceChain`, otterscan and affordability. Each test fails on its own family. Fixture fixes from review: the raw block's transfer and deposit target an EOA instead of the ecrecover precompile; the executor-rejection test matches the call error's message rather than its `Debug` rendering; the post-exec entry of a block trace is asserted at receipt gas; `eth_callMany` surfaces the response error before reading the value; `traceChain` derives its window from the fixture; the transaction count follows `POST_EXEC_INDEX`; the no-op `no_tx_pool` assignment is gone. The alloy-op-evm unit test now compares a Verify-mode result with a Disabled-mode run, so it proves the refund and the saved operator fee are credited before commit. The update guide names `v2.7.0` through `v2.8.1` as the alloy-evm 0.39 bases. Co-Authored-By: Claude Fable 5.1 --- rust/UPDATING-RETH.md | 2 +- .../src/block/tests/structural_tests.rs | 64 +- .../node/tests/it/debug_trace_post_exec.rs | 14 +- .../node/tests/it/rpc_replay_settlement.rs | 635 ------------------ .../it/rpc_replay_settlement/affordability.rs | 96 +++ .../it/rpc_replay_settlement/debug_tracers.rs | 94 +++ .../tests/it/rpc_replay_settlement/fixture.rs | 196 ++++++ .../tests/it/rpc_replay_settlement/mod.rs | 17 + .../it/rpc_replay_settlement/otterscan.rs | 24 + .../rpc_replay_settlement/parity_replays.rs | 83 +++ .../rpc_replay_settlement/post_exec_target.rs | 87 +++ .../rpc_replay_settlement/prefix_replays.rs | 111 +++ .../it/rpc_replay_settlement/trace_chain.rs | 81 +++ 13 files changed, 840 insertions(+), 664 deletions(-) delete mode 100644 rust/op-reth/crates/node/tests/it/rpc_replay_settlement.rs create mode 100644 rust/op-reth/crates/node/tests/it/rpc_replay_settlement/affordability.rs create mode 100644 rust/op-reth/crates/node/tests/it/rpc_replay_settlement/debug_tracers.rs create mode 100644 rust/op-reth/crates/node/tests/it/rpc_replay_settlement/fixture.rs create mode 100644 rust/op-reth/crates/node/tests/it/rpc_replay_settlement/mod.rs create mode 100644 rust/op-reth/crates/node/tests/it/rpc_replay_settlement/otterscan.rs create mode 100644 rust/op-reth/crates/node/tests/it/rpc_replay_settlement/parity_replays.rs create mode 100644 rust/op-reth/crates/node/tests/it/rpc_replay_settlement/post_exec_target.rs create mode 100644 rust/op-reth/crates/node/tests/it/rpc_replay_settlement/prefix_replays.rs create mode 100644 rust/op-reth/crates/node/tests/it/rpc_replay_settlement/trace_chain.rs diff --git a/rust/UPDATING-RETH.md b/rust/UPDATING-RETH.md index 671f57fa3fe..0b9354af9ae 100644 --- a/rust/UPDATING-RETH.md +++ b/rust/UPDATING-RETH.md @@ -332,7 +332,7 @@ on the next base: backport of paradigmxyz/reth#28266). Op-reth's SDM refund settlement is only visible to `debug_*`, `trace_*` and `ots_*` replays through it, and `rust/op-reth/crates/node/tests/it/rpc_replay_settlement.rs` fails without - it. On a base that still uses alloy-evm 0.39 (`v2.7.0`, `v2.8.0`), + it. On a base that still uses alloy-evm 0.39 (`v2.7.0` through `v2.8.1`), cherry-pick the backport and resolve conflicts in `helpers/call.rs`, `helpers/trace.rs` and `rpc/src/debug.rs`. On an evm2 base (`v2.9.0` and later), drop the backport and cherry-pick #28266 itself until a release diff --git a/rust/alloy-op-evm/src/block/tests/structural_tests.rs b/rust/alloy-op-evm/src/block/tests/structural_tests.rs index 5a5f09b6acd..d165e6732d8 100644 --- a/rust/alloy-op-evm/src/block/tests/structural_tests.rs +++ b/rust/alloy-op-evm/src/block/tests/structural_tests.rs @@ -1,5 +1,6 @@ use super::*; use crate::post_exec::{NullRefundPolicy, RevertToCheckpointError}; +use op_revm::constants::OPERATOR_FEE_RECIPIENT; fn recovered_post_exec(block_number: u64, entries: Vec) -> Recovered { Recovered::new_unchecked( @@ -186,17 +187,53 @@ fn canonicalized_result_gas_applies_refund_exactly_once() { /// A replay of an imported block runs in Verify mode with a tracer attached and reads each /// transaction's result before committing it, so that result must already carry the recorded -/// refund in both its gas and its state. +/// refund in both its gas and its state: the sender keeps the refunded gas at the transaction's +/// price plus the operator fee the lower canonical gas saves, compared with the same transaction +/// run without post-exec accounting, and the uncommitted state equals what a commit writes. #[test] fn verify_mode_result_is_settled_before_commit_with_inspector() { let receipt_builder = OpAlloyReceiptBuilder::default(); let hardforks = OpChainHardforks::op_mainnet(); + let gas_price = 1u128; let payload = PostExecPayload { version: 1, block_number: 0, gas_refund_entries: vec![SDMGasEntry { index: 0, gas_refund: 1 }], }; - let priced_tx = legacy_tx_with_price(0, OBSERVER_TEST_CONTRACT, 200_000, 1); + let priced_tx = legacy_tx_with_price(0, OBSERVER_TEST_CONTRACT, 200_000, gas_price); + let balance_in = |state: &EvmState, address: Address| { + state.get(&address).map(|account| account.info.balance).unwrap_or_default() + }; + + let uncommitted = |mode: PostExecMode| { + let mut db = prepare_observer_db(); + let mut executor = build_policy_executor_with::( + &mut db, + &receipt_builder, + &hardforks, + 1, + Address::ZERO, + Inspect::Enabled, + ); + executor.set_post_exec_mode(mode); + let output = + executor.execute_transaction_without_commit(&priced_tx).expect("transaction executes"); + let result_gas = output.inner.result.result.gas().tx_gas_used(); + (output.canonical_gas_used, output.evm_gas_used, result_gas, output.inner.result.state) + }; + let (canonical_gas, evm_gas, result_gas, verify_state) = + uncommitted(PostExecMode::Verify(payload.clone())); + let (_, _, _, disabled_state) = uncommitted(PostExecMode::Disabled); + + assert_eq!(canonical_gas, evm_gas - 1); + assert_eq!(result_gas, canonical_gas, "result gas must be the canonical gas"); + let operator_fee_saved = balance_in(&disabled_state, OPERATOR_FEE_RECIPIENT) - + balance_in(&verify_state, OPERATOR_FEE_RECIPIENT); + assert_eq!( + balance_in(&verify_state, Address::ZERO) - balance_in(&disabled_state, Address::ZERO), + U256::from(gas_price) + operator_fee_saved, + "uncommitted state must credit the refunded gas and the saved operator fee to the sender" + ); let mut committed_db = prepare_observer_db(); let mut committing = build_policy_executor_with::( @@ -207,34 +244,17 @@ fn verify_mode_result_is_settled_before_commit_with_inspector() { Address::ZERO, Inspect::Enabled, ); - committing.set_post_exec_mode(PostExecMode::Verify(payload.clone())); + committing.set_post_exec_mode(PostExecMode::Verify(payload)); committing.execute_transaction(&priced_tx).expect("refunded transaction commits"); drop(committing); let committed_balance = revm::Database::basic(&mut committed_db, Address::ZERO) .expect("sender is readable") .expect("sender exists") .balance; - - let mut db = prepare_observer_db(); - let mut executor = build_policy_executor_with::( - &mut db, - &receipt_builder, - &hardforks, - 1, - Address::ZERO, - Inspect::Enabled, - ); - executor.set_post_exec_mode(PostExecMode::Verify(payload)); - let output = executor - .execute_transaction_without_commit(&priced_tx) - .expect("refunded transaction executes"); - - assert_eq!(output.canonical_gas_used, output.evm_gas_used - 1); - assert_eq!(output.inner.result.result.gas().tx_gas_used(), output.canonical_gas_used); assert_eq!( - output.inner.result.state[&Address::ZERO].info.balance, + balance_in(&verify_state, Address::ZERO), committed_balance, - "uncommitted state must already carry the refund" + "uncommitted state must equal what a commit writes" ); } diff --git a/rust/op-reth/crates/node/tests/it/debug_trace_post_exec.rs b/rust/op-reth/crates/node/tests/it/debug_trace_post_exec.rs index 86af9c45867..351dc94b44c 100644 --- a/rust/op-reth/crates/node/tests/it/debug_trace_post_exec.rs +++ b/rust/op-reth/crates/node/tests/it/debug_trace_post_exec.rs @@ -15,7 +15,7 @@ use alloy_consensus::{ use alloy_primitives::{Address, B256, Bytes, Signature, TxKind, U256}; use alloy_rpc_types_eth::TransactionRequest; use alloy_rpc_types_trace::{common::TraceResult, geth::GethDebugTracingOptions}; -use jsonrpsee::http_client::HttpClient; +use jsonrpsee::{core::ClientError, http_client::HttpClient}; use op_alloy_consensus::{OpTxEnvelope, SDMGasEntry, TxDeposit, build_post_exec_tx}; use reth_chainspec::EthChainSpec; use reth_node_builder::{NodeBuilder, NodeHandle}; @@ -77,10 +77,12 @@ async fn test_debug_trace_block_rejects_exhausted_budget() -> eyre::Result<()> { .await .expect_err("debug_traceBlock must reject the transfer"); + let ClientError::Call(error) = error else { + panic!("debug_traceBlock must fail with a call error: {error:?}"); + }; assert_eq!( - error.to_string(), - "ErrorObject { code: InternalError, message: \"transaction gas limit 21000 is more than \ - blocks available gas 0\", data: None }", + error.message(), + "transaction gas limit 21000 is more than blocks available gas 0", "debug_traceBlock error for an executor-rejected block", ); @@ -135,7 +137,7 @@ fn raw_sdm_block( nonce: 1, gas_limit: TRANSFER_GAS, max_fee_per_gas: u128::from(header.base_fee_per_gas.unwrap_or_default()), - to: TxKind::Call(Address::with_last_byte(1)), + to: TxKind::Call(Address::repeat_byte(0x99)), ..Default::default() } .into_signed(Signature::test_signature()); @@ -143,7 +145,7 @@ fn raw_sdm_block( let deposit = TxDeposit { source_hash: B256::with_last_byte(1), from: signer, - to: TxKind::Call(Address::with_last_byte(1)), + to: TxKind::Call(Address::repeat_byte(0x99)), mint: 1_000_000_000_000_000_000, value: U256::ZERO, gas_limit: 21_000, diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement.rs deleted file mode 100644 index 019e8dd2e10..00000000000 --- a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement.rs +++ /dev/null @@ -1,635 +0,0 @@ -//! RPC replay over a sequenced Lagoon block whose transactions carry SDM refunds. -//! -//! The settlement of an SDM refund (canonical gas, sender credit, fee-vault debits) only happens -//! inside the block executor, so every RPC path that replays block transactions must go through it. -//! A replay on the bare EVM reports pre-refund gas and unsettled balances ([#485]). -//! -//! [#485]: https://github.com/ethereum-optimism/protocol-team/issues/485 - -use crate::lagoon::{ - self, DEPLOY_GAS, default_trace_gas, launch_sdm_node, launch_sdm_node_with_attributes, - prestate_tracer, -}; -use alloy_consensus::{BlockHeader, TxReceipt}; -use alloy_network::eip2718::Encodable2718; -use alloy_primitives::{Address, B256, Bytes, TxKind, U256, map::HashSet}; -use alloy_rpc_types_eth::{ - BlockNumberOrTag, EthCallResponse, TransactionInput, TransactionRequest, -}; -use alloy_rpc_types_trace::{ - common::TraceResult, - filter::TraceFilter, - geth::{ - ChainBlockTraceResult, GethDebugTracingCallOptions, GethDebugTracingOptions, GethTrace, - PreStateConfig, PreStateFrame, - }, - parity::{Delta, StateDiff, TraceType}, -}; -use jsonrpsee::{ - core::client::{ClientT, Subscription, SubscriptionClientT}, - http_client::HttpClient, - rpc_params, -}; -use reth_chainspec::EthChainSpec; -use reth_e2e_test_utils::{NodeHelperType, transaction::TransactionTestContext, wallet::Wallet}; -use reth_optimism_node::OpNode; -use reth_optimism_payload_builder::OpBuiltPayload; -use reth_optimism_primitives::OpTransactionSigned; -use reth_provider::{ReceiptProvider, StateProviderFactory}; -use reth_rpc_api::clients::{DebugApiClient, TraceApiClient}; -use serde_json::json; -use std::time::Duration; - -/// Index of the post-exec transaction in a [`SettledBlock`]. -const POST_EXEC_INDEX: usize = 4; - -/// Revert data returned by the reverting deployment in a [`SettledBlock`]. -const REVERT_OUTPUT: U256 = U256::from_limbs([42, 0, 0, 0]); - -/// A Lagoon block sequenced by a node running the fixed test policy, which refunds every regular -/// transaction one gas: a real, imported block with a 0x7d transaction and a settled state. -/// -/// The sender submits four transactions: a deployment of the init code `STOP` (refunded), a plain -/// transfer (not refunded, since it already sits on the EIP-7623 floor), a second deployment -/// (refunded) and a deployment whose init code reverts with [`REVERT_OUTPUT`]. -struct SettledBlock { - node: NodeHelperType, - client: HttpClient, - payload: OpBuiltPayload, - sender: Address, -} - -impl SettledBlock { - async fn sequence() -> eyre::Result { - let chain_spec = lagoon::chain_spec()?; - let mut node = launch_sdm_node(&chain_spec).await?; - let client = node.inner.add_ons_handle.rpc_server_handles().rpc.http_client().unwrap(); - let wallet = Wallet::default().with_chain_id(chain_spec.chain_id()); - let sender = wallet.inner.address(); - let deployments = [ - (TxKind::Create, Bytes::from_static(&[0x00])), - (TxKind::Call(Address::repeat_byte(0x99)), Bytes::new()), - (TxKind::Create, Bytes::from_static(&[0x00])), - // PUSH1 42 PUSH1 0 MSTORE PUSH1 32 PUSH1 0 REVERT - ( - TxKind::Create, - Bytes::from_static(&[0x60, 0x2a, 0x60, 0x00, 0x52, 0x60, 0x20, 0x60, 0x00, 0xfd]), - ), - ]; - for (nonce, (to, init_code)) in deployments.into_iter().enumerate() { - let transaction = TransactionRequest { - chain_id: Some(wallet.chain_id), - gas: Some(if matches!(to, TxKind::Call(_)) { 21_000 } else { 100_000 }), - input: TransactionInput::new(init_code), - max_fee_per_gas: Some(20_000_000_000), - max_priority_fee_per_gas: Some(1_000_000_000), - nonce: Some(nonce as u64), - to: Some(to), - ..Default::default() - }; - let signed = TransactionTestContext::sign_tx(wallet.inner.clone(), transaction).await; - node.rpc.inject_tx(signed.encoded_2718().into()).await?; - } - let payload = node.advance_block().await?; - - let fixture = Self { node, client, payload, sender }; - let transactions = fixture.transactions(); - assert_eq!(transactions.len(), 5, "four regular transactions and the post-exec tx"); - let OpTransactionSigned::PostExec(post_exec) = &transactions[POST_EXEC_INDEX] else { - panic!("block must end in a post-exec tx, got {:?}", transactions[POST_EXEC_INDEX]); - }; - let refund_entries = &post_exec.inner().payload.gas_refund_entries; - assert!( - refund_entries.iter().any(|entry| entry.index == 2 && entry.gas_refund > 0), - "the second deployment must be refunded: {refund_entries:?}", - ); - assert!( - !refund_entries.iter().any(|entry| entry.index == 1), - "the transfer must not be refunded: {refund_entries:?}", - ); - Ok(fixture) - } - - fn block_hash(&self) -> B256 { - self.payload.block().hash() - } - - fn block_number(&self) -> u64 { - self.payload.block().number() - } - - fn transactions(&self) -> &[OpTransactionSigned] { - &self.payload.block().body().transactions - } - - /// Gas each regular transaction used according to its receipt. - fn receipt_gas(&self) -> eyre::Result> { - let mut cumulative_gas = 0; - self.transactions() - .iter() - .map(|transaction| { - let receipt = - self.node.inner.provider.receipt_by_hash(transaction.tx_hash())?.unwrap(); - let gas_used = receipt.cumulative_gas_used() - cumulative_gas; - cumulative_gas = receipt.cumulative_gas_used(); - Ok(gas_used) - }) - .collect() - } - - /// Balance of `address` in the state the node committed for the block. - fn committed_balance(&self, address: Address) -> eyre::Result { - let state = self.node.inner.provider.state_by_block_hash(self.block_hash())?; - Ok(state.account_balance(&address)?.unwrap_or_default()) - } - - /// Balance of `address` right after the transaction at `index`, as `debug_accountAt` replays - /// it. - async fn replayed_balance(&self, index: usize, address: Address) -> eyre::Result { - let account = DebugApiClient::::debug_account_info_at( - &self.client, - self.block_hash().into(), - index.into(), - address, - ) - .await? - .unwrap_or_default(); - Ok(account.balance) - } - - async fn block_traces(&self) -> eyre::Result>> { - Ok(DebugApiClient::::debug_trace_block_by_hash( - &self.client, - self.block_hash(), - None, - ) - .await?) - } - - async fn trace_transaction( - &self, - index: usize, - options: Option, - ) -> eyre::Result { - Ok(DebugApiClient::::debug_trace_transaction( - &self.client, - self.transactions()[index].tx_hash(), - options, - ) - .await?) - } - - async fn prestate_diff( - &self, - index: usize, - ) -> eyre::Result { - let options = - prestate_tracer(PreStateConfig { diff_mode: Some(true), ..Default::default() }); - match self.trace_transaction(index, Some(options)).await? { - GethTrace::PreStateTracer(PreStateFrame::Diff(diff)) => Ok(diff), - other => panic!("unexpected prestate trace of transaction {index}: {other:?}"), - } - } -} - -/// Every RPC path that replays the block's own transactions agrees with what the node committed: -/// the receipts' canonical gas, the balances after each transaction, and the header's state root. -#[tokio::test] -async fn replays_match_sdm_settlement() -> eyre::Result<()> { - reth_tracing::init_test_tracing(); - let fixture = SettledBlock::sequence().await?; - let SettledBlock { client, sender, .. } = &fixture; - let client = client.clone(); - let sender = *sender; - let transactions = fixture.transactions().to_vec(); - let block_hash = fixture.block_hash(); - let receipt_gas = fixture.receipt_gas()?; - - // Pins the settlement itself: every check below compares a replay with what the node committed. - assert_eq!(receipt_gas[0], DEPLOY_GAS - 1, "receipt holds canonical gas"); - - let block_traces = fixture.block_traces().await?; - assert_eq!(block_traces.len(), transactions.len(), "debug_traceBlockByHash trace count"); - - for index in 0..POST_EXEC_INDEX { - let hash = transactions[index].tx_hash(); - let gas_used = receipt_gas[index]; - - let GethTrace::Default(frame) = fixture.trace_transaction(index, None).await? else { - panic!("unexpected default trace of transaction {index}"); - }; - assert_eq!(frame.gas, gas_used, "debug_traceTransaction gas of transaction {index}"); - assert_eq!( - default_trace_gas(&block_traces[index]), - gas_used, - "debug_traceBlockByHash gas of transaction {index}", - ); - let call: GethTrace = client - .request("debug_traceTransaction", rpc_params![hash, json!({"tracer": "callTracer"})]) - .await?; - let GethTrace::CallTracer(call_frame) = call else { - panic!("unexpected call trace of transaction {index}: {call:?}"); - }; - assert_eq!( - call_frame.gas_used, - U256::from(gas_used), - "callTracer gas of transaction {index}", - ); - - // Every balance the prestate diff ends on is the balance debug_accountAt replays at that - // index, for the sender as well as the fee vaults. - let diff = fixture.prestate_diff(index).await?; - assert!( - diff.post.contains_key(&sender), - "prestate diff of transaction {index} lacks sender" - ); - for (address, account) in &diff.post { - if let Some(balance) = account.balance { - assert_eq!( - balance, - fixture.replayed_balance(index, *address).await?, - "prestate diff balance of {address} after transaction {index}", - ); - } - } - - let replay = TraceApiClient::::replay_transaction( - &client, - hash, - HashSet::from_iter([TraceType::StateDiff, TraceType::Trace]), - ) - .await?; - assert_eq!( - settled_balance(replay.state_diff.as_ref(), sender), - fixture.replayed_balance(index, sender).await?, - "trace_replayTransaction state diff of transaction {index}", - ); - } - - // The last regular transaction leaves the committed state, since the post-exec transaction - // changes nothing; this anchors the replayed balances above to the provider. - let last_regular = POST_EXEC_INDEX - 1; - let committed = fixture.committed_balance(sender)?; - assert_eq!( - fixture.replayed_balance(last_regular, sender).await?, - committed, - "debug_accountAt after the last regular transaction", - ); - assert_eq!( - fixture.replayed_balance(POST_EXEC_INDEX, sender).await?, - committed, - "debug_accountAt after the post-exec transaction", - ); - for (address, account) in &fixture.prestate_diff(last_regular).await?.post { - if let Some(balance) = account.balance { - assert_eq!( - balance, - fixture.committed_balance(*address)?, - "committed balance of {address} after transaction {last_regular}", - ); - } - } - - let replays = TraceApiClient::::replay_block_transactions( - &client, - block_hash.into(), - HashSet::from_iter([TraceType::StateDiff]), - ) - .await? - .expect("block exists"); - assert_eq!(replays.len(), transactions.len(), "trace_replayBlockTransactions replay count"); - for (index, replay) in replays.iter().take(POST_EXEC_INDEX).enumerate() { - assert_eq!( - settled_balance(replay.full_trace.state_diff.as_ref(), sender), - fixture.replayed_balance(index, sender).await?, - "trace_replayBlockTransactions state diff of transaction {index}", - ); - } - - // debug_traceCall at an index runs on the settled prefix but earns no refund itself. - let prefix_call = DebugApiClient::::debug_trace_call( - &client, - TransactionRequest::default().from(sender).to(Address::with_last_byte(1)), - Some(block_hash.into()), - Some(GethDebugTracingCallOptions { - tracing_options: prestate_tracer(PreStateConfig::default()), - tx_index: Some(1), - ..Default::default() - }), - ) - .await?; - let GethTrace::PreStateTracer(PreStateFrame::Default(prestate)) = prefix_call else { - panic!("unexpected debug_traceCall prestate: {prefix_call:?}"); - }; - assert_eq!( - prestate.0[&sender].balance, - Some(fixture.replayed_balance(0, sender).await?), - "debug_traceCall prestate after the first deployment", - ); - let recipient = Address::repeat_byte(0x55); - let synthetic_transfer = DebugApiClient::::debug_trace_call( - &client, - TransactionRequest::default().from(sender).to(recipient).value(U256::from(1)), - Some(block_hash.into()), - Some(GethDebugTracingCallOptions { - tx_index: Some(POST_EXEC_INDEX as u64), - ..Default::default() - }), - ) - .await?; - let GethTrace::Default(synthetic_frame) = synthetic_transfer else { - panic!("unexpected debug_traceCall trace: {synthetic_transfer:?}"); - }; - assert_eq!(synthetic_frame.gas, 21_000, "debug_traceCall gas of a synthetic transfer"); - - // The post-exec transaction is its own replay target: an empty trace at its receipt gas. - let GethTrace::Default(post_exec_frame) = - fixture.trace_transaction(POST_EXEC_INDEX, None).await? - else { - panic!("unexpected default trace of the post-exec transaction"); - }; - assert!(post_exec_frame.struct_logs.is_empty(), "debug_traceTransaction of the post-exec tx"); - assert_eq!( - post_exec_frame.gas, receipt_gas[POST_EXEC_INDEX], - "debug_traceTransaction gas of the post-exec tx", - ); - let post_exec_call: GethTrace = client - .request( - "debug_traceTransaction", - rpc_params![transactions[POST_EXEC_INDEX].tx_hash(), json!({"tracer": "callTracer"})], - ) - .await?; - let GethTrace::CallTracer(post_exec_call_frame) = post_exec_call else { - panic!("unexpected call trace of the post-exec tx: {post_exec_call:?}"); - }; - assert_eq!(post_exec_call_frame.gas_used, U256::ZERO, "callTracer gas of the post-exec tx"); - let post_exec_diff = fixture.prestate_diff(POST_EXEC_INDEX).await?; - assert!( - post_exec_diff.pre.is_empty() && post_exec_diff.post.is_empty(), - "prestate diff of the post-exec tx must be empty: {post_exec_diff:?}", - ); - let GethTrace::Default(transfer_frame) = fixture.trace_transaction(1, None).await? else { - panic!("unexpected default trace of the transfer"); - }; - assert!(transfer_frame.struct_logs.is_empty(), "debug_traceTransaction of the transfer"); - - // Each regular transaction moves the state root; the post-exec transaction does not, and the - // last root is the header's. - let roots = - DebugApiClient::::debug_intermediate_roots(&client, block_hash, None) - .await?; - assert_eq!(roots.len(), transactions.len(), "debug_intermediateRoots root count"); - for index in 0..last_regular { - assert_ne!( - roots[index], - roots[index + 1], - "debug_intermediateRoots after tx {}", - index + 1 - ); - } - assert_eq!(roots[last_regular], roots[POST_EXEC_INDEX], "debug_intermediateRoots after 0x7d"); - assert_eq!( - roots.last(), - Some(&fixture.payload.block().state_root()), - "debug_intermediateRoots" - ); - - let filtered = TraceApiClient::::trace_filter( - &client, - TraceFilter { - from_block: Some(fixture.block_number()), - to_block: Some(fixture.block_number()), - ..Default::default() - }, - ) - .await?; - let filtered_hashes: HashSet<_> = - filtered.iter().filter_map(|trace| trace.transaction_hash).collect(); - let block_hashes: HashSet<_> = transactions.iter().map(|tx| tx.tx_hash()).collect(); - assert_eq!(filtered_hashes, block_hashes, "trace_filter covers every transaction"); - - // eth_callMany and debug_traceCallMany run on the settled prefix: a contract reading the - // sender's balance after the whole block sees the committed one. - let balance_reader = Address::repeat_byte(0x77); - let mut balance_code = vec![0x73]; - balance_code.extend_from_slice(sender.as_slice()); - // BALANCE PUSH1 0 MSTORE PUSH1 32 PUSH1 0 RETURN - balance_code.extend_from_slice(&[0x31, 0x60, 0x00, 0x52, 0x60, 0x20, 0x60, 0x00, 0xf3]); - let bundles = json!([{ - "transactions": [{"from": Address::ZERO, "gasPrice": "0x4a817c800", "to": balance_reader}] - }]); - let context = json!({"blockNumber": block_hash, "transactionIndex": POST_EXEC_INDEX}); - let overrides = json!({ - balance_reader.to_string(): {"code": Bytes::from(balance_code)}, - Address::ZERO.to_string(): {"balance": "0xffffffffffffffff"}, - }); - let output: Vec> = client - .request("eth_callMany", rpc_params![bundles.clone(), context.clone(), overrides.clone()]) - .await?; - assert_eq!( - U256::from_be_slice(output[0][0].value.as_ref().unwrap()), - committed, - "eth_callMany balance read", - ); - let traces: Vec> = client - .request( - "debug_traceCallMany", - rpc_params![bundles, context, json!({"stateOverrides": overrides})], - ) - .await?; - let GethTrace::Default(frame) = &traces[0][0] else { - panic!("unexpected debug_traceCallMany trace: {:?}", traces[0][0]); - }; - assert_eq!( - U256::from_be_slice(&frame.return_value), - committed, - "debug_traceCallMany balance read", - ); - - Ok(()) -} - -/// `traceChain` streams the same settled traces as `debug_traceBlockByHash`. -#[tokio::test] -async fn trace_chain_matches_block_traces() -> eyre::Result<()> { - reth_tracing::init_test_tracing(); - let fixture = SettledBlock::sequence().await?; - let block_traces = fixture.block_traces().await?; - - let ws = fixture.node.inner.add_ons_handle.rpc_server_handles().rpc.ws_client().await.unwrap(); - let mut subscription: Subscription = ws - .subscribe( - "debug_subscribe", - rpc_params![ - "traceChain", - BlockNumberOrTag::Number(0), - BlockNumberOrTag::Number(fixture.block_number()), - GethDebugTracingOptions::default() - ], - "debug_unsubscribe", - ) - .await?; - let traced = - tokio::time::timeout(Duration::from_secs(10), subscription.next()).await?.unwrap()?; - subscription.unsubscribe().await?; - - assert_eq!( - traced.traces, - block_traces.into_iter().map(Some).collect::>(), - "traceChain traces of the block", - ); - Ok(()) -} - -/// A tracer configuration the tracer rejects fails `traceChain` per block, not per subscription: -/// the first transaction carries the error and the rest of the block is left untraced. -#[tokio::test] -async fn trace_chain_reports_tracer_config_errors_per_block() -> eyre::Result<()> { - reth_tracing::init_test_tracing(); - let fixture = SettledBlock::sequence().await?; - - let ws = fixture.node.inner.add_ons_handle.rpc_server_handles().rpc.ws_client().await.unwrap(); - let mut subscription: Subscription = ws - .subscribe( - "debug_subscribe", - rpc_params![ - "traceChain", - BlockNumberOrTag::Number(0), - BlockNumberOrTag::Number(fixture.block_number()), - json!({"tracer": "callTracer", "tracerConfig": {"onlyTopCall": "invalid"}}) - ], - "debug_unsubscribe", - ) - .await?; - let failed = - tokio::time::timeout(Duration::from_secs(10), subscription.next()).await?.unwrap()?; - subscription.unsubscribe().await?; - - assert_eq!(failed.traces.len(), fixture.transactions().len(), "traceChain trace count"); - assert!( - matches!(failed.traces[0], Some(TraceResult::Error { .. })), - "traceChain must report the tracer error on the first transaction: {:?}", - failed.traces[0], - ); - assert!( - failed.traces[1..].iter().all(Option::is_none), - "traceChain must leave the rest of the block untraced: {:?}", - failed.traces, - ); - Ok(()) -} - -/// Otterscan replays a reverted transaction on an SDM block and returns its revert data. -#[tokio::test] -async fn otterscan_returns_revert_output_on_sdm_block() -> eyre::Result<()> { - reth_tracing::init_test_tracing(); - let fixture = SettledBlock::sequence().await?; - - let revert: Option = fixture - .client - .request("ots_getTransactionError", rpc_params![fixture.transactions()[3].tx_hash()]) - .await?; - - assert_eq!( - revert, - Some(Bytes::copy_from_slice(&REVERT_OUTPUT.to_be_bytes::<32>())), - "ots_getTransactionError revert data", - ); - Ok(()) -} - -/// The sender starts with exactly the settled cost of the first deployment plus the second -/// transaction's upfront `gas_limit * max_fee`, so the second transaction replays only if the -/// first one's refund was credited; a bare-EVM replay fails with insufficient funds. -#[tokio::test] -async fn later_transaction_affordability_depends_on_prior_refund() -> eyre::Result<()> { - reth_tracing::init_test_tracing(); - let wallet = Wallet::default(); - let sender = wallet.inner.address(); - let gas_price = 20_000_000_000u128; - let settled_deploy_gas = DEPLOY_GAS - 1; - let transaction_gas_limit = 100_000u64; - let initial_balance = - U256::from(settled_deploy_gas + transaction_gas_limit) * U256::from(gas_price); - let chain_spec = lagoon::chain_spec_with(|genesis| { - genesis.alloc.entry(sender).or_default().balance = initial_balance; - })?; - let wallet = wallet.with_chain_id(chain_spec.chain_id()); - - let mut forced_transactions = Vec::new(); - for nonce in 0..2 { - let transaction = TransactionRequest { - chain_id: Some(wallet.chain_id), - gas: Some(transaction_gas_limit), - input: TransactionInput::new(Bytes::from_static(&[0x00])), - max_fee_per_gas: Some(gas_price), - max_priority_fee_per_gas: Some(gas_price), - nonce: Some(nonce), - to: Some(TxKind::Create), - ..Default::default() - }; - let signed = TransactionTestContext::sign_tx(wallet.inner.clone(), transaction).await; - forced_transactions.push(signed.encoded_2718().into()); - } - let mut node = launch_sdm_node_with_attributes(&chain_spec, move |timestamp| { - let mut attributes = lagoon::payload_attributes(timestamp); - // Local sequencing produces refunds; derived mode only verifies embedded refunds. The - // transactions are forced through attributes because the pool's balance check does not - // know about refunds and would reject the second one. - attributes.0.no_tx_pool = Some(false); - attributes.0.transactions = Some(forced_transactions.clone()); - attributes - }) - .await?; - let payload = node.advance_block().await?; - let block = payload.block(); - assert_eq!(block.body().transactions.len(), 3, "two deployments and the post-exec tx"); - let client = node.inner.add_ons_handle.rpc_server_handles().rpc.http_client().unwrap(); - - let sender_before_second = DebugApiClient::::debug_account_info_at( - &client, - block.hash().into(), - 0usize.into(), - sender, - ) - .await? - .unwrap(); - assert_eq!( - sender_before_second.balance, - U256::from(transaction_gas_limit) * U256::from(gas_price), - "debug_accountAt balance after the first deployment", - ); - let second = block.body().transactions[1].tx_hash(); - let trace = - DebugApiClient::::debug_trace_transaction(&client, second, None) - .await?; - let GethTrace::Default(frame) = trace else { - panic!("unexpected trace of the second deployment: {trace:?}"); - }; - assert_eq!( - frame.gas, settled_deploy_gas, - "debug_traceTransaction gas of the second deployment" - ); - let traces = DebugApiClient::::debug_trace_block_by_number( - &client, - BlockNumberOrTag::Number(block.number()), - None, - ) - .await?; - assert_eq!( - default_trace_gas(&traces[1]), - settled_deploy_gas, - "debug_traceBlockByNumber gas of the second deployment", - ); - Ok(()) -} - -/// The balance a parity state diff leaves `address` with. -fn settled_balance(state_diff: Option<&StateDiff>, address: Address) -> U256 { - let state_diff = state_diff.expect("state diff requested"); - match &state_diff[&address].balance { - Delta::Changed(changed) => changed.to, - Delta::Added(to) => *to, - other => panic!("balance of {address} must change: {other:?}"), - } -} diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/affordability.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/affordability.rs new file mode 100644 index 00000000000..f5ea739ef2e --- /dev/null +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/affordability.rs @@ -0,0 +1,96 @@ +//! A later transaction that is only affordable because of an earlier refund. + +use crate::lagoon::{self, DEPLOY_GAS, default_trace_gas, launch_sdm_node_with_attributes}; +use alloy_consensus::BlockHeader; +use alloy_network::eip2718::Encodable2718; +use alloy_primitives::{Bytes, TxKind, U256}; +use alloy_rpc_types_eth::{BlockNumberOrTag, TransactionInput, TransactionRequest}; +use alloy_rpc_types_trace::geth::GethTrace; +use reth_chainspec::EthChainSpec; +use reth_e2e_test_utils::{transaction::TransactionTestContext, wallet::Wallet}; +use reth_rpc_api::clients::DebugApiClient; + +/// The sender starts with exactly the settled cost of the first deployment plus the second +/// transaction's upfront `gas_limit * max_fee`, so the second transaction replays only if the +/// first one's refund was credited; a bare-EVM replay fails with insufficient funds. +#[tokio::test] +async fn later_transaction_affordability_depends_on_prior_refund() -> eyre::Result<()> { + reth_tracing::init_test_tracing(); + let wallet = Wallet::default(); + let sender = wallet.inner.address(); + let gas_price = 20_000_000_000u128; + let settled_deploy_gas = DEPLOY_GAS - 1; + let transaction_gas_limit = 100_000u64; + let initial_balance = + U256::from(settled_deploy_gas + transaction_gas_limit) * U256::from(gas_price); + let chain_spec = lagoon::chain_spec_with(|genesis| { + genesis.alloc.entry(sender).or_default().balance = initial_balance; + })?; + let wallet = wallet.with_chain_id(chain_spec.chain_id()); + + let mut forced_transactions = Vec::new(); + for nonce in 0..2 { + let transaction = TransactionRequest { + chain_id: Some(wallet.chain_id), + gas: Some(transaction_gas_limit), + input: TransactionInput::new(Bytes::from_static(&[0x00])), + max_fee_per_gas: Some(gas_price), + max_priority_fee_per_gas: Some(gas_price), + nonce: Some(nonce), + to: Some(TxKind::Create), + ..Default::default() + }; + let signed = TransactionTestContext::sign_tx(wallet.inner.clone(), transaction).await; + forced_transactions.push(signed.encoded_2718().into()); + } + let mut node = launch_sdm_node_with_attributes(&chain_spec, move |timestamp| { + let mut attributes = lagoon::payload_attributes(timestamp); + // The transactions are forced through attributes because the pool's balance check does + // not know about refunds and would reject the second one. Local sequencing (the default + // mode) produces the refunds; derived mode would only verify embedded ones. + attributes.0.transactions = Some(forced_transactions.clone()); + attributes + }) + .await?; + let payload = node.advance_block().await?; + let block = payload.block(); + assert_eq!(block.body().transactions.len(), 3, "two deployments and the post-exec tx"); + let client = node.inner.add_ons_handle.rpc_server_handles().rpc.http_client().unwrap(); + + let sender_before_second = DebugApiClient::::debug_account_info_at( + &client, + block.hash().into(), + 0usize.into(), + sender, + ) + .await? + .unwrap(); + assert_eq!( + sender_before_second.balance, + U256::from(transaction_gas_limit) * U256::from(gas_price), + "debug_accountAt balance after the first deployment", + ); + let second = block.body().transactions[1].tx_hash(); + let trace = + DebugApiClient::::debug_trace_transaction(&client, second, None) + .await?; + let GethTrace::Default(frame) = trace else { + panic!("unexpected trace of the second deployment: {trace:?}"); + }; + assert_eq!( + frame.gas, settled_deploy_gas, + "debug_traceTransaction gas of the second deployment" + ); + let traces = DebugApiClient::::debug_trace_block_by_number( + &client, + BlockNumberOrTag::Number(block.number()), + None, + ) + .await?; + assert_eq!( + default_trace_gas(&traces[1]), + settled_deploy_gas, + "debug_traceBlockByNumber gas of the second deployment", + ); + Ok(()) +} diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/debug_tracers.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/debug_tracers.rs new file mode 100644 index 00000000000..625bb8d585b --- /dev/null +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/debug_tracers.rs @@ -0,0 +1,94 @@ +//! `debug_trace*` and `debug_accountAt` against the receipts and the committed state. + +use super::fixture::{POST_EXEC_INDEX, SettledBlock}; +use crate::lagoon::{DEPLOY_GAS, default_trace_gas}; +use alloy_primitives::U256; +use alloy_rpc_types_trace::geth::GethTrace; +use jsonrpsee::{core::client::ClientT, rpc_params}; +use serde_json::json; + +/// The default, call and prestate tracers report each regular transaction's canonical gas and +/// the balances `debug_accountAt` replays at that index; after the last regular transaction those +/// balances are the committed ones. +#[tokio::test] +async fn debug_tracers_report_settled_gas_and_balances() -> eyre::Result<()> { + reth_tracing::init_test_tracing(); + let fixture = SettledBlock::sequence().await?; + let receipt_gas = fixture.receipt_gas()?; + // Pins the settlement itself: every check below compares a replay with what the node committed. + assert_eq!(receipt_gas[0], DEPLOY_GAS - 1, "receipt holds canonical gas"); + + let block_traces = fixture.block_traces().await?; + assert_eq!(block_traces.len(), POST_EXEC_INDEX + 1, "debug_traceBlockByHash trace count"); + + for index in 0..POST_EXEC_INDEX { + let gas_used = receipt_gas[index]; + assert_eq!( + fixture.default_trace_gas_of(index).await?, + gas_used, + "debug_traceTransaction gas of transaction {index}", + ); + assert_eq!( + default_trace_gas(&block_traces[index]), + gas_used, + "debug_traceBlockByHash gas of transaction {index}", + ); + let call: GethTrace = fixture + .client + .request( + "debug_traceTransaction", + rpc_params![fixture.transaction_hash(index), json!({"tracer": "callTracer"})], + ) + .await?; + let GethTrace::CallTracer(call_frame) = call else { + panic!("unexpected call trace of transaction {index}: {call:?}"); + }; + assert_eq!( + call_frame.gas_used, + U256::from(gas_used), + "callTracer gas of transaction {index}", + ); + + // Every balance the prestate diff ends on is the balance debug_accountAt replays at that + // index, for the sender as well as the fee vaults. + let diff = fixture.prestate_diff(index).await?; + assert!( + diff.post.contains_key(&fixture.sender), + "prestate diff of transaction {index} lacks the sender", + ); + for (address, account) in &diff.post { + if let Some(balance) = account.balance { + assert_eq!( + balance, + fixture.replayed_balance(index, *address).await?, + "prestate diff balance of {address} after transaction {index}", + ); + } + } + } + + // The last regular transaction leaves the committed state, since the post-exec transaction + // changes nothing; this anchors the replayed balances above to the provider. + let last_regular = POST_EXEC_INDEX - 1; + let committed = fixture.committed_balance(fixture.sender)?; + assert_eq!( + fixture.replayed_balance(last_regular, fixture.sender).await?, + committed, + "debug_accountAt after the last regular transaction", + ); + assert_eq!( + fixture.replayed_balance(POST_EXEC_INDEX, fixture.sender).await?, + committed, + "debug_accountAt after the post-exec transaction", + ); + for (address, account) in &fixture.prestate_diff(last_regular).await?.post { + if let Some(balance) = account.balance { + assert_eq!( + balance, + fixture.committed_balance(*address)?, + "committed balance of {address} after transaction {last_regular}", + ); + } + } + Ok(()) +} diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/fixture.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/fixture.rs new file mode 100644 index 00000000000..c8d7b3ec8db --- /dev/null +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/fixture.rs @@ -0,0 +1,196 @@ +//! A sequenced Lagoon block with SDM refunds and the RPC accessors the family tests share. + +use crate::lagoon::{self, launch_sdm_node, prestate_tracer}; +use alloy_consensus::{BlockHeader, TxReceipt}; +use alloy_network::eip2718::Encodable2718; +use alloy_primitives::{Address, B256, Bytes, TxKind, U256}; +use alloy_rpc_types_eth::{TransactionInput, TransactionRequest}; +use alloy_rpc_types_trace::{ + common::TraceResult, + geth::{DiffMode, GethDebugTracingOptions, GethTrace, PreStateConfig, PreStateFrame}, +}; +use jsonrpsee::{http_client::HttpClient, ws_client::WsClient}; +use reth_chainspec::EthChainSpec; +use reth_e2e_test_utils::{NodeHelperType, transaction::TransactionTestContext, wallet::Wallet}; +use reth_optimism_node::OpNode; +use reth_optimism_payload_builder::OpBuiltPayload; +use reth_optimism_primitives::OpTransactionSigned; +use reth_provider::{ReceiptProvider, StateProviderFactory}; +use reth_rpc_api::clients::DebugApiClient; + +/// Index of the post-exec transaction in a [`SettledBlock`]; the regular transactions precede it. +pub(super) const POST_EXEC_INDEX: usize = 4; + +/// Revert data returned by the reverting deployment in a [`SettledBlock`]. +pub(super) const REVERT_OUTPUT: U256 = U256::from_limbs([42, 0, 0, 0]); + +/// A Lagoon block sequenced by a node running the fixed test policy, which refunds every regular +/// transaction one gas: a real, imported block with a 0x7d transaction and a settled state. +/// +/// The sender submits four transactions: a deployment of the init code `STOP` (refunded), a plain +/// transfer (not refunded, since it already sits on the EIP-7623 floor), a second deployment +/// (refunded) and a deployment whose init code reverts with [`REVERT_OUTPUT`]. +pub(super) struct SettledBlock { + pub(super) client: HttpClient, + pub(super) node: NodeHelperType, + pub(super) payload: OpBuiltPayload, + pub(super) sender: Address, +} + +impl SettledBlock { + pub(super) async fn sequence() -> eyre::Result { + let chain_spec = lagoon::chain_spec()?; + let mut node = launch_sdm_node(&chain_spec).await?; + let client = node.inner.add_ons_handle.rpc_server_handles().rpc.http_client().unwrap(); + let wallet = Wallet::default().with_chain_id(chain_spec.chain_id()); + let sender = wallet.inner.address(); + let deployments = [ + (TxKind::Create, Bytes::from_static(&[0x00])), + (TxKind::Call(Address::repeat_byte(0x99)), Bytes::new()), + (TxKind::Create, Bytes::from_static(&[0x00])), + // PUSH1 42 PUSH1 0 MSTORE PUSH1 32 PUSH1 0 REVERT + ( + TxKind::Create, + Bytes::from_static(&[0x60, 0x2a, 0x60, 0x00, 0x52, 0x60, 0x20, 0x60, 0x00, 0xfd]), + ), + ]; + assert_eq!(deployments.len(), POST_EXEC_INDEX, "one regular transaction per row"); + for (nonce, (to, init_code)) in deployments.into_iter().enumerate() { + let transaction = TransactionRequest { + chain_id: Some(wallet.chain_id), + gas: Some(if matches!(to, TxKind::Call(_)) { 21_000 } else { 100_000 }), + input: TransactionInput::new(init_code), + max_fee_per_gas: Some(20_000_000_000), + max_priority_fee_per_gas: Some(1_000_000_000), + nonce: Some(nonce as u64), + to: Some(to), + ..Default::default() + }; + let signed = TransactionTestContext::sign_tx(wallet.inner.clone(), transaction).await; + node.rpc.inject_tx(signed.encoded_2718().into()).await?; + } + let payload = node.advance_block().await?; + + let fixture = Self { client, node, payload, sender }; + let transactions = fixture.transactions(); + assert_eq!( + transactions.len(), + POST_EXEC_INDEX + 1, + "the regular transactions and the post-exec tx", + ); + let OpTransactionSigned::PostExec(post_exec) = &transactions[POST_EXEC_INDEX] else { + panic!("block must end in a post-exec tx, got {:?}", transactions[POST_EXEC_INDEX]); + }; + let refund_entries = &post_exec.inner().payload.gas_refund_entries; + assert!( + refund_entries.iter().any(|entry| entry.index == 2 && entry.gas_refund > 0), + "the second deployment must be refunded: {refund_entries:?}", + ); + assert!( + !refund_entries.iter().any(|entry| entry.index == 1), + "the transfer must not be refunded: {refund_entries:?}", + ); + Ok(fixture) + } + + pub(super) fn block_hash(&self) -> B256 { + self.payload.block().hash() + } + + pub(super) fn block_number(&self) -> u64 { + self.payload.block().number() + } + + pub(super) fn state_root(&self) -> B256 { + self.payload.block().state_root() + } + + pub(super) fn transactions(&self) -> &[OpTransactionSigned] { + &self.payload.block().body().transactions + } + + pub(super) fn transaction_hash(&self, index: usize) -> B256 { + self.transactions()[index].tx_hash() + } + + pub(super) async fn ws_client(&self) -> WsClient { + self.node.inner.add_ons_handle.rpc_server_handles().rpc.ws_client().await.unwrap() + } + + /// Gas each transaction used according to its receipt. + pub(super) fn receipt_gas(&self) -> eyre::Result> { + let mut cumulative_gas = 0; + self.transactions() + .iter() + .map(|transaction| { + let receipt = + self.node.inner.provider.receipt_by_hash(transaction.tx_hash())?.unwrap(); + let gas_used = receipt.cumulative_gas_used() - cumulative_gas; + cumulative_gas = receipt.cumulative_gas_used(); + Ok(gas_used) + }) + .collect() + } + + /// Balance of `address` in the state the node committed for the block. + pub(super) fn committed_balance(&self, address: Address) -> eyre::Result { + let state = self.node.inner.provider.state_by_block_hash(self.block_hash())?; + Ok(state.account_balance(&address)?.unwrap_or_default()) + } + + /// Balance of `address` right after the transaction at `index`, as `debug_accountAt` replays + /// it. + pub(super) async fn replayed_balance( + &self, + index: usize, + address: Address, + ) -> eyre::Result { + let account = DebugApiClient::::debug_account_info_at( + &self.client, + self.block_hash().into(), + index.into(), + address, + ) + .await? + .unwrap_or_default(); + Ok(account.balance) + } + + pub(super) async fn block_traces(&self) -> eyre::Result>> { + Ok(DebugApiClient::::debug_trace_block_by_hash( + &self.client, + self.block_hash(), + None, + ) + .await?) + } + + pub(super) async fn trace_transaction( + &self, + index: usize, + options: Option, + ) -> eyre::Result { + Ok(DebugApiClient::::debug_trace_transaction( + &self.client, + self.transaction_hash(index), + options, + ) + .await?) + } + + pub(super) async fn default_trace_gas_of(&self, index: usize) -> eyre::Result { + match self.trace_transaction(index, None).await? { + GethTrace::Default(frame) => Ok(frame.gas), + other => panic!("unexpected default trace of transaction {index}: {other:?}"), + } + } + + pub(super) async fn prestate_diff(&self, index: usize) -> eyre::Result { + let options = + prestate_tracer(PreStateConfig { diff_mode: Some(true), ..Default::default() }); + match self.trace_transaction(index, Some(options)).await? { + GethTrace::PreStateTracer(PreStateFrame::Diff(diff)) => Ok(diff), + other => panic!("unexpected prestate trace of transaction {index}: {other:?}"), + } + } +} diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/mod.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/mod.rs new file mode 100644 index 00000000000..62afe5f3506 --- /dev/null +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/mod.rs @@ -0,0 +1,17 @@ +//! RPC replay over a sequenced Lagoon block whose transactions carry SDM refunds. +//! +//! The settlement of an SDM refund (canonical gas, sender credit, fee-vault debits) only happens +//! inside the block executor, so every RPC path that replays block transactions must go through it. +//! A replay on the bare EVM reports pre-refund gas and unsettled balances ([#485]). Each file +//! covers one RPC family against the shared [`fixture::SettledBlock`]. +//! +//! [#485]: https://github.com/ethereum-optimism/protocol-team/issues/485 + +mod affordability; +mod debug_tracers; +mod fixture; +mod otterscan; +mod parity_replays; +mod post_exec_target; +mod prefix_replays; +mod trace_chain; diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/otterscan.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/otterscan.rs new file mode 100644 index 00000000000..34415824e00 --- /dev/null +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/otterscan.rs @@ -0,0 +1,24 @@ +//! `ots_getTransactionError` on an SDM block. + +use super::fixture::{REVERT_OUTPUT, SettledBlock}; +use alloy_primitives::Bytes; +use jsonrpsee::{core::client::ClientT, rpc_params}; + +/// Otterscan replays a reverted transaction on an SDM block and returns its revert data. +#[tokio::test] +async fn otterscan_returns_revert_output_on_sdm_block() -> eyre::Result<()> { + reth_tracing::init_test_tracing(); + let fixture = SettledBlock::sequence().await?; + + let revert: Option = fixture + .client + .request("ots_getTransactionError", rpc_params![fixture.transaction_hash(3)]) + .await?; + + assert_eq!( + revert, + Some(Bytes::copy_from_slice(&REVERT_OUTPUT.to_be_bytes::<32>())), + "ots_getTransactionError revert data", + ); + Ok(()) +} diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/parity_replays.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/parity_replays.rs new file mode 100644 index 00000000000..60d994d3183 --- /dev/null +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/parity_replays.rs @@ -0,0 +1,83 @@ +//! `trace_replayTransaction`, `trace_replayBlockTransactions` and `trace_filter` against +//! `debug_accountAt`. + +use super::fixture::{POST_EXEC_INDEX, SettledBlock}; +use alloy_primitives::{Address, U256, map::HashSet}; +use alloy_rpc_types_eth::TransactionRequest; +use alloy_rpc_types_trace::{ + filter::TraceFilter, + parity::{Delta, StateDiff, TraceType}, +}; +use reth_rpc_api::clients::TraceApiClient; + +/// Parity state diffs leave the sender with the balance `debug_accountAt` replays at that index, +/// per transaction and per block. +#[tokio::test] +async fn parity_replays_report_settled_state_diffs() -> eyre::Result<()> { + reth_tracing::init_test_tracing(); + let fixture = SettledBlock::sequence().await?; + + for index in 0..POST_EXEC_INDEX { + let replay = TraceApiClient::::replay_transaction( + &fixture.client, + fixture.transaction_hash(index), + HashSet::from_iter([TraceType::StateDiff, TraceType::Trace]), + ) + .await?; + assert_eq!( + settled_balance(replay.state_diff.as_ref(), fixture.sender), + fixture.replayed_balance(index, fixture.sender).await?, + "trace_replayTransaction state diff of transaction {index}", + ); + } + + let replays = TraceApiClient::::replay_block_transactions( + &fixture.client, + fixture.block_hash().into(), + HashSet::from_iter([TraceType::StateDiff]), + ) + .await? + .expect("block exists"); + assert_eq!(replays.len(), POST_EXEC_INDEX + 1, "trace_replayBlockTransactions replay count"); + for (index, replay) in replays.iter().take(POST_EXEC_INDEX).enumerate() { + assert_eq!( + settled_balance(replay.full_trace.state_diff.as_ref(), fixture.sender), + fixture.replayed_balance(index, fixture.sender).await?, + "trace_replayBlockTransactions state diff of transaction {index}", + ); + } + Ok(()) +} + +/// `trace_filter` over the block yields a trace for every transaction, the post-exec one included. +#[tokio::test] +async fn trace_filter_covers_every_transaction() -> eyre::Result<()> { + reth_tracing::init_test_tracing(); + let fixture = SettledBlock::sequence().await?; + + let filtered = TraceApiClient::::trace_filter( + &fixture.client, + TraceFilter { + from_block: Some(fixture.block_number()), + to_block: Some(fixture.block_number()), + ..Default::default() + }, + ) + .await?; + + let filtered_hashes: HashSet<_> = + filtered.iter().filter_map(|trace| trace.transaction_hash).collect(); + let block_hashes: HashSet<_> = fixture.transactions().iter().map(|tx| tx.tx_hash()).collect(); + assert_eq!(filtered_hashes, block_hashes, "trace_filter covers every transaction"); + Ok(()) +} + +/// The balance a parity state diff leaves `address` with. +fn settled_balance(state_diff: Option<&StateDiff>, address: Address) -> U256 { + let state_diff = state_diff.expect("state diff requested"); + match &state_diff[&address].balance { + Delta::Changed(changed) => changed.to, + Delta::Added(to) => *to, + other => panic!("balance of {address} must change: {other:?}"), + } +} diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/post_exec_target.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/post_exec_target.rs new file mode 100644 index 00000000000..23172c5c186 --- /dev/null +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/post_exec_target.rs @@ -0,0 +1,87 @@ +//! The post-exec (0x7d) transaction as a replay target, and `debug_intermediateRoots`. + +use super::fixture::{POST_EXEC_INDEX, SettledBlock}; +use crate::lagoon::default_trace_gas; +use alloy_primitives::U256; +use alloy_rpc_types_eth::TransactionRequest; +use alloy_rpc_types_trace::geth::GethTrace; +use jsonrpsee::{core::client::ClientT, rpc_params}; +use reth_rpc_api::clients::DebugApiClient; +use serde_json::json; + +/// Every tracer gives the post-exec transaction an empty trace at its receipt gas, and a traced +/// transfer carries nothing from the replayed prefix. +#[tokio::test] +async fn post_exec_transaction_traces_as_a_no_op() -> eyre::Result<()> { + reth_tracing::init_test_tracing(); + let fixture = SettledBlock::sequence().await?; + let receipt_gas = fixture.receipt_gas()?; + + let GethTrace::Default(post_exec_frame) = + fixture.trace_transaction(POST_EXEC_INDEX, None).await? + else { + panic!("unexpected default trace of the post-exec transaction"); + }; + assert!(post_exec_frame.struct_logs.is_empty(), "debug_traceTransaction of the post-exec tx"); + assert_eq!( + post_exec_frame.gas, receipt_gas[POST_EXEC_INDEX], + "debug_traceTransaction gas of the post-exec tx", + ); + let block_traces = fixture.block_traces().await?; + assert_eq!( + default_trace_gas(&block_traces[POST_EXEC_INDEX]), + receipt_gas[POST_EXEC_INDEX], + "debug_traceBlockByHash gas of the post-exec tx", + ); + let post_exec_call: GethTrace = fixture + .client + .request( + "debug_traceTransaction", + rpc_params![fixture.transaction_hash(POST_EXEC_INDEX), json!({"tracer": "callTracer"})], + ) + .await?; + let GethTrace::CallTracer(post_exec_call_frame) = post_exec_call else { + panic!("unexpected call trace of the post-exec tx: {post_exec_call:?}"); + }; + assert_eq!(post_exec_call_frame.gas_used, U256::ZERO, "callTracer gas of the post-exec tx"); + let post_exec_diff = fixture.prestate_diff(POST_EXEC_INDEX).await?; + assert!( + post_exec_diff.pre.is_empty() && post_exec_diff.post.is_empty(), + "prestate diff of the post-exec tx must be empty: {post_exec_diff:?}", + ); + + let GethTrace::Default(transfer_frame) = fixture.trace_transaction(1, None).await? else { + panic!("unexpected default trace of the transfer"); + }; + assert!(transfer_frame.struct_logs.is_empty(), "debug_traceTransaction of the transfer"); + Ok(()) +} + +/// Each regular transaction moves the state root, the post-exec transaction does not, and the +/// last root is the header's. +#[tokio::test] +async fn intermediate_roots_follow_each_boundary() -> eyre::Result<()> { + reth_tracing::init_test_tracing(); + let fixture = SettledBlock::sequence().await?; + + let roots = DebugApiClient::::debug_intermediate_roots( + &fixture.client, + fixture.block_hash(), + None, + ) + .await?; + + assert_eq!(roots.len(), POST_EXEC_INDEX + 1, "debug_intermediateRoots root count"); + let last_regular = POST_EXEC_INDEX - 1; + for index in 0..last_regular { + assert_ne!( + roots[index], + roots[index + 1], + "debug_intermediateRoots after tx {}", + index + 1 + ); + } + assert_eq!(roots[last_regular], roots[POST_EXEC_INDEX], "debug_intermediateRoots after 0x7d"); + assert_eq!(roots.last(), Some(&fixture.state_root()), "debug_intermediateRoots last root"); + Ok(()) +} diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/prefix_replays.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/prefix_replays.rs new file mode 100644 index 00000000000..d53acc7ab58 --- /dev/null +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/prefix_replays.rs @@ -0,0 +1,111 @@ +//! Synthetic calls on a settled prefix: `debug_traceCall` at an index, `eth_callMany` and +//! `debug_traceCallMany`. + +use super::fixture::{POST_EXEC_INDEX, SettledBlock}; +use crate::lagoon::prestate_tracer; +use alloy_primitives::{Address, Bytes, U256}; +use alloy_rpc_types_eth::{EthCallResponse, TransactionRequest}; +use alloy_rpc_types_trace::geth::{ + GethDebugTracingCallOptions, GethTrace, PreStateConfig, PreStateFrame, +}; +use jsonrpsee::{core::client::ClientT, rpc_params}; +use reth_rpc_api::clients::DebugApiClient; +use serde_json::json; + +/// `debug_traceCall` at an index runs on the settled prefix but earns no refund itself. +#[tokio::test] +async fn debug_trace_call_runs_on_settled_prefix_without_refund() -> eyre::Result<()> { + reth_tracing::init_test_tracing(); + let fixture = SettledBlock::sequence().await?; + + let prefix_call = DebugApiClient::::debug_trace_call( + &fixture.client, + TransactionRequest::default().from(fixture.sender).to(Address::with_last_byte(1)), + Some(fixture.block_hash().into()), + Some(GethDebugTracingCallOptions { + tracing_options: prestate_tracer(PreStateConfig::default()), + tx_index: Some(1), + ..Default::default() + }), + ) + .await?; + let GethTrace::PreStateTracer(PreStateFrame::Default(prestate)) = prefix_call else { + panic!("unexpected debug_traceCall prestate: {prefix_call:?}"); + }; + assert_eq!( + prestate.0[&fixture.sender].balance, + Some(fixture.replayed_balance(0, fixture.sender).await?), + "debug_traceCall prestate after the first deployment", + ); + + let synthetic_transfer = DebugApiClient::::debug_trace_call( + &fixture.client, + TransactionRequest::default() + .from(fixture.sender) + .to(Address::repeat_byte(0x55)) + .value(U256::from(1)), + Some(fixture.block_hash().into()), + Some(GethDebugTracingCallOptions { + tx_index: Some(POST_EXEC_INDEX as u64), + ..Default::default() + }), + ) + .await?; + let GethTrace::Default(synthetic_frame) = synthetic_transfer else { + panic!("unexpected debug_traceCall trace: {synthetic_transfer:?}"); + }; + assert_eq!(synthetic_frame.gas, 21_000, "debug_traceCall gas of a synthetic transfer"); + Ok(()) +} + +/// `eth_callMany` and `debug_traceCallMany` run on the settled prefix: a contract reading the +/// sender's balance after the whole block sees the committed one. +#[tokio::test] +async fn call_many_reads_settled_balances() -> eyre::Result<()> { + reth_tracing::init_test_tracing(); + let fixture = SettledBlock::sequence().await?; + let committed = fixture.committed_balance(fixture.sender)?; + + let balance_reader = Address::repeat_byte(0x77); + let mut balance_code = vec![0x73]; + balance_code.extend_from_slice(fixture.sender.as_slice()); + // BALANCE PUSH1 0 MSTORE PUSH1 32 PUSH1 0 RETURN + balance_code.extend_from_slice(&[0x31, 0x60, 0x00, 0x52, 0x60, 0x20, 0x60, 0x00, 0xf3]); + let bundles = json!([{ + "transactions": [{"from": Address::ZERO, "gasPrice": "0x4a817c800", "to": balance_reader}] + }]); + let context = json!({"blockNumber": fixture.block_hash(), "transactionIndex": POST_EXEC_INDEX}); + let overrides = json!({ + balance_reader.to_string(): {"code": Bytes::from(balance_code)}, + Address::ZERO.to_string(): {"balance": "0xffffffffffffffff"}, + }); + + let output: Vec> = fixture + .client + .request("eth_callMany", rpc_params![bundles.clone(), context.clone(), overrides.clone()]) + .await?; + let response = &output[0][0]; + assert!(response.error.is_none(), "eth_callMany failed: {:?}", response.error); + assert_eq!( + U256::from_be_slice(response.value.as_ref().expect("a successful call returns data")), + committed, + "eth_callMany balance read", + ); + + let traces: Vec> = fixture + .client + .request( + "debug_traceCallMany", + rpc_params![bundles, context, json!({"stateOverrides": overrides})], + ) + .await?; + let GethTrace::Default(frame) = &traces[0][0] else { + panic!("unexpected debug_traceCallMany trace: {:?}", traces[0][0]); + }; + assert_eq!( + U256::from_be_slice(&frame.return_value), + committed, + "debug_traceCallMany balance read", + ); + Ok(()) +} diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/trace_chain.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/trace_chain.rs new file mode 100644 index 00000000000..0c57fd7785c --- /dev/null +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/trace_chain.rs @@ -0,0 +1,81 @@ +//! `traceChain` over the block, streamed through `debug_subscribe`. + +use super::fixture::{POST_EXEC_INDEX, SettledBlock}; +use alloy_rpc_types_eth::BlockNumberOrTag; +use alloy_rpc_types_trace::{ + common::TraceResult, + geth::{ChainBlockTraceResult, GethDebugTracingOptions}, +}; +use jsonrpsee::{ + core::client::{Subscription, SubscriptionClientT}, + rpc_params, +}; +use serde_json::json; +use std::time::Duration; + +/// `traceChain` streams the same settled traces as `debug_traceBlockByHash`. +#[tokio::test] +async fn trace_chain_matches_block_traces() -> eyre::Result<()> { + reth_tracing::init_test_tracing(); + let fixture = SettledBlock::sequence().await?; + let block_traces = fixture.block_traces().await?; + + let traced = trace_chain_over_block(&fixture, GethDebugTracingOptions::default()).await?; + + assert_eq!( + traced.traces, + block_traces.into_iter().map(Some).collect::>(), + "traceChain traces of the block", + ); + Ok(()) +} + +/// A tracer configuration the tracer rejects fails `traceChain` per block, not per subscription: +/// the first transaction carries the error and the rest of the block is left untraced. +#[tokio::test] +async fn trace_chain_reports_tracer_config_errors_per_block() -> eyre::Result<()> { + reth_tracing::init_test_tracing(); + let fixture = SettledBlock::sequence().await?; + let invalid_options: GethDebugTracingOptions = serde_json::from_value( + json!({"tracer": "callTracer", "tracerConfig": {"onlyTopCall": "invalid"}}), + )?; + + let failed = trace_chain_over_block(&fixture, invalid_options).await?; + + assert_eq!(failed.traces.len(), POST_EXEC_INDEX + 1, "traceChain trace count"); + assert!( + matches!(failed.traces[0], Some(TraceResult::Error { .. })), + "traceChain must report the tracer error on the first transaction: {:?}", + failed.traces[0], + ); + assert!( + failed.traces[1..].iter().all(Option::is_none), + "traceChain must leave the rest of the block untraced: {:?}", + failed.traces, + ); + Ok(()) +} + +/// Subscribes to `traceChain` over `(parent, block]` and returns the block's result. +async fn trace_chain_over_block( + fixture: &SettledBlock, + options: GethDebugTracingOptions, +) -> eyre::Result { + let ws = fixture.ws_client().await; + let mut subscription: Subscription = ws + .subscribe( + "debug_subscribe", + rpc_params![ + "traceChain", + BlockNumberOrTag::Number(fixture.block_number() - 1), + BlockNumberOrTag::Number(fixture.block_number()), + options + ], + "debug_unsubscribe", + ) + .await?; + let result = + tokio::time::timeout(Duration::from_secs(10), subscription.next()).await?.unwrap()?; + subscription.unsubscribe().await?; + Ok(result) +} From 624ea26f4d9997a8fe301e784c408a4bf06d226c Mon Sep 17 00:00:00 2001 From: Einar Rasmussen Date: Mon, 9 Nov 2026 20:26:31 +0100 Subject: [PATCH 3/6] op-reth: make the replay tracers prove they observed execution The debug tracer assertions now check what the tracer saw, not only the settled result it was handed: every deployment steps through its init code, only the reverting one fails, and the call frame is from the sender. The synthetic-call refund check runs at a refunded slot, where a leaked refund would show as gas below the intrinsic cost. A rejected bad block is traced through `debug_traceBadBlock` and fails with the executor's reason, and `traceChain` anchors its first trace to the settled deployment gas. The alloy-op-evm Verify-mode test sends calldata so an operator fee is charged at all, asserts the saved fee, and rewards a beneficiary distinct from the sender, so the sender delta no longer nets a zero priority leg by coincidence. Also names the fixture's transaction indexes, uses `TRANSFER_GAS` for the transfer's gas limit, matches the executor's rejection by substring, says which checks are executor-path smoke tests, points the update guide at the test directory, drops the Lagoon genesis duplicate from the derived attributes test, and corrects two alloy-op-evm comments that still described RPC replay as bare-EVM transacting. Co-Authored-By: Claude Fable 5.1 --- rust/UPDATING-RETH.md | 2 +- .../src/block/tests/structural_tests.rs | 25 +++++++++++--- rust/alloy-op-evm/src/lib.rs | 5 +-- rust/alloy-op-evm/src/tests.rs | 7 ++-- .../node/tests/it/debug_trace_post_exec.rs | 10 +++--- .../node/tests/it/derived_attributes.rs | 14 ++------ .../crates/node/tests/it/invalid_post_exec.rs | 33 ++++++++++++++++++- .../it/rpc_replay_settlement/debug_tracers.rs | 23 ++++++++++--- .../tests/it/rpc_replay_settlement/fixture.rs | 30 +++++++++-------- .../tests/it/rpc_replay_settlement/mod.rs | 4 ++- .../it/rpc_replay_settlement/otterscan.rs | 4 +-- .../rpc_replay_settlement/prefix_replays.rs | 10 +++--- .../it/rpc_replay_settlement/trace_chain.rs | 7 ++++ 13 files changed, 119 insertions(+), 55 deletions(-) diff --git a/rust/UPDATING-RETH.md b/rust/UPDATING-RETH.md index 0b9354af9ae..74453f28787 100644 --- a/rust/UPDATING-RETH.md +++ b/rust/UPDATING-RETH.md @@ -331,7 +331,7 @@ on the next base: - **RPC replay through the block executor** (ethereum-optimism/reth#37, a backport of paradigmxyz/reth#28266). Op-reth's SDM refund settlement is only visible to `debug_*`, `trace_*` and `ots_*` replays through it, and - `rust/op-reth/crates/node/tests/it/rpc_replay_settlement.rs` fails without + `rust/op-reth/crates/node/tests/it/rpc_replay_settlement/` fails without it. On a base that still uses alloy-evm 0.39 (`v2.7.0` through `v2.8.1`), cherry-pick the backport and resolve conflicts in `helpers/call.rs`, `helpers/trace.rs` and `rpc/src/debug.rs`. On an evm2 base (`v2.9.0` and diff --git a/rust/alloy-op-evm/src/block/tests/structural_tests.rs b/rust/alloy-op-evm/src/block/tests/structural_tests.rs index d165e6732d8..9b0dbaef435 100644 --- a/rust/alloy-op-evm/src/block/tests/structural_tests.rs +++ b/rust/alloy-op-evm/src/block/tests/structural_tests.rs @@ -193,14 +193,28 @@ fn canonicalized_result_gas_applies_refund_exactly_once() { #[test] fn verify_mode_result_is_settled_before_commit_with_inspector() { let receipt_builder = OpAlloyReceiptBuilder::default(); - let hardforks = OpChainHardforks::op_mainnet(); + // The settlement reads the fork from these hardforks at the block timestamp; mainnet's + // schedule puts that timestamp at Isthmus, whose operator fee rounds a one-gas saving to zero. + let hardforks = OpChainHardforks::new( + OpHardfork::op_mainnet() + .into_iter() + .chain([(OpHardfork::Jovian, ForkCondition::Timestamp(JOVIAN_TIMESTAMP))]), + ); let gas_price = 1u128; + let beneficiary = Address::repeat_byte(0xbe); let payload = PostExecPayload { version: 1, block_number: 0, gas_refund_entries: vec![SDMGasEntry { index: 0, gas_refund: 1 }], }; - let priced_tx = legacy_tx_with_price(0, OBSERVER_TEST_CONTRACT, 200_000, gas_price); + // Operator fees are only charged on transactions that carry calldata. + let priced_tx = recovered_legacy(TxLegacy { + gas_limit: 200_000, + gas_price, + input: Bytes::from_static(&[0x01]), + to: TxKind::Call(OBSERVER_TEST_CONTRACT), + ..Default::default() + }); let balance_in = |state: &EvmState, address: Address| { state.get(&address).map(|account| account.info.balance).unwrap_or_default() }; @@ -212,7 +226,7 @@ fn verify_mode_result_is_settled_before_commit_with_inspector() { &receipt_builder, &hardforks, 1, - Address::ZERO, + beneficiary, Inspect::Enabled, ); executor.set_post_exec_mode(mode); @@ -225,10 +239,11 @@ fn verify_mode_result_is_settled_before_commit_with_inspector() { uncommitted(PostExecMode::Verify(payload.clone())); let (_, _, _, disabled_state) = uncommitted(PostExecMode::Disabled); - assert_eq!(canonical_gas, evm_gas - 1); + assert_eq!(canonical_gas, evm_gas - 1, "the refund entry lowers canonical gas by one"); assert_eq!(result_gas, canonical_gas, "result gas must be the canonical gas"); let operator_fee_saved = balance_in(&disabled_state, OPERATOR_FEE_RECIPIENT) - balance_in(&verify_state, OPERATOR_FEE_RECIPIENT); + assert_eq!(operator_fee_saved, U256::from(500), "1 gas * scalar 5 * Jovian multiplier 100"); assert_eq!( balance_in(&verify_state, Address::ZERO) - balance_in(&disabled_state, Address::ZERO), U256::from(gas_price) + operator_fee_saved, @@ -241,7 +256,7 @@ fn verify_mode_result_is_settled_before_commit_with_inspector() { &receipt_builder, &hardforks, 1, - Address::ZERO, + beneficiary, Inspect::Enabled, ); committing.set_post_exec_mode(PostExecMode::Verify(payload)); diff --git a/rust/alloy-op-evm/src/lib.rs b/rust/alloy-op-evm/src/lib.rs index fb086890949..ccfbf7e97f5 100644 --- a/rust/alloy-op-evm/src/lib.rs +++ b/rust/alloy-op-evm/src/lib.rs @@ -392,8 +392,9 @@ where let tx = OpTx(tx.into()); // Post-exec transactions never execute: the block executor short-circuits them, and revm - // would reject their tx env outright. Replay paths (e.g. RPC tracing) transact each - // transaction directly, so synthesize the consensus-defined result here. + // would reject their tx env outright. A caller that transacts a block's transactions on + // the bare EVM, such as a replay positioned by a cached BAL, still sends them here, so + // synthesize the consensus-defined result. if tx.tx_type() == POST_EXEC_TX_TYPE_ID { return Ok(post_exec::noop_post_exec_result()); } diff --git a/rust/alloy-op-evm/src/tests.rs b/rust/alloy-op-evm/src/tests.rs index 60ed2313bfc..620e99319f1 100644 --- a/rust/alloy-op-evm/src/tests.rs +++ b/rust/alloy-op-evm/src/tests.rs @@ -210,10 +210,9 @@ fn tracing_inspector_traces_post_exec_tx_as_noop() { ); } -/// The `trace_*` namespace iterates a block's transactions through `TxTracer::try_trace_many`, -/// which ends the iteration early — without surfacing an error — when a replay fails. A block -/// carrying a post-exec tx must produce one trace result per transaction, not a silently -/// truncated list. +/// `TxTracer::try_trace_many` ends its iteration early, without surfacing an error, when a replay +/// fails. A consumer iterating a block that carries a post-exec tx through it must get one trace +/// result per transaction, not a silently truncated list. #[test] fn try_trace_many_covers_every_tx_in_a_post_exec_block() { let mut tracer = OpEvmFactory::::default().create_tracer( diff --git a/rust/op-reth/crates/node/tests/it/debug_trace_post_exec.rs b/rust/op-reth/crates/node/tests/it/debug_trace_post_exec.rs index 351dc94b44c..441c65fdd5d 100644 --- a/rust/op-reth/crates/node/tests/it/debug_trace_post_exec.rs +++ b/rust/op-reth/crates/node/tests/it/debug_trace_post_exec.rs @@ -26,9 +26,7 @@ use reth_tasks::Runtime; use std::sync::Arc; /// `debug_traceBlock` over a raw block that ends in a post-exec (0x7d) transaction returns one -/// trace per transaction, including the post-exec one, with the payload's refund settled. Before -/// the `transact_raw` short-circuit this failed for the whole block with `-32000: invalid chain -/// ID`. +/// trace per transaction, including the post-exec one, with the payload's refund settled. /// /// The refund takes the transfer below the EIP-7623 floor: the producer never refunds that far, /// but a verifier applies whatever refund the payload carries. @@ -80,10 +78,10 @@ async fn test_debug_trace_block_rejects_exhausted_budget() -> eyre::Result<()> { let ClientError::Call(error) = error else { panic!("debug_traceBlock must fail with a call error: {error:?}"); }; - assert_eq!( + assert!( + error.message().contains("available gas 0"), + "debug_traceBlock error must name the executor's rejection: {}", error.message(), - "transaction gas limit 21000 is more than blocks available gas 0", - "debug_traceBlock error for an executor-rejected block", ); Ok(()) diff --git a/rust/op-reth/crates/node/tests/it/derived_attributes.rs b/rust/op-reth/crates/node/tests/it/derived_attributes.rs index 4fa7a8508b0..481e5acf0a5 100644 --- a/rust/op-reth/crates/node/tests/it/derived_attributes.rs +++ b/rust/op-reth/crates/node/tests/it/derived_attributes.rs @@ -4,7 +4,6 @@ //! valid payload's executed block from `engine_getPayload`. use alloy_consensus::{Sealable, SignableTransaction, TxEip1559}; -use alloy_genesis::Genesis; use alloy_network::eip2718::Encodable2718; use alloy_primitives::{Address, B64, B256, Bytes, Signature, TxKind}; use alloy_rpc_types_engine::{ForkchoiceState, ForkchoiceUpdated, PayloadStatus}; @@ -12,11 +11,9 @@ use jsonrpsee::{ core::{ClientError, client::ClientT}, rpc_params, }; -use op_alloy_consensus::{ - OpTxEnvelope, SDMGasEntry, TxDeposit, build_post_exec_tx, encode_jovian_extra_data, -}; +use op_alloy_consensus::{OpTxEnvelope, SDMGasEntry, TxDeposit, build_post_exec_tx}; use op_alloy_rpc_types_engine::{OpExecutionPayloadEnvelopeV3, OpExecutionPayloadEnvelopeV4}; -use reth_chainspec::{BaseFeeParams, EthChainSpec}; +use reth_chainspec::EthChainSpec; use reth_db_common::init::init_genesis; use reth_e2e_test_utils::{Adapter, TmpDB}; use reth_node_api::NodeTypesWithDBAdapter; @@ -233,12 +230,7 @@ async fn run( #[tokio::test(flavor = "multi_thread")] async fn invalid_derived_transactions_are_rejected_at_fcu() -> eyre::Result<()> { // A Jovian parent must carry Jovian extra data, or no child of it passes validation. - let mut genesis: Genesis = serde_json::from_str(include_str!("../assets/genesis.json"))?; - genesis.extra_data = encode_jovian_extra_data(B64::ZERO, BaseFeeParams::optimism(), 0)?; - genesis.base_fee_per_gas = Some(1_000_000_000); - let chain_spec = Arc::new( - OpChainSpecBuilder::optimism_sepolia().genesis(genesis).lagoon_activated().build(), - ); + let chain_spec = crate::lagoon::chain_spec()?; let Txs { deposit, next_deposit, transfer, nonce_too_high } = Txs::new(chain_spec.chain_id())?; let invalid = vec![ ("nonce too high", vec![deposit.clone(), nonce_too_high]), diff --git a/rust/op-reth/crates/node/tests/it/invalid_post_exec.rs b/rust/op-reth/crates/node/tests/it/invalid_post_exec.rs index 9b796859947..55c49a8dd3a 100644 --- a/rust/op-reth/crates/node/tests/it/invalid_post_exec.rs +++ b/rust/op-reth/crates/node/tests/it/invalid_post_exec.rs @@ -7,6 +7,8 @@ use alloy_consensus::{Sealable, proofs::calculate_transaction_root}; use alloy_rpc_types_engine::{PayloadStatus, PayloadStatusEnum, PayloadValidationError}; +use alloy_rpc_types_eth::TransactionRequest; +use jsonrpsee::core::ClientError; use op_alloy_consensus::{PostExecPayloadValidationError, SDMGasEntry, build_post_exec_tx}; use op_alloy_rpc_types_engine::{OpExecutionData, OpExecutionPayload}; use reth_e2e_test_utils::{NodeHelperType, setup_engine_with_connection, wallet::Wallet}; @@ -16,7 +18,8 @@ use reth_optimism_node::{ utils::{advance_chain, setup}, }; use reth_optimism_primitives::OpTransactionSigned; -use std::sync::Arc; +use reth_rpc_api::clients::DebugApiClient; +use std::{sync::Arc, time::Duration}; use tokio::sync::Mutex; /// Creates Lagoon-active nodes without changing the shared Ecotone fixture. @@ -111,6 +114,7 @@ async fn test_lagoon_new_payload_with_wrong_post_exec_block_number_is_invalid() let payloads = advance_chain(2, &mut node, Arc::new(Mutex::new(wallet))).await?; let parent = &payloads[0]; let (bad_child, reason) = with_mismatched_post_exec_block_number(&payloads[1]); + let bad_child_hash = bad_child.payload.block_hash(); let engine = &node.inner.add_ons_handle.beacon_engine_handle; let status = engine.new_payload(bad_child.clone()).await.expect("not an internal error"); @@ -121,6 +125,33 @@ async fn test_lagoon_new_payload_with_wrong_post_exec_block_number_is_invalid() assert_invalid(&status, &PayloadValidationError::LinksToRejectedPayload.to_string()); assert_eq!(status.latest_valid_hash, Some(parent.block().hash())); + // The rejected block is cached for diagnostics, but tracing it replays through the block + // executor, which rejects it for the same reason instead of returning pre-refund traces. + let client = + node.inner.add_ons_handle.rpc_server_handles().rpc.http_client().expect("HTTP RPC on"); + let trace_error = loop { + match DebugApiClient::::debug_trace_bad_block( + &client, + bad_child_hash, + None, + ) + .await + { + Ok(traces) => panic!("debug_traceBadBlock must reject the block, got {traces:?}"), + Err(ClientError::Call(error)) if error.message().contains("not found in cache") => { + tokio::time::sleep(Duration::from_millis(250)).await; + } + Err(error) => break error, + } + }; + let ClientError::Call(trace_error) = trace_error else { + panic!("debug_traceBadBlock must fail with a call error: {trace_error:?}"); + }; + assert!( + trace_error.message().contains(&reason), + "debug_traceBadBlock error must name the executor's rejection: {}", + trace_error.message(), + ); Ok(()) } diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/debug_tracers.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/debug_tracers.rs index 625bb8d585b..5759eaf20ad 100644 --- a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/debug_tracers.rs +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/debug_tracers.rs @@ -1,6 +1,6 @@ //! `debug_trace*` and `debug_accountAt` against the receipts and the committed state. -use super::fixture::{POST_EXEC_INDEX, SettledBlock}; +use super::fixture::{POST_EXEC_INDEX, REVERTING_INDEX, SettledBlock, TRANSFER_INDEX}; use crate::lagoon::{DEPLOY_GAS, default_trace_gas}; use alloy_primitives::U256; use alloy_rpc_types_trace::geth::GethTrace; @@ -15,7 +15,8 @@ async fn debug_tracers_report_settled_gas_and_balances() -> eyre::Result<()> { reth_tracing::init_test_tracing(); let fixture = SettledBlock::sequence().await?; let receipt_gas = fixture.receipt_gas()?; - // Pins the settlement itself: every check below compares a replay with what the node committed. + // Pins the settlement itself; the gas checks below compare with receipts, and the balances are + // anchored to committed state after the last regular transaction. assert_eq!(receipt_gas[0], DEPLOY_GAS - 1, "receipt holds canonical gas"); let block_traces = fixture.block_traces().await?; @@ -23,10 +24,21 @@ async fn debug_tracers_report_settled_gas_and_balances() -> eyre::Result<()> { for index in 0..POST_EXEC_INDEX { let gas_used = receipt_gas[index]; + let GethTrace::Default(frame) = fixture.trace_transaction(index, None).await? else { + panic!("unexpected default trace of transaction {index}"); + }; + assert_eq!(frame.gas, gas_used, "debug_traceTransaction gas of transaction {index}"); + // The tracer must have watched the execution, not only been handed the settled result: + // every deployment steps through its init code, and only the reverting one fails. assert_eq!( - fixture.default_trace_gas_of(index).await?, - gas_used, - "debug_traceTransaction gas of transaction {index}", + frame.struct_logs.is_empty(), + index == TRANSFER_INDEX, + "default tracer steps of transaction {index}", + ); + assert_eq!( + frame.failed, + index == REVERTING_INDEX, + "default tracer status of transaction {index}" ); assert_eq!( default_trace_gas(&block_traces[index]), @@ -48,6 +60,7 @@ async fn debug_tracers_report_settled_gas_and_balances() -> eyre::Result<()> { U256::from(gas_used), "callTracer gas of transaction {index}", ); + assert_eq!(call_frame.from, fixture.sender, "callTracer frame of transaction {index}"); // Every balance the prestate diff ends on is the balance debug_accountAt replays at that // index, for the sender as well as the fee vaults. diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/fixture.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/fixture.rs index c8d7b3ec8db..0fa4c563e9d 100644 --- a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/fixture.rs +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/fixture.rs @@ -1,6 +1,6 @@ //! A sequenced Lagoon block with SDM refunds and the RPC accessors the family tests share. -use crate::lagoon::{self, launch_sdm_node, prestate_tracer}; +use crate::lagoon::{self, TRANSFER_GAS, launch_sdm_node, prestate_tracer}; use alloy_consensus::{BlockHeader, TxReceipt}; use alloy_network::eip2718::Encodable2718; use alloy_primitives::{Address, B256, Bytes, TxKind, U256}; @@ -21,11 +21,20 @@ use reth_rpc_api::clients::DebugApiClient; /// Index of the post-exec transaction in a [`SettledBlock`]; the regular transactions precede it. pub(super) const POST_EXEC_INDEX: usize = 4; +/// Index of the plain transfer, the one regular transaction that runs no code and earns no refund. +pub(super) const TRANSFER_INDEX: usize = 1; + +/// Index of the second deployment, a refunded transaction with earlier transactions before it. +pub(super) const REFUNDED_DEPLOYMENT_INDEX: usize = 2; + +/// Index of the deployment whose init code reverts with [`REVERT_OUTPUT`]. +pub(super) const REVERTING_INDEX: usize = 3; + /// Revert data returned by the reverting deployment in a [`SettledBlock`]. pub(super) const REVERT_OUTPUT: U256 = U256::from_limbs([42, 0, 0, 0]); -/// A Lagoon block sequenced by a node running the fixed test policy, which refunds every regular -/// transaction one gas: a real, imported block with a 0x7d transaction and a settled state. +/// A Lagoon block sequenced under the fixed test policy (one gas refunded per transaction above the +/// EIP-7623 floor): a real, imported block with a 0x7d transaction and a settled state. /// /// The sender submits four transactions: a deployment of the init code `STOP` (refunded), a plain /// transfer (not refunded, since it already sits on the EIP-7623 floor), a second deployment @@ -58,7 +67,7 @@ impl SettledBlock { for (nonce, (to, init_code)) in deployments.into_iter().enumerate() { let transaction = TransactionRequest { chain_id: Some(wallet.chain_id), - gas: Some(if matches!(to, TxKind::Call(_)) { 21_000 } else { 100_000 }), + gas: Some(if matches!(to, TxKind::Call(_)) { TRANSFER_GAS } else { 100_000 }), input: TransactionInput::new(init_code), max_fee_per_gas: Some(20_000_000_000), max_priority_fee_per_gas: Some(1_000_000_000), @@ -83,11 +92,13 @@ impl SettledBlock { }; let refund_entries = &post_exec.inner().payload.gas_refund_entries; assert!( - refund_entries.iter().any(|entry| entry.index == 2 && entry.gas_refund > 0), + refund_entries.iter().any( + |entry| entry.index == REFUNDED_DEPLOYMENT_INDEX as u64 && entry.gas_refund > 0 + ), "the second deployment must be refunded: {refund_entries:?}", ); assert!( - !refund_entries.iter().any(|entry| entry.index == 1), + !refund_entries.iter().any(|entry| entry.index == TRANSFER_INDEX as u64), "the transfer must not be refunded: {refund_entries:?}", ); Ok(fixture) @@ -178,13 +189,6 @@ impl SettledBlock { .await?) } - pub(super) async fn default_trace_gas_of(&self, index: usize) -> eyre::Result { - match self.trace_transaction(index, None).await? { - GethTrace::Default(frame) => Ok(frame.gas), - other => panic!("unexpected default trace of transaction {index}: {other:?}"), - } - } - pub(super) async fn prestate_diff(&self, index: usize) -> eyre::Result { let options = prestate_tracer(PreStateConfig { diff_mode: Some(true), ..Default::default() }); diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/mod.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/mod.rs index 62afe5f3506..38d6a188017 100644 --- a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/mod.rs +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/mod.rs @@ -3,7 +3,9 @@ //! The settlement of an SDM refund (canonical gas, sender credit, fee-vault debits) only happens //! inside the block executor, so every RPC path that replays block transactions must go through it. //! A replay on the bare EVM reports pre-refund gas and unsettled balances ([#485]). Each file -//! covers one RPC family against the shared [`fixture::SettledBlock`]. +//! covers one RPC family against the shared [`fixture::SettledBlock`]. Checks that do not compare +//! gas or balances (revert data, hash coverage, error shapes) are smoke tests of the executor path +//! rather than regression guards; they pass on either pin. //! //! [#485]: https://github.com/ethereum-optimism/protocol-team/issues/485 diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/otterscan.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/otterscan.rs index 34415824e00..1067ddb7883 100644 --- a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/otterscan.rs +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/otterscan.rs @@ -1,6 +1,6 @@ //! `ots_getTransactionError` on an SDM block. -use super::fixture::{REVERT_OUTPUT, SettledBlock}; +use super::fixture::{REVERT_OUTPUT, REVERTING_INDEX, SettledBlock}; use alloy_primitives::Bytes; use jsonrpsee::{core::client::ClientT, rpc_params}; @@ -12,7 +12,7 @@ async fn otterscan_returns_revert_output_on_sdm_block() -> eyre::Result<()> { let revert: Option = fixture .client - .request("ots_getTransactionError", rpc_params![fixture.transaction_hash(3)]) + .request("ots_getTransactionError", rpc_params![fixture.transaction_hash(REVERTING_INDEX)]) .await?; assert_eq!( diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/prefix_replays.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/prefix_replays.rs index d53acc7ab58..3faa8b59853 100644 --- a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/prefix_replays.rs +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/prefix_replays.rs @@ -1,8 +1,8 @@ //! Synthetic calls on a settled prefix: `debug_traceCall` at an index, `eth_callMany` and //! `debug_traceCallMany`. -use super::fixture::{POST_EXEC_INDEX, SettledBlock}; -use crate::lagoon::prestate_tracer; +use super::fixture::{POST_EXEC_INDEX, REFUNDED_DEPLOYMENT_INDEX, SettledBlock}; +use crate::lagoon::{TRANSFER_GAS, prestate_tracer}; use alloy_primitives::{Address, Bytes, U256}; use alloy_rpc_types_eth::{EthCallResponse, TransactionRequest}; use alloy_rpc_types_trace::geth::{ @@ -45,8 +45,10 @@ async fn debug_trace_call_runs_on_settled_prefix_without_refund() -> eyre::Resul .to(Address::repeat_byte(0x55)) .value(U256::from(1)), Some(fixture.block_hash().into()), + // At the refunded slot, a refund entry leaking into the synthetic call would show as gas + // below the intrinsic cost. Some(GethDebugTracingCallOptions { - tx_index: Some(POST_EXEC_INDEX as u64), + tx_index: Some(REFUNDED_DEPLOYMENT_INDEX as u64), ..Default::default() }), ) @@ -54,7 +56,7 @@ async fn debug_trace_call_runs_on_settled_prefix_without_refund() -> eyre::Resul let GethTrace::Default(synthetic_frame) = synthetic_transfer else { panic!("unexpected debug_traceCall trace: {synthetic_transfer:?}"); }; - assert_eq!(synthetic_frame.gas, 21_000, "debug_traceCall gas of a synthetic transfer"); + assert_eq!(synthetic_frame.gas, TRANSFER_GAS, "debug_traceCall gas of a synthetic transfer"); Ok(()) } diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/trace_chain.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/trace_chain.rs index 0c57fd7785c..9a8f72a4ef2 100644 --- a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/trace_chain.rs +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/trace_chain.rs @@ -1,6 +1,7 @@ //! `traceChain` over the block, streamed through `debug_subscribe`. use super::fixture::{POST_EXEC_INDEX, SettledBlock}; +use crate::lagoon::{DEPLOY_GAS, default_trace_gas}; use alloy_rpc_types_eth::BlockNumberOrTag; use alloy_rpc_types_trace::{ common::TraceResult, @@ -22,6 +23,12 @@ async fn trace_chain_matches_block_traces() -> eyre::Result<()> { let traced = trace_chain_over_block(&fixture, GethDebugTracingOptions::default()).await?; + let first = traced.traces[0].as_ref().expect("traceChain traces the first transaction"); + assert_eq!( + default_trace_gas(first), + DEPLOY_GAS - 1, + "traceChain gas of the refunded deployment" + ); assert_eq!( traced.traces, block_traces.into_iter().map(Some).collect::>(), From fce2662fb91262684b6dd9d4b211bfad5b96933d Mon Sep 17 00:00:00 2001 From: Einar Rasmussen Date: Mon, 9 Nov 2026 21:00:09 +0100 Subject: [PATCH 4/6] op-reth: share the test node launch and tighten the replay assertions The bad-block trace poll now has a ten-second deadline, the prestate-diff balance loops assert the sender's balance is present before comparing, and a `traceChain` timeout or closed subscription names the block it waited for. The prefix `debug_traceCall` probes a no-code address instead of the ecrecover precompile, and a missing sender in its prestate fails with a message. One launch helper, HTTP client accessor and signed-transaction builder in `lagoon.rs` replace the three copies across the raw-block tests, the fixture and the affordability test; a typed `call_trace` accessor replaces the raw-JSON callTracer requests; the duplicated transfer step check in the post-exec target test is gone. The alloy-op-evm `transact_raw` comment states the local invariant instead of naming a reth caller. Co-Authored-By: Claude Fable 5.1 --- rust/alloy-op-evm/src/lib.rs | 7 +- .../node/tests/it/debug_trace_post_exec.rs | 28 ++----- .../crates/node/tests/it/invalid_post_exec.rs | 30 ++++--- rust/op-reth/crates/node/tests/it/lagoon.rs | 80 ++++++++++++++++--- .../it/rpc_replay_settlement/affordability.rs | 35 ++++---- .../it/rpc_replay_settlement/debug_tracers.rs | 24 +++--- .../tests/it/rpc_replay_settlement/fixture.rs | 45 ++++++----- .../rpc_replay_settlement/post_exec_target.rs | 21 +---- .../rpc_replay_settlement/prefix_replays.rs | 4 +- .../it/rpc_replay_settlement/trace_chain.rs | 8 +- 10 files changed, 158 insertions(+), 124 deletions(-) diff --git a/rust/alloy-op-evm/src/lib.rs b/rust/alloy-op-evm/src/lib.rs index ccfbf7e97f5..9ba63233286 100644 --- a/rust/alloy-op-evm/src/lib.rs +++ b/rust/alloy-op-evm/src/lib.rs @@ -391,10 +391,9 @@ where let tx = OpTx(tx.into()); - // Post-exec transactions never execute: the block executor short-circuits them, and revm - // would reject their tx env outright. A caller that transacts a block's transactions on - // the bare EVM, such as a replay positioned by a cached BAL, still sends them here, so - // synthesize the consensus-defined result. + // Post-exec transactions never execute, and revm would reject their tx env outright, so + // one that arrives here without the block executor's short-circuit gets the + // consensus-defined no-op result. if tx.tx_type() == POST_EXEC_TX_TYPE_ID { return Ok(post_exec::noop_post_exec_result()); } diff --git a/rust/op-reth/crates/node/tests/it/debug_trace_post_exec.rs b/rust/op-reth/crates/node/tests/it/debug_trace_post_exec.rs index 441c65fdd5d..d45e5e0f875 100644 --- a/rust/op-reth/crates/node/tests/it/debug_trace_post_exec.rs +++ b/rust/op-reth/crates/node/tests/it/debug_trace_post_exec.rs @@ -8,21 +8,19 @@ //! [#485]: https://github.com/ethereum-optimism/protocol-team/issues/485 //! [premium#163]: https://github.com/ethereum-optimism/optimism-premium/issues/163 -use crate::lagoon::{TRANSFER_GAS, default_trace_gas, rpc_node_config}; +use crate::lagoon::{TRANSFER_GAS, default_trace_gas, http_client, launch_node}; use alloy_consensus::{ Block, BlockBody, EMPTY_ROOT_HASH, Header, Sealable, SignableTransaction, TxEip1559, }; use alloy_primitives::{Address, B256, Bytes, Signature, TxKind, U256}; use alloy_rpc_types_eth::TransactionRequest; use alloy_rpc_types_trace::{common::TraceResult, geth::GethDebugTracingOptions}; -use jsonrpsee::{core::ClientError, http_client::HttpClient}; +use jsonrpsee::core::ClientError; use op_alloy_consensus::{OpTxEnvelope, SDMGasEntry, TxDeposit, build_post_exec_tx}; use reth_chainspec::EthChainSpec; -use reth_node_builder::{NodeBuilder, NodeHandle}; use reth_optimism_chainspec::{OpChainSpec, OpChainSpecBuilder}; -use reth_optimism_node::OpNode; +use reth_optimism_node::args::RollupArgs; use reth_rpc_api::clients::DebugApiClient; -use reth_tasks::Runtime; use std::sync::Arc; /// `debug_traceBlock` over a raw block that ends in a post-exec (0x7d) transaction returns one @@ -35,7 +33,8 @@ async fn test_debug_trace_block_with_post_exec_tx() -> eyre::Result<()> { reth_tracing::init_test_tracing(); let chain_spec = Arc::new(OpChainSpecBuilder::optimism_sepolia().lagoon_activated().build()); - let (_node, client) = launch_rpc_client(&chain_spec).await?; + let node = launch_node(&chain_spec, RollupArgs::default()).await?; + let client = http_client(&node); let block = raw_sdm_block(&chain_spec, 30_000_000)?; let traces = DebugApiClient::::debug_trace_block( @@ -64,7 +63,8 @@ async fn test_debug_trace_block_rejects_exhausted_budget() -> eyre::Result<()> { reth_tracing::init_test_tracing(); let chain_spec = Arc::new(OpChainSpecBuilder::optimism_sepolia().lagoon_activated().build()); - let (_node, client) = launch_rpc_client(&chain_spec).await?; + let node = launch_node(&chain_spec, RollupArgs::default()).await?; + let client = http_client(&node); let block = raw_sdm_block(&chain_spec, TRANSFER_GAS)?; let error = DebugApiClient::::debug_trace_block( @@ -87,20 +87,6 @@ async fn test_debug_trace_block_rejects_exhausted_budget() -> eyre::Result<()> { Ok(()) } -/// Launches a node on `chain_spec` and returns it with its HTTP RPC client; the node shuts down -/// when the returned handle drops. -async fn launch_rpc_client( - chain_spec: &Arc, -) -> eyre::Result<(impl Sized, HttpClient)> { - let NodeHandle { node, node_exit_future: _ } = NodeBuilder::new(rpc_node_config(chain_spec)) - .testing_node(Runtime::test()) - .node(OpNode::default()) - .launch() - .await?; - let client = node.add_ons_handle.rpc_server_handles().rpc.http_client().unwrap(); - Ok((node, client)) -} - /// Builds block 1 on genesis state: a funding deposit, a refunded transfer and the post-exec /// transaction carrying that refund, under the given block gas limit. /// diff --git a/rust/op-reth/crates/node/tests/it/invalid_post_exec.rs b/rust/op-reth/crates/node/tests/it/invalid_post_exec.rs index 55c49a8dd3a..93bd7cdfb78 100644 --- a/rust/op-reth/crates/node/tests/it/invalid_post_exec.rs +++ b/rust/op-reth/crates/node/tests/it/invalid_post_exec.rs @@ -8,6 +8,7 @@ use alloy_consensus::{Sealable, proofs::calculate_transaction_root}; use alloy_rpc_types_engine::{PayloadStatus, PayloadStatusEnum, PayloadValidationError}; use alloy_rpc_types_eth::TransactionRequest; +use eyre::WrapErr; use jsonrpsee::core::ClientError; use op_alloy_consensus::{PostExecPayloadValidationError, SDMGasEntry, build_post_exec_tx}; use op_alloy_rpc_types_engine::{OpExecutionData, OpExecutionPayload}; @@ -129,21 +130,26 @@ async fn test_lagoon_new_payload_with_wrong_post_exec_block_number_is_invalid() // executor, which rejects it for the same reason instead of returning pre-refund traces. let client = node.inner.add_ons_handle.rpc_server_handles().rpc.http_client().expect("HTTP RPC on"); - let trace_error = loop { - match DebugApiClient::::debug_trace_bad_block( - &client, - bad_child_hash, - None, - ) - .await - { - Ok(traces) => panic!("debug_traceBadBlock must reject the block, got {traces:?}"), - Err(ClientError::Call(error)) if error.message().contains("not found in cache") => { - tokio::time::sleep(Duration::from_millis(250)).await; + let trace_rejected_block = async { + loop { + match DebugApiClient::::debug_trace_bad_block( + &client, + bad_child_hash, + None, + ) + .await + { + Ok(traces) => panic!("debug_traceBadBlock must reject the block, got {traces:?}"), + Err(ClientError::Call(error)) if error.message().contains("not found in cache") => { + tokio::time::sleep(Duration::from_millis(250)).await; + } + Err(error) => break error, } - Err(error) => break error, } }; + let trace_error = tokio::time::timeout(Duration::from_secs(10), trace_rejected_block) + .await + .wrap_err("the rejected block never reached the bad-block cache")?; let ClientError::Call(trace_error) = trace_error else { panic!("debug_traceBadBlock must fail with a call error: {trace_error:?}"); }; diff --git a/rust/op-reth/crates/node/tests/it/lagoon.rs b/rust/op-reth/crates/node/tests/it/lagoon.rs index edc1bec96bd..bb022b7b26d 100644 --- a/rust/op-reth/crates/node/tests/it/lagoon.rs +++ b/rust/op-reth/crates/node/tests/it/lagoon.rs @@ -1,7 +1,9 @@ //! Lagoon-at-genesis fixtures and SDM node helpers shared by the integration tests. use alloy_genesis::Genesis; -use alloy_primitives::B64; +use alloy_network::eip2718::Encodable2718; +use alloy_primitives::{B64, Bytes, TxKind}; +use alloy_rpc_types_eth::{TransactionInput, TransactionRequest}; use alloy_rpc_types_trace::{ common::TraceResult, geth::{ @@ -9,9 +11,12 @@ use alloy_rpc_types_trace::{ GethDebugTracingOptions, GethTrace, PreStateConfig, }, }; +use jsonrpsee::http_client::HttpClient; use op_alloy_consensus::encode_jovian_extra_data; use reth_chainspec::BaseFeeParams; -use reth_e2e_test_utils::{NodeHelperType, node::NodeTestContext}; +use reth_e2e_test_utils::{ + NodeHelperType, node::NodeTestContext, transaction::TransactionTestContext, wallet::Wallet, +}; use reth_node_builder::{NodeBuilder, NodeHandle}; use reth_node_core::{ args::{NetworkArgs, RpcServerArgs}, @@ -72,31 +77,80 @@ pub(crate) fn rpc_node_config(chain_spec: &Arc) -> NodeConfig, + rollup_args: RollupArgs, ) -> eyre::Result> { - launch_sdm_node_with_attributes(chain_spec, payload_attributes).await + launch_node_with_attributes(chain_spec, rollup_args, payload_attributes).await } -/// Like [`launch_sdm_node`], with the payload attributes supplied per block timestamp. -pub(crate) async fn launch_sdm_node_with_attributes( +/// Like [`launch_node`], with the payload attributes supplied per block timestamp. +pub(crate) async fn launch_node_with_attributes( chain_spec: &Arc, + rollup_args: RollupArgs, attributes: impl Fn(u64) -> OpPayloadAttrs + Send + Sync + 'static, ) -> eyre::Result> { - let op_node = OpNode::new(RollupArgs { - operator_sdm_opt_in: true, - testing_sdm_fixed_policy: Some(None), - ..Default::default() - }); let NodeHandle { node, node_exit_future: _ } = NodeBuilder::new(rpc_node_config(chain_spec)) .testing_node(Runtime::test()) - .node(op_node) + .node(OpNode::new(rollup_args)) .launch() .await?; NodeTestContext::new(node, attributes).await } +/// Rollup arguments that opt into SDM and sequence one refund per regular transaction. +pub(crate) fn sdm_rollup_args() -> RollupArgs { + RollupArgs { + operator_sdm_opt_in: true, + testing_sdm_fixed_policy: Some(None), + ..Default::default() + } +} + +/// Launches a Lagoon node that opts into SDM and sequences one refund per regular transaction. +pub(crate) async fn launch_sdm_node( + chain_spec: &Arc, +) -> eyre::Result> { + launch_node(chain_spec, sdm_rollup_args()).await +} + +/// Like [`launch_sdm_node`], with the payload attributes supplied per block timestamp. +pub(crate) async fn launch_sdm_node_with_attributes( + chain_spec: &Arc, + attributes: impl Fn(u64) -> OpPayloadAttrs + Send + Sync + 'static, +) -> eyre::Result> { + launch_node_with_attributes(chain_spec, sdm_rollup_args(), attributes).await +} + +/// The HTTP client of a node launched with [`rpc_node_config`]. +pub(crate) fn http_client(node: &NodeHelperType) -> HttpClient { + node.inner.add_ons_handle.rpc_server_handles().rpc.http_client().expect("HTTP RPC on") +} + +/// An EIP-1559 transaction from `wallet` paying `fee` per gas as both fee cap and tip, signed and +/// encoded for `eth_sendRawTransaction` or forced payload attributes. +pub(crate) async fn signed_transaction( + wallet: &Wallet, + nonce: u64, + gas_limit: u64, + fee: u128, + to: TxKind, + input: Bytes, +) -> Bytes { + let request = TransactionRequest { + chain_id: Some(wallet.chain_id), + gas: Some(gas_limit), + input: TransactionInput::new(input), + max_fee_per_gas: Some(fee), + max_priority_fee_per_gas: Some(fee), + nonce: Some(nonce), + to: Some(to), + ..Default::default() + }; + TransactionTestContext::sign_tx(wallet.inner.clone(), request).await.encoded_2718().into() +} + /// Returns tracing options selecting the prestate tracer with the given config. pub(crate) fn prestate_tracer(config: PreStateConfig) -> GethDebugTracingOptions { GethDebugTracingOptions::default() diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/affordability.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/affordability.rs index f5ea739ef2e..2da503cc943 100644 --- a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/affordability.rs +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/affordability.rs @@ -1,13 +1,15 @@ //! A later transaction that is only affordable because of an earlier refund. -use crate::lagoon::{self, DEPLOY_GAS, default_trace_gas, launch_sdm_node_with_attributes}; +use crate::lagoon::{ + self, DEPLOY_GAS, default_trace_gas, http_client, launch_sdm_node_with_attributes, + signed_transaction, +}; use alloy_consensus::BlockHeader; -use alloy_network::eip2718::Encodable2718; use alloy_primitives::{Bytes, TxKind, U256}; -use alloy_rpc_types_eth::{BlockNumberOrTag, TransactionInput, TransactionRequest}; +use alloy_rpc_types_eth::{BlockNumberOrTag, TransactionRequest}; use alloy_rpc_types_trace::geth::GethTrace; use reth_chainspec::EthChainSpec; -use reth_e2e_test_utils::{transaction::TransactionTestContext, wallet::Wallet}; +use reth_e2e_test_utils::wallet::Wallet; use reth_rpc_api::clients::DebugApiClient; /// The sender starts with exactly the settled cost of the first deployment plus the second @@ -30,18 +32,17 @@ async fn later_transaction_affordability_depends_on_prior_refund() -> eyre::Resu let mut forced_transactions = Vec::new(); for nonce in 0..2 { - let transaction = TransactionRequest { - chain_id: Some(wallet.chain_id), - gas: Some(transaction_gas_limit), - input: TransactionInput::new(Bytes::from_static(&[0x00])), - max_fee_per_gas: Some(gas_price), - max_priority_fee_per_gas: Some(gas_price), - nonce: Some(nonce), - to: Some(TxKind::Create), - ..Default::default() - }; - let signed = TransactionTestContext::sign_tx(wallet.inner.clone(), transaction).await; - forced_transactions.push(signed.encoded_2718().into()); + let stop = Bytes::from_static(&[0x00]); + let signed = signed_transaction( + &wallet, + nonce, + transaction_gas_limit, + gas_price, + TxKind::Create, + stop, + ) + .await; + forced_transactions.push(signed); } let mut node = launch_sdm_node_with_attributes(&chain_spec, move |timestamp| { let mut attributes = lagoon::payload_attributes(timestamp); @@ -55,7 +56,7 @@ async fn later_transaction_affordability_depends_on_prior_refund() -> eyre::Resu let payload = node.advance_block().await?; let block = payload.block(); assert_eq!(block.body().transactions.len(), 3, "two deployments and the post-exec tx"); - let client = node.inner.add_ons_handle.rpc_server_handles().rpc.http_client().unwrap(); + let client = http_client(&node); let sender_before_second = DebugApiClient::::debug_account_info_at( &client, diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/debug_tracers.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/debug_tracers.rs index 5759eaf20ad..1d843c3c6d2 100644 --- a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/debug_tracers.rs +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/debug_tracers.rs @@ -4,8 +4,6 @@ use super::fixture::{POST_EXEC_INDEX, REVERTING_INDEX, SettledBlock, TRANSFER_IN use crate::lagoon::{DEPLOY_GAS, default_trace_gas}; use alloy_primitives::U256; use alloy_rpc_types_trace::geth::GethTrace; -use jsonrpsee::{core::client::ClientT, rpc_params}; -use serde_json::json; /// The default, call and prestate tracers report each regular transaction's canonical gas and /// the balances `debug_accountAt` replays at that index; after the last regular transaction those @@ -45,16 +43,7 @@ async fn debug_tracers_report_settled_gas_and_balances() -> eyre::Result<()> { gas_used, "debug_traceBlockByHash gas of transaction {index}", ); - let call: GethTrace = fixture - .client - .request( - "debug_traceTransaction", - rpc_params![fixture.transaction_hash(index), json!({"tracer": "callTracer"})], - ) - .await?; - let GethTrace::CallTracer(call_frame) = call else { - panic!("unexpected call trace of transaction {index}: {call:?}"); - }; + let call_frame = fixture.call_trace(index).await?; assert_eq!( call_frame.gas_used, U256::from(gas_used), @@ -66,8 +55,8 @@ async fn debug_tracers_report_settled_gas_and_balances() -> eyre::Result<()> { // index, for the sender as well as the fee vaults. let diff = fixture.prestate_diff(index).await?; assert!( - diff.post.contains_key(&fixture.sender), - "prestate diff of transaction {index} lacks the sender", + diff.post.get(&fixture.sender).is_some_and(|account| account.balance.is_some()), + "prestate diff of transaction {index} lacks the sender's balance: {diff:?}", ); for (address, account) in &diff.post { if let Some(balance) = account.balance { @@ -94,7 +83,12 @@ async fn debug_tracers_report_settled_gas_and_balances() -> eyre::Result<()> { committed, "debug_accountAt after the post-exec transaction", ); - for (address, account) in &fixture.prestate_diff(last_regular).await?.post { + let diff = fixture.prestate_diff(last_regular).await?; + assert!( + diff.post.get(&fixture.sender).is_some_and(|account| account.balance.is_some()), + "prestate diff of transaction {last_regular} lacks the sender's balance: {diff:?}", + ); + for (address, account) in &diff.post { if let Some(balance) = account.balance { assert_eq!( balance, diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/fixture.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/fixture.rs index 0fa4c563e9d..62cd7cb8ec9 100644 --- a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/fixture.rs +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/fixture.rs @@ -1,17 +1,21 @@ //! A sequenced Lagoon block with SDM refunds and the RPC accessors the family tests share. -use crate::lagoon::{self, TRANSFER_GAS, launch_sdm_node, prestate_tracer}; +use crate::lagoon::{ + self, TRANSFER_GAS, http_client, launch_sdm_node, prestate_tracer, signed_transaction, +}; use alloy_consensus::{BlockHeader, TxReceipt}; -use alloy_network::eip2718::Encodable2718; use alloy_primitives::{Address, B256, Bytes, TxKind, U256}; -use alloy_rpc_types_eth::{TransactionInput, TransactionRequest}; +use alloy_rpc_types_eth::TransactionRequest; use alloy_rpc_types_trace::{ common::TraceResult, - geth::{DiffMode, GethDebugTracingOptions, GethTrace, PreStateConfig, PreStateFrame}, + geth::{ + CallFrame, DiffMode, GethDebugBuiltInTracerType, GethDebugTracerType, + GethDebugTracingOptions, GethTrace, PreStateConfig, PreStateFrame, + }, }; use jsonrpsee::{http_client::HttpClient, ws_client::WsClient}; use reth_chainspec::EthChainSpec; -use reth_e2e_test_utils::{NodeHelperType, transaction::TransactionTestContext, wallet::Wallet}; +use reth_e2e_test_utils::{NodeHelperType, wallet::Wallet}; use reth_optimism_node::OpNode; use reth_optimism_payload_builder::OpBuiltPayload; use reth_optimism_primitives::OpTransactionSigned; @@ -50,7 +54,7 @@ impl SettledBlock { pub(super) async fn sequence() -> eyre::Result { let chain_spec = lagoon::chain_spec()?; let mut node = launch_sdm_node(&chain_spec).await?; - let client = node.inner.add_ons_handle.rpc_server_handles().rpc.http_client().unwrap(); + let client = http_client(&node); let wallet = Wallet::default().with_chain_id(chain_spec.chain_id()); let sender = wallet.inner.address(); let deployments = [ @@ -64,19 +68,12 @@ impl SettledBlock { ), ]; assert_eq!(deployments.len(), POST_EXEC_INDEX, "one regular transaction per row"); - for (nonce, (to, init_code)) in deployments.into_iter().enumerate() { - let transaction = TransactionRequest { - chain_id: Some(wallet.chain_id), - gas: Some(if matches!(to, TxKind::Call(_)) { TRANSFER_GAS } else { 100_000 }), - input: TransactionInput::new(init_code), - max_fee_per_gas: Some(20_000_000_000), - max_priority_fee_per_gas: Some(1_000_000_000), - nonce: Some(nonce as u64), - to: Some(to), - ..Default::default() - }; - let signed = TransactionTestContext::sign_tx(wallet.inner.clone(), transaction).await; - node.rpc.inject_tx(signed.encoded_2718().into()).await?; + for (nonce, (to, input)) in deployments.into_iter().enumerate() { + let gas_limit = if matches!(to, TxKind::Call(_)) { TRANSFER_GAS } else { 100_000 }; + let signed = + signed_transaction(&wallet, nonce as u64, gas_limit, 20_000_000_000, to, input) + .await; + node.rpc.inject_tx(signed).await?; } let payload = node.advance_block().await?; @@ -189,6 +186,16 @@ impl SettledBlock { .await?) } + pub(super) async fn call_trace(&self, index: usize) -> eyre::Result { + let options = GethDebugTracingOptions::default().with_tracer( + GethDebugTracerType::BuiltInTracer(GethDebugBuiltInTracerType::CallTracer), + ); + match self.trace_transaction(index, Some(options)).await? { + GethTrace::CallTracer(frame) => Ok(frame), + other => panic!("unexpected call trace of transaction {index}: {other:?}"), + } + } + pub(super) async fn prestate_diff(&self, index: usize) -> eyre::Result { let options = prestate_tracer(PreStateConfig { diff_mode: Some(true), ..Default::default() }); diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/post_exec_target.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/post_exec_target.rs index 23172c5c186..41b45cbdb1b 100644 --- a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/post_exec_target.rs +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/post_exec_target.rs @@ -5,12 +5,9 @@ use crate::lagoon::default_trace_gas; use alloy_primitives::U256; use alloy_rpc_types_eth::TransactionRequest; use alloy_rpc_types_trace::geth::GethTrace; -use jsonrpsee::{core::client::ClientT, rpc_params}; use reth_rpc_api::clients::DebugApiClient; -use serde_json::json; -/// Every tracer gives the post-exec transaction an empty trace at its receipt gas, and a traced -/// transfer carries nothing from the replayed prefix. +/// Every tracer gives the post-exec transaction an empty trace at its receipt gas. #[tokio::test] async fn post_exec_transaction_traces_as_a_no_op() -> eyre::Result<()> { reth_tracing::init_test_tracing(); @@ -33,27 +30,13 @@ async fn post_exec_transaction_traces_as_a_no_op() -> eyre::Result<()> { receipt_gas[POST_EXEC_INDEX], "debug_traceBlockByHash gas of the post-exec tx", ); - let post_exec_call: GethTrace = fixture - .client - .request( - "debug_traceTransaction", - rpc_params![fixture.transaction_hash(POST_EXEC_INDEX), json!({"tracer": "callTracer"})], - ) - .await?; - let GethTrace::CallTracer(post_exec_call_frame) = post_exec_call else { - panic!("unexpected call trace of the post-exec tx: {post_exec_call:?}"); - }; + let post_exec_call_frame = fixture.call_trace(POST_EXEC_INDEX).await?; assert_eq!(post_exec_call_frame.gas_used, U256::ZERO, "callTracer gas of the post-exec tx"); let post_exec_diff = fixture.prestate_diff(POST_EXEC_INDEX).await?; assert!( post_exec_diff.pre.is_empty() && post_exec_diff.post.is_empty(), "prestate diff of the post-exec tx must be empty: {post_exec_diff:?}", ); - - let GethTrace::Default(transfer_frame) = fixture.trace_transaction(1, None).await? else { - panic!("unexpected default trace of the transfer"); - }; - assert!(transfer_frame.struct_logs.is_empty(), "debug_traceTransaction of the transfer"); Ok(()) } diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/prefix_replays.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/prefix_replays.rs index 3faa8b59853..19217125170 100644 --- a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/prefix_replays.rs +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/prefix_replays.rs @@ -20,7 +20,7 @@ async fn debug_trace_call_runs_on_settled_prefix_without_refund() -> eyre::Resul let prefix_call = DebugApiClient::::debug_trace_call( &fixture.client, - TransactionRequest::default().from(fixture.sender).to(Address::with_last_byte(1)), + TransactionRequest::default().from(fixture.sender).to(Address::repeat_byte(0x55)), Some(fixture.block_hash().into()), Some(GethDebugTracingCallOptions { tracing_options: prestate_tracer(PreStateConfig::default()), @@ -33,7 +33,7 @@ async fn debug_trace_call_runs_on_settled_prefix_without_refund() -> eyre::Resul panic!("unexpected debug_traceCall prestate: {prefix_call:?}"); }; assert_eq!( - prestate.0[&fixture.sender].balance, + prestate.0.get(&fixture.sender).expect("sender in prestate").balance, Some(fixture.replayed_balance(0, fixture.sender).await?), "debug_traceCall prestate after the first deployment", ); diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/trace_chain.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/trace_chain.rs index 9a8f72a4ef2..ab34c7042df 100644 --- a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/trace_chain.rs +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/trace_chain.rs @@ -7,6 +7,7 @@ use alloy_rpc_types_trace::{ common::TraceResult, geth::{ChainBlockTraceResult, GethDebugTracingOptions}, }; +use eyre::WrapErr; use jsonrpsee::{ core::client::{Subscription, SubscriptionClientT}, rpc_params, @@ -81,8 +82,11 @@ async fn trace_chain_over_block( "debug_unsubscribe", ) .await?; - let result = - tokio::time::timeout(Duration::from_secs(10), subscription.next()).await?.unwrap()?; + let block_number = fixture.block_number(); + let result = tokio::time::timeout(Duration::from_secs(10), subscription.next()) + .await + .wrap_err_with(|| format!("traceChain yielded no result for block {block_number}"))? + .ok_or_else(|| eyre::eyre!("traceChain closed before block {block_number}"))??; subscription.unsubscribe().await?; Ok(result) } From 54e36918634c15297a85704a1b5fd3783658e820 Mon Sep 17 00:00:00 2001 From: Einar Rasmussen Date: Mon, 9 Nov 2026 23:26:04 +0100 Subject: [PATCH 5/6] op-reth: derive the test node handles instead of storing them The raw-block rejection test formats its expected message from the typed `BlockValidationError`, so it survives rewording and still proves which error the executor returned. `SettledBlock` derives its HTTP client from the node like it already does for WebSocket, the test launchers reduce to `launch_node` and `launch_node_with_attributes` with `sdm_rollup_args()`, and the engine test uses the shared client accessor. The node config no longer repeats the unused-ports override that `NodeConfig::test()` already applies, nor does the derived attributes test, and the launch doc no longer claims the node stops when its handle drops. The alloy-op-evm Jovian schedule lives in one `jovian_hardforks` helper shared by the fixture and the Verify-mode settlement test. Co-Authored-By: Claude Fable 5.1 --- rust/alloy-op-evm/src/block/tests.rs | 15 +++++++---- .../src/block/tests/structural_tests.rs | 11 +++----- .../node/tests/it/debug_trace_post_exec.rs | 11 +++++--- .../node/tests/it/derived_attributes.rs | 4 +-- .../crates/node/tests/it/invalid_post_exec.rs | 3 +-- rust/op-reth/crates/node/tests/it/lagoon.rs | 25 +++---------------- .../it/rpc_replay_settlement/affordability.rs | 4 +-- .../tests/it/rpc_replay_settlement/fixture.rs | 19 ++++++++------ .../it/rpc_replay_settlement/otterscan.rs | 2 +- .../rpc_replay_settlement/parity_replays.rs | 6 ++--- .../rpc_replay_settlement/post_exec_target.rs | 2 +- .../rpc_replay_settlement/prefix_replays.rs | 8 +++--- 12 files changed, 48 insertions(+), 62 deletions(-) diff --git a/rust/alloy-op-evm/src/block/tests.rs b/rust/alloy-op-evm/src/block/tests.rs index 007c62669a1..4cfe9b0f298 100644 --- a/rust/alloy-op-evm/src/block/tests.rs +++ b/rust/alloy-op-evm/src/block/tests.rs @@ -198,16 +198,21 @@ struct JovianExecutorFixture { beneficiary: Address, } +/// Mainnet's schedule with Jovian moved to `jovian_timestamp`. +fn jovian_hardforks(jovian_timestamp: u64) -> OpChainHardforks { + OpChainHardforks::new( + OpHardfork::op_mainnet() + .into_iter() + .chain([(OpHardfork::Jovian, ForkCondition::Timestamp(jovian_timestamp))]), + ) +} + impl JovianExecutorFixture { fn new(da_footprint_gas_scalar: u16, gas_limit: u64, jovian_timestamp: u64) -> Self { Self { db: prepare_jovian_db(da_footprint_gas_scalar), receipt_builder: OpAlloyReceiptBuilder::default(), - op_chain_hardforks: OpChainHardforks::new( - OpHardfork::op_mainnet() - .into_iter() - .chain(vec![(OpHardfork::Jovian, ForkCondition::Timestamp(jovian_timestamp))]), - ), + op_chain_hardforks: jovian_hardforks(jovian_timestamp), gas_limit, jovian_timestamp, // These Jovian execution tests run normal (non-activation) blocks; leaving the parent diff --git a/rust/alloy-op-evm/src/block/tests/structural_tests.rs b/rust/alloy-op-evm/src/block/tests/structural_tests.rs index 9b0dbaef435..889706fcf4d 100644 --- a/rust/alloy-op-evm/src/block/tests/structural_tests.rs +++ b/rust/alloy-op-evm/src/block/tests/structural_tests.rs @@ -193,19 +193,14 @@ fn canonicalized_result_gas_applies_refund_exactly_once() { #[test] fn verify_mode_result_is_settled_before_commit_with_inspector() { let receipt_builder = OpAlloyReceiptBuilder::default(); - // The settlement reads the fork from these hardforks at the block timestamp; mainnet's - // schedule puts that timestamp at Isthmus, whose operator fee rounds a one-gas saving to zero. - let hardforks = OpChainHardforks::new( - OpHardfork::op_mainnet() - .into_iter() - .chain([(OpHardfork::Jovian, ForkCondition::Timestamp(JOVIAN_TIMESTAMP))]), - ); + // The settlement reads the fork from these hardforks at the block timestamp. + let hardforks = jovian_hardforks(JOVIAN_TIMESTAMP); let gas_price = 1u128; let beneficiary = Address::repeat_byte(0xbe); let payload = PostExecPayload { - version: 1, block_number: 0, gas_refund_entries: vec![SDMGasEntry { index: 0, gas_refund: 1 }], + version: 1, }; // Operator fees are only charged on transactions that carry calldata. let priced_tx = recovered_legacy(TxLegacy { diff --git a/rust/op-reth/crates/node/tests/it/debug_trace_post_exec.rs b/rust/op-reth/crates/node/tests/it/debug_trace_post_exec.rs index d45e5e0f875..4ecb42f090b 100644 --- a/rust/op-reth/crates/node/tests/it/debug_trace_post_exec.rs +++ b/rust/op-reth/crates/node/tests/it/debug_trace_post_exec.rs @@ -18,6 +18,7 @@ use alloy_rpc_types_trace::{common::TraceResult, geth::GethDebugTracingOptions}; use jsonrpsee::core::ClientError; use op_alloy_consensus::{OpTxEnvelope, SDMGasEntry, TxDeposit, build_post_exec_tx}; use reth_chainspec::EthChainSpec; +use reth_evm::execute::BlockValidationError; use reth_optimism_chainspec::{OpChainSpec, OpChainSpecBuilder}; use reth_optimism_node::args::RollupArgs; use reth_rpc_api::clients::DebugApiClient; @@ -78,10 +79,14 @@ async fn test_debug_trace_block_rejects_exhausted_budget() -> eyre::Result<()> { let ClientError::Call(error) = error else { panic!("debug_traceBlock must fail with a call error: {error:?}"); }; - assert!( - error.message().contains("available gas 0"), - "debug_traceBlock error must name the executor's rejection: {}", + let rejection = BlockValidationError::TransactionGasLimitMoreThanAvailableBlockGas { + transaction_gas_limit: TRANSFER_GAS, + block_available_gas: 0, + }; + assert_eq!( error.message(), + rejection.to_string(), + "debug_traceBlock error must be the executor's rejection", ); Ok(()) diff --git a/rust/op-reth/crates/node/tests/it/derived_attributes.rs b/rust/op-reth/crates/node/tests/it/derived_attributes.rs index 481e5acf0a5..8903bf546e1 100644 --- a/rust/op-reth/crates/node/tests/it/derived_attributes.rs +++ b/rust/op-reth/crates/node/tests/it/derived_attributes.rs @@ -116,9 +116,7 @@ type TestNode = FullNode< >; async fn launch(chain_spec: Arc) -> eyre::Result { - let mut config = NodeConfig::test().map_chain(chain_spec).with_unused_ports(); - config.network.discovery.discv5_port = Some(0); - config.network.discovery.discv5_port_ipv6 = Some(0); + let config = NodeConfig::test().map_chain(chain_spec).with_unused_ports(); let op_node = OpNode::default(); Ok(NodeBuilder::new(config) .testing_node(Runtime::test()) diff --git a/rust/op-reth/crates/node/tests/it/invalid_post_exec.rs b/rust/op-reth/crates/node/tests/it/invalid_post_exec.rs index 93bd7cdfb78..4e2c41149da 100644 --- a/rust/op-reth/crates/node/tests/it/invalid_post_exec.rs +++ b/rust/op-reth/crates/node/tests/it/invalid_post_exec.rs @@ -128,8 +128,7 @@ async fn test_lagoon_new_payload_with_wrong_post_exec_block_number_is_invalid() // The rejected block is cached for diagnostics, but tracing it replays through the block // executor, which rejects it for the same reason instead of returning pre-refund traces. - let client = - node.inner.add_ons_handle.rpc_server_handles().rpc.http_client().expect("HTTP RPC on"); + let client = crate::lagoon::http_client(&node); let trace_rejected_block = async { loop { match DebugApiClient::::debug_trace_bad_block( diff --git a/rust/op-reth/crates/node/tests/it/lagoon.rs b/rust/op-reth/crates/node/tests/it/lagoon.rs index bb022b7b26d..509ec975b5d 100644 --- a/rust/op-reth/crates/node/tests/it/lagoon.rs +++ b/rust/op-reth/crates/node/tests/it/lagoon.rs @@ -18,10 +18,7 @@ use reth_e2e_test_utils::{ NodeHelperType, node::NodeTestContext, transaction::TransactionTestContext, wallet::Wallet, }; use reth_node_builder::{NodeBuilder, NodeHandle}; -use reth_node_core::{ - args::{NetworkArgs, RpcServerArgs}, - node_config::NodeConfig, -}; +use reth_node_core::{args::RpcServerArgs, node_config::NodeConfig}; use reth_optimism_chainspec::{OpChainSpec, OpChainSpecBuilder}; use reth_optimism_node::{OpNode, args::RollupArgs, utils::optimism_payload_attributes}; use reth_optimism_payload_builder::OpPayloadAttrs; @@ -64,8 +61,7 @@ pub(crate) const fn payload_attributes(timestamp: u64) -> OpPayloadAttrs { /// Returns a test node config serving every RPC module over HTTP and `WebSocket` on unused ports. pub(crate) fn rpc_node_config(chain_spec: &Arc) -> NodeConfig { - let network_args = NetworkArgs::default().with_unused_ports(); - NodeConfig::test().map_chain(chain_spec.clone()).with_network(network_args).with_rpc( + NodeConfig::test().map_chain(chain_spec.clone()).with_rpc( RpcServerArgs::default() .with_unused_ports() .with_http() @@ -77,7 +73,7 @@ pub(crate) fn rpc_node_config(chain_spec: &Arc) -> NodeConfig, rollup_args: RollupArgs, @@ -108,21 +104,6 @@ pub(crate) fn sdm_rollup_args() -> RollupArgs { } } -/// Launches a Lagoon node that opts into SDM and sequences one refund per regular transaction. -pub(crate) async fn launch_sdm_node( - chain_spec: &Arc, -) -> eyre::Result> { - launch_node(chain_spec, sdm_rollup_args()).await -} - -/// Like [`launch_sdm_node`], with the payload attributes supplied per block timestamp. -pub(crate) async fn launch_sdm_node_with_attributes( - chain_spec: &Arc, - attributes: impl Fn(u64) -> OpPayloadAttrs + Send + Sync + 'static, -) -> eyre::Result> { - launch_node_with_attributes(chain_spec, sdm_rollup_args(), attributes).await -} - /// The HTTP client of a node launched with [`rpc_node_config`]. pub(crate) fn http_client(node: &NodeHelperType) -> HttpClient { node.inner.add_ons_handle.rpc_server_handles().rpc.http_client().expect("HTTP RPC on") diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/affordability.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/affordability.rs index 2da503cc943..8e1dbe2ceba 100644 --- a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/affordability.rs +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/affordability.rs @@ -1,7 +1,7 @@ //! A later transaction that is only affordable because of an earlier refund. use crate::lagoon::{ - self, DEPLOY_GAS, default_trace_gas, http_client, launch_sdm_node_with_attributes, + self, DEPLOY_GAS, default_trace_gas, http_client, launch_node_with_attributes, sdm_rollup_args, signed_transaction, }; use alloy_consensus::BlockHeader; @@ -44,7 +44,7 @@ async fn later_transaction_affordability_depends_on_prior_refund() -> eyre::Resu .await; forced_transactions.push(signed); } - let mut node = launch_sdm_node_with_attributes(&chain_spec, move |timestamp| { + let mut node = launch_node_with_attributes(&chain_spec, sdm_rollup_args(), move |timestamp| { let mut attributes = lagoon::payload_attributes(timestamp); // The transactions are forced through attributes because the pool's balance check does // not know about refunds and would reject the second one. Local sequencing (the default diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/fixture.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/fixture.rs index 62cd7cb8ec9..17fb97d06bf 100644 --- a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/fixture.rs +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/fixture.rs @@ -1,7 +1,8 @@ //! A sequenced Lagoon block with SDM refunds and the RPC accessors the family tests share. use crate::lagoon::{ - self, TRANSFER_GAS, http_client, launch_sdm_node, prestate_tracer, signed_transaction, + self, TRANSFER_GAS, http_client, launch_node, prestate_tracer, sdm_rollup_args, + signed_transaction, }; use alloy_consensus::{BlockHeader, TxReceipt}; use alloy_primitives::{Address, B256, Bytes, TxKind, U256}; @@ -44,7 +45,6 @@ pub(super) const REVERT_OUTPUT: U256 = U256::from_limbs([42, 0, 0, 0]); /// transfer (not refunded, since it already sits on the EIP-7623 floor), a second deployment /// (refunded) and a deployment whose init code reverts with [`REVERT_OUTPUT`]. pub(super) struct SettledBlock { - pub(super) client: HttpClient, pub(super) node: NodeHelperType, pub(super) payload: OpBuiltPayload, pub(super) sender: Address, @@ -53,8 +53,7 @@ pub(super) struct SettledBlock { impl SettledBlock { pub(super) async fn sequence() -> eyre::Result { let chain_spec = lagoon::chain_spec()?; - let mut node = launch_sdm_node(&chain_spec).await?; - let client = http_client(&node); + let mut node = launch_node(&chain_spec, sdm_rollup_args()).await?; let wallet = Wallet::default().with_chain_id(chain_spec.chain_id()); let sender = wallet.inner.address(); let deployments = [ @@ -77,7 +76,7 @@ impl SettledBlock { } let payload = node.advance_block().await?; - let fixture = Self { client, node, payload, sender }; + let fixture = Self { node, payload, sender }; let transactions = fixture.transactions(); assert_eq!( transactions.len(), @@ -121,6 +120,10 @@ impl SettledBlock { self.transactions()[index].tx_hash() } + pub(super) fn client(&self) -> HttpClient { + http_client(&self.node) + } + pub(super) async fn ws_client(&self) -> WsClient { self.node.inner.add_ons_handle.rpc_server_handles().rpc.ws_client().await.unwrap() } @@ -154,7 +157,7 @@ impl SettledBlock { address: Address, ) -> eyre::Result { let account = DebugApiClient::::debug_account_info_at( - &self.client, + &self.client(), self.block_hash().into(), index.into(), address, @@ -166,7 +169,7 @@ impl SettledBlock { pub(super) async fn block_traces(&self) -> eyre::Result>> { Ok(DebugApiClient::::debug_trace_block_by_hash( - &self.client, + &self.client(), self.block_hash(), None, ) @@ -179,7 +182,7 @@ impl SettledBlock { options: Option, ) -> eyre::Result { Ok(DebugApiClient::::debug_trace_transaction( - &self.client, + &self.client(), self.transaction_hash(index), options, ) diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/otterscan.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/otterscan.rs index 1067ddb7883..0bde52842d4 100644 --- a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/otterscan.rs +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/otterscan.rs @@ -11,7 +11,7 @@ async fn otterscan_returns_revert_output_on_sdm_block() -> eyre::Result<()> { let fixture = SettledBlock::sequence().await?; let revert: Option = fixture - .client + .client() .request("ots_getTransactionError", rpc_params![fixture.transaction_hash(REVERTING_INDEX)]) .await?; diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/parity_replays.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/parity_replays.rs index 60d994d3183..3403ce3856e 100644 --- a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/parity_replays.rs +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/parity_replays.rs @@ -19,7 +19,7 @@ async fn parity_replays_report_settled_state_diffs() -> eyre::Result<()> { for index in 0..POST_EXEC_INDEX { let replay = TraceApiClient::::replay_transaction( - &fixture.client, + &fixture.client(), fixture.transaction_hash(index), HashSet::from_iter([TraceType::StateDiff, TraceType::Trace]), ) @@ -32,7 +32,7 @@ async fn parity_replays_report_settled_state_diffs() -> eyre::Result<()> { } let replays = TraceApiClient::::replay_block_transactions( - &fixture.client, + &fixture.client(), fixture.block_hash().into(), HashSet::from_iter([TraceType::StateDiff]), ) @@ -56,7 +56,7 @@ async fn trace_filter_covers_every_transaction() -> eyre::Result<()> { let fixture = SettledBlock::sequence().await?; let filtered = TraceApiClient::::trace_filter( - &fixture.client, + &fixture.client(), TraceFilter { from_block: Some(fixture.block_number()), to_block: Some(fixture.block_number()), diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/post_exec_target.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/post_exec_target.rs index 41b45cbdb1b..5b6c7c341e1 100644 --- a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/post_exec_target.rs +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/post_exec_target.rs @@ -48,7 +48,7 @@ async fn intermediate_roots_follow_each_boundary() -> eyre::Result<()> { let fixture = SettledBlock::sequence().await?; let roots = DebugApiClient::::debug_intermediate_roots( - &fixture.client, + &fixture.client(), fixture.block_hash(), None, ) diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/prefix_replays.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/prefix_replays.rs index 19217125170..603e4fe9eed 100644 --- a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/prefix_replays.rs +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/prefix_replays.rs @@ -19,7 +19,7 @@ async fn debug_trace_call_runs_on_settled_prefix_without_refund() -> eyre::Resul let fixture = SettledBlock::sequence().await?; let prefix_call = DebugApiClient::::debug_trace_call( - &fixture.client, + &fixture.client(), TransactionRequest::default().from(fixture.sender).to(Address::repeat_byte(0x55)), Some(fixture.block_hash().into()), Some(GethDebugTracingCallOptions { @@ -39,7 +39,7 @@ async fn debug_trace_call_runs_on_settled_prefix_without_refund() -> eyre::Resul ); let synthetic_transfer = DebugApiClient::::debug_trace_call( - &fixture.client, + &fixture.client(), TransactionRequest::default() .from(fixture.sender) .to(Address::repeat_byte(0x55)) @@ -83,7 +83,7 @@ async fn call_many_reads_settled_balances() -> eyre::Result<()> { }); let output: Vec> = fixture - .client + .client() .request("eth_callMany", rpc_params![bundles.clone(), context.clone(), overrides.clone()]) .await?; let response = &output[0][0]; @@ -95,7 +95,7 @@ async fn call_many_reads_settled_balances() -> eyre::Result<()> { ); let traces: Vec> = fixture - .client + .client() .request( "debug_traceCallMany", rpc_params![bundles, context, json!({"stateOverrides": overrides})], From a1cc64227e38a9030c57d7815fa590a0d32681e7 Mon Sep 17 00:00:00 2001 From: Einar Rasmussen Date: Tue, 10 Nov 2026 00:45:35 +0100 Subject: [PATCH 6/6] op-reth: build the settled block's HTTP client once `SettledBlock` creates its HTTP client when the block is sequenced and hands out a reference, instead of building a new client with its own connection pool on every accessor call. Co-Authored-By: Claude Fable 5.1 --- .../tests/it/rpc_replay_settlement/fixture.rs | 15 +++++++++------ .../it/rpc_replay_settlement/parity_replays.rs | 6 +++--- .../it/rpc_replay_settlement/post_exec_target.rs | 2 +- .../it/rpc_replay_settlement/prefix_replays.rs | 4 ++-- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/fixture.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/fixture.rs index 17fb97d06bf..257fd51586b 100644 --- a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/fixture.rs +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/fixture.rs @@ -45,6 +45,7 @@ pub(super) const REVERT_OUTPUT: U256 = U256::from_limbs([42, 0, 0, 0]); /// transfer (not refunded, since it already sits on the EIP-7623 floor), a second deployment /// (refunded) and a deployment whose init code reverts with [`REVERT_OUTPUT`]. pub(super) struct SettledBlock { + client: HttpClient, pub(super) node: NodeHelperType, pub(super) payload: OpBuiltPayload, pub(super) sender: Address, @@ -54,6 +55,7 @@ impl SettledBlock { pub(super) async fn sequence() -> eyre::Result { let chain_spec = lagoon::chain_spec()?; let mut node = launch_node(&chain_spec, sdm_rollup_args()).await?; + let client = http_client(&node); let wallet = Wallet::default().with_chain_id(chain_spec.chain_id()); let sender = wallet.inner.address(); let deployments = [ @@ -76,7 +78,7 @@ impl SettledBlock { } let payload = node.advance_block().await?; - let fixture = Self { node, payload, sender }; + let fixture = Self { client, node, payload, sender }; let transactions = fixture.transactions(); assert_eq!( transactions.len(), @@ -120,8 +122,9 @@ impl SettledBlock { self.transactions()[index].tx_hash() } - pub(super) fn client(&self) -> HttpClient { - http_client(&self.node) + /// The HTTP client, built once at [`SettledBlock::sequence`] and shared by every accessor. + pub(super) const fn client(&self) -> &HttpClient { + &self.client } pub(super) async fn ws_client(&self) -> WsClient { @@ -157,7 +160,7 @@ impl SettledBlock { address: Address, ) -> eyre::Result { let account = DebugApiClient::::debug_account_info_at( - &self.client(), + self.client(), self.block_hash().into(), index.into(), address, @@ -169,7 +172,7 @@ impl SettledBlock { pub(super) async fn block_traces(&self) -> eyre::Result>> { Ok(DebugApiClient::::debug_trace_block_by_hash( - &self.client(), + self.client(), self.block_hash(), None, ) @@ -182,7 +185,7 @@ impl SettledBlock { options: Option, ) -> eyre::Result { Ok(DebugApiClient::::debug_trace_transaction( - &self.client(), + self.client(), self.transaction_hash(index), options, ) diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/parity_replays.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/parity_replays.rs index 3403ce3856e..b76fdbc3fbd 100644 --- a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/parity_replays.rs +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/parity_replays.rs @@ -19,7 +19,7 @@ async fn parity_replays_report_settled_state_diffs() -> eyre::Result<()> { for index in 0..POST_EXEC_INDEX { let replay = TraceApiClient::::replay_transaction( - &fixture.client(), + fixture.client(), fixture.transaction_hash(index), HashSet::from_iter([TraceType::StateDiff, TraceType::Trace]), ) @@ -32,7 +32,7 @@ async fn parity_replays_report_settled_state_diffs() -> eyre::Result<()> { } let replays = TraceApiClient::::replay_block_transactions( - &fixture.client(), + fixture.client(), fixture.block_hash().into(), HashSet::from_iter([TraceType::StateDiff]), ) @@ -56,7 +56,7 @@ async fn trace_filter_covers_every_transaction() -> eyre::Result<()> { let fixture = SettledBlock::sequence().await?; let filtered = TraceApiClient::::trace_filter( - &fixture.client(), + fixture.client(), TraceFilter { from_block: Some(fixture.block_number()), to_block: Some(fixture.block_number()), diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/post_exec_target.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/post_exec_target.rs index 5b6c7c341e1..2b6e99d0882 100644 --- a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/post_exec_target.rs +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/post_exec_target.rs @@ -48,7 +48,7 @@ async fn intermediate_roots_follow_each_boundary() -> eyre::Result<()> { let fixture = SettledBlock::sequence().await?; let roots = DebugApiClient::::debug_intermediate_roots( - &fixture.client(), + fixture.client(), fixture.block_hash(), None, ) diff --git a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/prefix_replays.rs b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/prefix_replays.rs index 603e4fe9eed..839076f32a1 100644 --- a/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/prefix_replays.rs +++ b/rust/op-reth/crates/node/tests/it/rpc_replay_settlement/prefix_replays.rs @@ -19,7 +19,7 @@ async fn debug_trace_call_runs_on_settled_prefix_without_refund() -> eyre::Resul let fixture = SettledBlock::sequence().await?; let prefix_call = DebugApiClient::::debug_trace_call( - &fixture.client(), + fixture.client(), TransactionRequest::default().from(fixture.sender).to(Address::repeat_byte(0x55)), Some(fixture.block_hash().into()), Some(GethDebugTracingCallOptions { @@ -39,7 +39,7 @@ async fn debug_trace_call_runs_on_settled_prefix_without_refund() -> eyre::Resul ); let synthetic_transfer = DebugApiClient::::debug_trace_call( - &fixture.client(), + fixture.client(), TransactionRequest::default() .from(fixture.sender) .to(Address::repeat_byte(0x55))