Skip to content

fix: pick upstream RPC, p2p and storage fixes onto op-v2.7.0 - #44

Merged
sebastianst merged 11 commits into
op-v2.7.0from
seb/op-v2.7.0-forward-fixes
Nov 12, 2026
Merged

sebastianst merged 11 commits into
op-v2.7.0from
seb/op-v2.7.0-forward-fixes

Conversation

@sebastianst

@sebastianst sebastianst commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Picks upstream fixes newer than v2.7.0 onto op-v2.7.0, for the op-v2.7.0-1 tag. A forward sweep of the reth update review (ethereum-optimism/optimism#24024) found them. Please rebase-merge, so each pick keeps its own commit and (cherry picked from commit …) line.

Fixes:

paradigmxyz#27462 (cancel long blocking jobs once their request is dropped) is included because paradigmxyz#28253's loop calls its is_cancelled().

Upstream wrote paradigmxyz#27462, paradigmxyz#28253 and paradigmxyz#28314 on top of its evm2 refactor, so they are hand-ported to revm 43 / alloy-evm 0.39. Each of these commits says in its message what was adapted. An independent review against upstream found them faithful: the same limits, errors and gas accounting (EIP-7623 floor, state gas). The out-of-gas classification covers OP's OpHaltReason, and deposit and post-exec transactions can't reach the budgets.

paradigmxyz#28370 alone made test_engine_tree_fcu_reorg_with_all_blocks_v2_e2e fail about 1 run in 6. That was a real race, not a test artifact: during an on-disk reorg, a reader could decode the tip header's last value from stale bytes past its offset, and newPayload rejected a valid block as INVALID. Upstream avoids it with paradigmxyz#27678, so paradigmxyz#27719 and paradigmxyz#27678 are picked before it. With them, the test passes 24 of 24 runs.

Not included:

  • The .expect("fee is always valid") in eth_callBundle can panic on pre-London state when a base_fee override exceeds a transaction's fee cap. Every OP chain has London active, and upstream's fix exists only inside the evm2 refactor (refactor!: replace revm with evm2 paradigmxyz/reth#25002), so this PR leaves it.
  • The other forward-sweep findings were rated LOW for op-reth. A second sweep, up to current upstream main, picks candidates for op-v2.7.0-2.

All picks except paradigmxyz#27462, paradigmxyz#27719 and paradigmxyz#27678 are newer than v2.8.1 and must be carried again onto op-v2.8.1.

op-reth's own copies of get_proof and build_pending_env get the matching fixes in ethereum-optimism/optimism#24077 and ethereum-optimism/optimism#24078.

🤖 Co-created with Claude Opus 5.5

mattsse and others added 11 commits November 11, 2026 21:23
…adigmxyz#27462)

Picked as a prerequisite of the eth_callBundle bound (paradigmxyz#28253), whose
transaction loop stops on reth_tasks::cancel::is_cancelled().

Adapted: the fork's backport of paradigmxyz#28266 replays block transactions through
the block executor. The cancellation checks upstream placed in the replaced
EVM loops go into the executor loops instead (replay_transactions_until_with_executor,
trace_block_until_with_inspector and debug intermediate roots), as upstream
did when paradigmxyz#28266 landed.

Co-authored-by: Matthias Seitz <19890894+mattsse@users.noreply.github.com>
(cherry picked from commit 13a59de)
)

Co-authored-by: Matthias Seitz <19890894+mattsse@users.noreply.github.com>
(cherry picked from commit 0d1324f)
Co-authored-by: Matthias Seitz <19890894+mattsse@users.noreply.github.com>
(cherry picked from commit 22e3708)
Adapted: the test imports StorageSlot from reth_revm::db::states (revm 43)
instead of reth_trie_common::bundle_state, which wraps evm2 types upstream.

(cherry picked from commit 3c8b4e8)
Adapted to revm 43 / alloy-evm 0.39, which this base still runs instead of
evm2:
- EIP-8037 detection reads `cfg_env.enable_amsterdam_eip8037` and the cap
  `Cfg::tx_gas_limit_cap()` instead of `version().feature(EIP8037)` and
  `version().tx_gas_limit_cap`, the same values alloy-evm's block executor
  admits transactions with.
- Per-transaction regular and state gas come from
  `ResultGas::block_regular_gas_used()` / `block_state_gas_used()`, which
  compute what evm2's `execution_gas_spent()` / `state_gas_spent()` do.
- The block gas limit is a u64 on the base's block env, and the loop keeps
  the base's peekable iteration and deferred commit.

(cherry picked from commit 329fcfc)
…aradigmxyz#28314)

Adapted to revm 43 / alloy-evm 0.39, which this base still runs instead of
evm2. The limits, error variants, messages and codes are upstream's.
- `CallManyBudget::admit` takes the call's `TransactionEnvMut` tx env
  directly; the base's call env is not wrapped in `Recovered`.
- `CallManyBudget::charge` takes revm's `ExecutionResult<H>`. evm2's
  "out of gas, except MemoryLimitOOG" check becomes a halt with any
  `OutOfGasError` except `MemoryLimit`, matched through `H::from(HaltReason)`
  so it also covers wrapping halt reasons such as op-revm's.
- The base's trace_callMany and debug_traceCallMany pass the tx env by value
  and an `&mut` inspector, so the budget calls wrap those `inspect` calls.
- The budget's unit tests build revm `TxEnv`s and `ExecutionResult`s instead
  of evm2 envelopes and `TxResultExt`s; the core.rs test imports TraceType,
  BlockingTaskGuard and Runtime, which upstream's test module got through
  imports this base lacks.

Not picked: 13a59de (paradigmxyz#27462) is not needed by this bound; it is in this
stack only for paradigmxyz#28253's cancellation check.

(cherry picked from commit faf670e)
…xyz#27716)

Co-authored-by: Matthias Seitz <19890894+mattsse@users.noreply.github.com>
(cherry picked from commit b5dc94c)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
(cherry picked from commit 9e10691)
Co-authored-by: Matthias Seitz <19890894+mattsse@users.noreply.github.com>
(cherry picked from commit b5e7d63)
…8423)

Co-authored-by: Matthias Seitz <19890894+mattsse@users.noreply.github.com>
(cherry picked from commit c050a76)

@aakoshh aakoshh left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TL;DR: I think this PR can be merged as is. Below is a list of other upstream PRs we could cherry-pick alongside the included ones; I couldn't tell from the description why they were left out. Could you say for each group whether it was considered and why it was left out? Any you agree should go in can be a follow-up PR, so they don't hold this one up.

The picks themselves check out. I range-diffed each commit against its upstream original:

  • 7 picks are identical apart from the (cherry picked from …) line and hunk context.
  • Each of the 4 hand-ports changes only what its message says:
    • paradigmxyz#27462 covers every cancellation site; the two missing ones are folded into replay_transactions_until_with_executor.
    • paradigmxyz#28253's admission uses the same block_regular_gas_used/block_state_gas_used/tx_gas_limit_cap as alloy-evm 0.39's block executor.
    • paradigmxyz#28314's out-of-gas list maps 1:1 onto evm2's is_out_of_gas() minus MemoryLimitOOG.
    • paradigmxyz#28148 only changes a test import.

No upstream commit reverts or fixes any of the picks.

I couldn't see the forward-sweep report, so I rebuilt the candidate list: 505 upstream commits newer than v2.7.0 (--cherry-pick against this branch), 263 of them fix/perf, about 210 after dropping CI/bench/build/test-only ones. Can you share the report, or say why these were left out? "Left for v2.8.1" can't apply to anything newer than v2.8.1.

Follow-ups to picked work

Same class as the HIGH picks (resource bounds, liveness), newer than v2.8.1

Snap serving. Does op-reth serve snap at this base? If so: paradigmxyz#28375 (a range proof can reserve GBs), paradigmxyz#28367 (alloy-trie 0.9.9 panic fix; this base locks 0.9.7), paradigmxyz#28378, paradigmxyz#28392 (serves partially downloaded state) and paradigmxyz#28401 (a peer can grow the shared changeset cache).

In v2.8.1 (so they come with the next bump), but they look urgent enough to ask whether waiting was decided per fix: paradigmxyz#27270 (sparse trie reuse fork safety), paradigmxyz#27952 (WS origin allowlist), paradigmxyz#27864 and paradigmxyz#27866 (IPC oversized requests), paradigmxyz#27903 (JS tracer timeout), paradigmxyz#27465 (otterscan tracing permits), paradigmxyz#27842 (pending inbound rate limit), paradigmxyz#27868 and paradigmxyz#27722 (discv4 pong/neighbours source IP).

Exclusions I checked and agree with

Description nits

  • paradigmxyz#28423: before the fix, a second remove_peer on a disconnecting peer dropped its entry, because is_connected() excludes Disconnecting*. The close handler then never released the slot. So the slot leaked rather than being "freed twice".
  • Where does the "roughly 240 MB per message" figure for paradigmxyz#28403 come from? Upstream doesn't give one.

Carrying forward. Only paradigmxyz#27462, paradigmxyz#27719 and paradigmxyz#27678 are in v2.8.1. The other 8 picks (paradigmxyz#28148 v2.9.0, paradigmxyz#28253 v2.10.0, the rest v2.11.0 only) have to be carried again on op-v2.8.1. Could they go in the guide's "Carried patches" list, together with the op-reth follow-ups for get_proof and build_pending_env? I couldn't find issues for those two.

@sebastianst
sebastianst merged commit ed91041 into op-v2.7.0 Nov 12, 2026
30 checks passed
@sebastianst
sebastianst deleted the seb/op-v2.7.0-forward-fixes branch November 12, 2026 13:04
@sebastianst

Copy link
Copy Markdown
Member Author

🤖 Opus 5.5 says: Thanks for the review. Merged, and op-v2.7.0-1 gets tagged once fork CI passes on the merge commit.

Forward sweep. It covered v2.7.0 up to upstream main at 6f1d966 (paradigmxyz#28438, yesterday 15:41 UTC), not just v2.8.1. So "left for v2.8.1" in the description was wrong for the main-only findings; it's fixed now. The report is session notes, not a shareable doc, but it rated paradigmxyz#28364, paradigmxyz#28428, paradigmxyz#28360, paradigmxyz#28332, paradigmxyz#28280 and paradigmxyz#28345 LOW for op-reth, and paradigmxyz#27270 practically unreachable on OP (its cross-fork reuse is keyed on the parent state root). Snap serving isn't reachable at this base, so the snap group doesn't apply.

That leaves two gaps you found: paradigmxyz#28453 and paradigmxyz#28454 merged after that tip, and several of your candidates were in range with no recorded verdict (paradigmxyz#28251, paradigmxyz#28312/paradigmxyz#28390, paradigmxyz#28326, paradigmxyz#28198, paradigmxyz#28420, paradigmxyz#27952, paradigmxyz#27864/paradigmxyz#27866). A second sweep, up to current main, now gives a verdict on every item in your list. Its picks go into a follow-up PR for op-v2.7.0-2. The libmdbx monitor lock inversion (paradigmxyz#28254 + paradigmxyz#28404) and the paradigmxyz#28453 timeout that completes paradigmxyz#28253 are the likely ones.

Nits. Both fixed in the description. paradigmxyz#28423 now says the slot leaked. The 240 MB was our own estimate for a 10 MiB message, not an upstream figure, and the description now says so.

Carrying forward. Agreed. A monorepo PR adds the picks newer than v2.8.1 to the "Carried patches" list in UPDATING-RETH.md. The get_proof and build_pending_env follow-ups are PRs, not issues: ethereum-optimism/optimism#24077 and ethereum-optimism/optimism#24078.

@sebastianst

Copy link
Copy Markdown
Member Author

🤖 Opus 5.5 says: op-v2.7.0-1 is tagged on ed91041, and ethereum-optimism/optimism#24077 and ethereum-optimism/optimism#24078 now pin it.

The second sweep ran up to upstream main at 5588697 and gave a verdict on every candidate in your list. Nothing affects consensus, so we're not cutting op-v2.7.0-2 for now:

Your guide suggestions go into a separate monorepo PR.

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.

6 participants