Skip to content

chore: bump revm to 21.0.0 release #10183

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

Draft
wants to merge 116 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
6933c85
start fixing imports
zerosnacks Mar 26, 2025
bc48af7
continue fixing imports
zerosnacks Mar 26, 2025
1122da1
continue fixing imports
zerosnacks Mar 26, 2025
85036e8
continue fixing imports
zerosnacks Mar 26, 2025
03083a7
add alloy-evm
zerosnacks Mar 26, 2025
edb2455
fix known good changes
zerosnacks Mar 26, 2025
1c11e70
more known good fixes
zerosnacks Mar 26, 2025
5f4f8e5
more known good fixes
zerosnacks Mar 26, 2025
94d8397
more known good fixes
zerosnacks Mar 26, 2025
8d0e45f
more known good fixes, unclear how OptimismFields should be ported
zerosnacks Mar 26, 2025
bc856c4
start introducing crate::Env
zerosnacks Mar 26, 2025
eccc959
continue introducing crate::Env
zerosnacks Mar 26, 2025
6bf4e91
fix cow types
zerosnacks Mar 27, 2025
c75903a
fix type
zerosnacks Mar 27, 2025
39206bd
add journaledstate types, fix env types
zerosnacks Mar 27, 2025
5208520
fix JournaledState = JournalInner<JournalEntry>
zerosnacks Mar 27, 2025
e3ecba7
fix types
zerosnacks Mar 27, 2025
b3e648e
fix merge type
zerosnacks Mar 27, 2025
d72eb16
add odyssey precompile
zerosnacks Mar 27, 2025
5dbabaf
continue fixing type issues, handler abstraction
zerosnacks Mar 27, 2025
933ea20
start working on create2 handler
zerosnacks Mar 27, 2025
256a414
revert to type instead of struct, investigating handlers
zerosnacks Mar 27, 2025
721845e
comment out accesslistinspector for now, needs to be addressed
zerosnacks Mar 28, 2025
6404dab
fix imports, minor fixes
zerosnacks Mar 28, 2025
cab1d4f
imports, minor fixes, there is no equivalent of AuthorizationList - r…
zerosnacks Mar 28, 2025
0d2dc86
more interpreter type fixes
zerosnacks Mar 28, 2025
e2d0db7
continue type fixes
zerosnacks Mar 28, 2025
bfa11ce
fix inspectorext
zerosnacks Mar 28, 2025
396791e
start porting inspectors
zerosnacks Mar 28, 2025
d347f24
start adding custom evm
zerosnacks Mar 28, 2025
b31257a
continue adding custom FoundryEvm
zerosnacks Mar 28, 2025
81f6c81
impl traits for FoundryEvm
zerosnacks Mar 28, 2025
8946aa3
restructure, move out of utils into evm, precompiles and future handlers
zerosnacks Mar 28, 2025
24a7e83
clean up
zerosnacks Mar 28, 2025
2f671e5
clean up
zerosnacks Mar 28, 2025
dd0a072
improve docs
zerosnacks Mar 28, 2025
f15710c
scaffold handler
zerosnacks Mar 28, 2025
3269e90
evaluate how to add handles
zerosnacks Mar 28, 2025
c42e152
prefer EnvRef over EnvMut
zerosnacks Mar 28, 2025
523a7b6
address feedback of owned env
zerosnacks Mar 28, 2025
28dc375
revert get_or_insert_map workaround
zerosnacks Mar 28, 2025
58a8994
avoid changing types, leave mut where previously, avoid unnecessary mut
zerosnacks Mar 28, 2025
b7e2484
start layout out handler registry connected to evm
zerosnacks Mar 31, 2025
b08e41b
get create2 from frame inputs
zerosnacks Mar 31, 2025
ed210a3
start adding create2 handler
zerosnacks Mar 31, 2025
73141a9
continue create2handler
zerosnacks Mar 31, 2025
242df6b
wrap up create2 handler
zerosnacks Mar 31, 2025
ba5d558
clean up
zerosnacks Mar 31, 2025
9f935a2
continue fixing types
zerosnacks Mar 31, 2025
94c94a7
generalize precompiles
zerosnacks Mar 31, 2025
eff2a0c
clean up
zerosnacks Mar 31, 2025
d6ac47d
tag inline
zerosnacks Apr 1, 2025
0429e63
Merge branch 'master' into zerosnacks/revm-bump-2
zerosnacks Apr 1, 2025
8534afc
fix imports
zerosnacks Apr 1, 2025
7742e25
start fixing cheatcode types
zerosnacks Apr 1, 2025
df22fcc
use `env` on handler
zerosnacks Apr 1, 2025
3469e1c
clean up
zerosnacks Apr 2, 2025
02ebd02
temp revert
zerosnacks Apr 2, 2025
268e1b7
odyssey precompile was deprecated
zerosnacks Apr 2, 2025
0e2085d
refix cheatcode types
zerosnacks Apr 2, 2025
de3e8f7
merge in master
zerosnacks Apr 2, 2025
f69d141
clean up
zerosnacks Apr 2, 2025
30a6284
still facing issues with borrow-checker, double mut
zerosnacks Apr 2, 2025
eb3142e
open questions around passing around env
zerosnacks Apr 2, 2025
5fb9554
minor fix
zerosnacks Apr 2, 2025
2a4bfa4
for now work around mutability limitations by limited cloning, unclea…
zerosnacks Apr 2, 2025
270dbad
continue fixing types, still issues around cheatcodes, inspector
zerosnacks Apr 2, 2025
12c3b71
merge in master
zerosnacks Apr 8, 2025
6ed3ae7
bump revm
zerosnacks Apr 8, 2025
f0fca47
bump deps
zerosnacks Apr 8, 2025
ed7c35c
minor type fixes
zerosnacks Apr 8, 2025
25440e8
bump foundry-fork-db to handle c-kzg build issue
zerosnacks Apr 8, 2025
464b39e
bump rust version
zerosnacks Apr 8, 2025
7b0279b
utilize Host, ContextTr, JournalTr to avoid double mutable borrows
zerosnacks Apr 9, 2025
0daddb8
temp revert
zerosnacks Apr 10, 2025
2e3107e
merge in master
zerosnacks Apr 10, 2025
cc045f2
temp revert
zerosnacks Apr 10, 2025
926db33
restore handler, improve types
zerosnacks Apr 10, 2025
a25b13b
refactor types
zerosnacks Apr 10, 2025
695f0ff
restore types
zerosnacks Apr 10, 2025
fc5b1ec
restore, clean up
zerosnacks Apr 10, 2025
4f24fb6
continue fixing types
zerosnacks Apr 10, 2025
11146d7
clean up
zerosnacks Apr 11, 2025
44afdd2
Merge branch 'master' into zerosnacks/revm-bump-2
zerosnacks Apr 11, 2025
9b27ff2
continue fixing types
zerosnacks Apr 11, 2025
ec10771
Merge branch 'master' into zerosnacks/revm-bump-2
zerosnacks Apr 14, 2025
8957990
revert journal env cloning, still issues around double borrows
zerosnacks Apr 14, 2025
32c7201
fix core types per conversation, use EnvMut<'_>
zerosnacks Apr 15, 2025
db518f3
merge in master
zerosnacks Apr 15, 2025
2db1c84
fix types
zerosnacks Apr 15, 2025
4849341
more progress for foundry-evm
klkvr Apr 15, 2025
9735c08
mutate outcome in place
zerosnacks Apr 16, 2025
756ac40
temp revert exec_create
zerosnacks Apr 16, 2025
efebbf6
some progress with porting with_evm core loop
zerosnacks Apr 16, 2025
c589110
remove redundant types
zerosnacks Apr 16, 2025
61a9338
context -> test_context in Cheatcodes config
zerosnacks Apr 16, 2025
6373a24
construct new handler, wrapping evm context, imports Handler trait
zerosnacks Apr 16, 2025
106cdf4
temporarily comment out exec_create section to unblock
zerosnacks Apr 16, 2025
1eb2ca8
add replacement of EnvWithHandlerCfg
zerosnacks Apr 16, 2025
10cd5bf
minor fixes
zerosnacks Apr 16, 2025
8a908af
continue fixing types
zerosnacks Apr 16, 2025
8968b00
continue fixing types
zerosnacks Apr 16, 2025
c42649f
fix merge conflict
zerosnacks Apr 16, 2025
479b151
continue fixing types
zerosnacks Apr 17, 2025
2f5c2ec
continue fixing types
zerosnacks Apr 17, 2025
27bf832
continue types
zerosnacks Apr 17, 2025
a978d45
fix cached_env
zerosnacks Apr 17, 2025
28c0e9e
remove possibly incorrect handling of CreateOutcome on methods like d…
zerosnacks Apr 17, 2025
ab40c0f
add custom_printer from revm19, porting for compatibility
zerosnacks Apr 17, 2025
2d4f538
cast: fix types
zerosnacks Apr 17, 2025
3d607f3
verify: fix types
zerosnacks Apr 17, 2025
7a6b9c1
forge + script: fix types
zerosnacks Apr 17, 2025
e20d2a6
anvil: start fixing types
zerosnacks Apr 17, 2025
8d06e42
anvil: continue porting types
zerosnacks Apr 17, 2025
b94f25f
anvil: continue porting types
zerosnacks Apr 17, 2025
905b253
anvil: continue porting types
zerosnacks Apr 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,342 changes: 1,051 additions & 291 deletions Cargo.lock

Large diffs are not rendered by default.

74 changes: 45 additions & 29 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ resolver = "2"
version = "1.1.0"
edition = "2021"
# Remember to update clippy.toml as well
rust-version = "1.83"
rust-version = "1.85"
authors = ["Foundry Contributors"]
license = "MIT OR Apache-2.0"
homepage = "https://github.com/foundry-rs/foundry"
@@ -116,10 +116,18 @@ alloy-sol-types.opt-level = 3
hashbrown.opt-level = 3
foldhash.opt-level = 3
keccak.opt-level = 3
revm.opt-level = 3
revm-primitives.opt-level = 3
revm-interpreter.opt-level = 3
revm-precompile.opt-level = 3
revm-primitives.opt-level = 3
revm.opt-level = 3
revm-database-interface.opt-level = 3
revm-database.opt-level = 3
revm-bytecode.opt-level = 3
revm-state.opt-level = 3
revm-context-interface.opt-level = 3
revm-context.opt-level = 3
revm-handlers.opt-level = 3
revm-inspector.opt-level = 3
ruint.opt-level = 3
sha2.opt-level = 3
sha3.opt-level = 3
@@ -196,32 +204,32 @@ solar-parse = { version = "=0.1.2", default-features = false }
solar-sema = { version = "=0.1.2", default-features = false }

