Skip to content

refactor(rpc): make block replays overridable - #25

Closed
geoknee wants to merge 1 commit into
op-v2.6.0from
geoknee/rpc-replay-extension-points
Closed

geoknee wants to merge 1 commit into
op-v2.6.0from
geoknee/rpc-replay-extension-points

Conversation

@geoknee

@geoknee geoknee commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

Moves the per-block replay loops behind defaulted Trace methods, so an EthApi whose block executor keeps per-transaction state can replay blocks through the executor instead of a bare EVM: trace_block_transactions (backing trace_block_until_with_inspector, so the trace_* and ots_* block traces), debug_trace_block_transactions (debug_traceBlock*, debug_traceBadBlock), debug_trace_chain_block_transactions (traceChain) and block_intermediate_roots (debug_intermediateRoots). The bodies are moved unchanged, so behavior is the same on every chain.

Block-trace callbacks get a reth-owned TracingCtx with a public constructor, because alloy-evm's has private fields and can only be built by its TxTracer; the default loop keeps TxTracer's semantics. The context borrows the execution result instead of owning it.

This is the reth half of the plan in ethereum-optimism/protocol-team#485: op-reth overrides these methods to settle SDM refunds, and the change is a candidate for upstream. Supersedes #24 for that purpose.

🤖 Generated with Claude Code

Move the per-block replay loops behind defaulted `Trace` methods so an
`EthApi` whose block executor keeps per-transaction state can replay
through it: `trace_block_transactions` (backing
`trace_block_until_with_inspector`), `debug_trace_block_transactions`,
`debug_trace_chain_block_transactions` and `block_intermediate_roots`.
The bodies are unchanged. Callbacks get a reth-owned `TracingCtx` that
can be constructed outside the crate, since alloy-evm's can't; it
borrows the execution result.

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

Copy link
Copy Markdown

Superseded by #26, which derives from this extension-point design with explicit canonical versus diagnostic replay and an owned callback result. Tracked in ethereum-optimism/protocol-team#485. Closing as superseded; branch kept.

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.

2 participants