diff --git a/Cargo.lock b/Cargo.lock index db801a765..8453ae99f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6659,6 +6659,7 @@ dependencies = [ name = "reth-db" version = "1.0.7" dependencies = [ + "alloy-primitives", "arbitrary", "assert_matches", "bytes", @@ -6698,6 +6699,7 @@ dependencies = [ name = "reth-db-api" version = "1.0.7" dependencies = [ + "alloy-primitives", "arbitrary", "bytes", "derive_more", @@ -6751,6 +6753,7 @@ dependencies = [ name = "reth-db-models" version = "1.0.7" dependencies = [ + "alloy-primitives", "arbitrary", "bytes", "modular-bitfield", @@ -8178,6 +8181,7 @@ dependencies = [ name = "reth-provider" version = "1.0.7" dependencies = [ + "alloy-primitives", "alloy-rpc-types-engine", "assert_matches", "auto_impl", diff --git a/crates/storage/db-api/Cargo.toml b/crates/storage/db-api/Cargo.toml index 5bdad1500..1c2c757fe 100644 --- a/crates/storage/db-api/Cargo.toml +++ b/crates/storage/db-api/Cargo.toml @@ -22,6 +22,9 @@ reth-stages-types.workspace = true reth-storage-errors.workspace = true reth-trie-common.workspace = true +# ethereum +alloy-primitives.workspace = true + # codecs modular-bitfield.workspace = true parity-scale-codec = { version = "3.2.1", features = ["bytes"] } diff --git a/crates/storage/db-api/src/models/accounts.rs b/crates/storage/db-api/src/models/accounts.rs index b71864c2f..338a3a06f 100644 --- a/crates/storage/db-api/src/models/accounts.rs +++ b/crates/storage/db-api/src/models/accounts.rs @@ -7,7 +7,7 @@ use crate::{ table::{Decode, Encode}, DatabaseError, }; -use reth_primitives::{Address, BlockNumber, StorageKey}; +use alloy_primitives::{Address, BlockNumber, StorageKey}; use serde::{Deserialize, Serialize}; /// [`BlockNumber`] concatenated with [`Address`]. diff --git a/crates/storage/db-api/src/models/blocks.rs b/crates/storage/db-api/src/models/blocks.rs index 0da35da6b..b48baf6d6 100644 --- a/crates/storage/db-api/src/models/blocks.rs +++ b/crates/storage/db-api/src/models/blocks.rs @@ -1,7 +1,8 @@ //! Block related models and types. +use alloy_primitives::B256; use reth_codecs::{add_arbitrary_tests, Compact}; -use reth_primitives::{Header, B256}; +use reth_primitives::Header; use serde::{Deserialize, Serialize}; /// The storage representation of a block's ommers. diff --git a/crates/storage/db-api/src/models/mod.rs b/crates/storage/db-api/src/models/mod.rs index 5061876fb..3720242ef 100644 --- a/crates/storage/db-api/src/models/mod.rs +++ b/crates/storage/db-api/src/models/mod.rs @@ -4,8 +4,12 @@ use crate::{ table::{Compress, Decode, Decompress, Encode}, DatabaseError, }; +use alloy_primitives::{Address, Log, B256, U256}; use reth_codecs::{add_arbitrary_tests, Compact}; -use reth_primitives::{Address, B256, *}; +use reth_primitives::{ + Account, Bytecode, GenesisAccount, Header, Receipt, Requests, SealedHeader, StorageEntry, + TransactionSignedNoHash, TxType, +}; use reth_prune_types::{PruneCheckpoint, PruneSegment}; use reth_stages_types::StageCheckpoint; use reth_trie_common::{StoredNibbles, StoredNibblesSubKey, *}; diff --git a/crates/storage/db-api/src/models/sharded_key.rs b/crates/storage/db-api/src/models/sharded_key.rs index feba230a6..dd8702a48 100644 --- a/crates/storage/db-api/src/models/sharded_key.rs +++ b/crates/storage/db-api/src/models/sharded_key.rs @@ -3,7 +3,7 @@ use crate::{ table::{Decode, Encode}, DatabaseError, }; -use reth_primitives::BlockNumber; +use alloy_primitives::BlockNumber; use serde::{Deserialize, Serialize}; use std::hash::Hash; diff --git a/crates/storage/db-api/src/models/storage_sharded_key.rs b/crates/storage/db-api/src/models/storage_sharded_key.rs index 04243808f..b6538256e 100644 --- a/crates/storage/db-api/src/models/storage_sharded_key.rs +++ b/crates/storage/db-api/src/models/storage_sharded_key.rs @@ -3,8 +3,8 @@ use crate::{ table::{Decode, Encode}, DatabaseError, }; +use alloy_primitives::{Address, BlockNumber, B256}; use derive_more::AsRef; -use reth_primitives::{Address, BlockNumber, B256}; use serde::{Deserialize, Serialize}; use super::ShardedKey; diff --git a/crates/storage/db-api/src/scale.rs b/crates/storage/db-api/src/scale.rs index a837dadef..99382a4a9 100644 --- a/crates/storage/db-api/src/scale.rs +++ b/crates/storage/db-api/src/scale.rs @@ -2,7 +2,7 @@ use crate::{ table::{Compress, Decompress}, DatabaseError, }; -use reth_primitives::*; +use alloy_primitives::U256; mod sealed { pub trait Sealed {} diff --git a/crates/storage/db-models/Cargo.toml b/crates/storage/db-models/Cargo.toml index 6f0ae3ffc..9bcd54f38 100644 --- a/crates/storage/db-models/Cargo.toml +++ b/crates/storage/db-models/Cargo.toml @@ -16,6 +16,9 @@ workspace = true reth-codecs.workspace = true reth-primitives = { workspace = true, features = ["reth-codec"] } +# ethereum +alloy-primitives.workspace = true + # codecs modular-bitfield.workspace = true serde = { workspace = true, default-features = false } diff --git a/crates/storage/db-models/src/accounts.rs b/crates/storage/db-models/src/accounts.rs index bc84ea0fc..74736247a 100644 --- a/crates/storage/db-models/src/accounts.rs +++ b/crates/storage/db-models/src/accounts.rs @@ -1,7 +1,8 @@ use reth_codecs::{add_arbitrary_tests, Compact}; use serde::Serialize; -use reth_primitives::{Account, Address, Buf}; +use alloy_primitives::Address; +use reth_primitives::{Account, Buf}; /// Account as it is saved in the database. /// diff --git a/crates/storage/db-models/src/blocks.rs b/crates/storage/db-models/src/blocks.rs index 72ff433f8..3e740a2e1 100644 --- a/crates/storage/db-models/src/blocks.rs +++ b/crates/storage/db-models/src/blocks.rs @@ -1,7 +1,8 @@ use std::ops::Range; +use alloy_primitives::TxNumber; use reth_codecs::{add_arbitrary_tests, Compact}; -use reth_primitives::{TxNumber, Withdrawals}; +use reth_primitives::Withdrawals; use serde::{Deserialize, Serialize}; /// Total number of transactions. diff --git a/crates/storage/db/Cargo.toml b/crates/storage/db/Cargo.toml index 97046e54b..09ae5efd4 100644 --- a/crates/storage/db/Cargo.toml +++ b/crates/storage/db/Cargo.toml @@ -24,6 +24,9 @@ reth-stages-types.workspace = true reth-tracing.workspace = true reth-trie-common.workspace = true +# ethereum +alloy-primitives.workspace = true + # mdbx reth-libmdbx = { workspace = true, optional = true, features = [ "return-borrowed", diff --git a/crates/storage/db/benches/utils.rs b/crates/storage/db/benches/utils.rs index 7856627e1..97154d483 100644 --- a/crates/storage/db/benches/utils.rs +++ b/crates/storage/db/benches/utils.rs @@ -1,3 +1,4 @@ +use alloy_primitives::Bytes; use reth_db::{test_utils::create_test_rw_db_with_path, DatabaseEnv}; use reth_db_api::{ database::Database, @@ -5,7 +6,6 @@ use reth_db_api::{ transaction::DbTxMut, }; use reth_fs_util as fs; -use reth_primitives::Bytes; use std::{path::Path, sync::Arc}; /// Path where the DB is initialized for benchmarks. diff --git a/crates/storage/db/src/implementation/mdbx/mod.rs b/crates/storage/db/src/implementation/mdbx/mod.rs index e53fbfbe3..8b4a136c3 100644 --- a/crates/storage/db/src/implementation/mdbx/mod.rs +++ b/crates/storage/db/src/implementation/mdbx/mod.rs @@ -476,13 +476,14 @@ mod tests { test_utils::*, AccountChangeSets, }; + use alloy_primitives::{Address, B256, U256}; use reth_db_api::{ cursor::{DbDupCursorRO, DbDupCursorRW, ReverseWalker, Walker}, models::{AccountBeforeTx, ShardedKey}, table::{Encode, Table}, }; use reth_libmdbx::Error; - use reth_primitives::{Account, Address, Header, StorageEntry, B256, U256}; + use reth_primitives::{Account, Header, StorageEntry}; use reth_primitives_traits::IntegerList; use reth_storage_errors::db::{DatabaseWriteError, DatabaseWriteOperation}; use std::str::FromStr; diff --git a/crates/storage/db/src/static_file/cursor.rs b/crates/storage/db/src/static_file/cursor.rs index 18bb33671..f14e02308 100644 --- a/crates/storage/db/src/static_file/cursor.rs +++ b/crates/storage/db/src/static_file/cursor.rs @@ -1,8 +1,9 @@ use super::mask::{ColumnSelectorOne, ColumnSelectorThree, ColumnSelectorTwo}; +use alloy_primitives::B256; use derive_more::{Deref, DerefMut}; use reth_db_api::table::Decompress; use reth_nippy_jar::{DataReader, NippyJar, NippyJarCursor}; -use reth_primitives::{static_file::SegmentHeader, B256}; +use reth_primitives::static_file::SegmentHeader; use reth_storage_errors::provider::{ProviderError, ProviderResult}; use std::sync::Arc; diff --git a/crates/storage/db/src/static_file/masks.rs b/crates/storage/db/src/static_file/masks.rs index f3ce90f0d..ac2811a44 100644 --- a/crates/storage/db/src/static_file/masks.rs +++ b/crates/storage/db/src/static_file/masks.rs @@ -4,8 +4,9 @@ use crate::{ static_file::mask::{ColumnSelectorOne, ColumnSelectorTwo, HeaderMask}, HeaderTerminalDifficulties, RawValue, Receipts, Transactions, }; +use alloy_primitives::BlockHash; use reth_db_api::table::Table; -use reth_primitives::{BlockHash, Header}; +use reth_primitives::Header; // HEADER MASKS add_static_file_mask!(HeaderMask, Header, 0b001); diff --git a/crates/storage/db/src/tables/codecs/fuzz/mod.rs b/crates/storage/db/src/tables/codecs/fuzz/mod.rs index 1d038bf7e..9cb4caed3 100644 --- a/crates/storage/db/src/tables/codecs/fuzz/mod.rs +++ b/crates/storage/db/src/tables/codecs/fuzz/mod.rs @@ -17,7 +17,7 @@ macro_rules! impl_fuzzer_with_input { use reth_db_api::table; #[allow(unused_imports)] - use reth_primitives::*; + #[allow(unused_imports)] use reth_primitives_traits::*; diff --git a/crates/storage/db/src/tables/mod.rs b/crates/storage/db/src/tables/mod.rs index 090c22e97..835d1486d 100644 --- a/crates/storage/db/src/tables/mod.rs +++ b/crates/storage/db/src/tables/mod.rs @@ -19,6 +19,7 @@ pub use raw::{RawDupSort, RawKey, RawTable, RawValue, TableRawRow}; #[cfg(feature = "mdbx")] pub(crate) mod utils; +use alloy_primitives::{Address, BlockHash, BlockNumber, TxHash, TxNumber, B256}; use reth_db_api::{ models::{ accounts::BlockNumberAddress, @@ -30,8 +31,7 @@ use reth_db_api::{ table::{Decode, DupSort, Encode, Table}, }; use reth_primitives::{ - Account, Address, BlockHash, BlockNumber, Bytecode, Header, Receipt, Requests, StorageEntry, - TransactionSignedNoHash, TxHash, TxNumber, B256, + Account, Bytecode, Header, Receipt, Requests, StorageEntry, TransactionSignedNoHash, }; use reth_primitives_traits::IntegerList; use reth_prune_types::{PruneCheckpoint, PruneSegment}; diff --git a/crates/storage/errors/src/db.rs b/crates/storage/errors/src/db.rs index e2c275d5a..f27dacdc3 100644 --- a/crates/storage/errors/src/db.rs +++ b/crates/storage/errors/src/db.rs @@ -106,7 +106,7 @@ impl fmt::Display for DatabaseWriteError { f, "write operation {:?} failed for key \"{}\" in table {}: {}", self.operation, - reth_primitives::hex::encode(&self.key), + alloy_primitives::hex::encode(&self.key), self.table_name, self.info ) diff --git a/crates/storage/provider/Cargo.toml b/crates/storage/provider/Cargo.toml index 75d05e477..533cd8306 100644 --- a/crates/storage/provider/Cargo.toml +++ b/crates/storage/provider/Cargo.toml @@ -35,6 +35,7 @@ reth-chain-state.workspace = true reth-node-types.workspace = true # ethereum +alloy-primitives.workspace = true alloy-rpc-types-engine.workspace = true revm.workspace = true diff --git a/crates/storage/provider/src/bundle_state/state_reverts.rs b/crates/storage/provider/src/bundle_state/state_reverts.rs index 37d44cde5..09b892562 100644 --- a/crates/storage/provider/src/bundle_state/state_reverts.rs +++ b/crates/storage/provider/src/bundle_state/state_reverts.rs @@ -1,4 +1,4 @@ -use reth_primitives::{B256, U256}; +use alloy_primitives::{B256, U256}; use revm::db::states::RevertToSlot; use std::iter::Peekable; diff --git a/crates/storage/provider/src/providers/blockchain_provider.rs b/crates/storage/provider/src/providers/blockchain_provider.rs index 81d7c115b..8c8cb967c 100644 --- a/crates/storage/provider/src/providers/blockchain_provider.rs +++ b/crates/storage/provider/src/providers/blockchain_provider.rs @@ -7,6 +7,7 @@ use crate::{ RequestsProvider, StageCheckpointReader, StateProviderBox, StateProviderFactory, StateReader, StaticFileProviderFactory, TransactionVariant, TransactionsProvider, WithdrawalsProvider, }; +use alloy_primitives::{Address, BlockHash, BlockNumber, TxHash, TxNumber, B256, U256}; use alloy_rpc_types_engine::ForkchoiceState; use reth_chain_state::{ BlockState, CanonicalInMemoryState, ForkChoiceNotifications, ForkChoiceSubscriptions, @@ -19,10 +20,9 @@ use reth_evm::ConfigureEvmEnv; use reth_execution_types::ExecutionOutcome; use reth_node_types::NodeTypesWithDB; use reth_primitives::{ - Account, Address, Block, BlockHash, BlockHashOrNumber, BlockId, BlockNumHash, BlockNumber, - BlockNumberOrTag, BlockWithSenders, EthereumHardforks, Header, Receipt, SealedBlock, - SealedBlockWithSenders, SealedHeader, TransactionMeta, TransactionSigned, - TransactionSignedNoHash, TxHash, TxNumber, Withdrawal, Withdrawals, B256, U256, + Account, Block, BlockHashOrNumber, BlockId, BlockNumHash, BlockNumberOrTag, BlockWithSenders, + EthereumHardforks, Header, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, + TransactionMeta, TransactionSigned, TransactionSignedNoHash, Withdrawal, Withdrawals, }; use reth_prune_types::{PruneCheckpoint, PruneSegment}; use reth_stages_types::{StageCheckpoint, StageId}; @@ -1395,6 +1395,7 @@ mod tests { writer::UnifiedStorageWriter, BlockWriter, CanonChainTracker, StaticFileProviderFactory, StaticFileWriter, }; + use alloy_primitives::B256; use itertools::Itertools; use rand::Rng; use reth_chain_state::{ @@ -1409,7 +1410,7 @@ mod tests { use reth_primitives::{ BlockHashOrNumber, BlockNumHash, BlockNumberOrTag, BlockWithSenders, Receipt, SealedBlock, SealedBlockWithSenders, StaticFileSegment, TransactionMeta, TransactionSignedNoHash, - Withdrawals, B256, + Withdrawals, }; use reth_storage_api::{ BlockHashReader, BlockIdReader, BlockNumReader, BlockReader, BlockReaderIdExt, BlockSource, diff --git a/crates/storage/provider/src/providers/bundle_state_provider.rs b/crates/storage/provider/src/providers/bundle_state_provider.rs index 51824bb6f..50d3d46ce 100644 --- a/crates/storage/provider/src/providers/bundle_state_provider.rs +++ b/crates/storage/provider/src/providers/bundle_state_provider.rs @@ -1,7 +1,8 @@ use crate::{ AccountReader, BlockHashReader, ExecutionDataProvider, StateProvider, StateRootProvider, }; -use reth_primitives::{Account, Address, BlockNumber, Bytecode, Bytes, B256}; +use alloy_primitives::{Address, BlockNumber, Bytes, B256}; +use reth_primitives::{Account, Bytecode}; use reth_storage_api::{StateProofProvider, StorageRootProvider}; use reth_storage_errors::provider::ProviderResult; use reth_trie::{ @@ -160,8 +161,8 @@ impl StateProvider for BundleStat fn storage( &self, account: Address, - storage_key: reth_primitives::StorageKey, - ) -> ProviderResult> { + storage_key: alloy_primitives::StorageKey, + ) -> ProviderResult> { let u256_storage_key = storage_key.into(); if let Some(value) = self .block_execution_data_provider diff --git a/crates/storage/provider/src/providers/consistent_view.rs b/crates/storage/provider/src/providers/consistent_view.rs index b86eef226..4640f4603 100644 --- a/crates/storage/provider/src/providers/consistent_view.rs +++ b/crates/storage/provider/src/providers/consistent_view.rs @@ -1,8 +1,10 @@ use crate::{BlockNumReader, DatabaseProviderFactory, HeaderProvider}; +use alloy_primitives::B256; use reth_errors::ProviderError; -use reth_primitives::{GotExpected, B256}; +use reth_primitives::GotExpected; use reth_storage_api::{BlockReader, DBProvider}; use reth_storage_errors::provider::ProviderResult; + use reth_trie::HashedPostState; use reth_trie_db::DatabaseHashedPostState; diff --git a/crates/storage/provider/src/providers/database/mod.rs b/crates/storage/provider/src/providers/database/mod.rs index a055292a6..57f1a88b7 100644 --- a/crates/storage/provider/src/providers/database/mod.rs +++ b/crates/storage/provider/src/providers/database/mod.rs @@ -7,6 +7,7 @@ use crate::{ PruneCheckpointReader, RequestsProvider, StageCheckpointReader, StateProviderBox, StaticFileProviderFactory, TransactionVariant, TransactionsProvider, WithdrawalsProvider, }; +use alloy_primitives::{Address, BlockHash, BlockNumber, TxHash, TxNumber, B256, U256}; use core::fmt; use reth_chainspec::ChainInfo; use reth_db::{init_db, mdbx::DatabaseArguments, DatabaseEnv}; @@ -15,10 +16,9 @@ use reth_errors::{RethError, RethResult}; use reth_evm::ConfigureEvmEnv; use reth_node_types::NodeTypesWithDB; use reth_primitives::{ - Address, Block, BlockHash, BlockHashOrNumber, BlockNumber, BlockWithSenders, Header, Receipt, - SealedBlock, SealedBlockWithSenders, SealedHeader, StaticFileSegment, TransactionMeta, - TransactionSigned, TransactionSignedNoHash, TxHash, TxNumber, Withdrawal, Withdrawals, B256, - U256, + Block, BlockHashOrNumber, BlockWithSenders, Header, Receipt, SealedBlock, + SealedBlockWithSenders, SealedHeader, StaticFileSegment, TransactionMeta, TransactionSigned, + TransactionSignedNoHash, Withdrawal, Withdrawals, }; use reth_prune_types::{PruneCheckpoint, PruneModes, PruneSegment}; use reth_stages_types::{StageCheckpoint, StageId}; @@ -633,6 +633,7 @@ mod tests { test_utils::{blocks::TEST_BLOCK, create_test_provider_factory, MockNodeTypesWithDB}, BlockHashReader, BlockNumReader, BlockWriter, HeaderSyncGapProvider, TransactionsProvider, }; + use alloy_primitives::{TxNumber, B256, U256}; use assert_matches::assert_matches; use rand::Rng; use reth_chainspec::ChainSpecBuilder; @@ -641,7 +642,7 @@ mod tests { tables, test_utils::{create_test_static_files_dir, ERROR_TEMPDIR}, }; - use reth_primitives::{StaticFileSegment, TxNumber, B256, U256}; + use reth_primitives::StaticFileSegment; use reth_prune_types::{PruneMode, PruneModes}; use reth_storage_errors::provider::ProviderError; use reth_testing_utils::generators::{self, random_block, random_header, BlockParams}; diff --git a/crates/storage/provider/src/providers/database/provider.rs b/crates/storage/provider/src/providers/database/provider.rs index 7da5459be..5b43f7770 100644 --- a/crates/storage/provider/src/providers/database/provider.rs +++ b/crates/storage/provider/src/providers/database/provider.rs @@ -15,6 +15,7 @@ use crate::{ StatsReader, StorageReader, StorageTrieWriter, TransactionVariant, TransactionsProvider, TransactionsProviderExt, TrieWriter, WithdrawalsProvider, }; +use alloy_primitives::{keccak256, Address, BlockHash, BlockNumber, TxHash, TxNumber, B256, U256}; use itertools::{izip, Itertools}; use rayon::slice::ParallelSliceMut; use reth_chainspec::{ChainInfo, ChainSpec, EthereumHardforks}; @@ -37,11 +38,10 @@ use reth_evm::ConfigureEvmEnv; use reth_execution_types::{Chain, ExecutionOutcome}; use reth_network_p2p::headers::downloader::SyncTarget; use reth_primitives::{ - keccak256, Account, Address, Block, BlockHash, BlockHashOrNumber, BlockNumber, - BlockWithSenders, Bytecode, GotExpected, Header, Receipt, Requests, SealedBlock, - SealedBlockWithSenders, SealedHeader, StaticFileSegment, StorageEntry, TransactionMeta, - TransactionSigned, TransactionSignedEcRecovered, TransactionSignedNoHash, TxHash, TxNumber, - Withdrawal, Withdrawals, B256, U256, + Account, Block, BlockHashOrNumber, BlockWithSenders, Bytecode, GotExpected, Header, Receipt, + Requests, SealedBlock, SealedBlockWithSenders, SealedHeader, StaticFileSegment, StorageEntry, + TransactionMeta, TransactionSigned, TransactionSignedEcRecovered, TransactionSignedNoHash, + Withdrawal, Withdrawals, }; use reth_prune_types::{PruneCheckpoint, PruneModes, PruneSegment}; use reth_stages_types::{StageCheckpoint, StageId}; diff --git a/crates/storage/provider/src/providers/mod.rs b/crates/storage/provider/src/providers/mod.rs index 8c4046146..ce1ca8766 100644 --- a/crates/storage/provider/src/providers/mod.rs +++ b/crates/storage/provider/src/providers/mod.rs @@ -7,6 +7,7 @@ use crate::{ StageCheckpointReader, StateProviderBox, StateProviderFactory, StaticFileProviderFactory, TransactionVariant, TransactionsProvider, TreeViewer, WithdrawalsProvider, }; +use alloy_primitives::{Address, BlockHash, BlockNumber, TxHash, TxNumber, B256, U256}; use reth_blockchain_tree_api::{ error::{CanonicalError, InsertBlockError}, BlockValidationKind, BlockchainTreeEngine, BlockchainTreeViewer, CanonicalOutcome, @@ -19,10 +20,9 @@ use reth_db_api::models::{AccountBeforeTx, StoredBlockBodyIndices}; use reth_evm::ConfigureEvmEnv; use reth_node_types::NodeTypesWithDB; use reth_primitives::{ - Account, Address, Block, BlockHash, BlockHashOrNumber, BlockId, BlockNumHash, BlockNumber, - BlockNumberOrTag, BlockWithSenders, Header, Receipt, SealedBlock, SealedBlockWithSenders, - SealedHeader, TransactionMeta, TransactionSigned, TransactionSignedNoHash, TxHash, TxNumber, - Withdrawal, Withdrawals, B256, U256, + Account, Block, BlockHashOrNumber, BlockId, BlockNumHash, BlockNumberOrTag, BlockWithSenders, + Header, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, TransactionMeta, + TransactionSigned, TransactionSignedNoHash, Withdrawal, Withdrawals, }; use reth_prune_types::{PruneCheckpoint, PruneSegment}; use reth_stages_types::{StageCheckpoint, StageId}; diff --git a/crates/storage/provider/src/providers/state/historical.rs b/crates/storage/provider/src/providers/state/historical.rs index 86f4800e1..a8613a8d1 100644 --- a/crates/storage/provider/src/providers/state/historical.rs +++ b/crates/storage/provider/src/providers/state/historical.rs @@ -2,6 +2,7 @@ use crate::{ providers::{state::macros::delegate_provider_impls, StaticFileProvider}, AccountReader, BlockHashReader, ProviderError, StateProvider, StateRootProvider, }; +use alloy_primitives::{Address, BlockNumber, Bytes, StorageKey, StorageValue, B256}; use reth_db::{tables, BlockNumberList}; use reth_db_api::{ cursor::{DbCursorRO, DbDupCursorRO}, @@ -9,10 +10,7 @@ use reth_db_api::{ table::Table, transaction::DbTx, }; -use reth_primitives::{ - constants::EPOCH_SLOTS, Account, Address, BlockNumber, Bytecode, Bytes, StaticFileSegment, - StorageKey, StorageValue, B256, -}; +use reth_primitives::{constants::EPOCH_SLOTS, Account, Bytecode, StaticFileSegment}; use reth_storage_api::{StateProofProvider, StorageRootProvider}; use reth_storage_errors::provider::ProviderResult; use reth_trie::{ @@ -496,12 +494,13 @@ mod tests { AccountReader, HistoricalStateProvider, HistoricalStateProviderRef, StateProvider, StaticFileProviderFactory, }; + use alloy_primitives::{address, b256, Address, B256, U256}; use reth_db::{tables, BlockNumberList}; use reth_db_api::{ models::{storage_sharded_key::StorageShardedKey, AccountBeforeTx, ShardedKey}, transaction::{DbTx, DbTxMut}, }; - use reth_primitives::{address, b256, Account, Address, StorageEntry, B256, U256}; + use reth_primitives::{Account, StorageEntry}; use reth_storage_errors::provider::ProviderError; const ADDRESS: Address = address!("0000000000000000000000000000000000000001"); diff --git a/crates/storage/provider/src/providers/state/latest.rs b/crates/storage/provider/src/providers/state/latest.rs index 16ea5cdcd..74dfdac73 100644 --- a/crates/storage/provider/src/providers/state/latest.rs +++ b/crates/storage/provider/src/providers/state/latest.rs @@ -2,15 +2,13 @@ use crate::{ providers::{state::macros::delegate_provider_impls, StaticFileProvider}, AccountReader, BlockHashReader, StateProvider, StateRootProvider, }; +use alloy_primitives::{Address, BlockNumber, Bytes, StorageKey, StorageValue, B256}; use reth_db::tables; use reth_db_api::{ cursor::{DbCursorRO, DbDupCursorRO}, transaction::DbTx, }; -use reth_primitives::{ - Account, Address, BlockNumber, Bytecode, Bytes, StaticFileSegment, StorageKey, StorageValue, - B256, -}; +use reth_primitives::{Account, Bytecode, StaticFileSegment}; use reth_storage_api::{StateProofProvider, StorageRootProvider}; use reth_storage_errors::provider::{ProviderError, ProviderResult}; use reth_trie::{ diff --git a/crates/storage/provider/src/providers/state/macros.rs b/crates/storage/provider/src/providers/state/macros.rs index 0e86f2fae..49a168f4e 100644 --- a/crates/storage/provider/src/providers/state/macros.rs +++ b/crates/storage/provider/src/providers/state/macros.rs @@ -31,29 +31,29 @@ macro_rules! delegate_provider_impls { $crate::providers::state::macros::delegate_impls_to_as_ref!( for $target => AccountReader $(where [$($generics)*])? { - fn basic_account(&self, address: reth_primitives::Address) -> reth_storage_errors::provider::ProviderResult>; + fn basic_account(&self, address: alloy_primitives::Address) -> reth_storage_errors::provider::ProviderResult>; } BlockHashReader $(where [$($generics)*])? { - fn block_hash(&self, number: u64) -> reth_storage_errors::provider::ProviderResult>; - fn canonical_hashes_range(&self, start: reth_primitives::BlockNumber, end: reth_primitives::BlockNumber) -> reth_storage_errors::provider::ProviderResult>; + fn block_hash(&self, number: u64) -> reth_storage_errors::provider::ProviderResult>; + fn canonical_hashes_range(&self, start: alloy_primitives::BlockNumber, end: alloy_primitives::BlockNumber) -> reth_storage_errors::provider::ProviderResult>; } StateProvider $(where [$($generics)*])? { - fn storage(&self, account: reth_primitives::Address, storage_key: reth_primitives::StorageKey) -> reth_storage_errors::provider::ProviderResult>; - fn bytecode_by_hash(&self, code_hash: reth_primitives::B256) -> reth_storage_errors::provider::ProviderResult>; + fn storage(&self, account: alloy_primitives::Address, storage_key: alloy_primitives::StorageKey) -> reth_storage_errors::provider::ProviderResult>; + fn bytecode_by_hash(&self, code_hash: alloy_primitives::B256) -> reth_storage_errors::provider::ProviderResult>; } StateRootProvider $(where [$($generics)*])? { - fn state_root(&self, state: reth_trie::HashedPostState) -> reth_storage_errors::provider::ProviderResult; - fn state_root_from_nodes(&self, input: reth_trie::TrieInput) -> reth_storage_errors::provider::ProviderResult; - fn state_root_with_updates(&self, state: reth_trie::HashedPostState) -> reth_storage_errors::provider::ProviderResult<(reth_primitives::B256, reth_trie::updates::TrieUpdates)>; - fn state_root_from_nodes_with_updates(&self, input: reth_trie::TrieInput) -> reth_storage_errors::provider::ProviderResult<(reth_primitives::B256, reth_trie::updates::TrieUpdates)>; + fn state_root(&self, state: reth_trie::HashedPostState) -> reth_storage_errors::provider::ProviderResult; + fn state_root_from_nodes(&self, input: reth_trie::TrieInput) -> reth_storage_errors::provider::ProviderResult; + fn state_root_with_updates(&self, state: reth_trie::HashedPostState) -> reth_storage_errors::provider::ProviderResult<(alloy_primitives::B256, reth_trie::updates::TrieUpdates)>; + fn state_root_from_nodes_with_updates(&self, input: reth_trie::TrieInput) -> reth_storage_errors::provider::ProviderResult<(alloy_primitives::B256, reth_trie::updates::TrieUpdates)>; } StorageRootProvider $(where [$($generics)*])? { - fn storage_root(&self, address: reth_primitives::Address, storage: reth_trie::HashedStorage) -> reth_storage_errors::provider::ProviderResult; + fn storage_root(&self, address: alloy_primitives::Address, storage: reth_trie::HashedStorage) -> reth_storage_errors::provider::ProviderResult; } StateProofProvider $(where [$($generics)*])? { - fn proof(&self, input: reth_trie::TrieInput, address: reth_primitives::Address, slots: &[reth_primitives::B256]) -> reth_storage_errors::provider::ProviderResult; - fn multiproof(&self, input: reth_trie::TrieInput, targets: std::collections::HashMap>) -> reth_storage_errors::provider::ProviderResult; - fn witness(&self, input: reth_trie::TrieInput, target: reth_trie::HashedPostState) -> reth_storage_errors::provider::ProviderResult>; + fn proof(&self, input: reth_trie::TrieInput, address: alloy_primitives::Address, slots: &[alloy_primitives::B256]) -> reth_storage_errors::provider::ProviderResult; + fn multiproof(&self, input: reth_trie::TrieInput, targets: std::collections::HashMap>) -> reth_storage_errors::provider::ProviderResult; + fn witness(&self, input: reth_trie::TrieInput, target: reth_trie::HashedPostState) -> reth_storage_errors::provider::ProviderResult>; } ); } diff --git a/crates/storage/provider/src/providers/static_file/jar.rs b/crates/storage/provider/src/providers/static_file/jar.rs index 8eaaf505a..2f7b0add7 100644 --- a/crates/storage/provider/src/providers/static_file/jar.rs +++ b/crates/storage/provider/src/providers/static_file/jar.rs @@ -6,12 +6,13 @@ use crate::{ to_range, BlockHashReader, BlockNumReader, HeaderProvider, ReceiptProvider, TransactionsProvider, }; +use alloy_primitives::{Address, BlockHash, BlockNumber, TxHash, TxNumber, B256, U256}; use reth_chainspec::ChainInfo; use reth_db::static_file::{HeaderMask, ReceiptMask, StaticFileCursor, TransactionMask}; use reth_db_api::models::CompactU256; use reth_primitives::{ - Address, BlockHash, BlockHashOrNumber, BlockNumber, Header, Receipt, SealedHeader, - TransactionMeta, TransactionSigned, TransactionSignedNoHash, TxHash, TxNumber, B256, U256, + BlockHashOrNumber, Header, Receipt, SealedHeader, TransactionMeta, TransactionSigned, + TransactionSignedNoHash, }; use reth_storage_errors::provider::{ProviderError, ProviderResult}; use std::{ diff --git a/crates/storage/provider/src/providers/static_file/manager.rs b/crates/storage/provider/src/providers/static_file/manager.rs index 8ed33cf19..03d6f6904 100644 --- a/crates/storage/provider/src/providers/static_file/manager.rs +++ b/crates/storage/provider/src/providers/static_file/manager.rs @@ -8,6 +8,7 @@ use crate::{ HeaderProvider, ReceiptProvider, RequestsProvider, StageCheckpointReader, StatsReader, TransactionVariant, TransactionsProvider, TransactionsProviderExt, WithdrawalsProvider, }; +use alloy_primitives::{keccak256, Address, BlockHash, BlockNumber, TxHash, TxNumber, B256, U256}; use dashmap::DashMap; use notify::{RecommendedWatcher, RecursiveMode, Watcher}; use parking_lot::RwLock; @@ -25,12 +26,10 @@ use reth_db_api::{ }; use reth_nippy_jar::{NippyJar, NippyJarChecker, CONFIG_FILE_EXTENSION}; use reth_primitives::{ - keccak256, static_file::{find_fixed_range, HighestStaticFiles, SegmentHeader, SegmentRangeInclusive}, - Address, Block, BlockHash, BlockHashOrNumber, BlockNumber, BlockWithSenders, Header, Receipt, - SealedBlock, SealedBlockWithSenders, SealedHeader, StaticFileSegment, TransactionMeta, - TransactionSigned, TransactionSignedNoHash, TxHash, TxNumber, Withdrawal, Withdrawals, B256, - U256, + Block, BlockHashOrNumber, BlockWithSenders, Header, Receipt, SealedBlock, + SealedBlockWithSenders, SealedHeader, StaticFileSegment, TransactionMeta, TransactionSigned, + TransactionSignedNoHash, Withdrawal, Withdrawals, }; use reth_stages_types::{PipelineTarget, StageId}; use reth_storage_errors::provider::{ProviderError, ProviderResult}; diff --git a/crates/storage/provider/src/providers/static_file/mod.rs b/crates/storage/provider/src/providers/static_file/mod.rs index abbc774c7..a4bd2cf57 100644 --- a/crates/storage/provider/src/providers/static_file/mod.rs +++ b/crates/storage/provider/src/providers/static_file/mod.rs @@ -58,10 +58,11 @@ impl Deref for LoadedJar { mod tests { use super::*; use crate::{test_utils::create_test_provider_factory, HeaderProvider}; + use alloy_primitives::{B256, U256}; use rand::seq::SliceRandom; use reth_db::{CanonicalHeaders, HeaderNumbers, HeaderTerminalDifficulties, Headers}; use reth_db_api::transaction::DbTxMut; - use reth_primitives::{static_file::find_fixed_range, B256, U256}; + use reth_primitives::static_file::find_fixed_range; use reth_testing_utils::generators::{self, random_header_range}; #[test] diff --git a/crates/storage/provider/src/providers/static_file/writer.rs b/crates/storage/provider/src/providers/static_file/writer.rs index d89618077..b5e2a07cc 100644 --- a/crates/storage/provider/src/providers/static_file/writer.rs +++ b/crates/storage/provider/src/providers/static_file/writer.rs @@ -2,14 +2,14 @@ use super::{ manager::StaticFileProviderInner, metrics::StaticFileProviderMetrics, StaticFileProvider, }; use crate::providers::static_file::metrics::StaticFileProviderOperation; +use alloy_primitives::{BlockHash, BlockNumber, TxNumber, U256}; use parking_lot::{lock_api::RwLockWriteGuard, RawRwLock, RwLock}; use reth_codecs::Compact; use reth_db_api::models::CompactU256; use reth_nippy_jar::{NippyJar, NippyJarError, NippyJarWriter}; use reth_primitives::{ static_file::{find_fixed_range, SegmentHeader, SegmentRangeInclusive}, - BlockHash, BlockNumber, Header, Receipt, StaticFileSegment, TransactionSignedNoHash, TxNumber, - U256, + Header, Receipt, StaticFileSegment, TransactionSignedNoHash, }; use reth_storage_errors::provider::{ProviderError, ProviderResult}; use std::{ diff --git a/crates/storage/provider/src/test_utils/blocks.rs b/crates/storage/provider/src/test_utils/blocks.rs index 8c913da66..439a4b955 100644 --- a/crates/storage/provider/src/test_utils/blocks.rs +++ b/crates/storage/provider/src/test_utils/blocks.rs @@ -1,13 +1,14 @@ //! Dummy blocks and data for tests use crate::{DatabaseProviderRW, ExecutionOutcome}; -use alloy_primitives::Log; +use alloy_primitives::{ + b256, hex_literal::hex, Address, BlockNumber, Bytes, Log, TxKind, B256, U256, +}; use once_cell::sync::Lazy; use reth_db::tables; use reth_db_api::{database::Database, models::StoredBlockBodyIndices}; use reth_primitives::{ - alloy_primitives, b256, hex_literal::hex, Account, Address, BlockNumber, Bytes, Header, - Receipt, Requests, SealedBlock, SealedBlockWithSenders, SealedHeader, Signature, Transaction, - TransactionSigned, TxKind, TxLegacy, TxType, Withdrawal, Withdrawals, B256, U256, + Account, Header, Receipt, Requests, SealedBlock, SealedBlockWithSenders, SealedHeader, + Signature, Transaction, TransactionSigned, TxLegacy, TxType, Withdrawal, Withdrawals, }; use reth_trie::root::{state_root_unhashed, storage_root_unhashed}; use revm::{ diff --git a/crates/storage/provider/src/test_utils/mock.rs b/crates/storage/provider/src/test_utils/mock.rs index c14eb3d54..4b54e243d 100644 --- a/crates/storage/provider/src/test_utils/mock.rs +++ b/crates/storage/provider/src/test_utils/mock.rs @@ -6,6 +6,10 @@ use crate::{ StateProviderBox, StateProviderFactory, StateReader, StateRootProvider, TransactionVariant, TransactionsProvider, WithdrawalsProvider, }; +use alloy_primitives::{ + keccak256, Address, BlockHash, BlockNumber, Bytes, StorageKey, StorageValue, TxHash, TxNumber, + B256, U256, +}; use parking_lot::Mutex; use reth_chainspec::{ChainInfo, ChainSpec}; use reth_db::mock::{DatabaseMock, TxMock}; @@ -13,11 +17,9 @@ use reth_db_api::models::{AccountBeforeTx, StoredBlockBodyIndices}; use reth_evm::ConfigureEvmEnv; use reth_execution_types::{Chain, ExecutionOutcome}; use reth_primitives::{ - keccak256, Account, Address, Block, BlockHash, BlockHashOrNumber, BlockId, BlockNumber, - BlockNumberOrTag, BlockWithSenders, Bytecode, Bytes, GotExpected, Header, Receipt, SealedBlock, - SealedBlockWithSenders, SealedHeader, StorageKey, StorageValue, TransactionMeta, - TransactionSigned, TransactionSignedNoHash, TxHash, TxNumber, Withdrawal, Withdrawals, B256, - U256, + Account, Block, BlockHashOrNumber, BlockId, BlockNumberOrTag, BlockWithSenders, Bytecode, + GotExpected, Header, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, + TransactionMeta, TransactionSigned, TransactionSignedNoHash, Withdrawal, Withdrawals, }; use reth_stages_types::{StageCheckpoint, StageId}; use reth_storage_api::{ @@ -308,7 +310,7 @@ impl TransactionsProvider for MockEthProvider { fn transactions_by_block_range( &self, - range: impl RangeBounds, + range: impl RangeBounds, ) -> ProviderResult>> { // init btreemap so we can return in order let mut map = BTreeMap::new(); @@ -439,7 +441,7 @@ impl BlockNumReader for MockEthProvider { self.best_block_number() } - fn block_number(&self, hash: B256) -> ProviderResult> { + fn block_number(&self, hash: B256) -> ProviderResult> { let lock = self.blocks.lock(); let num = lock.iter().find_map(|(h, b)| (*h == hash).then_some(b.number)); Ok(num) diff --git a/crates/storage/provider/src/test_utils/mod.rs b/crates/storage/provider/src/test_utils/mod.rs index e2d7e6d77..220078109 100644 --- a/crates/storage/provider/src/test_utils/mod.rs +++ b/crates/storage/provider/src/test_utils/mod.rs @@ -1,4 +1,5 @@ use crate::{providers::StaticFileProvider, HashingWriter, ProviderFactory, TrieWriter}; +use alloy_primitives::B256; use reth_chainspec::{ChainSpec, MAINNET}; use reth_db::{ test_utils::{create_test_rw_db, create_test_static_files_dir, TempDatabase}, @@ -6,7 +7,7 @@ use reth_db::{ }; use reth_errors::ProviderResult; use reth_node_types::{NodeTypesWithDB, NodeTypesWithDBAdapter}; -use reth_primitives::{Account, StorageEntry, B256}; +use reth_primitives::{Account, StorageEntry}; use reth_trie::StateRoot; use reth_trie_db::DatabaseStateRoot; use std::sync::Arc; diff --git a/crates/storage/provider/src/test_utils/noop.rs b/crates/storage/provider/src/test_utils/noop.rs index b58cdbea3..96ed401de 100644 --- a/crates/storage/provider/src/test_utils/noop.rs +++ b/crates/storage/provider/src/test_utils/noop.rs @@ -4,6 +4,9 @@ use std::{ sync::Arc, }; +use alloy_primitives::{ + Address, BlockHash, BlockNumber, Bytes, StorageKey, StorageValue, TxHash, TxNumber, B256, U256, +}; use reth_chain_state::{ CanonStateNotifications, CanonStateSubscriptions, ForkChoiceNotifications, ForkChoiceSubscriptions, @@ -13,10 +16,9 @@ use reth_db_api::models::{AccountBeforeTx, StoredBlockBodyIndices}; use reth_errors::ProviderError; use reth_evm::ConfigureEvmEnv; use reth_primitives::{ - Account, Address, Block, BlockHash, BlockHashOrNumber, BlockId, BlockNumber, BlockNumberOrTag, - BlockWithSenders, Bytecode, Bytes, Header, Receipt, SealedBlock, SealedBlockWithSenders, - SealedHeader, StorageKey, StorageValue, TransactionMeta, TransactionSigned, - TransactionSignedNoHash, TxHash, TxNumber, Withdrawal, Withdrawals, B256, U256, + Account, Block, BlockHashOrNumber, BlockId, BlockNumberOrTag, BlockWithSenders, Bytecode, + Header, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, TransactionMeta, + TransactionSigned, TransactionSignedNoHash, Withdrawal, Withdrawals, }; use reth_prune_types::{PruneCheckpoint, PruneSegment}; use reth_stages_types::{StageCheckpoint, StageId}; diff --git a/crates/storage/provider/src/traits/block.rs b/crates/storage/provider/src/traits/block.rs index cbdafbbce..8e3a54d86 100644 --- a/crates/storage/provider/src/traits/block.rs +++ b/crates/storage/provider/src/traits/block.rs @@ -1,6 +1,7 @@ +use alloy_primitives::BlockNumber; use reth_db_api::models::StoredBlockBodyIndices; use reth_execution_types::{Chain, ExecutionOutcome}; -use reth_primitives::{BlockNumber, SealedBlockWithSenders}; +use reth_primitives::SealedBlockWithSenders; use reth_storage_api::BlockReader; use reth_storage_errors::provider::ProviderResult; use reth_trie::{updates::TrieUpdates, HashedPostStateSorted}; diff --git a/crates/storage/provider/src/traits/finalized_block.rs b/crates/storage/provider/src/traits/finalized_block.rs index 4bf4da798..5509db0aa 100644 --- a/crates/storage/provider/src/traits/finalized_block.rs +++ b/crates/storage/provider/src/traits/finalized_block.rs @@ -1,5 +1,5 @@ +use alloy_primitives::BlockNumber; use reth_errors::ProviderResult; -use reth_primitives::BlockNumber; /// Functionality to read the last known finalized block from the database. pub trait FinalizedBlockReader: Send + Sync { diff --git a/crates/storage/provider/src/traits/hashing.rs b/crates/storage/provider/src/traits/hashing.rs index 78efcc627..2b759afa7 100644 --- a/crates/storage/provider/src/traits/hashing.rs +++ b/crates/storage/provider/src/traits/hashing.rs @@ -1,6 +1,7 @@ +use alloy_primitives::{Address, BlockNumber, B256}; use auto_impl::auto_impl; use reth_db_api::models::BlockNumberAddress; -use reth_primitives::{Account, Address, BlockNumber, StorageEntry, B256}; +use reth_primitives::{Account, StorageEntry}; use reth_storage_errors::provider::ProviderResult; use std::{ collections::{BTreeMap, BTreeSet, HashMap}, diff --git a/crates/storage/provider/src/traits/header_sync_gap.rs b/crates/storage/provider/src/traits/header_sync_gap.rs index faa02b39e..e5da6f799 100644 --- a/crates/storage/provider/src/traits/header_sync_gap.rs +++ b/crates/storage/provider/src/traits/header_sync_gap.rs @@ -1,5 +1,6 @@ +use alloy_primitives::{BlockNumber, B256}; use reth_network_p2p::headers::downloader::SyncTarget; -use reth_primitives::{BlockHashOrNumber, BlockNumber, SealedHeader, B256}; +use reth_primitives::{BlockHashOrNumber, SealedHeader}; use reth_storage_errors::provider::ProviderResult; use tokio::sync::watch; diff --git a/crates/storage/provider/src/traits/history.rs b/crates/storage/provider/src/traits/history.rs index b6f9d72ac..cbf9bece4 100644 --- a/crates/storage/provider/src/traits/history.rs +++ b/crates/storage/provider/src/traits/history.rs @@ -1,6 +1,6 @@ +use alloy_primitives::{Address, BlockNumber, B256}; use auto_impl::auto_impl; use reth_db_api::models::BlockNumberAddress; -use reth_primitives::{Address, BlockNumber, B256}; use reth_storage_errors::provider::ProviderResult; use std::ops::{Range, RangeInclusive}; diff --git a/crates/storage/provider/src/traits/state.rs b/crates/storage/provider/src/traits/state.rs index 8c68c2acd..14546442a 100644 --- a/crates/storage/provider/src/traits/state.rs +++ b/crates/storage/provider/src/traits/state.rs @@ -1,5 +1,5 @@ +use alloy_primitives::BlockNumber; use reth_execution_types::ExecutionOutcome; -use reth_primitives::BlockNumber; use reth_storage_errors::provider::ProviderResult; use reth_trie::HashedPostStateSorted; use revm::db::{ diff --git a/crates/storage/provider/src/traits/trie.rs b/crates/storage/provider/src/traits/trie.rs index 960af93c8..2edb4e072 100644 --- a/crates/storage/provider/src/traits/trie.rs +++ b/crates/storage/provider/src/traits/trie.rs @@ -1,7 +1,7 @@ use std::collections::HashMap; +use alloy_primitives::B256; use auto_impl::auto_impl; -use reth_primitives::B256; use reth_storage_errors::provider::ProviderResult; use reth_trie::updates::{StorageTrieUpdates, TrieUpdates}; diff --git a/crates/storage/provider/src/writer/database.rs b/crates/storage/provider/src/writer/database.rs index fafacbd1c..3ae42b4bf 100644 --- a/crates/storage/provider/src/writer/database.rs +++ b/crates/storage/provider/src/writer/database.rs @@ -1,9 +1,10 @@ +use alloy_primitives::{BlockNumber, TxNumber}; use reth_db::{ cursor::{DbCursorRO, DbCursorRW}, tables, }; use reth_errors::ProviderResult; -use reth_primitives::{BlockNumber, Receipt, TxNumber}; +use reth_primitives::Receipt; use reth_storage_api::ReceiptWriter; pub(crate) struct DatabaseWriter<'a, W>(pub(crate) &'a mut W); diff --git a/crates/storage/provider/src/writer/mod.rs b/crates/storage/provider/src/writer/mod.rs index 1af542382..a0e84212c 100644 --- a/crates/storage/provider/src/writer/mod.rs +++ b/crates/storage/provider/src/writer/mod.rs @@ -3,6 +3,7 @@ use crate::{ writer::static_file::StaticFileWriter, BlockExecutionWriter, BlockWriter, HistoryWriter, StateChangeWriter, StateWriter, TrieWriter, }; +use alloy_primitives::{BlockNumber, B256, U256}; use reth_chain_state::ExecutedBlock; use reth_db::{ cursor::DbCursorRO, @@ -12,9 +13,7 @@ use reth_db::{ }; use reth_errors::{ProviderError, ProviderResult}; use reth_execution_types::ExecutionOutcome; -use reth_primitives::{ - BlockNumber, Header, SealedBlock, StaticFileSegment, TransactionSignedNoHash, B256, U256, -}; +use reth_primitives::{Header, SealedBlock, StaticFileSegment, TransactionSignedNoHash}; use reth_stages_types::{StageCheckpoint, StageId}; use reth_storage_api::{ DBProvider, HeaderProvider, ReceiptWriter, StageCheckpointWriter, TransactionsProviderExt, @@ -543,15 +542,14 @@ mod tests { use crate::{ test_utils::create_test_provider_factory, AccountReader, StorageTrieWriter, TrieWriter, }; + use alloy_primitives::{keccak256, B256, U256}; use reth_db::tables; use reth_db_api::{ cursor::{DbCursorRO, DbCursorRW, DbDupCursorRO}, models::{AccountBeforeTx, BlockNumberAddress}, transaction::{DbTx, DbTxMut}, }; - use reth_primitives::{ - keccak256, Account, Address, Receipt, Receipts, StorageEntry, B256, U256, - }; + use reth_primitives::{Account, Address, Receipt, Receipts, StorageEntry}; use reth_trie::{ test_utils::{state_root, storage_root_prehashed}, HashedPostState, HashedStorage, StateRoot, StorageRoot, diff --git a/crates/storage/provider/src/writer/static_file.rs b/crates/storage/provider/src/writer/static_file.rs index 11c46d52e..aca226ca9 100644 --- a/crates/storage/provider/src/writer/static_file.rs +++ b/crates/storage/provider/src/writer/static_file.rs @@ -1,6 +1,7 @@ use crate::providers::StaticFileProviderRWRefMut; +use alloy_primitives::{BlockNumber, TxNumber}; use reth_errors::ProviderResult; -use reth_primitives::{BlockNumber, Receipt, TxNumber}; +use reth_primitives::Receipt; use reth_storage_api::ReceiptWriter; pub(crate) struct StaticFileWriter<'a, W>(pub(crate) &'a mut W); diff --git a/crates/storage/storage-api/src/state.rs b/crates/storage/storage-api/src/state.rs index bd487ce0d..16ad938b4 100644 --- a/crates/storage/storage-api/src/state.rs +++ b/crates/storage/storage-api/src/state.rs @@ -2,12 +2,10 @@ use super::{ AccountReader, BlockHashReader, BlockIdReader, StateProofProvider, StateRootProvider, StorageRootProvider, }; -use alloy_primitives::{Address, BlockHash, BlockNumber, B256, U256}; +use alloy_primitives::{Address, BlockHash, BlockNumber, StorageKey, StorageValue, B256, U256}; use auto_impl::auto_impl; use reth_execution_types::ExecutionOutcome; -use reth_primitives::{ - BlockId, BlockNumHash, BlockNumberOrTag, Bytecode, StorageKey, StorageValue, KECCAK_EMPTY, -}; +use reth_primitives::{BlockId, BlockNumHash, BlockNumberOrTag, Bytecode, KECCAK_EMPTY}; use reth_storage_errors::provider::{ProviderError, ProviderResult}; /// Type alias of boxed [`StateProvider`].