Skip to content

Commit 40b1cc3

Browse files
chore(ethereum): replace reth-primitives with alloy
Signed-off-by: Abhishekkochar <[email protected]>
1 parent 68d76f6 commit 40b1cc3

File tree

12 files changed

+35
-14
lines changed

12 files changed

+35
-14
lines changed

Diff for: Cargo.lock

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: crates/ethereum/consensus/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,7 @@ reth-consensus-common.workspace = true
1717
reth-primitives.workspace = true
1818
reth-consensus.workspace = true
1919

20+
# alloy
21+
alloy-primitives.workspace = true
22+
2023
tracing.workspace = true

Diff for: crates/ethereum/consensus/src/lib.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
99
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
1010

11+
use alloy_primitives::U256;
1112
use reth_chainspec::{EthChainSpec, EthereumHardfork, EthereumHardforks};
1213
use reth_consensus::{Consensus, ConsensusError, PostExecutionInput};
1314
use reth_consensus_common::validation::{
@@ -18,7 +19,7 @@ use reth_consensus_common::validation::{
1819
};
1920
use reth_primitives::{
2021
constants::MINIMUM_GAS_LIMIT, BlockWithSenders, Header, SealedBlock, SealedHeader,
21-
EMPTY_OMMER_ROOT_HASH, U256,
22+
EMPTY_OMMER_ROOT_HASH,
2223
};
2324
use std::{fmt::Debug, sync::Arc, time::SystemTime};
2425

@@ -232,8 +233,9 @@ impl<ChainSpec: Send + Sync + EthChainSpec + EthereumHardforks + Debug> Consensu
232233
#[cfg(test)]
233234
mod tests {
234235
use super::*;
236+
use alloy_primitives::{Sealable, B256};
235237
use reth_chainspec::{ChainSpec, ChainSpecBuilder};
236-
use reth_primitives::{alloy_primitives::Sealable, proofs, B256};
238+
use reth_primitives::proofs;
237239

238240
fn header_with_gas_limit(gas_limit: u64) -> SealedHeader {
239241
let header = Header { gas_limit: gas_limit.into(), ..Default::default() };

Diff for: crates/ethereum/consensus/src/validation.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
use alloy_primitives::{Bloom, B256};
12
use reth_chainspec::EthereumHardforks;
23
use reth_consensus::ConsensusError;
3-
use reth_primitives::{
4-
gas_spent_by_transactions, BlockWithSenders, Bloom, GotExpected, Receipt, Request, B256,
5-
};
4+
use reth_primitives::{gas_spent_by_transactions, BlockWithSenders, GotExpected, Receipt, Request};
65

76
/// Validate a block with regard to execution results:
87
///

Diff for: crates/ethereum/engine-primitives/Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ reth-rpc-types-compat.workspace = true
2121
alloy-rlp.workspace = true
2222
reth-chain-state.workspace = true
2323

24+
# alloy
25+
alloy-primitives.workspace = true
26+
alloy-eips.workspace = true
27+
2428
# misc
2529
serde.workspace = true
2630
sha2.workspace = true

Diff for: crates/ethereum/engine-primitives/src/payload.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
//! Contains types required for building a payload.
22
3+
use alloy_eips::eip4844::BlobTransactionSidecar;
4+
use alloy_primitives::{Address, B256, U256};
35
use alloy_rlp::Encodable;
46
use reth_chain_state::ExecutedBlock;
57
use reth_payload_primitives::{BuiltPayload, PayloadBuilderAttributes};
6-
use reth_primitives::{Address, BlobTransactionSidecar, SealedBlock, Withdrawals, B256, U256};
8+
use reth_primitives::{SealedBlock, Withdrawals};
79
use reth_rpc_types::engine::{
810
ExecutionPayloadEnvelopeV2, ExecutionPayloadEnvelopeV3, ExecutionPayloadEnvelopeV4,
911
ExecutionPayloadV1, PayloadAttributes, PayloadId,

Diff for: crates/ethereum/evm/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ reth-execution-types.workspace = true
2525
revm-primitives.workspace = true
2626

2727
# Alloy
28+
alloy-primitives.workspace = true
2829
alloy-eips.workspace = true
2930
alloy-sol-types.workspace = true
3031

Diff for: crates/ethereum/evm/src/dao_fork.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! DAO Fork related constants from [EIP-779](https://eips.ethereum.org/EIPS/eip-779).
22
//! It happened on Ethereum block 1_920_000
33
4-
use reth_primitives::{address, Address};
4+
use alloy_primitives::{address, Address};
55

66
/// Dao hardfork beneficiary that received ether from accounts from DAO and DAO creator children.
77
pub static DAO_HARDFORK_BENEFICIARY: Address = address!("bf4ed7b27f1d666546e30d74d50d173d20bca754");

Diff for: crates/ethereum/evm/src/execute.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use crate::{
55
EthEvmConfig,
66
};
77
use alloc::{boxed::Box, sync::Arc, vec, vec::Vec};
8+
use alloy_primitives::{BlockNumber, U256};
89
use core::fmt::Display;
910
use reth_chainspec::{ChainSpec, EthereumHardforks, MAINNET};
1011
use reth_ethereum_consensus::validate_block_post_execution;
@@ -20,9 +21,7 @@ use reth_evm::{
2021
ConfigureEvm,
2122
};
2223
use reth_execution_types::ExecutionOutcome;
23-
use reth_primitives::{
24-
BlockNumber, BlockWithSenders, EthereumHardfork, Header, Receipt, Request, U256,
25-
};
24+
use reth_primitives::{BlockWithSenders, EthereumHardfork, Header, Receipt, Request};
2625
use reth_prune_types::PruneModes;
2726
use reth_revm::{
2827
batch::BlockBatchRecord,
@@ -478,10 +477,11 @@ mod tests {
478477
eip4788::{BEACON_ROOTS_ADDRESS, BEACON_ROOTS_CODE, SYSTEM_ADDRESS},
479478
eip7002::{WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS, WITHDRAWAL_REQUEST_PREDEPLOY_CODE},
480479
};
480+
use alloy_primitives::{keccak256, TxKind, B256};
481481
use reth_chainspec::{ChainSpecBuilder, ForkCondition};
482482
use reth_primitives::{
483483
constants::{EMPTY_ROOT_HASH, ETH_TO_WEI},
484-
keccak256, public_key_to_address, Account, Block, Transaction, TxKind, TxLegacy, B256,
484+
public_key_to_address, Account, Block, Transaction, TxLegacy,
485485
};
486486
use reth_revm::{
487487
database::StateProviderDatabase, test_utils::StateProviderTest, TransitionState,

Diff for: crates/ethereum/evm/src/lib.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
extern crate alloc;
1313

1414
use alloc::vec::Vec;
15+
use alloy_primitives::{Address, U256};
1516
use reth_chainspec::{ChainSpec, Head};
1617
use reth_evm::{ConfigureEvm, ConfigureEvmEnv, NextBlockEnvAttributes};
17-
use reth_primitives::{transaction::FillTxEnv, Address, Header, TransactionSigned, U256};
18+
use reth_primitives::{transaction::FillTxEnv, Header, TransactionSigned};
1819
use revm_primitives::{
1920
AnalysisKind, BlobExcessGasAndPrice, BlockEnv, Bytes, CfgEnv, CfgEnvWithHandlerCfg, Env,
2021
SpecId, TxEnv, TxKind,
@@ -194,11 +195,12 @@ impl ConfigureEvm for EthEvmConfig {
194195
#[cfg(test)]
195196
mod tests {
196197
use super::*;
198+
use alloy_primitives::{B256, U256};
197199
use reth_chainspec::{Chain, ChainSpec, MAINNET};
198200
use reth_evm::execute::ProviderError;
199201
use reth_primitives::{
200202
revm_primitives::{BlockEnv, CfgEnv, SpecId},
201-
Genesis, Header, B256, KECCAK_EMPTY, U256,
203+
Genesis, Header, KECCAK_EMPTY,
202204
};
203205
use reth_revm::{
204206
db::{CacheDB, EmptyDBTyped},

Diff for: crates/ethereum/payload/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,8 @@ reth-chain-state.workspace = true
3030
# ethereum
3131
revm.workspace = true
3232

33+
# alloy
34+
alloy-primitives.workspace = true
35+
3336
# misc
3437
tracing.workspace = true

Diff for: crates/ethereum/payload/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
1010
#![allow(clippy::useless_let_if_seq)]
1111

12+
use alloy_primitives::U256;
1213
use reth_basic_payload_builder::{
1314
commit_withdrawals, is_better_payload, BuildArguments, BuildOutcome, PayloadBuilder,
1415
PayloadConfig, WithdrawalsOutcome,
@@ -33,7 +34,6 @@ use reth_primitives::{
3334
proofs::{self, calculate_requests_root},
3435
revm_primitives::{BlockEnv, CfgEnvWithHandlerCfg},
3536
Block, EthereumHardforks, Header, IntoRecoveredTransaction, Receipt, EMPTY_OMMER_ROOT_HASH,
36-
U256,
3737
};
3838
use reth_provider::StateProviderFactory;
3939
use reth_revm::database::StateProviderDatabase;

0 commit comments

Comments
 (0)