## revm
revm = { version = "19.4.0", default-features = false }
revm-primitives = { version = "15.1.0", default-features = false }
revm-inspectors = { version = "0.16.0", features = ["serde"] }
revm = "21.0.0"
revm-inspectors = { version = "0.18.1", features = ["serde"] }
op-revm = "3.0.2"

## alloy
alloy-consensus = { version = "0.12.1", default-features = false }
alloy-contract = { version = "0.12.1", default-features = false }
alloy-eips = { version = "0.12.1", default-features = false }
alloy-genesis = { version = "0.12.1", default-features = false }
alloy-json-rpc = { version = "0.12.1", default-features = false }
alloy-network = { version = "0.12.1", default-features = false }
alloy-provider = { version = "0.12.1", default-features = false }
alloy-pubsub = { version = "0.12.1", default-features = false }
alloy-rpc-client = { version = "0.12.1", default-features = false }
alloy-rpc-types = { version = "0.12.1", default-features = true }
alloy-serde = { version = "0.12.1", default-features = false }
alloy-signer = { version = "0.12.1", default-features = false }
alloy-signer-aws = { version = "0.12.1", default-features = false }
alloy-signer-gcp = { version = "0.12.1", default-features = false }
alloy-signer-ledger = { version = "0.12.1", default-features = false }
alloy-signer-local = { version = "0.12.1", default-features = false }
alloy-signer-trezor = { version = "0.12.1", default-features = false }
alloy-transport = { version = "0.12.1", default-features = false }
alloy-transport-http = { version = "0.12.1", default-features = false }
alloy-transport-ipc = { version = "0.12.1", default-features = false }
alloy-transport-ws = { version = "0.12.1", default-features = false }
alloy-consensus = { version = "0.13.0", default-features = false }
alloy-contract = { version = "0.13.0", default-features = false }
alloy-eips = { version = "0.13.0", default-features = false }
alloy-genesis = { version = "0.13.0", default-features = false }
alloy-json-rpc = { version = "0.13.0", default-features = false }
alloy-network = { version = "0.13.0", default-features = false }
alloy-provider = { version = "0.13.0", default-features = false }
alloy-pubsub = { version = "0.13.0", default-features = false }
alloy-rpc-client = { version = "0.13.0", default-features = false }
alloy-rpc-types = { version = "0.13.0", default-features = true }
alloy-serde = { version = "0.13.0", default-features = false }
alloy-signer = { version = "0.13.0", default-features = false }
alloy-signer-aws = { version = "0.13.0", default-features = false }
alloy-signer-gcp = { version = "0.13.0", default-features = false }
alloy-signer-ledger = { version = "0.13.0", default-features = false }
alloy-signer-local = { version = "0.13.0", default-features = false }
alloy-signer-trezor = { version = "0.13.0", default-features = false }
alloy-transport = { version = "0.13.0", default-features = false }
alloy-transport-http = { version = "0.13.0", default-features = false }
alloy-transport-ipc = { version = "0.13.0", default-features = false }
alloy-transport-ws = { version = "0.13.0", default-features = false }

