Skip to content

op-reth: settle SDM refunds during canonical RPC replay - #23670

Closed
einar-oplabs wants to merge 14 commits into
developfrom
einar/sdm-settled-rpc-485
Closed

einar-oplabs wants to merge 14 commits into
developfrom
einar/sdm-settled-rpc-485

Conversation

@einar-oplabs

@einar-oplabs einar-oplabs commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Canonical transaction and block replays include SDM settlement, so debug gas, replayed balances/state diffs, and intermediate roots agree with execution. Related to ethereum-optimism/protocol-team#485; based on George’s #23615/#23616 with explicit canonical/diagnostic replay policies and preservation of supplied transaction environments.

Depends only on reth#26, which targets op-v2.6.0 directly. The separate security work in reth#27 and reth-core#1 is closed and dropped from the issue. Both workspace manifests and lockfiles retain their base dependency versions; no reth-core patch or compressor vendoring is included. Existing SP1 crypto patches remain unchanged. OP’s zstd 0.14 declaration is inherited from its base.

Coverage includes multiple imported transactions, an unrefunded gap, refund-dependent affordability, modified-environment replay, direct OTS/call-many checks, and traceChain success/error alignment. Raw/bad-block diagnostics retain permissive pre-refund behavior; parity call-frame gas keeps its existing convention. The branch preserves the main-selected monorepo revision and develop fixes, including Lagoon precompile limits.

This head, acbdd92a, merges develop as of November 3 and pins Reth #26 at e6d32dc3, the branch's single signed commit, whose hooks mirror the upstream port paradigmxyz/reth#28233: the trace context carries a borrowed ResultAndState, the database and an owned per-transaction inspector, canonical block tracing is its own method, and the transaction hooks return the same tuple as inspect_transaction_in_block. The override here follows that shape. Locally on this head the three canonical settlement tests and both raw-block cases pass, clippy with all features is clean, and the same three canonical tests fail on develop with only the test files applied: traced gas 53006 against receipt gas 53005, and the refund-dependent transaction rejected with insufficient funds. The previously validated pins were OP 300521cc and premium 0fed17d8 on Reth bf02003c, whose CI and published, smoke-tested OP images passed; premium#391 now pins this head. The earlier Reth #26 head, 470cfb96, contained the standard-test refactor and compact-checkout CI fix: all six replay cases use standard Rust tests and a shared assertion helper in trace/replay_tests.rs, included from trace/mod.rs. No new test dependencies are introduced; rstest, rstest_macros, and relative-path are removed, and the lockfile adds no packages relative to the release base. Production replay bodies are unchanged. On d87b1bb0, all 13 API unit tests, pinned-nightly all-features Clippy, formatting, locked dependency resolution, Zepter, and TOML checks pass locally; functional CI checks pass as well. Reth #26 keeps the fork's cargo-deny gate green with compatible lockfile patch updates and documented ignores for the zstd and crypto-bigint advisories that op-v2.6.0 cannot fix; the security prerequisite reth#27 and reth-core#1 are closed and dropped from the issue. Before landing OP, repin to the validated merged Reth fork tag; after OP merges, repin both premium workspaces to its merge commit. JS-tracer runtime parity, release-artifact/devnet verification, and rollout remain outstanding.

Companion: optimism-premium#391. Before landing OP, replace the temporary Reth revision with its validated merged fork tag. After OP merges, repin both premium workspaces to the merge commit. Keep this PR in draft pending review and the separate Reth merge-gate resolution.

Replay canonical transactions through one executor, preserving transaction
position and settled prefix state. Keep diagnostic block replay permissive
and execute custom transaction environments without recorded settlement.

Add regression fixtures for later targets, missing refund entries, refund-
dependent affordability, call-many state overrides, OTS errors, and traceChain.

Co-authored-by: geoknee <georgeknee@googlemail.com>
@einar-oplabs einar-oplabs self-assigned this Oct 26, 2026
Pin the combined Reth hook and security backport stack, and explicitly
patch the compressor in both the main and SP1 guest workspace roots.
Upgrade the main compression and Tokio dependencies while preserving
unrelated resolver choices and the existing SP1 crypto patches.

The independent SP1 SDK compression dependency remains outside this
Reth backport.
einar-oplabs and others added 4 commits November 1, 2026 15:55
Follows the reshaped fork hooks: the trace context carries a borrowed
`ResultAndState`, the database and an owned per-transaction inspector, so
the override hands each callback the inspector the executor's EVM ran and
installs the next one from `inspector_setup`. Canonical block tracing is
its own method, so the `BlockReplayMode` branch is gone, and the
transaction hooks return the same tuple as `inspect_transaction_in_block`.
Repins reth to the fork head carrying that API.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The fork branch was squashed into one signed commit with an identical
tree, so only the pinned revision and the mirror tags change.

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

Copy link
Copy Markdown
Contributor Author

Superseded by the executor routing approach in paradigmxyz/reth#28266

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.

1 participant