Skip to content

feat(rpc): replay block transactions through the block executor - #28266

Merged
mattsse merged 10 commits into
mainfrom
klkvr/executor-replays
Nov 6, 2026
Merged

mattsse merged 10 commits into
mainfrom
klkvr/executor-replays

Conversation

@klkvr

@klkvr klkvr commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #26614, alternative to #28047 / #28233.

RPC replays of a block's own transactions (debug_* tracing, trace_*, ots_*, intermediate roots, call prefixes) now run through the block executor instead of a bare EVM, so executors that adjust results on top of the EVM (e.g. OP SDM settlement) get traces that match their receipts. The BAL path still executes only the target transaction, positioned via set_block_access_index.

@klkvr
klkvr requested review from Rjected and mattsse as code owners November 3, 2026 21:22
@tempoxyz-bot

tempoxyz-bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

👁️ Cyclops Security Review

✅ Reviewed 5b17afe (latest) · Coverage: partial · no open findings · report
⚠️ Not checked: Incremental push: result().clone() replaced with into_result() in RPC replay paths: ruled out without reading the cited code at this commit
⚠️ Not checked: Consuming detached replay outputs in the BAL and prefix-replay branches: ruled out without reading the cited code at this commit
⚠️ Not checked: Consuming the detached output returned by transaction inspection: ruled out without reading the cited code at this commit

# Severity Finding Introduced Status
1 🟡 Medium inspect_transaction_without_commit panics when executor clears the EVM inspector 04378da ✅ Fixed in a71a626
2 🟡 Medium Evm::take_inspector downcast lets safe code extend inspector lifetimes to 'static 04378da ✅ Fixed in a71a626
3 🟢 Low TracedInspector drops inspector_config, forcing per-opcode hooks in RPC tracing ab2eec9 ✅ Fixed in f6559b0

Comment thread crates/evm/evm/src/execute.rs Resolved
Comment thread crates/evm/evm/src/execute.rs Resolved
einar-oplabs added a commit to ethereum-optimism/reth that referenced this pull request Nov 5, 2026
Ports the end-to-end test from paradigmxyz#28266: 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>
Comment thread crates/evm/evm/src/execute.rs Resolved
klkvr added a commit to alloy-rs/evm2 that referenced this pull request Nov 6, 2026
Adds `BlockTransactionResult::into_result`, so callers that own a
detached transaction output can take its `TxResultWithState` without
cloning the pending state.

reth needs it to replay block transactions through the block executor
(paradigmxyz/reth#28266) without copying each traced transaction's
write-set.
@klkvr
klkvr requested a review from gakonst as a code owner November 6, 2026 04:32
einar-oplabs added a commit to ethereum-optimism/reth that referenced this pull request Nov 6, 2026
…paradigmxyz#28266)

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>
einar-oplabs added a commit to ethereum-optimism/reth that referenced this pull request Nov 6, 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>
einar-oplabs added a commit to ethereum-optimism/optimism that referenced this pull request Nov 6, 2026
…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 <noreply@anthropic.com>
@mattsse
mattsse added this pull request to the merge queue Nov 6, 2026
Merged via the queue into main with commit 19d390a Nov 6, 2026
53 checks passed
@mattsse
mattsse deleted the klkvr/executor-replays branch November 6, 2026 20:31
dome pushed a commit to ThaiFi/thbos that referenced this pull request Nov 9, 2026
Automated nightly update of reth dependencies from `paradigmxyz/reth`
main branch.

## Upstream reth changes


[`0973a13...5efe80f`](paradigmxyz/reth@0973a13...5efe80f)

🔗 Amp thread:
https://ampcode.com/threads/T-01a1be48-3fc2-73b5-a136-e526759a67bc
- **RPC**
- Cap default `eth_call` gas, reject conflicting transaction fees, and
respect namespace selection defaults
([#28315](paradigmxyz/reth#28315),
[#28324](paradigmxyz/reth#28324),
[#28327](paradigmxyz/reth#28327)).
- Replay block transactions through the block executor and support
bad-block replay in `debug_intermediateRoots`
([#28266](paradigmxyz/reth#28266),
[#28331](paradigmxyz/reth#28331)).
- Update evm2, fixing a tracer panic on frameless logs
([#28318](paradigmxyz/reth#28318),
[#28330](paradigmxyz/reth#28330)).
- **EVM / Perf**
- Parallelize EIP-7702 authorization recovery
([#28307](paradigmxyz/reth#28307)).
- **Trie**
- Return an error when a proof job panics
([#28313](paradigmxyz/reth#28313)).
- **Networking**
- Prevent pending sessions and the listener from being starved under
load; truncate status payloads in handshake decode logs
([#28332](paradigmxyz/reth#28332),
[#28322](paradigmxyz/reth#28322)).
- **CLI / IPC**
- Reject zero blocks per archive and enforce IPC socket permissions
([#28328](paradigmxyz/reth#28328),
[#28326](paradigmxyz/reth#28326)).
- **Maintenance**
- Bump to v2.10.1 and upgrade dependencies
([#28319](paradigmxyz/reth#28319),
[#28329](paradigmxyz/reth#28329)).

## Migrations

🔗 Amp thread:
https://ampcode.com/threads/T-01a1be48-7ee3-72e7-ac8e-8bdd6d38b88c
- Updated all Git-pinned Reth dependencies from `0973a138` to
`5efe80f5`, keeping them aligned on the new upstream revision.
- Updated `evm2`, `evm2-macros`, and `evm2-jit` from `baf0d38f` to
`37fb326b`, including all `DaniPopes/evm2` patch overrides, to keep
direct and patched dependencies aligned.

[GitHub
Workflow](https://github.com/tempoxyz/tempo/actions/runs/42554287121)
op-will pushed a commit to ethereum-optimism/reth that referenced this pull request 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)
op-will pushed a commit to ethereum-optimism/reth that referenced this pull request 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)
sebastianst pushed a commit to ethereum-optimism/reth that referenced this pull request Nov 12, 2026
…adigmxyz#27462)

Picked as a prerequisite of the eth_callBundle bound (paradigmxyz#28253), whose
transaction loop stops on reth_tasks::cancel::is_cancelled().

Adapted: the fork's backport of paradigmxyz#28266 replays block transactions through
the block executor. The cancellation checks upstream placed in the replaced
EVM loops go into the executor loops instead (replay_transactions_until_with_executor,
trace_block_until_with_inspector and debug intermediate roots), as upstream
did when paradigmxyz#28266 landed.

Co-authored-by: Matthias Seitz <19890894+mattsse@users.noreply.github.com>
(cherry picked from commit 13a59de)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants