Skip to content

Commit d1f625f

Browse files
authored
chore: bump alloy-evm (paradigmxyz#14917)
1 parent a870ac4 commit d1f625f

File tree

49 files changed

+611
-2657
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+611
-2657
lines changed

Cargo.lock

Lines changed: 211 additions & 221 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
@@ -448,13 +448,13 @@ revm-inspectors = "0.16"
448448
alloy-chains = { version = "0.1.32", default-features = false }
449449
alloy-dyn-abi = "0.8.20"
450450
alloy-eip2124 = { version = "0.1.0", default-features = false }
451-
alloy-evm = { git = "https://github.com/alloy-rs/evm", rev = "69c77cf", default-features = false }
451+
alloy-evm = { git = "https://github.com/alloy-rs/evm", rev = "f9ed4d3", default-features = false }
452452
alloy-primitives = { version = "0.8.20", default-features = false, features = ["map-foldhash"] }
453453
alloy-rlp = { version = "0.3.10", default-features = false, features = ["core-net"] }
454454
alloy-sol-types = { version = "0.8.20", default-features = false }
455455
alloy-trie = { version = "0.7", default-features = false }
456456

457-
alloy-hardforks = { git = "https://github.com/alloy-rs/hardforks", rev = "42a3427" }
457+
alloy-hardforks = { git = "https://github.com/alloy-rs/hardforks", rev = "ae4176c" }
458458

459459
alloy-consensus = { version = "0.12.2", default-features = false }
460460
alloy-contract = { version = "0.12.2", default-features = false }
@@ -486,8 +486,8 @@ alloy-transport-ipc = { version = "0.12.2", default-features = false }
486486
alloy-transport-ws = { version = "0.12.2", default-features = false }
487487

488488
# op
489-
alloy-op-evm = { git = "https://github.com/alloy-rs/evm", rev = "69c77cf", default-features = false }
490-
alloy-op-hardforks = { git = "https://github.com/alloy-rs/hardforks", rev = "42a3427" }
489+
alloy-op-evm = { git = "https://github.com/alloy-rs/evm", rev = "f9ed4d3", default-features = false }
490+
alloy-op-hardforks = { git = "https://github.com/alloy-rs/hardforks", rev = "ae4176c" }
491491
op-alloy-rpc-types = { version = "0.11.0", default-features = false }
492492
op-alloy-rpc-types-engine = { version = "0.11.0", default-features = false }
493493
op-alloy-network = { version = "0.11.0", default-features = false }

crates/chainspec/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ alloy-trie = { workspace = true, features = ["ethereum"] }
1818
reth-primitives-traits.workspace = true
1919

2020
# ethereum
21+
alloy-evm.workspace = true
2122
alloy-chains = { workspace = true, features = ["serde", "rlp"] }
2223
alloy-eips = { workspace = true, features = ["serde"] }
2324
alloy-genesis.workspace = true
@@ -51,6 +52,7 @@ std = [
5152
"derive_more/std",
5253
"reth-network-peers/std",
5354
"serde_json/std",
55+
"alloy-evm/std",
5456
]
5557
arbitrary = [
5658
"alloy-chains/arbitrary",

crates/chainspec/src/spec.rs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
pub use alloy_eips::eip1559::BaseFeeParams;
2+
use alloy_evm::eth::spec::EthExecutorSpec;
23

34
use crate::{
45
constants::{MAINNET_DEPOSIT_CONTRACT, MAINNET_PRUNE_DELETE_LIMIT},
@@ -1000,6 +1001,12 @@ impl From<&Arc<ChainSpec>> for ChainSpecBuilder {
10001001
}
10011002
}
10021003

1004+
impl EthExecutorSpec for ChainSpec {
1005+
fn deposit_contract_address(&self) -> Option<Address> {
1006+
self.deposit_contract.map(|deposit_contract| deposit_contract.address)
1007+
}
1008+
}
1009+
10031010
/// `PoS` deposit contract details.
10041011
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
10051012
pub struct DepositContract {
@@ -1035,6 +1042,8 @@ pub fn test_fork_ids(spec: &ChainSpec, cases: &[(Head, ForkId)]) {
10351042
mod tests {
10361043
use super::*;
10371044
use alloy_chains::Chain;
1045+
use alloy_consensus::constants::ETH_TO_WEI;
1046+
use alloy_evm::block::calc::{base_block_reward, block_reward};
10381047
use alloy_genesis::{ChainConfig, GenesisAccount};
10391048
use alloy_primitives::{b256, hex};
10401049
use alloy_trie::{TrieAccount, EMPTY_ROOT_HASH};
@@ -2415,4 +2424,40 @@ Post-merge hard forks (timestamp based):
24152424
.all(|(expected, actual)| &**expected == *actual));
24162425
assert_eq!(expected_hardforks.len(), hardforks.len());
24172426
}
2427+
2428+
#[test]
2429+
fn test_calc_base_block_reward() {
2430+
// ((block number, td), reward)
2431+
let cases = [
2432+
// Pre-byzantium
2433+
((0, U256::ZERO), Some(ETH_TO_WEI * 5)),
2434+
// Byzantium
2435+
((4370000, U256::ZERO), Some(ETH_TO_WEI * 3)),
2436+
// Petersburg
2437+
((7280000, U256::ZERO), Some(ETH_TO_WEI * 2)),
2438+
// Merge
2439+
((15537394, U256::from(58_750_000_000_000_000_000_000_u128)), None),
2440+
];
2441+
2442+
for ((block_number, _td), expected_reward) in cases {
2443+
assert_eq!(base_block_reward(&*MAINNET, block_number), expected_reward);
2444+
}
2445+
}
2446+
2447+
#[test]
2448+
fn test_calc_full_block_reward() {
2449+
let base_reward = ETH_TO_WEI;
2450+
let one_thirty_twoth_reward = base_reward >> 5;
2451+
2452+
// (num_ommers, reward)
2453+
let cases = [
2454+
(0, base_reward),
2455+
(1, base_reward + one_thirty_twoth_reward),
2456+
(2, base_reward + one_thirty_twoth_reward * 2),
2457+
];
2458+
2459+
for (num_ommers, expected_reward) in cases {
2460+
assert_eq!(block_reward(base_reward, num_ommers), expected_reward);
2461+
}
2462+
}
24182463
}

crates/consensus/common/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ reth-chainspec.workspace = true
1616
reth-consensus.workspace = true
1717

1818
# ethereum
19-
alloy-primitives.workspace = true
2019
reth-primitives-traits.workspace = true
2120
alloy-consensus.workspace = true
2221
alloy-eips.workspace = true
@@ -32,9 +31,9 @@ default = ["std"]
3231
std = [
3332
"alloy-consensus/std",
3433
"alloy-eips/std",
35-
"alloy-primitives/std",
3634
"reth-chainspec/std",
3735
"reth-consensus/std",
3836
"reth-primitives-traits/std",
3937
"reth-ethereum-primitives/std",
38+
"alloy-primitives/std",
4039
]

crates/consensus/common/src/calc.rs

Lines changed: 0 additions & 152 deletions
This file was deleted.

crates/consensus/common/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,3 @@
1111

1212
/// Collection of consensus validation methods.
1313
pub mod validation;
14-
15-
/// Various calculation methods (e.g. block rewards)
16-
pub mod calc;

crates/engine/tree/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ reth-trie-sparse.workspace = true
3535
reth-trie.workspace = true
3636

3737
# alloy
38+
alloy-evm.workspace = true
3839
alloy-consensus.workspace = true
3940
alloy-eips.workspace = true
4041
alloy-primitives.workspace = true

crates/engine/tree/benches/state_root_task.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#![allow(missing_docs)]
55

66
use alloy_consensus::constants::KECCAK_EMPTY;
7+
use alloy_evm::block::StateChangeSource;
78
use alloy_primitives::{Address, B256};
89
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};
910
use proptest::test_runner::TestRunner;
@@ -14,7 +15,7 @@ use reth_db_common::init::init_genesis;
1415
use reth_engine_tree::tree::{
1516
executor::WorkloadExecutor, PayloadProcessor, StateProviderBuilder, TreeConfig,
1617
};
17-
use reth_evm::system_calls::{OnStateHook, StateChangeSource};
18+
use reth_evm::OnStateHook;
1819
use reth_evm_ethereum::EthEvmConfig;
1920
use reth_primitives_traits::{Account as RethAccount, StorageEntry};
2021
use reth_provider::{

crates/engine/tree/src/tree/payload_processor/mod.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,13 @@ use crate::tree::{
1010
StateProviderBuilder, TreeConfig,
1111
};
1212
use alloy_consensus::{transaction::Recovered, BlockHeader};
13+
use alloy_evm::block::StateChangeSource;
1314
use alloy_primitives::B256;
1415
use executor::WorkloadExecutor;
1516
use multiproof::*;
1617
use parking_lot::RwLock;
1718
use prewarm::PrewarmMetrics;
18-
use reth_evm::{
19-
system_calls::{OnStateHook, StateChangeSource},
20-
ConfigureEvm, ConfigureEvmEnvFor,
21-
};
19+
use reth_evm::{ConfigureEvm, ConfigureEvmEnvFor, OnStateHook};
2220
use reth_primitives_traits::{NodePrimitives, SealedHeaderFor};
2321
use reth_provider::{
2422
providers::ConsistentDbView, BlockReader, DatabaseProviderFactory, StateCommitmentProvider,
@@ -392,10 +390,11 @@ mod tests {
392390
},
393391
StateProviderBuilder, TreeConfig,
394392
};
393+
use alloy_evm::block::StateChangeSource;
395394
use reth_chainspec::ChainSpec;
396395
use reth_db_common::init::init_genesis;
397396
use reth_ethereum_primitives::EthPrimitives;
398-
use reth_evm::system_calls::{OnStateHook, StateChangeSource};
397+
use reth_evm::OnStateHook;
399398
use reth_evm_ethereum::EthEvmConfig;
400399
use reth_primitives_traits::{Account, StorageEntry};
401400
use reth_provider::{

crates/engine/tree/src/tree/payload_processor/multiproof.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
//! Multiproof task related functionality.
22
33
use crate::tree::payload_processor::{executor::WorkloadExecutor, sparse_trie::SparseTrieEvent};
4+
use alloy_evm::block::StateChangeSource;
45
use alloy_primitives::{keccak256, map::HashSet, B256};
56
use derive_more::derive::Deref;
67
use metrics::Histogram;
78
use reth_errors::ProviderError;
8-
use reth_evm::system_calls::StateChangeSource;
99
use reth_metrics::Metrics;
1010
use reth_provider::{
1111
providers::ConsistentDbView, BlockReader, DatabaseProviderFactory, StateCommitmentProvider,

crates/engine/util/Cargo.toml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,18 @@ workspace = true
1212

1313
[dependencies]
1414
# reth
15-
reth-ethereum-primitives.workspace = true
1615
reth-primitives.workspace = true
1716
reth-primitives-traits.workspace = true
1817
reth-errors.workspace = true
1918
reth-chainspec.workspace = true
20-
reth-consensus-common.workspace = true
2119
reth-fs-util.workspace = true
2220
reth-engine-primitives.workspace = true
2321
reth-evm.workspace = true
2422
reth-revm.workspace = true
2523
reth-provider.workspace = true
26-
reth-ethereum-forks.workspace = true
27-
revm-primitives.workspace = true
28-
revm-database.workspace = true
29-
reth-trie.workspace = true
3024
reth-payload-primitives.workspace = true
3125

3226
# alloy
33-
alloy-eips.workspace = true
34-
alloy-primitives.workspace = true
3527
alloy-rpc-types-engine.workspace = true
3628
alloy-consensus.workspace = true
3729

0 commit comments

Comments
 (0)