Skip to content

op-reth: pin the executor-routing reth fork and lock SDM-settled RPC replay - #23942

Merged
einar-oplabs merged 6 commits into
developfrom
einar/sdm-executor-replay-485
Nov 10, 2026
Merged

einar-oplabs merged 6 commits into
developfrom
einar/sdm-executor-replay-485

Conversation

@einar-oplabs

@einar-oplabs einar-oplabs commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Op-reth RPC replay must report the SDM-settled gas and balances committed by block execution.

Pins reth to op-v2.6.0-4, the merge commit of ethereum-optimism/reth#37 (backport of paradigmxyz/reth#28266). For ethereum-optimism/protocol-team#485; replaces #23670.

Regression tests cover debug and parity replays, settled prefixes, refund-dependent affordability, post-exec targets, intermediate roots, traceChain, otterscan, and executor rejection of raw or bad blocks. An alloy-op-evm unit test checks settlement before commit with an inspector enabled. UPDATING-RETH.md records the carried patch and tagging rules.

Pre-existing follow-ups: the default tracer reports failed: true for a post-exec target, and #23963 tracks the shared inspector slot. After merge, both op-reth-premium workspaces repin to the merge commit and the same tag.

Breakdown

Area Added Removed Netchanges
Implementation 0 0 0
Tests 1197 109 1088
Docs 40 4 36
Dependency pins 179 179 0
Total 1416 292 1124

AI Reviews

  • 2026-11-10T00:00:14Z a1cc642 GPT-6.1-Sol xhigh
  • 2026-11-09T23:56:18Z a1cc642 Fable 5.1 xhigh

…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>
@einar-oplabs
einar-oplabs force-pushed the einar/sdm-executor-replay-485 branch from 4e5f2f1 to 72603ef Compare November 6, 2026 14:48
…tures

Turns `rpc_replay_settlement` into a directory module with the sequenced
block in `fixture.rs` and one file per family: debug tracers against
receipts and committed state, parity replays and `trace_filter` against
`debug_accountAt`, synthetic calls on the settled prefix, the post-exec
transaction as a no-op target with intermediate roots, `traceChain`,
otterscan and affordability. Each test fails on its own family.

Fixture fixes from review: the raw block's transfer and deposit target an
EOA instead of the ecrecover precompile; the executor-rejection test
matches the call error's message rather than its `Debug` rendering; the
post-exec entry of a block trace is asserted at receipt gas; `eth_callMany`
surfaces the response error before reading the value; `traceChain` derives
its window from the fixture; the transaction count follows
`POST_EXEC_INDEX`; the no-op `no_tx_pool` assignment is gone. The
alloy-op-evm unit test now compares a Verify-mode result with a Disabled-mode
run, so it proves the refund and the saved operator fee are credited before
commit. The update guide names `v2.7.0` through `v2.8.1` as the alloy-evm
0.39 bases.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@einar-oplabs

Copy link
Copy Markdown
Contributor Author

GPT-6.1-Sol (xhigh): Reviewed at 5e3d04bd85. No actionable introduced issues found.

Checked the fork’s production changes, settlement behavior, deposit handling, and regression coverage.

Validation:

  • All 13 focused RPC tests passed.
  • The new settlement unit test passed.
  • CI at last check: 92 passed, 14 pending, no failures.

geoknee
geoknee previously approved these changes Nov 9, 2026
Comment thread rust/UPDATING-RETH.md Resolved
@geoknee

geoknee commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Claude: Summary for the inline review above, run at 5e3d04bd85. The inline comments cover lines in the diff; these points are in files the PR doesn't touch.

Overall: no blockers. The pin is a strict extension of op-v2.6.0-2, adding reth#38 (CI only) and reth#37. The tag resolves to reth#37's merge commit, and the lockfile has only the source swap. op-reth overrides none of the replay paths reth#37 changed. Canonical-block replays now match import: pre-execution runs once, the tx index lines up with the SDM refund entries, and deposits are unchanged. The main ask is the positive tracer assertion on debug_tracers.rs.