## alloy-core
alloy-dyn-abi = "0.8.22"
@@ -237,12 +245,13 @@ alloy-sol-macro-input = "0.8.22"
alloy-sol-types = "0.8.22"

alloy-chains = "0.1"
alloy-evm = "0.3.1"
alloy-rlp = "0.3"
alloy-trie = "0.7.0"

## op-alloy
op-alloy-consensus = "0.11.0"
op-alloy-rpc-types = "0.11.0"
op-alloy-consensus = "0.12.0"
op-alloy-rpc-types = "0.12.0"

## cli
anstream = "0.6"
@@ -348,3 +357,10 @@ path-slash = "0.2"
# alloy-transport-http = { git = "https://github.com/alloy-rs/alloy", rev = "7fab7ee" }
# alloy-transport-ipc = { git = "https://github.com/alloy-rs/alloy", rev = "7fab7ee" }
# alloy-transport-ws = { git = "https://github.com/alloy-rs/alloy", rev = "7fab7ee" }

## revm
# revm = { git = "https://github.com/bluealloy/revm.git", rev = "4266922" }
# revm-inspectors = { git = "https://github.com/paradigmxyz/revm-inspectors.git", rev = "a625c04" }

## foundry
foundry-fork-db = { git = "https://github.com/foundry-rs/foundry-fork-db", rev = "6144088" }
1 change: 1 addition & 0 deletions crates/anvil/Cargo.toml
Original file line number Diff line number Diff line change
@@ -27,6 +27,7 @@ foundry-cli.workspace = true
foundry-common.workspace = true
foundry-config.workspace = true
foundry-evm.workspace = true
foundry-evm-core.workspace = true

