name: update-revm
description: Update REVM and related crate dependencies (revm, revm-primitives, revm-interpreter, revm-precompile, revm-handler, revm-context, revm-context-interface, revm-database-interface, revm-state, revm-bytecode, revm-inspector, op-revm) to a specific release version. Fetches version information from the REVM GitHub repository at a git tag, updates all Cargo.toml workspace dependencies, fixes compilation errors, and runs quality checks.
disable-model-invocation: true
context: fork
agent: general-purpose
argument-hint: (e.g., v103)
Update REVM Dependencies
You are updating the REVM dependencies in this Rust workspace to the versions at git tag $ARGUMENTS.
Step 1: Discover target versions
Fetch the REVM workspace root Cargo.toml at the tag to discover workspace members:
https://raw.githubusercontent.com/bluealloy/revm/$ARGUMENTS/Cargo.toml
Parse [workspace].members to find all crates. Then for each crate this workspace uses, fetch its Cargo.toml to get [package].version:
https://raw.githubusercontent.com/bluealloy/revm/$ARGUMENTS/crates/<path>/Cargo.toml
Known crate paths (verify against workspace members):
crates/revm→ revmcrates/primitives→ revm-primitivescrates/interpreter→ revm-interpretercrates/precompile→ revm-precompilecrates/handler→ revm-handlercrates/context→ revm-contextcrates/context/interface→ revm-context-interfacecrates/database→ revm-databasecrates/database/interface→ revm-database-interfacecrates/state→ revm-statecrates/bytecode→ revm-bytecodecrates/inspector→ revm-inspectorcrates/op→ op-revm
Build a complete mapping: crate-name → version.
Step 2: Update dependency versions
Read the root Cargo.toml and update every REVM crate version in [workspace.dependencies]. Also search all individual crate Cargo.toml files for REVM dependencies that specify their own version (i.e., not using workspace = true) and update those too. Keep all existing features, default-features, and other settings unchanged — only update version numbers.
Also check and update these related ecosystem crates if needed:
revm-inspectors(from paradigmxyz/revm-inspectors) — find a compatible version/commitfoundry-fork-db— find a compatible version if it existsc-kzg— update if the REVM release requires a newer versionop-alloy-rpc-types(from alloy-rs/op-alloy) — keep compatible with the op-revm/alloy versions; bump if the upgrade requires it
If the project uses a [patch] section for any of these crates, note it may need updating.
Step 3: Compile and fix errors
Determine the feature flags to use based on whether ALCHEMY_URL is set (mirroring the pre-commit hook):
if [ -z "${ALCHEMY_URL}" ]; then
ALL_FEATURES="--features tracing,serde,std"
else
ALL_FEATURES="--all-features"
fi
Run cargo clippy --all-targets ${ALL_FEATURES} --workspace 2>&1 and iteratively fix compilation errors.
First, fetch the REVM migration guide for guidance on breaking API changes:
https://raw.githubusercontent.com/bluealloy/revm/main/MIGRATION_GUIDE.md
Foundry upstream reference
This project vendors Foundry code under crates/foundry/. Use the upstream Foundry PR for the same REVM upgrade as a reference for fixing compilation errors in our Foundry-derived code.
- Repo: https://github.com/foundry-rs/foundry
- Example PR for REVM 34: https://github.com/foundry-rs/foundry/pull/13130
To find the relevant PR for the target REVM version, search the Foundry repo for PRs mentioning the REVM version (e.g., gh search prs --repo foundry-rs/foundry "revm 34" --state merged).
Use gh pr diff <number> --repo foundry-rs/foundry to fetch the diff for reference. Focus on changes to files that correspond to code under our crates/foundry/ directory. Apply analogous fixes, adapting for any local differences in our vendored code.
Common REVM upgrade issues:
- Renamed types, traits, or methods
- Changed function signatures or generic parameters
- Items moved between modules
- New required trait implementations
- Changed error types or enums with new variants
For each error:
- Read the error carefully
- Consult the migration guide for known breaking changes and their fixes
- Look up the relevant REVM source at the target tag if needed:
https://raw.githubusercontent.com/bluealloy/revm/$ARGUMENTS/crates/<crate>/src/<file> - Apply the minimal fix
- Re-check compilation
Repeat until cargo clippy --all-targets ${ALL_FEATURES} --workspace succeeds.
Step 4: Quality checks
Use the same ALL_FEATURES variable determined in Step 3. Run each check and fix issues before moving to the next:
Formatting:
cargo +nightly fmt --check 2>&1- If it fails, run
cargo +nightly fmtto auto-format
- If it fails, run
Documentation:
RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps 2>&1- Fix any doc warnings
Tests:
cargo test --all-targets ${ALL_FEATURES} --workspace 2>&1- Fix any failing tests due to API changes
Step 5: Summary
Report:
- Version changes (old → new) for each crate
- Code changes required by API differences (files modified and why)
- Quality check results (pass/fail for each)
- Any remaining issues or TODOs