Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump revm to 21.0.0 release #10183

Draft
wants to merge 85 commits into
base: master
Choose a base branch
from
Draft

Conversation

zerosnacks
Copy link
Member

@zerosnacks zerosnacks commented Mar 26, 2025

Motivation

Opening for visibility / easier collaboration

Restructured commit history so it is easier to revert to known good changes whilst iteratively implementing the complex changes (handler, journal)

Uses #10051 as reference

CI is expected to be failing for quite some time

Solution

Depends on:

Next steps:

  • Selectively extract changes from feat: bump revm #10051
  • Continue migrating foundry-evm-core crate, preferring internal mapping types rather than direct replacement - similar to Ethers > Alloy migration process
  • Refactor / reimplement handlers:
    • Odyssey
    • CREATE2
  • Refactor JournaledState using JournalInner
  • Clarify how TxEnv + OptimismFields would work
  • Clarify how EvmContext / InnerEvmContext successor
  • Clarify interpreter.shared_memory successor
  • Investigate internal mapping approach rather than refactor cheatcodes
  • Refactor inspector
  • Refactor Anvil
  • Fix tests

Issues:

  • with_evm copies l1_block_info, this field no longer exists yielding the question whether Cheatcodes, like Anvil, expects OpEvm
  • The get_prank cheatcode expects depth to be a u64, not a usize - try_into? works
  • Pattern ccx.ecx.journaled_state.load_account(&mut ccx.ecx.db(), *from) causes cannot borrow ccx.ecx as mutable more than once at a time second mutable borrow occurs here

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@zerosnacks zerosnacks added A-dependencies Area: dependencies T-chore Type: chore labels Mar 26, 2025
@zerosnacks zerosnacks moved this to In Progress in Foundry Mar 26, 2025
@zerosnacks zerosnacks added this to the v1.1.0 milestone Mar 26, 2025
Comment on lines 55 to +60
if let Some(l1_block_number) = block
.other_fields()
.and_then(|other| other.get("l1BlockNumber").cloned())
.and_then(|l1_block_number| {
serde_json::from_value::<U256>(l1_block_number).ok()
})
.and_then(|v| v.as_u64())
{
env.block.number = l1_block_number;
env.evm_env.block_env.number = l1_block_number;
Copy link
Member Author

Choose a reason for hiding this comment

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

l1_block_number no longer exists, only in op-revm. We may need to always use op-revm considering we also need it for Anvil

Copy link
Member Author

Choose a reason for hiding this comment

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

After looking into this I think we can integrate it inside of Foundry EVM, I'm wondering what length we should go to for OP compatibility.

@zerosnacks zerosnacks changed the title chore: bump revm to 20.0.0 release chore: bump revm to 21.0.0 release Apr 8, 2025
@grandizzy grandizzy modified the milestones: v1.1.0, v1.2.0 Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-dependencies Area: dependencies T-chore Type: chore
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

3 participants