Skip to content
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

primitives: rm alloy Header reexport #12515

Merged
merged 6 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
25 changes: 19 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion crates/blockchain-tree/src/block_indices.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,9 @@ impl BlockIndices {
#[cfg(test)]
mod tests {
use super::*;
use alloy_consensus::Header;
use alloy_primitives::B256;
use reth_primitives::{Header, SealedBlock, SealedHeader};
use reth_primitives::{SealedBlock, SealedHeader};

#[test]
fn pending_block_num_hash_returns_none_if_no_fork() {
Expand Down
4 changes: 2 additions & 2 deletions crates/blockchain-tree/src/blockchain_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1374,7 +1374,7 @@ where
#[cfg(test)]
mod tests {
use super::*;
use alloy_consensus::{TxEip1559, EMPTY_ROOT_HASH};
use alloy_consensus::{Header, TxEip1559, EMPTY_ROOT_HASH};
use alloy_eips::{eip1559::INITIAL_BASE_FEE, eip4895::Withdrawals};
use alloy_genesis::{Genesis, GenesisAccount};
use alloy_primitives::{keccak256, Address, PrimitiveSignature as Signature, B256};
Expand All @@ -1389,7 +1389,7 @@ mod tests {
use reth_primitives::{
proofs::{calculate_receipt_root, calculate_transaction_root},
revm_primitives::AccountInfo,
Account, BlockBody, Header, Transaction, TransactionSigned, TransactionSignedEcRecovered,
Account, BlockBody, Transaction, TransactionSigned, TransactionSignedEcRecovered,
};
use reth_provider::{
test_utils::{
Expand Down
19 changes: 9 additions & 10 deletions crates/chain-state/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ reth-trie.workspace = true
# ethereum
alloy-eips.workspace = true
alloy-primitives.workspace = true
alloy-consensus.workspace = true

# async
tokio = { workspace = true, features = ["sync", "macros", "rt-multi-thread"] }
Expand All @@ -42,7 +43,6 @@ pin-project.workspace = true
# optional deps for test-utils
alloy-signer = { workspace = true, optional = true }
alloy-signer-local = { workspace = true, optional = true }
alloy-consensus = { workspace = true, optional = true }
rand = { workspace = true, optional = true }
revm = { workspace = true, optional = true }

Expand All @@ -56,13 +56,12 @@ revm.workspace = true

[features]
test-utils = [
"alloy-signer",
"alloy-signer-local",
"alloy-consensus",
"rand",
"revm",
"reth-chainspec/test-utils",
"reth-primitives/test-utils",
"reth-trie/test-utils",
"revm?/test-utils"
"alloy-signer",
"alloy-signer-local",
"rand",
"revm",
"reth-chainspec/test-utils",
"reth-primitives/test-utils",
"reth-trie/test-utils",
"revm?/test-utils",
]
3 changes: 2 additions & 1 deletion crates/chain-state/src/in_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ use crate::{
CanonStateNotification, CanonStateNotificationSender, CanonStateNotifications,
ChainInfoTracker, MemoryOverlayStateProvider,
};
use alloy_consensus::Header;
use alloy_eips::{BlockHashOrNumber, BlockNumHash};
use alloy_primitives::{map::HashMap, Address, TxHash, B256};
use parking_lot::RwLock;
use reth_chainspec::ChainInfo;
use reth_execution_types::{Chain, ExecutionOutcome};
use reth_metrics::{metrics::Gauge, Metrics};
use reth_primitives::{
BlockWithSenders, Header, Receipt, Receipts, SealedBlock, SealedBlockWithSenders, SealedHeader,
BlockWithSenders, Receipt, Receipts, SealedBlock, SealedBlockWithSenders, SealedHeader,
TransactionMeta, TransactionSigned,
};
use reth_storage_api::StateProviderBox;
Expand Down
6 changes: 3 additions & 3 deletions crates/chain-state/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::{
in_memory::ExecutedBlock, CanonStateNotification, CanonStateNotifications,
CanonStateSubscriptions,
};
use alloy_consensus::{Transaction as _, TxEip1559, EMPTY_ROOT_HASH};
use alloy_consensus::{Header, Transaction as _, TxEip1559, EMPTY_ROOT_HASH};
use alloy_eips::{eip1559::INITIAL_BASE_FEE, eip7685::Requests};
use alloy_primitives::{Address, BlockNumber, B256, U256};
use alloy_signer::SignerSync;
Expand All @@ -12,8 +12,8 @@ use reth_chainspec::{ChainSpec, EthereumHardfork, MIN_TRANSACTION_GAS};
use reth_execution_types::{Chain, ExecutionOutcome};
use reth_primitives::{
proofs::{calculate_receipt_root, calculate_transaction_root, calculate_withdrawals_root},
BlockBody, Header, Receipt, Receipts, SealedBlock, SealedBlockWithSenders, SealedHeader,
Transaction, TransactionSigned, TransactionSignedEcRecovered,
BlockBody, Receipt, Receipts, SealedBlock, SealedBlockWithSenders, SealedHeader, Transaction,
TransactionSigned, TransactionSignedEcRecovered,
};
use reth_trie::{root::state_root_unhashed, updates::TrieUpdates, HashedPostState};
use revm::{db::BundleState, primitives::AccountInfo};
Expand Down
2 changes: 1 addition & 1 deletion crates/chainspec/src/api.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use crate::{ChainSpec, DepositContract};
use alloc::{boxed::Box, vec::Vec};
use alloy_chains::Chain;
use alloy_consensus::Header;
use alloy_eips::eip1559::BaseFeeParams;
use alloy_genesis::Genesis;
use alloy_primitives::B256;
use core::fmt::{Debug, Display};
use reth_network_peers::NodeRecord;
use reth_primitives_traits::Header;

/// Trait representing type configuring a chain spec.
#[auto_impl::auto_impl(&, Arc)]
Expand Down
7 changes: 5 additions & 2 deletions crates/chainspec/src/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ use alloy_genesis::Genesis;
use alloy_primitives::{address, b256, Address, BlockNumber, B256, U256};
use derive_more::From;

use alloy_consensus::constants::{DEV_GENESIS_HASH, MAINNET_GENESIS_HASH, SEPOLIA_GENESIS_HASH};
use alloy_consensus::{
constants::{DEV_GENESIS_HASH, MAINNET_GENESIS_HASH, SEPOLIA_GENESIS_HASH},
Header,
};
use alloy_eips::eip1559::ETHEREUM_BLOCK_GAS_LIMIT;
use reth_ethereum_forks::{
ChainHardforks, DisplayHardforks, EthereumHardfork, EthereumHardforks, ForkCondition,
Expand All @@ -21,7 +24,7 @@ use reth_network_peers::{
base_nodes, base_testnet_nodes, holesky_nodes, mainnet_nodes, op_nodes, op_testnet_nodes,
sepolia_nodes, NodeRecord,
};
use reth_primitives_traits::{constants::HOLESKY_GENESIS_HASH, Header, SealedHeader};
use reth_primitives_traits::{constants::HOLESKY_GENESIS_HASH, SealedHeader};
use reth_trie_common::root::state_root_ref_unhashed;

use crate::{constants::MAINNET_DEPOSIT_CONTRACT, once_cell_set, EthChainSpec, LazyLock, OnceLock};
Expand Down
37 changes: 19 additions & 18 deletions crates/cli/commands/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ reth-trie-common = { workspace = true, optional = true }
alloy-eips.workspace = true
alloy-primitives.workspace = true
alloy-rlp.workspace = true
alloy-consensus.workspace = true

itertools.workspace = true
futures.workspace = true
Expand Down Expand Up @@ -94,22 +95,22 @@ reth-discv4.workspace = true
[features]
default = []
arbitrary = [
"dep:proptest",
"dep:arbitrary",
"dep:proptest-arbitrary-interop",
"reth-primitives/arbitrary",
"reth-db-api/arbitrary",
"reth-eth-wire/arbitrary",
"reth-db/arbitrary",
"reth-chainspec/arbitrary",
"alloy-eips/arbitrary",
"alloy-primitives/arbitrary",
"reth-codecs/test-utils",
"reth-prune-types/test-utils",
"reth-stages-types/test-utils",
"reth-trie-common/test-utils",
"reth-codecs?/arbitrary",
"reth-prune-types?/arbitrary",
"reth-stages-types?/arbitrary",
"reth-trie-common?/arbitrary"
"dep:proptest",
"dep:arbitrary",
"dep:proptest-arbitrary-interop",
"reth-primitives/arbitrary",
"reth-db-api/arbitrary",
"reth-eth-wire/arbitrary",
"reth-db/arbitrary",
"reth-chainspec/arbitrary",
"alloy-eips/arbitrary",
"alloy-primitives/arbitrary",
"reth-codecs/test-utils",
"reth-prune-types/test-utils",
"reth-stages-types/test-utils",
"reth-trie-common/test-utils",
"reth-codecs?/arbitrary",
"reth-prune-types?/arbitrary",
"reth-stages-types?/arbitrary",
"reth-trie-common?/arbitrary",
]
2 changes: 1 addition & 1 deletion crates/cli/commands/src/db/get.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use alloy_consensus::Header;
use alloy_primitives::{hex, BlockHash};
use clap::Parser;
use reth_db::{
Expand All @@ -7,7 +8,6 @@ use reth_db::{
use reth_db_api::table::{Decompress, DupSort, Table};
use reth_db_common::DbTool;
use reth_node_builder::NodeTypesWithDB;
use reth_primitives::Header;
use reth_provider::{providers::ProviderNodeTypes, StaticFileProviderFactory};
use reth_static_file_types::StaticFileSegment;
use tracing::error;
Expand Down
3 changes: 2 additions & 1 deletion crates/cli/commands/src/init_state/without_evm.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use alloy_primitives::{BlockNumber, B256, U256};
use alloy_rlp::Decodable;

use alloy_consensus::Header;
use reth_primitives::{
BlockBody, Header, SealedBlock, SealedBlockWithSenders, SealedHeader, StaticFileSegment,
BlockBody, SealedBlock, SealedBlockWithSenders, SealedHeader, StaticFileSegment,
};
use reth_provider::{
providers::StaticFileProvider, BlockWriter, StageCheckpointWriter, StaticFileWriter,
Expand Down
3 changes: 2 additions & 1 deletion crates/cli/commands/src/test_vectors/tables.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use alloy_consensus::Header;
use alloy_primitives::{hex, private::getrandom::getrandom};
use arbitrary::Arbitrary;
use eyre::Result;
Expand All @@ -10,7 +11,7 @@ use proptest_arbitrary_interop::arb;
use reth_db::tables;
use reth_db_api::table::{DupSort, Table, TableRow};
use reth_fs_util as fs;
use reth_primitives::{Header, TransactionSignedNoHash};
use reth_primitives::TransactionSignedNoHash;
use std::collections::HashSet;
use tracing::error;

Expand Down
Loading
Loading