Repository navigation
refactor(rpc): expose block replay hooks - #28233
Closed
einar-oplabs wants to merge 2 commits into
Closed
einar-oplabs wants to merge 2 commits into
einar-oplabs wants to merge 2 commits into
Conversation
Moves the debug_traceBlock*, debug_traceChain and debug_intermediateRoots loops out of DebugApi, and the trace_* block loop out of Trace::trace_block_until_with_inspector, into defaulted Trace methods, and adds Trace::inspect_canonical_transaction_in_block for replaying the signed transaction recorded at an index. Behavior is unchanged; the loop bodies move verbatim. Networks whose block execution changes state beyond the transactions themselves can override these to replay through their block executor without copying the RPC handlers, while raw and bad blocks keep the permissive bare-EVM path. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This was referenced Nov 1, 2026
einar-oplabs
marked this pull request as ready for review
November 1, 2026 22:01
einar-oplabs
requested review from
Rjected,
gakonst and
mattsse
as code owners
November 1, 2026 22:01
Author
|
Superseded by the executor routing approach in #28266 |
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.
Moves the
debug_traceBlock*,debug_traceChainanddebug_intermediateRootsloops out ofDebugApi, and thetrace_*block loop out ofTrace::trace_block_until_with_inspector, into defaultedTracemethods, and addsTrace::inspect_canonical_transaction_in_blockfor replaying the signed transaction recorded at an index. Behavior is unchanged: the loop bodies move verbatim and the defaults call each other exactly as the inlined code did, including the cached-BAL positioning and cancellation checks.This lets a downstream network change how a block is replayed without copying the RPC handlers. op-reth needs it because its block execution settles gas refunds after each transaction (the SDM feature of the Lagoon hardfork), so replaying a block through the bare EVM reports pre-settlement gas and balances on every trace and replay endpoint while receipts and committed state are correct. With these hooks op-reth replays canonical blocks and transactions through its block executor, and keeps
debug_traceBlock(raw) anddebug_traceBadBlockon the permissive bare-EVM path, which is why canonical and unvalidated block tracing are separate methods.The one new error path, a transaction index past the end of the block in the canonical hook, has a unit test. Alternative to #28047, which routes every chain's replay through the block executor. The same change on the v2.6.0 release line is ethereum-optimism#26.
🤖 Generated with Claude Code