Skip to content

Commit cce84fd

Browse files
authored
chore(deps): bump to revm 29 (#11416)
* fix merge conflicts * bump deps * bump foundry-fork-db * apply fixes of 1.3.0: c4245d6 * nit * bump alloy-evm * bump op-alloy-* to avoid duplicate deps w/ alloy-evm
1 parent 5c99c90 commit cce84fd

File tree

4 files changed

+60
-61
lines changed

4 files changed

+60
-61
lines changed

Cargo.lock

Lines changed: 36 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ foundry-linking = { path = "crates/linking" }
205205
# solc & compilation utilities
206206
foundry-block-explorers = { version = "0.20.0", default-features = false }
207207
foundry-compilers = { version = "0.18.2", default-features = false }
208-
foundry-fork-db = "0.17"
208+
foundry-fork-db = "0.18"
209209
solang-parser = { version = "=0.3.9", package = "foundry-solang-parser" }
210210
solar-ast = { version = "=0.1.5", default-features = false }
211211
solar-parse = { version = "=0.1.5", default-features = false }
@@ -257,18 +257,18 @@ alloy-rlp = "0.3"
257257
alloy-trie = "0.9"
258258

259259
## op-alloy
260-
op-alloy-consensus = "0.18.13"
261-
op-alloy-rpc-types = "0.18.13"
260+
op-alloy-consensus = "0.19.0"
261+
op-alloy-rpc-types = "0.19.0"
262262
op-alloy-flz = "0.13.1"
263263

264264
## revm
265-
revm = { version = "28.0.0", default-features = false }
266-
revm-inspectors = { version = "0.28.0", features = ["serde"] }
267-
op-revm = { version = "9.0.1", default-features = false }
265+
revm = { version = "29.0.0", default-features = false }
266+
revm-inspectors = { version = "0.29.0", features = ["serde"] }
267+
op-revm = { version = "10.0.0", default-features = false }
268268

269269
## alloy-evm
270-
alloy-evm = "0.18.3"
271-
alloy-op-evm = "0.18.3"
270+
alloy-evm = "0.19.0"
271+
alloy-op-evm = "0.19.0"
272272

273273
## cli
274274
anstream = "0.6"
@@ -399,18 +399,18 @@ idna_adapter = "=1.1.0"
399399
# alloy-transport-ws = { git = "https://github.com/alloy-rs/alloy", rev = "7fab7ee" }
400400

401401
## alloy-evm
402-
# alloy-evm = { git = "https://github.com/alloy-rs/evm.git", rev = "7762adc" }
403-
# alloy-op-evm = { git = "https://github.com/alloy-rs/evm.git", rev = "7762adc" }
402+
# alloy-evm = { git = "https://github.com/alloy-rs/evm.git", rev = "3c6cebb" }
403+
# alloy-op-evm = { git = "https://github.com/alloy-rs/evm.git", rev = "3c6cebb" }
404404

405405
## revm
406406
# revm = { git = "https://github.com/bluealloy/revm.git", rev = "d9cda3a" }
407407
# op-revm = { git = "https://github.com/bluealloy/revm.git", rev = "d9cda3a" }
408-
# revm-inspectors = { git = "https://github.com/paradigmxyz/revm-inspectors.git", rev = "956bc98" }
408+
# revm-inspectors = { git = "https://github.com/zerosnacks/revm-inspectors.git", rev = "74e215d" }
409409

410410
## foundry
411411
# foundry-block-explorers = { git = "https://github.com/foundry-rs/block-explorers.git", rev = "e09cb89" }
412412
# foundry-compilers = { git = "https://github.com/foundry-rs/compilers.git", rev = "e4a9b04" }
413-
# foundry-fork-db = { git = "https://github.com/foundry-rs/foundry-fork-db", rev = "50683eb" }
413+
# foundry-fork-db = { git = "https://github.com/foundry-rs/foundry-fork-db", rev = "eee6563" }
414414

415415
## solar
416416
# solar-ast = { git = "https://github.com/paradigmxyz/solar.git", branch = "main" }

crates/anvil/src/evm.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,27 @@ use alloy_evm::{
66

77
use foundry_evm_core::either_evm::EitherEvm;
88
use op_revm::OpContext;
9-
use revm::{Inspector, precompile::PrecompileWithAddress};
9+
use revm::{Inspector, precompile::Precompile};
1010
use std::fmt::Debug;
1111

1212
/// Object-safe trait that enables injecting extra precompiles when using
1313
/// `anvil` as a library.
1414
pub trait PrecompileFactory: Send + Sync + Unpin + Debug {
1515
/// Returns a set of precompiles to extend the EVM with.
16-
fn precompiles(&self) -> Vec<(PrecompileWithAddress, u64)>;
16+
fn precompiles(&self) -> Vec<(Precompile, u64)>;
1717
}
1818

1919
/// Inject precompiles into the EVM dynamically.
2020
pub fn inject_precompiles<DB, I>(
2121
evm: &mut EitherEvm<DB, I, PrecompilesMap>,
22-
precompiles: Vec<(PrecompileWithAddress, u64)>,
22+
precompiles: Vec<(Precompile, u64)>,
2323
) where
2424
DB: Database,
2525
I: Inspector<EthEvmContext<DB>> + Inspector<OpContext<DB>>,
2626
{
27-
for (PrecompileWithAddress(addr, func), gas) in precompiles {
27+
for (precompile, gas) in precompiles {
28+
let addr = *precompile.address();
29+
let func = *precompile.precompile();
2830
evm.precompiles_mut().apply_precompile(&addr, move |_| {
2931
Some(DynPrecompile::from(move |input: PrecompileInput<'_>| func(input.data, gas)))
3032
});
@@ -33,7 +35,7 @@ pub fn inject_precompiles<DB, I>(
3335

3436
#[cfg(test)]
3537
mod tests {
36-
use std::convert::Infallible;
38+
use std::{borrow::Cow, convert::Infallible};
3739

3840
use alloy_evm::{EthEvm, Evm, EvmEnv, eth::EthEvmContext, precompiles::PrecompilesMap};
3941
use alloy_op_evm::OpEvm;
@@ -49,7 +51,7 @@ mod tests {
4951
inspector::NoOpInspector,
5052
interpreter::interpreter::EthInterpreter,
5153
precompile::{
52-
PrecompileOutput, PrecompileResult, PrecompileSpecId, PrecompileWithAddress,
54+
Precompile, PrecompileId, PrecompileOutput, PrecompileResult, PrecompileSpecId,
5355
Precompiles,
5456
},
5557
primitives::hardfork::SpecId,
@@ -71,9 +73,10 @@ mod tests {
7173
struct CustomPrecompileFactory;
7274

7375
impl PrecompileFactory for CustomPrecompileFactory {
74-
fn precompiles(&self) -> Vec<(PrecompileWithAddress, u64)> {
76+
fn precompiles(&self) -> Vec<(Precompile, u64)> {
7577
vec![(
76-
PrecompileWithAddress::from((
78+
Precompile::from((
79+
PrecompileId::Custom(Cow::Borrowed("custom_echo")),
7780
PRECOMPILE_ADDR,
7881
custom_echo_precompile as fn(&[u8], u64) -> PrecompileResult,
7982
)),

crates/evm/core/src/backend/mod.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,8 +1131,6 @@ impl DatabaseExt for Backend {
11311131
// selected. This ensures that there are no gaps in depth which would
11321132
// otherwise cause issues with the tracer
11331133
fork.journaled_state.depth = active_journaled_state.depth;
1134-
// Set proper journal of state changes into the fork.
1135-
fork.journaled_state.journal = active_journaled_state.journal.clone();
11361134

11371135
// another edge case where a fork is created and selected during setup with not
11381136
// necessarily the same caller as for the test, however we must always
@@ -1198,10 +1196,8 @@ impl DatabaseExt for Backend {
11981196

11991197
let active = self.inner.get_fork_mut(active_idx);
12001198
active.journaled_state = self.fork_init_journaled_state.clone();
1201-
12021199
active.journaled_state.depth = journaled_state.depth;
1203-
// Set proper journal of state changes into the fork.
1204-
active.journaled_state.journal = journaled_state.journal.clone();
1200+
12051201
for addr in persistent_addrs {
12061202
merge_journaled_state_data(addr, journaled_state, &mut active.journaled_state);
12071203
}

0 commit comments

Comments
 (0)