Skip to content

Commit 6eccd50

Browse files
authored
chore(deps): bump alloy-evm 0.20 + alloy-hardforks 0.3 (#11477)
* bump to alloy-evm 0.20.1 & alloy-hardforks 0.3.0 * optimize * fix fmt
1 parent 0eceb1b commit 6eccd50

File tree

6 files changed

+53
-21
lines changed

6 files changed

+53
-21
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ alloy-transport = { version = "1.0.23", default-features = false }
234234
alloy-transport-http = { version = "1.0.23", default-features = false }
235235
alloy-transport-ipc = { version = "1.0.23", default-features = false }
236236
alloy-transport-ws = { version = "1.0.23", default-features = false }
237-
alloy-hardforks = { version = "0.2.12", default-features = false }
238-
alloy-op-hardforks = { version = "0.2.12", default-features = false }
237+
alloy-hardforks = { version = "0.3.0", default-features = false }
238+
alloy-op-hardforks = { version = "0.3.0", default-features = false }
239239

240240
## alloy-core
241241
alloy-dyn-abi = "1.3.1"
@@ -265,8 +265,8 @@ revm-inspectors = { version = "0.29.0", features = ["serde"] }
265265
op-revm = { version = "10.0.0", default-features = false }
266266

267267
## alloy-evm
268-
alloy-evm = "0.19.0"
269-
alloy-op-evm = "0.19.0"
268+
alloy-evm = "0.20.1"
269+
alloy-op-evm = "0.20.1"
270270

271271
## cli
272272
anstream = "0.6"

crates/anvil/src/eth/backend/cheats.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@ use alloy_primitives::{
77
};
88
use parking_lot::RwLock;
99
use revm::precompile::{
10-
PrecompileError, PrecompileOutput, PrecompileResult, secp256k1::ec_recover_run,
10+
PrecompileError, PrecompileId, PrecompileOutput, PrecompileResult, secp256k1::ec_recover_run,
1111
utilities::right_pad,
1212
};
13-
use std::sync::Arc;
13+
use std::{borrow::Cow, sync::Arc};
14+
15+
/// ID for the [`CheatEcrecover::precompile_id`] precompile.
16+
static PRECOMPILE_ID_CHEAT_ECRECOVER: PrecompileId =
17+
PrecompileId::Custom(Cow::Borrowed("cheat_ecrecover"));
1418

1519
/// Manages user modifications that may affect the node's behavior
1620
///
@@ -127,6 +131,10 @@ impl Precompile for CheatEcrecover {
127131
ec_recover_run(input.data, input.gas)
128132
}
129133

134+
fn precompile_id(&self) -> &PrecompileId {
135+
&PRECOMPILE_ID_CHEAT_ECRECOVER
136+
}
137+
130138
fn is_pure(&self) -> bool {
131139
false
132140
}

crates/anvil/src/eth/backend/executor.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,10 @@ impl<DB: Db + ?Sized, V: TransactionValidator> Iterator for &mut TransactionExec
356356
if cheats.has_recover_overrides() {
357357
let cheat_ecrecover = CheatEcrecover::new(Arc::clone(&cheats));
358358
evm.precompiles_mut().apply_precompile(&EC_RECOVER, move |_| {
359-
Some(DynPrecompile::new_stateful(move |input| cheat_ecrecover.call(input)))
359+
Some(DynPrecompile::new_stateful(
360+
cheat_ecrecover.precompile_id().clone(),
361+
move |input| cheat_ecrecover.call(input),
362+
))
360363
});
361364
}
362365

crates/anvil/src/eth/backend/mem/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,10 @@ impl Backend {
11851185
if cheats.has_recover_overrides() {
11861186
let cheat_ecrecover = CheatEcrecover::new(Arc::clone(&cheats));
11871187
evm.precompiles_mut().apply_precompile(&EC_RECOVER, move |_| {
1188-
Some(DynPrecompile::new_stateful(move |input| cheat_ecrecover.call(input)))
1188+
Some(DynPrecompile::new_stateful(
1189+
cheat_ecrecover.precompile_id().clone(),
1190+
move |input| cheat_ecrecover.call(input),
1191+
))
11891192
});
11901193
}
11911194

crates/anvil/src/hardfork.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ pub fn spec_id_from_ethereum_hardfork(hardfork: EthereumHardfork) -> SpecId {
5454
EthereumHardfork::Cancun => SpecId::CANCUN,
5555
EthereumHardfork::Prague => SpecId::PRAGUE,
5656
EthereumHardfork::Osaka => SpecId::OSAKA,
57+
EthereumHardfork::Bpo1
58+
| EthereumHardfork::Bpo2
59+
| EthereumHardfork::Bpo3
60+
| EthereumHardfork::Bpo4
61+
| EthereumHardfork::Bpo5 => unimplemented!(),
5762
}
5863
}
5964

0 commit comments

Comments
 (0)