build: upgrade REVM to v41.0.0 (tag v113) - #1604
Conversation
|
|
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.
| # ^38), so a shallow mirror of the ethereum-optimism monorepo commit matching | ||
| # the op-reth v2.4.1 release (workspace pins revm 41.0.0, the revm version at | ||
| # tag v113) is used instead. See the mirror's PROVENANCE.md. | ||
| op-revm = { git = "https://github.com/anaPerezGhiglia/op-revm", tag = "op-reth-v2.4.1-a9a8dad", default-features = false, features = [ |
There was a problem hiding this comment.
The tag is on a mirror repo we control, following a one-tag-per-snapshot convention (documented in its PROVENANCE.md). Tags should never be moved, and new snapshots get new tags.
Reproducibility comes from Cargo.lock, which records the exact commit.
Keeping the tag as is unless someone from the teams agrees on this approach.
62f59f1 to
f392718
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## chore/remove-op-hardfork-osaka #1604 +/- ##
=================================================================
Coverage ? 79.87%
=================================================================
Files ? 454
Lines ? 79251
Branches ? 79251
=================================================================
Hits ? 63302
Misses ? 13766
Partials ? 2183 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Supersedes #1590.
Changes
revmworkspace dependencies to the versions released at revm tagv113, which unifies every revm crate at41.0.0.op-revmmoves from crates.io19.0.0to the version released with op-reth v2.4.1, consumed through a shallow mirror repo (details below). The crate's own version number is not a usable reference since not-released version has the still declares20.0.0in the manifest, which s the last crates.io release, that still pins revm ^38.foundry-fork-dbbumps to the plain crates.io release 0.27 (pins revm ^41).L1Hardfork/OpHardforktypes (introduced in Introduce EDR-owned hardfork types #1601) retain all of them; the removals are absorbed at the revm conversion boundary.Dependency changes
op-reth-v2.4.1-a9a8dadop-revm: why a mirror repo
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
anaPerezGhiglia/op-revmat tagop-reth-v2.4.1-a9a8dad: a byte-identical snapshot ofrust/op-revmat monorepo commita9a8dad, the commit shipped in op-reth v2.4.1, which pins revm 41.0.0. The tag convention is<upstream release>-<upstream sha>, so the manifest documents its own provenance. The mirror includes aPROVENANCE.md(update procedure) and averify.shthat re-checks byte-identity against the GitHub API.Why a mirror instead of the monorepo. Stable cargo cannot shallow-clone git dependencies, so depending on the monorepo directly costs ~1.1 GB per machine and CI cache; the mirror clone is ~128 KB.
Note. The mirror currently lives under a personal account. If this solution is accepted, the recommended path is to migrate the repo to the NomicFoundation organization so ownership and updates are team-managed.
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.