Comments this change makes wrong (outside the diff):

  • rust/alloy-op-evm/src/tests.rs:213: says trace_* goes through TxTracer::try_trace_many. After reth#37 it goes through the block executor, so that test now guards a path RPC no longer uses.
  • rust/alloy-op-evm/src/lib.rs:394-395: "Replay paths (e.g. RPC tracing) transact each transaction directly" is no longer true for RPC.
  • rust/op-reth/crates/node/tests/it/derived_attributes.rs:236-241: a verbatim copy of lagoon::chain_spec(), left behind when invalid_post_exec.rs was migrated.

Behaviour change worth noting: debug_traceBadBlock now fails the whole call when the executor rejects a tx, where it used to return pre-refund traces. That's consistent with the raw-block decision on reth#37, but no test covers it.

Pre-existing, not from this PR:

Possible follow-ups on the fork:

The debug tracer assertions now check what the tracer saw, not only the
settled result it was handed: every deployment steps through its init code,
only the reverting one fails, and the call frame is from the sender. The
synthetic-call refund check runs at a refunded slot, where a leaked refund
would show as gas below the intrinsic cost. A rejected bad block is traced
through `debug_traceBadBlock` and fails with the executor's reason, and
`traceChain` anchors its first trace to the settled deployment gas.

The alloy-op-evm Verify-mode test sends calldata so an operator fee is
charged at all, asserts the saved fee, and rewards a beneficiary distinct
from the sender, so the sender delta no longer nets a zero priority leg by
coincidence.

Also names the fixture's transaction indexes, uses `TRANSFER_GAS` for the
transfer's gas limit, matches the executor's rejection by substring, says
which checks are executor-path smoke tests, points the update guide at the
test directory, drops the Lagoon genesis duplicate from the derived
attributes test, and corrects two alloy-op-evm comments that still
described RPC replay as bare-EVM transacting.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@einar-oplabs

Copy link
Copy Markdown
Contributor Author

Fable 5.1 (high): Thanks. All inline should-fixes and nits are applied in 624ea26, with a reply on each thread. On the points outside the diff:

  • alloy-op-evm/src/tests.rs and alloy-op-evm/src/lib.rs: both comments corrected. The try_trace_many test now says it guards a consumer that iterates a block carrying a post-exec transaction through the tracer, and the lib.rs note names the bare-EVM caller that still exists (a replay positioned by a cached BAL).
  • derived_attributes.rs: the inline genesis is replaced by crate::lagoon::chain_spec().
  • debug_traceBadBlock: test_lagoon_new_payload_with_wrong_post_exec_block_number_is_invalid now traces the rejected block once it is in the bad-block cache and asserts the call fails with the executor's rejection reason.
  • Tag: the pin is op-v2.6.0-4, which resolves to reth#37's merge commit 58c6608d as you say; op-v2.6.0-2 is the pin on develop.
  • frame_start/frame_end forwarding is tracked in alloy-op-evm: move the SDM refund observer out of the EVM inspector slot #23963. The call-many budget backport (fix(rpc): bound eth_callMany, trace_callMany and debug_traceCallMany paradigmxyz/reth#28314) and the caller-less Trace::apply_pre_execution_changes are fork follow-ups, noted for the next fork move.

Comment thread rust/alloy-op-evm/src/lib.rs Resolved
The bad-block trace poll now has a ten-second deadline, the prestate-diff
balance loops assert the sender's balance is present before comparing, and
a `traceChain` timeout or closed subscription names the block it waited
for. The prefix `debug_traceCall` probes a no-code address instead of the
ecrecover precompile, and a missing sender in its prestate fails with a
message.

One launch helper, HTTP client accessor and signed-transaction builder in
`lagoon.rs` replace the three copies across the raw-block tests, the
fixture and the affordability test; a typed `call_trace` accessor replaces
the raw-JSON callTracer requests; the duplicated transfer step check in
the post-exec target test is gone. The alloy-op-evm `transact_raw` comment
states the local invariant instead of naming a reth caller.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@einar-oplabs

