Repository navigation
rpc: replay block transactions through the block executor (backport of #28266) - #41
Merged
Merged
Conversation
7 tasks
aakoshh
added a commit
to ethereum-optimism/optimism
that referenced
this pull request
Nov 10, 2026
develop now pins op-v2.6.0-4 (#23942), which carries ethereum-optimism/reth#37: RPC block replays through the block executor, which op-reth's SDM refund settlement depends on. Carry it onto op-v2.7.0 as ethereum-optimism/reth#41, stacked on ethereum-optimism/reth#40, and pin its head. Resolve the conflicts with #23942: - Cargo.toml and Cargo.lock: keep the op-v2.7.0 rev, now ethereum-optimism/reth#41's head. - UPDATING-RETH.md: keep both sides, and update "Carried patches" for op-v2.7.0: where ethereum-optimism/reth#37's carry conflicted on v2.7.0, and the trie seek boundary fix carried as ethereum-optimism/reth#40. - invalid_post_exec.rs: develop's crate::lagoon helpers in the E2ETestSetupBuilder call reth v2.7.0 needs. Adapt #23942's new tests to reth v2.7.0: trace_replayTransaction returns an optional TraceResultsWithTransactionHash, and StateProviderDatabase takes an EvmStateProvider. Advance the reth mirror tags; ethereum-optimism/reth#41 touches no mirrored symbol.
op-will
reviewed
Nov 11, 2026
There was a problem hiding this comment.
Review focused on what differs from upstream paradigmxyz#28266 and the risk of those differences. Upstream is built on evm2; this backport targets alloy-evm 0.39 and rebuilds the fix with a different design (one toggled inspector per block, a reth-owned TracingCtx, from_eth_err mapping). Most findings come from that redesign.
Suggestions only touch code where this backport departs from upstream; behavior copied verbatim from upstream is left alone.
Highest priority: error-code mapping (changes client-visible behavior today) and the BAL branch still using a bare EVM. The toggled-inspector comment is non-blocking. Not verified: nothing was compiled or run.
op-will
approved these changes
Nov 11, 2026
…paradigmxyz#28266) (#37) Backports paradigmxyz#28266 to op-v2.6.0. Every replay of a block's own transactions, canonical, raw or bad, runs through the chain's block executor instead of a bare EVM, so traces, replayed state diffs, `debug_accountAt` and `debug_intermediateRoots` include the per-transaction changes the executor applies on top of the EVM result. `Call` gains `block_executor` and `replay_transactions_until_with_executor`; `Trace::inspect_transaction_in_block` takes the target transaction's index instead of a transaction environment and rejects an out-of-range index; `TracingCtx` borrows the result and owns the inspector, as upstream. Raw and bad blocks the executor rejects error instead of returning pre-refund traces. Differences from upstream, both forced by alloy-evm 0.39: the inspector is a type parameter of the EVM, so tracing paths build an inspected executor and enable the inspector only for the target transaction instead of calling `inspect_transaction_without_commit`; and there is no `set_block_access_index`, so the cached-BAL path still executes the target transaction on a bare EVM. Ports upstream's end-to-end test: a node whose block executor credits a settlement to every sender shows that prestate diffs, block traces and intermediate roots agree with committed state. Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> (cherry picked from commit 58c6608)
clippy's type_complexity rejects the return type of Call::block_executor since v2.7.0 wraps the provider in EvmStateProviderAdapter. Name the database StateCacheDb reads through instead.
op-will
force-pushed
the
af/carry-executor-replay
branch
from
November 11, 2026 18:58
0447ceb to
87070b5
Compare
op-will
enabled stacked auto-merge (rebase)
November 11, 2026 19:30
op-will
disabled stacked auto-merge
November 11, 2026 19:31
This was referenced Nov 12, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #40. Carries #37 onto
op-v2.7.0, soop-v2.7.0-0keeps the executor-routed RPC replays thatdevelopnow depends on.What
Cherry-picks
58c6608d3(#37,op-v2.6.0-4) with-x: the backport ofparadigmxyz/reth#28266, which replays a block's own transactions through the block executor indebug_*,trace_*andots_*RPCs.Why
ethereum-optimism/optimism#23942 merged today. It pins
op-v2.6.0-4, and itsrpc_replay_settlementtests fail without this patch: op-reth's SDM refund settlement is only visible to RPC replays that go through the executor. No upstream release up to v2.9.0 contains paradigmxyz#28266, so the monorepo's v2.7.0 bump has to carry the backport. The monorepo'srust/UPDATING-RETH.md("Carried patches") says the same forv2.7.0throughv2.8.1.How
Two conflicts, both from v2.7.0 changing code the backport touches:
crates/rpc/rpc-eth-api/src/helpers/call.rs: imports only. v2.7.0 addsStateProviderandreth_tasks::CancelOnDrop, and the backport addsStateProviderBox. Kept both.crates/rpc/rpc/src/trace.rs: thetrace_replay_block_transactionscallback. Took the backport's side, which uses theTracingCtxthe backport itself defines (the inspector owned, the result and database borrowed). v2.7.0's side usedtake_inspector()andinto_trace_results_with_state_partsfrom alloy-evm'sTracingCtx, which the backport replaces.One compile fix on top: the backport's new
Call::block_executornamed its databaseStateProviderDatabase<StateProviderBox>. In v2.7.0,StateProviderDatabasetakes anEvmStateProvider(paradigmxyz/reth#27109) andStateCacheDbwraps the box inEvmStateProviderAdapter, so the return type now saysStateProviderDatabase<EvmStateProviderAdapter<StateProviderBox>>.The backport's end-to-end test,
executor_replay.rs, was written for v2.6.0's e2e harness, which v2.7.0 replaced (paradigmxyz/reth#27432). It now launches its node withSettlingNode::test_setup_for(EthereumHardfork::Prague).build_single(), as upstream's version of the test does, instead ofsetupwith a hand-built Prague chain spec andeth_payload_attributes_for_fork. The two are equivalent:test_chain_spec(Prague)is mainnet's chain ID with the test genesis and every fork through Prague, and the builder's default payload attributes areeth_payload_attributesfor that spec. Upstream's version also enablescache_computed_bals, for the BAL path this backport doesn't carry, so that is left out.cargo test -p reth-node-ethereum --test e2e executor_replaypasses, and so do the unit tests ofreth-rpcandreth-rpc-eth-api. Formatted with thenightly-2026-07-14rustfmt thatlint.ymlpins.