build: upgrade REVM to v41.0.0 (tag v113) - #1604
Conversation
🦋 Changeset detectedLatest commit: 01ba1ff The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub. |
There was a problem hiding this comment.
Pull request overview
Upgrades the workspace’s REVM dependency family to revm/revm-* 41.0.0 (tag v113), including aligning ecosystem crates (foundry-fork-db, revm-inspectors) and adapting EDR integration points to updated REVM APIs/types (e.g., TransactionId, state gas signedness, and inspector outcome fields).
Changes:
- Bump REVM crates to
41.0.0, updatefoundry-fork-dbto0.27, and moveop-revmto a git-sourced mirror matching op-rethv2.4.1. - Update EDR/foundry integration code to new REVM APIs:
TransactionId,initial_total_gas()accessor,charged_new_account_state_gasfield, and state gas clamping for unsigned trace surfaces. - Vendor
edge_covinspector implementation into the foundry port to replace the removedrevm-inspectors::edge_covmodule.
Reviewed changes
Copilot reviewed 24 out of 25 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| crates/tracing/src/lib.rs | Clamp signed per-frame state gas to 0 when producing unsigned ResultGas. |
| crates/state/api/src/lib.rs | Re-export TransactionId from revm_state for downstream use. |
| crates/state/api/src/diff.rs | Switch account creation to Account::from(...) and set status/storage explicitly where needed. |
| crates/primitives/src/lib.rs | Re-export AddressSet from alloy_primitives map utilities. |
| crates/precompile/src/lib.rs | Update precompile warm address handling to use AddressSet and new warm_addresses signature. |
| crates/foundry/evm/evm/src/inspectors/stack.rs | Route edge coverage to vendored inspector; add charged_new_account_state_gas field initialization. |
| crates/foundry/evm/evm/src/inspectors/mod.rs | Add and re-export new edge_cov module. |
| crates/foundry/evm/evm/src/inspectors/logs.rs | Initialize charged_new_account_state_gas in CallOutcome construction. |
| crates/foundry/evm/evm/src/inspectors/edge_cov.rs | New vendored edge coverage inspector implementation. |
| crates/foundry/evm/evm/src/executors/mod.rs | Adapt to initial_total_gas() API change. |
| crates/foundry/evm/core/src/opts.rs | Fix intra-doc link to crate::fork::configure_env. |
| crates/foundry/evm/core/src/backend/predeploy.rs | Use Account::from(...) for predeploy account insertion. |
| crates/foundry/evm/core/src/backend/mod.rs | Introduce TransactionId::ZERO uses and adapt precompile warm address plumbing. |
| crates/foundry/cheatcodes/src/inspector.rs | Initialize charged_new_account_state_gas; update result halt check (is_halt). |
| crates/edr_solidity/src/nested_trace/conversion.rs | Handle new InternalResult::Suspend conversion path. |
| crates/edr_provider/tests/integration/eip7778.rs | Update storage slot construction to use TransactionId::ZERO. |
| crates/edr_provider/src/data.rs | Update storage slot/change tracking and account construction to use TransactionId/Account::from. |
| crates/edr_op/src/hardfork.rs | Simplify parity tests to only check default mapping vs op_revm::OpSpecId. |
| crates/edr_napi/src/account.rs | Update NAPI account override storage slots to use TransactionId::ZERO. |
| crates/edr_coverage/src/collector.rs | Initialize charged_new_account_state_gas in coverage inspector outcomes. |
| crates/edr_chain_l1/src/hardfork.rs | Update L1Hardfork -> EvmSpecId conversion to account for REVM SpecId cleanup; refresh tests accordingly. |
| crates/blockchain/local/src/lib.rs | Update test account construction to use Account::from(...). |
| crates/blockchain/fork/src/lib.rs | Update account construction to use Account::from(...) for special predeploy accounts. |
| Cargo.toml | Upgrade REVM dependency set, bump foundry-fork-db, and switch op-revm to a git mirror source. |
| Cargo.lock | Lockfile updates reflecting dependency upgrades and the git-sourced op-revm. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
62f59f1 to
f392718
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1604 +/- ##
==========================================
- Coverage 80.00% 79.89% -0.12%
==========================================
Files 453 454 +1
Lines 79292 79294 +2
Branches 79292 79294 +2
==========================================
- Hits 63435 63348 -87
- Misses 13675 13763 +88
- Partials 2182 2183 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…ponding associated type names Two sites got narrower bounds: chain/spec/evm/src/lib.rs:27 — ContextForChainSpec only needs the EVM-level type, so it now projects through EvmHardforkChainSpec. edr_napi_core/src/solidity/config.rs:224-225 — the combined bound decomposed into EvmHardforkChainSpec<EvmHardfork: HardforkTr> + ProtocolHardforkChainSpec<ProtocolHardfork: FromStr<Err = UnknownHardfork>>.
Supersedes #1590.
Changes
revmworkspace dependencies to the versions released at revm tagv113, which unifies every revm crate at41.0.0.op-revmmoves from crates.io 19.0.0 to the version released with op-reth v2.4.1, consumed as a git dependency on theethereum-optimism/optimismmonorepo pinned at that release's commit (details below).foundry-fork-dbbumps to the plain crates.io release 0.27 (pins revm ^41).L1Hardfork/OpHardforktypes (introduced in refactor: introduce EDR-owned protocol hardfork types #1601) retain all of them; the removals are absorbed at the revm conversion boundary.Dependency changes
ethereum-optimism/optimism@a9a8dadThe locked alloy 2.x family moves 2.0.5 → 2.3.0 — a floor inherited from the monorepo's vendored
op-alloy(see theop-revmsection).op-revm: git dependency on the optimism monorepo
Why not crates.io. No op-revm release supports revm 41: the last crates.io release (20.0.0) still pins
revm = "^38".What is pinned. A git dependency on
ethereum-optimism/optimismat reva9a8dad3f1500a4cc2e4077edb480848bfdef29a— the commit of the op-reth v2.4.1 release, which pins revm 41.0.0. This is unreleased code but an accepted trade-off; the priority is keeping L1 on released revm.Known costs.
op-alloy's home (the source of truth of the published crate), whichop-revmdepends on by path. As a consequence,op-revmresolves the in-repoop-alloy-consensusinstead of the crates.io release with the same version numberop-alloy-consensus 2.0.0entries (registry + git) in the lockfile.Alternative. A follow-up PR will propose replacing this with a shallow per-snapshot mirror (~1 MB, single registry
op-alloycopy), laying out the trade-offs in detail.Hardfork handling: revm's SpecId cleanup
L1. revm 39's "SpecId cleanup" (see the MIGRATION_GUIDE) removed six historical
SpecIdvariants, and this upgrade's 38→41 jump crosses that removal. Thanks to the refactor done in #1601, EDR'sL1Hardforkgets to keeps all of its variants. The only change is in theFrom<L1Hardfork> for SpecIdconversion, which now maps each removed variant to the fork with identical EVM rules:The napi/config surface (names, parsing, serialization) is fully unchanged, so no Hardhat coordination is needed.
OP.
OpSpecIdgainedKARST, the OP hardfork that activates the L1 Osaka EVM rules. EDR has no correspondingOpHardforkvariant yet, so nothing converts to it; Karst support is a follow-up. Until it lands, the chain-config generator keeps ignoring the registry'skarst_timeentries (it parses withOpHardfork::from_str), so thecheck-generated-filesworkflow stays green.Tests. The
revm_paritymodules asserted variant-set equality with revm and instructed their own deletion once the sets diverged. That happened here; they are replaced with monotonicity/default tests.Other code changes required by the API delta
PrecompileProvider::warm_addressesnow returns&AddressSetinstead of a boxed iterator. The provider stores the set and converts once;AddressSetis re-exported fromedr_primitives.Account.original_infois nowOption<Box<_>>, and transaction ids use a newTransactionIdnewtype. Call sites build accounts withAccount::from(info)plus a status and useTransactionId::ZERO;TransactionIdis re-exported fromedr_state_api.CallOutcome.charged_new_account_state_gas, which our 8 inspector sites set tofalse(matching upstream foundry), and madeGas::state_gas_spent()signed, which tracing clamps at 0. Both are TODO-flagged, to revisit when fully implementing EIP-8037.initial_total_gasfield → method; newInternalResult::Suspendvariant handled in nested-trace conversion; deprecatedis_error()→is_halt()in cheatcodes.edge_covmodule; upstream foundry took it in-tree, and so do we. The 0.39.0 snapshot lives atcrates/foundry/evm/evm/src/inspectors/edge_cov.rs— the same path as foundry's copy — keeping coverage-guided fuzzing behavior identical. It is part of the foundry-port surface: the next foundry backport sync replaces it with upstream's since-evolved version.Follow-ups (out of scope)
OpHardfork::KARSTvariant, the Karst activation entries (regenerating the chain configs), and napi exposure.charged_new_account_state_gassites and the signed state-gas clamp.edge_covmodule: replaced by upstream foundry's version at the next foundry backport sync.