Copy link
Copy Markdown
Contributor Author

GPT-6.1-Sol (xhigh): Rereviewed fce2662. No new actionable findings; previous review feedback is addressed.

Reviewed the full diff and pinned reth changes. Validation passed: 14 focused integration tests and the settlement unit test. CI is green.

The raw-block rejection test formats its expected message from the typed
`BlockValidationError`, so it survives rewording and still proves which
error the executor returned. `SettledBlock` derives its HTTP client from
the node like it already does for WebSocket, the test launchers reduce to
`launch_node` and `launch_node_with_attributes` with `sdm_rollup_args()`,
and the engine test uses the shared client accessor. The node config no
longer repeats the unused-ports override that `NodeConfig::test()` already
applies, nor does the derived attributes test, and the launch doc no longer
claims the node stops when its handle drops.

The alloy-op-evm Jovian schedule lives in one `jovian_hardforks` helper
shared by the fixture and the Verify-mode settlement test.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@einar-oplabs

Copy link
Copy Markdown
Contributor Author

Fable 5.1 (xhigh): Reviewed 54e3691 (full diff against develop plus the pinned fork source). No correctness defects in the change; the pin is the tag resolving to reth#37's merge commit, the lockfile moves only the reth source, and every replay path the tests exercise goes through the block executor. Ten test-side and metadata notes, none blocking:

  1. affordability.rs:26: the exact-budget balance assumes zero L1 data and operator fees from the genesis fixture without asserting it; derive the budget from the first receipt's cost or assert the fee components are zero.
  2. PR title and squash subject say "drop the RPC replay override", but against develop nothing is dropped; the override only existed in op-reth: settle SDM refunds during canonical RPC replay #23670. The branch's first commit subject, "pin the executor-routing reth fork and lock SDM-settled RPC replay", describes the change.
  3. fixture.rs:123: client() now builds a new HttpClient per call, and the accessors call it dozens of times per test. This reverses the previous round's note; caching one client at sequence() and handing out a reference is the better of the two.
  4. lagoon.rs:107: the http_client doc names rpc_node_config as the precondition, but invalid_post_exec.rs uses it on an e2e-setup node; the real precondition is HTTP RPC enabled.
  5. trace_chain.rs:44: the tracer-config error test pins the fork's per-block error shape (error on tx 0, None after), which a later base may change without touching settlement.
  6. post_exec_target.rs:10: the doc says every tracer gives the post-exec transaction an empty trace, but failed: true from the default tracer is known and not asserted; assert it with a pointer to the follow-up, or narrow the doc.
  7. invalid_post_exec.rs:142: the retry keys on the substring "bad block not found in cache"; a rewording makes the first poll's error final and the assertion message points at the executor instead of the cache race.
  8. debug_tracers.rs:91: the prestate-diff balance loop is duplicated with only the balance source changed; a helper taking the resolver removes the copy.
  9. derived_attributes.rs:119: .with_unused_ports() on NodeConfig::test() is redundant, since test() already applies it.
  10. debug_trace_post_exec.rs:83: the TransactionGasLimitMoreThanAvailableBlockGas literal lists its fields non-alphabetically.

@einar-oplabs einar-oplabs changed the title op-reth: drop the RPC replay override and pin the executor-routing fork op-reth: pin the executor-routing reth fork and lock SDM-settled RPC replay Nov 9, 2026
`SettledBlock` creates its HTTP client when the block is sequenced and
hands out a reference, instead of building a new client with its own
connection pool on every accessor call.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@einar-oplabs

Copy link
Copy Markdown
Contributor Author

