Skip to content

fix(rpc): replay block txs through the executor - #28047

Closed
geoknee wants to merge 3 commits into
paradigmxyz:mainfrom
geoknee:geoknee/rpc-replay-through-executor
Closed

geoknee wants to merge 3 commits into
paradigmxyz:mainfrom
geoknee:geoknee/rpc-replay-through-executor

Conversation

@geoknee

@geoknee geoknee commented Oct 20, 2026 •

Copy link
Copy Markdown

Follow-up to #26614. The RPC helpers that replay a block's own transactions without a cached BAL run them on a bare EVM, so per-transaction work done by the block executor is skipped, and an executor that settles per transaction, like OP Stack's SDM gas refunds, gets results that disagree with its receipts, state and header. Those replays (debug_traceTransaction, debug_traceBlockByHash / ByNumber, traceChain, trace_*, ots_*, debug_intermediateRoots, and calls at a transaction index) now go through executor_for_block. The cached-BAL paths from #24097 are unchanged, and debug_traceBlock (raw RLP) and debug_traceBadBlock keep the bare EVM so blocks the executor would reject still trace. On Ethereum, results for valid blocks are unchanged.

TxTracer can't drive an executor, so trace_block_until_with_inspector has its own loop and a local TracingCtx that borrows the result; method signatures are otherwise unchanged. replay_transactions_until_with_evm has no callers left and is removed.

Draft until a regression test lands: like #26614, it needs a test executor, here one that settles per transaction.

🤖 Generated with Claude Code

The RPC helpers that replay a block's own transactions ran them on a
bare EVM, so per-transaction logic that lives in the block executor was
skipped. An `EvmConfig` whose executor settles something per transaction
then got traces, replayed state and intermediate roots that disagree
with the receipts and the header.

Prefix replays now go through `executor_for_block`, and traced
transactions run on an executor built over the inspected EVM via
`execute_transaction_without_commit`. alloy-evm's `TxTracer` is replaced
by an executor loop with a local `TracingCtx` of the same public shape.

`replay_block_until` keeps the cached-BAL shortcut, since a BAL is the
executor's own post-state. `inspect_transaction_in_block` and
`spawn_replay_transaction` no longer use it, because attaching the BAL
ran the target transaction on a bare EVM.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@geoknee

geoknee commented Oct 20, 2026 •

Copy link
Copy Markdown
Author

Tracking downstream: the same change on our v2.6.0-based fork is ethereum-optimism#24, and ethereum-optimism/optimism#23465 is the OP Stack regression test that pins it.

@geoknee geoknee changed the title fix(rpc): replay block transactions through the block executor fix(rpc): replay block txs through the executor Oct 20, 2026
geoknee and others added 2 commits October 20, 2026 18:10
`replay_transactions_until_with_evm` and `Trace::apply_pre_execution_changes` have no callers left once replays go through the block executor, and both replay outside it. `TracingCtx` now borrows the execution result instead of cloning it per transaction, and the inspector is no longer reset after the last traced transaction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The cached-BAL paths from paradigmxyz#24097 run the target on its own again, as before this PR, so tracing keeps its fast path, and `inspect_transaction_in_block` keeps its signature. `debug_traceBlock` (raw RLP) and `debug_traceBadBlock` keep the bare EVM so blocks the executor would reject still trace; canonical block tracing goes through the executor. `Trace::apply_pre_execution_changes` is back for the bare path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@geoknee

geoknee commented Nov 17, 2026

Copy link
Copy Markdown
Author

Superseded #28266

@geoknee geoknee closed this Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-stale This issue/PR is stale and will close with no further activity

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant