Skip to content

feat!(rust): upgrade alloy-evm to 0.30.0, bump reth to 082c36e, remove op feature#19854

Open
theochap wants to merge 5 commits intodevelopfrom
alloy-op-evm-0.30.0
Open

feat!(rust): upgrade alloy-evm to 0.30.0, bump reth to 082c36e, remove op feature#19854
theochap wants to merge 5 commits intodevelopfrom
alloy-op-evm-0.30.0

Conversation

@theochap
Copy link
Copy Markdown
Member

@theochap theochap commented Apr 1, 2026

Summary

  • Upgrade alloy-evm from 0.27.2 to 0.30.0 and bump alloy-op-evm to 0.30.0
  • Bump reth from v1.11.3 / f0d07c3 to 082c36e (uses reth-rpc-traits from crates.io)
  • Bump revm 34 → 36, op-revm 15 → 17, and related crates
  • Remove the op feature flag from alloy-evm and reth-rpc-eth-api dependencies entirely

Key changes

  • alloy-op-evm: Add OpTx newtype with trait impls (FromRecoveredTx, FromTxWithEncoded, IntoTxEnv, TransactionEnvMut) previously behind alloy-evm's op feature. Default OpEvm/OpEvmFactory Tx param to OpTx. Adapt to alloy-evm 0.30 API changes (TxResult::into_result, BlockExecutorFactory::create_executor signature, BlockEnv::slot_num via EIP-7843 tracked in Support EIP-7843 slot_num in BlockEnv for OP Stack #19853, removal of set_state_clear_flag).
  • op-alloy-rpc-types: Add reth feature with reth-rpc-traits impls (FromConsensusTx, TryIntoSimTx, SignableTxRequest) for OP types.
  • op-reth: Add OpTxEnvConverter to handle OpTransactionRequestOpTx conversion via TxEnvConverter trait (bypasses orphan rule). Wire it into OpRpcConvert. Remove op feature from reth-rpc-eth-api.
  • Workspace: Reorganize reth deps in Cargo.toml — crates.io-published crates (reth-codecs, reth-primitives-traits, reth-rpc-traits, reth-zstd-compressors) listed separately from git deps. Remove stale [patch.crates-io] entries (only rollup-boost patches remain).

Test plan

  • cargo check --workspace passes
  • cargo clippy --workspace -- -D warnings passes
  • cargo test -p alloy-op-evm — all 24 tests pass
  • cargo test --workspace --doc — all doctests pass
  • cargo +nightly fmt --check passes
  • RUSTDOCFLAGS="--cfg docsrs -D warnings" cargo +nightly doc --workspace --all-features --no-deps passes
  • zepter passes
  • CI: memory-all-* failures are pre-existing acceptance test infra issues

🤖 Generated with Claude Code

Important note

Bump MSRV to 1.94

@theochap theochap requested a review from a team as a code owner April 1, 2026 14:26
@wiz-inc-a178a98b5d
Copy link
Copy Markdown

wiz-inc-a178a98b5d bot commented Apr 1, 2026

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations 1 High 1 Medium 1 Low 1 Info
SAST Finding SAST Findings 1 Medium
Software Management Finding Software Management Findings -
Total 1 High 2 Medium 1 Low 1 Info

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

@theochap theochap force-pushed the alloy-op-evm-0.30.0 branch 2 times, most recently from 56ee35e to 070105c Compare April 1, 2026 14:32
….30.0

Update alloy-op-evm to work with alloy-evm 0.30.0, which removes the
'op' feature and bumps revm to v36. Key changes:

- Remove 'op' feature from alloy-evm dependency
- Bump revm 34->36, op-revm 15->17, and related crates
- Add OpTx newtype wrapper with trait impls (FromRecoveredTx,
  FromTxWithEncoded, IntoTxEnv, etc.) previously in alloy-evm's op feature
- Default OpEvm/OpEvmFactory Tx parameter to OpTx
- Add into_result() to TxResult impl
- Remove set_state_clear_flag (removed in revm 36)
- Handle new BlockEnv::slot_num field (EIP-7843)
- Update BlockExecutorFactory::create_executor signature for new API
- Bump alloy-op-evm version to 0.30.0
@theochap theochap force-pushed the alloy-op-evm-0.30.0 branch from 070105c to 60ece10 Compare April 1, 2026 14:38
theochap added 3 commits April 1, 2026 10:57
….24.0

Upgrade the Rust workspace dependencies:

- reth: v1.11.3 tag -> main @ e3dbdbb
- reth-core: reth-codecs, reth-primitives-traits, reth-zstd-compressors moved to crates.io 0.1.0
- revm: 34 -> 36, op-revm: 15 -> 17, revm-inspectors: 0.34 -> 0.36
- alloy-evm: 0.27.2 -> 0.29.2, alloy main crates: 1.6.3 -> 1.8.2
- alloy-chains: 0.2.30 -> 0.2.33, alloy-eip7928: 0.3.2 -> 0.3.3
- op-alloy crates: 0.23.1 -> 0.24.0, alloy-op-evm: 0.26.3 -> 0.28.0
- rollup-boost: crates.io 0.7.13 -> git bc4518c
- Rust toolchain: 1.92 -> 1.94

Key changes:
- Removed stale op features from reth-db, reth-db-api, reth-primitives-traits, reth-codecs, reth-payload-primitives
- Removed edge feature (no longer in reth)
- Added InMemorySize, Compact, Compress, Decompress, SignerRecoverable impls for OP types in op-alloy-consensus (behind reth-core/reth-codec features)
- Adapted to reth API changes: StateProvider, Decompress, BlockEnv, TxResult, TaskSpawner -> Runtime, PayloadTypes, TryIntoTxEnv, etc.
- Introduced OpExecData/OpPayloadAttrs newtypes for orphan rule compliance with ExecutionPayload/PayloadAttributes traits
- Updated Dockerfile and CI config for Rust 1.94
- Fixed zepter feature propagation
Inline the PayloadAttributesBuilder logic directly into
OpLocalPayloadAttributesBuilder, removing the dependency on the
upstream reth-engine-local 'op' feature flag entirely.
Make proof history conditional on L2ELConfig.ProofHistory and enabled
by default (matching previous behavior). Also capture stderr from
proofs init to aid debugging if it fails.
@theochap theochap force-pushed the alloy-op-evm-0.30.0 branch from 1ddbe02 to 2d50d08 Compare April 1, 2026 16:01
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 53.22196% with 392 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.0%. Comparing base (3b2194d) to head (c52d477).
⚠️ Report is 16 commits behind head on develop.

Files with missing lines Patch % Lines
rust/alloy-op-evm/src/tx.rs 38.1% 81 Missing ⚠️
rust/op-reth/crates/payload/src/payload.rs 49.6% 81 Missing ⚠️
rust/op-reth/crates/node/src/node.rs 10.4% 43 Missing ⚠️
rust/op-alloy/crates/consensus/src/reth_codec.rs 82.1% 36 Missing ⚠️
rust/op-alloy/crates/consensus/src/reth_core.rs 21.4% 33 Missing ⚠️
rust/op-alloy/crates/rpc-types/src/reth_compat.rs 0.0% 25 Missing ⚠️
rust/op-reth/crates/cli/src/app.rs 0.0% 13 Missing ⚠️
rust/op-reth/crates/evm/src/tx.rs 0.0% 12 Missing ⚠️
rust/op-reth/crates/rpc/src/debug.rs 0.0% 10 Missing ⚠️
rust/op-reth/crates/payload/src/traits.rs 46.1% 7 Missing ⚠️
... and 24 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #19854      +/-   ##
===========================================
+ Coverage     75.3%    76.0%    +0.7%     
===========================================
  Files          195      688     +493     
  Lines        11343    73263   +61920     
===========================================
+ Hits          8544    55720   +47176     
- Misses        2655    17399   +14744     
  Partials       144      144              
Flag Coverage Δ
cannon-go-tests-64 66.4% <ø> (ø)
contracts-bedrock-tests 80.7% <ø> (+0.5%) ⬆️
unit 76.1% <53.2%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
rust/alloy-op-evm/src/env.rs 84.0% <ø> (ø)
rust/alloy-op-evm/src/lib.rs 89.3% <100.0%> (ø)
.../bin/client/src/fpvm_evm/precompiles/test_utils.rs 87.3% <100.0%> (ø)
...ust/kona/crates/proof/executor/src/builder/core.rs 88.7% <100.0%> (ø)
rust/kona/crates/proof/executor/src/db/mod.rs 97.0% <ø> (ø)
rust/op-reth/crates/evm/src/lib.rs 99.7% <ø> (ø)
rust/op-reth/crates/node/src/engine.rs 76.6% <100.0%> (ø)
rust/op-reth/crates/node/src/rpc.rs 100.0% <100.0%> (ø)
rust/op-reth/crates/node/src/utils.rs 34.0% <100.0%> (ø)
rust/op-reth/crates/primitives/src/receipt.rs 93.1% <ø> (ø)
... and 39 more

... and 447 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@theochap theochap force-pushed the alloy-op-evm-0.30.0 branch 5 times, most recently from 49a303c to e028f8c Compare April 1, 2026 17:13
@theochap theochap changed the title feat(alloy-op-evm): upgrade alloy-evm to 0.30.0 feat(rust): upgrade alloy-evm to 0.30.0, bump reth to 082c36e, remove op feature Apr 1, 2026
@theochap theochap force-pushed the alloy-op-evm-0.30.0 branch 3 times, most recently from 8cf9ecb to c86030b Compare April 1, 2026 19:20
@theochap theochap changed the title feat(rust): upgrade alloy-evm to 0.30.0, bump reth to 082c36e, remove op feature feat!(rust): upgrade alloy-evm to 0.30.0, bump reth to 082c36e, remove op feature Apr 1, 2026
@nonsense nonsense mentioned this pull request Apr 2, 2026
27 tasks
///
/// Intended to use with the [`serde_with::serde_as`] macro in the following way:
/// ```rust
/// ```rust,ignore
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