# evm support
revm = { workspace = true, features = [
1 change: 1 addition & 0 deletions crates/anvil/core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@ revm = { workspace = true, default-features = false, features = [
"memory_limit",
"c-kzg",
] }
op-revm.workspace = true

alloy-primitives = { workspace = true, features = ["serde", "rlp"] }
alloy-rpc-types = { workspace = true, features = ["anvil", "trace"] }
68 changes: 33 additions & 35 deletions crates/anvil/core/src/eth/transaction/mod.rs
Original file line number Diff line number Diff line change
@@ -23,10 +23,7 @@ use alloy_serde::{OtherFields, WithOtherFields};
use bytes::BufMut;
use foundry_evm::traces::CallTraceNode;
use op_alloy_consensus::{TxDeposit, DEPOSIT_TX_TYPE_ID};
use revm::{
interpreter::InstructionResult,
primitives::{OptimismFields, TxEnv},
};
use revm::{context::TxEnv, interpreter::InstructionResult};
use serde::{Deserialize, Serialize};
use std::ops::{Deref, Mul};

@@ -399,15 +396,15 @@ impl PendingTransaction {
let TxLegacy { nonce, gas_price, gas_limit, value, to, input, .. } = tx.tx();
TxEnv {
caller,
transact_to: transact_to(to),
kind: transact_to(to),
data: input.clone(),
chain_id,
nonce: Some(*nonce),
nonce: *nonce,
value: (*value),
gas_price: U256::from(*gas_price),
gas_price: *gas_price,
gas_priority_fee: None,
gas_limit: *gas_limit,
access_list: vec![],
access_list: vec![].into(),
..Default::default()
}
}
@@ -425,12 +422,12 @@ impl PendingTransaction {
} = tx.tx();
TxEnv {
caller,
transact_to: transact_to(to),
kind: transact_to(to),
data: input.clone(),
chain_id: Some(*chain_id),
nonce: Some(*nonce),
nonce: *nonce,
value: *value,
gas_price: U256::from(*gas_price),
gas_price: *gas_price,
gas_priority_fee: None,
gas_limit: *gas_limit,
access_list: access_list.clone().into(),
@@ -452,13 +449,13 @@ impl PendingTransaction {
} = tx.tx();
TxEnv {
caller,
transact_to: transact_to(to),
kind: transact_to(to),
data: input.clone(),
chain_id: Some(*chain_id),
nonce: Some(*nonce),
nonce: *nonce,
value: *value,
gas_price: U256::from(*max_fee_per_gas),
gas_priority_fee: Some(U256::from(*max_priority_fee_per_gas)),
gas_price: *max_fee_per_gas,
gas_priority_fee: Some(*max_priority_fee_per_gas),
gas_limit: *gas_limit,
access_list: access_list.clone().into(),
..Default::default()
@@ -481,14 +478,14 @@ impl PendingTransaction {
} = tx.tx().tx();
TxEnv {
caller,
transact_to: TxKind::Call(*to),
kind: TxKind::Call(*to),
data: input.clone(),
chain_id: Some(*chain_id),
nonce: Some(*nonce),
nonce: *nonce,
value: *value,
gas_price: U256::from(*max_fee_per_gas),
gas_priority_fee: Some(U256::from(*max_priority_fee_per_gas)),
max_fee_per_blob_gas: Some(U256::from(*max_fee_per_blob_gas)),
gas_price: *max_fee_per_gas,
gas_priority_fee: Some(*max_priority_fee_per_gas),
max_fee_per_blob_gas: *max_fee_per_blob_gas,
blob_hashes: blob_versioned_hashes.clone(),
gas_limit: *gas_limit,
access_list: access_list.clone().into(),
@@ -510,16 +507,16 @@ impl PendingTransaction {
} = tx.tx();
TxEnv {
caller,
transact_to: TxKind::Call(*to),
kind: TxKind::Call(*to),
data: input.clone(),
chain_id: Some(*chain_id),
nonce: Some(*nonce),
nonce: *nonce,
value: *value,
gas_price: U256::from(*max_fee_per_gas),
gas_priority_fee: Some(U256::from(*max_priority_fee_per_gas)),
gas_price: *max_fee_per_gas,
gas_priority_fee: Some(*max_priority_fee_per_gas),
gas_limit: *gas_limit,
access_list: access_list.clone().into(),
authorization_list: Some(authorization_list.clone().into()),
authorization_list: authorization_list.clone(),
..Default::default()
}
}
@@ -538,21 +535,22 @@ impl PendingTransaction {
} = tx;
TxEnv {
caller,
transact_to: transact_to(kind),
kind: transact_to(kind),
data: input.clone(),
chain_id,
nonce: Some(*nonce),
nonce: *nonce,
value: *value,
gas_price: U256::ZERO,
gas_price: 0,
gas_priority_fee: None,
gas_limit: { *gas_limit },
access_list: vec![],
optimism: OptimismFields {
source_hash: Some(*source_hash),
mint: Some(mint.to::<u128>()),
is_system_transaction: Some(*is_system_tx),
enveloped_tx: None,
},
access_list: vec![].into(),
// TODO: add Optimism support
// optimism: OptimismFields {
// source_hash: Some(*source_hash),
// mint: Some(mint.to::<u128>()),
// is_system_transaction: Some(*is_system_tx),
// enveloped_tx: None,
// },
..Default::default()
}
}
Loading