Fable 5.1 (xhigh): Reviewed a1cc642. No correctness defects. Checked against the pinned fork: the tag is reth#37's squash-merge commit with all lockfile entries moved and no stale -2 references; the dropped discv5 overrides were redundant; the tests' semantic assumptions hold (inclusive debug_accountAt, exclusive tx_index and eth_callMany prefix, executor errors propagated from trace_block, bad-block cache filled from the engine's InvalidBlock event). Seven notes, none blocking:

  1. affordability.rs:26: the exact budget assumes a zero L1 data fee, a zero operator fee and an effective price equal to gas_price; derive the first deployment's settled cost from debug_accountAt(0) or the receipt, or assert the zero-fee precondition.
  2. invalid_post_exec.rs:132: the bad-block poll retries only ClientError::Call cache misses; a transport error inside the window escapes the loop and fails with a misleading message. Retry non-Call errors too.
  3. debug_trace_post_exec.rs:83: the full-message comparison pins block_available_gas: 0, which depends on the deposit consuming exactly its limit; a change to the deposit turns the guard into a message mismatch. The reviewers disagree across rounds here (substring versus typed message); matching the variant's stable prefix is the middle ground.
  4. derived_attributes.rs:118: launch still hand-builds a node although lagoon::launch_node now exists and its inner is the FullNode this test needs.
  5. debug_tracers.rs:61: the post-balance loop is written twice against different balance sources; a helper taking the resolver removes the copy.
  6. fixture.rs:55: each family test sequences its own block, nine launches in total; the files with two tests over the same fixture could share one. This is the per-family split chosen in the author's review, so it is a deliberate trade.
  7. Field order: SDMGasEntry { index, gas_refund } in the new alloy-op-evm test and the TransactionGasLimitMoreThanAvailableBlockGas literal are not alphabetical.

@einar-oplabs

Copy link
Copy Markdown
Contributor Author

GPT-6.1-Sol (xhigh): Reviewed a1cc64227e38a9030c57d7815fa590a0d32681e7 against the PR merge base. No new actionable introduced issues found.

Reviewed the full diff, both added fork commits, inherited replay helpers, SDM transaction indexing and settlement, deposit handling, and the regression assertions. The fork retains all prior patches; the lockfile changes only the reth source. The final HTTP client change shares one connection pool across fixture accessors.

Validation: the settlement-before-commit unit test and cargo +nightly-2026-10-31 fmt --all -- --check passed. The integration-test rebuild stopped with No space left on device, so this review does not claim a fresh integration pass. CI at inspection: 43 passed, 31 pending, no failures.

Previously documented inspector and call-many follow-ups remain outside this PR. Forward review covered replay-related changes in cached upstream main through ad1b0fe4a35c; it was not a complete audit of newer upstream releases.

@einar-oplabs
einar-oplabs requested a review from geoknee November 10, 2026 10:33
@einar-oplabs
einar-oplabs added this pull request to the merge queue Nov 10, 2026
Merged via the queue into develop with commit 964ce53 Nov 10, 2026
114 of 116 checks passed
@einar-oplabs
einar-oplabs deleted the einar/sdm-executor-replay-485 branch November 10, 2026 16:58
aakoshh added a commit that referenced this pull request Nov 10, 2026
develop now pins op-v2.6.0-4 (#23942), which
carries ethereum-optimism/reth#37: RPC block replays through the block
executor, which op-reth's SDM refund settlement depends on. Carry it
onto op-v2.7.0 as ethereum-optimism/reth#41, stacked on
ethereum-optimism/reth#40, and pin its head.

Resolve the conflicts with #23942:

- Cargo.toml and Cargo.lock: keep the op-v2.7.0 rev, now
  ethereum-optimism/reth#41's head.
- UPDATING-RETH.md: keep both sides, and update "Carried patches" for
  op-v2.7.0: where ethereum-optimism/reth#37's carry conflicted on
  v2.7.0, and the trie seek boundary fix carried as
  ethereum-optimism/reth#40.
- invalid_post_exec.rs: develop's crate::lagoon helpers in the
  E2ETestSetupBuilder call reth v2.7.0 needs.

Adapt #23942's new tests to reth v2.7.0: trace_replayTransaction returns
an optional TraceResultsWithTransactionHash, and StateProviderDatabase
takes an EvmStateProvider. Advance the reth mirror tags;
ethereum-optimism/reth#41 touches no mirrored symbol.
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