DON'T IGNORE DOC COMMENTS

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

still needs to be fixed? :D

@theochap theochap force-pushed the alloy-op-evm-0.30.0 branch 5 times, most recently from beddab4 to ce53fe8 Compare April 2, 2026 16:06
@theochap
Copy link
Copy Markdown
Member Author

theochap commented Apr 2, 2026

Fix: proof history initialization with packed trie keys

The integration tests (op-reth-e2e-sysgo-tests, rust-e2e-simple-kona) were failing with:

Error: write operation CursorAppendDup failed for key "000...0001" in table AccountTrieHistory:
the given key value is mismatched to the current cursor position (-30418)

Root cause

Reth commit 80bf5532a (perf(trie): pack StoredNibblesSubKey from 65→33 bytes, generic cursor factory (#22158)) introduced packed nibble encoding for trie keys. Previously, StoredNibbles stored 1 nibble per byte (65 bytes). The packed format (PackedStoredNibbles) stores 2 nibbles per byte (33 bytes), a 50% size reduction that preserves memcmp sort order.

Key types introduced:

  • PackedStoredNibbles / PackedStoredNibblesSubKey (33-byte fixed layout)
  • PackedAccountsTrie / PackedStoragesTrie — table views sharing the same underlying MDBX tables as AccountsTrie / StoragesTrie
  • PackedKeyAdapter vs LegacyKeyAdapter for runtime dispatch via a with_adapter! macro
  • StorageSettings { storage_v2: bool } metadata flag to select encoding at runtime

Critically, StorageSettings::base() now returns v2() (storage_v2: true), meaning all new databases use packed encoding by default. The init_genesis function calls StorageSettings::base(), so genesis trie entries are written with PackedAccountsTrie (33-byte packed keys).

What broke

The proof history initialization code (op-reth/crates/trie/src/initialize.rs) was reading from tables::AccountsTrie (unpacked 65-byte key view), but the underlying MDBX table contained packed 33-byte keys. Since both table views share the same MDBX table name, the cursor returned raw packed bytes which StoredNibbles::Decode interpreted as unpacked nibbles — producing garbage nibble values. When these garbage nibbles were sorted and written to AccountTrieHistory via append_dup, the misordered keys caused the MDBX MDB_KEYEXIST error.

Fix

Updated AccountsTrieInit to read from tables::PackedAccountsTrie instead of tables::AccountsTrie, so the cursor correctly decodes packed keys into PackedStoredNibbles. The Nibbles values extracted from PackedStoredNibbles are correct, and the downstream store_account_branches sorts and writes them properly.

Files changed:

  • op-reth/crates/trie/src/initialize.rs — switched AccountsTrieInit to use PackedAccountsTrie + PackedStoredNibbles, updated initialize_accounts_trie to read from the packed table, updated unit tests accordingly

@theochap theochap force-pushed the alloy-op-evm-0.30.0 branch 5 times, most recently from eec1707 to 0472366 Compare April 2, 2026 17:21
Copy link
Copy Markdown
Member

@sebastianst sebastianst left a comment

Choose a reason for hiding this comment

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

first 73 or 104 files reviewed.

Comment on lines -113 to -121
assert_eq!(block_payloads.len(), 1);
let block = block_payloads.first().unwrap().block();

// Verify the new block is at 1001 (genesis 1000 + 1)
assert_eq!(
block.number(),
1001,
"Block number should be 1001 after advancing from genesis 100"
);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why is it safe to remove these assertions from the test?

///
/// Intended to use with the [`serde_with::serde_as`] macro in the following way:
/// ```rust
/// ```rust,ignore
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

still needs to be fixed? :D

Copy link
Copy Markdown
Member

@sebastianst sebastianst left a comment

Choose a reason for hiding this comment

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

OK this lgtm besides the comments from the first review. However, I couldn't review every line in detail, it's too much. I skimmed most bits that looked like mechanical plumbing.

…dd OpTx/OpTxEnvConverter

- Bump alloy-evm 0.27.2 -> 0.30.0, alloy-op-evm version to 0.30.0
- Bump reth to 082c36e (uses reth-rpc-traits from crates.io)
- Add OpTx newtype + trait impls (FromRecoveredTx, FromTxWithEncoded, IntoTxEnv, TransactionEnvMut)
- Add OpTxEnvConverter for RPC tx conversion without orphan rule issues
- Add reth-rpc-traits impls (FromConsensusTx, TryIntoSimTx, SignableTxRequest) to op-alloy-rpc-types
- Remove alloy-evm op feature dependency throughout
- Fix zepter std feature propagation for reth-rpc-traits
@theochap theochap force-pushed the alloy-op-evm-0.30.0 branch from 0472366 to c52d477 Compare April 2, 2026 20:38
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