Skip to content

op-reth: settle SDM refunds in per-transaction RPC replays - #23615

Closed
geoknee wants to merge 2 commits into
developfrom
geoknee/sdm-rpc-replay-per-tx
Closed

geoknee wants to merge 2 commits into
developfrom
geoknee/sdm-rpc-replay-per-tx

Conversation

@geoknee

@geoknee geoknee commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Step 1 of the plan in ethereum-optimism/protocol-team#485: fix the per-transaction RPC replay paths in op-reth alone, with no reth change.

On SDM blocks the RPC paths that replay a block's transactions run them on a bare EVM, so they report pre-refund gas and unsettled balances; only the block executor applies the settlement. OpEthApi now overrides Trace::replay_block_until, Trace::inspect_transaction_in_block and Call::spawn_replay_transaction to replay through the executor. That fixes debug_traceTransaction, trace_replayTransaction / trace_transaction / trace_get, ots_traceTransaction / ots_getTransactionError, and debug_traceCall / debug_traceCallMany / eth_callMany at a transaction index. The BAL argument these methods take is ignored: op-reth never caches a block access list.

Block-level paths (debug_traceBlock*, debug_intermediateRoots, traceChain, and trace_block / trace_replayBlockTransactions / trace_filter) are hard-coded loops in reth and still report pre-refund results. They need the reth extension points in ethereum-optimism/reth#25 and follow in a stacked PR.

debug_trace_post_exec.rs sequences a real refunded Lagoon block (moved from #23465) and checks the paths above against the receipt and the committed balances. It fails on develop (debug_traceTransaction gas 53006, receipt 53005) and passes here; the op-reth it suite passes and clippy is clean.

🤖 Generated with Claude Code

geoknee and others added 2 commits October 23, 2026 16:14
Sequences a real refunded Lagoon block and checks debug_traceTransaction, debug_traceCall at an index and trace_replayTransaction against the receipt and the committed balances. Fails on develop: traces report pre-refund gas.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OpEthApi overrides Trace::replay_block_until, Trace::inspect_transaction_in_block and Call::spawn_replay_transaction to replay through the block executor, which applies the SDM settlement keyed by each transaction's position. Fixes debug_traceTransaction, trace_replayTransaction / trace_transaction / trace_get, ots_traceTransaction / ots_getTransactionError, and debug_traceCall / debug_traceCallMany / eth_callMany at a transaction index.

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

Copy link
Copy Markdown
Contributor

Superseded by #23670, which combines the per-transaction and block-level overrides on ethereum-optimism/reth#26. 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