diff --git a/Cargo.lock b/Cargo.lock index a51a10d8b..7656829cf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8187,6 +8187,7 @@ dependencies = [ name = "reth-provider" version = "1.0.7" dependencies = [ + "alloy-eips", "alloy-primitives", "alloy-rpc-types-engine", "assert_matches", @@ -8748,6 +8749,7 @@ dependencies = [ name = "reth-storage-api" version = "1.0.7" dependencies = [ + "alloy-eips", "alloy-primitives", "auto_impl", "reth-chainspec", @@ -8765,6 +8767,7 @@ dependencies = [ name = "reth-storage-errors" version = "1.0.7" dependencies = [ + "alloy-eips", "alloy-primitives", "alloy-rlp", "derive_more", diff --git a/crates/storage/errors/Cargo.toml b/crates/storage/errors/Cargo.toml index cbea35036..52c93ae4e 100644 --- a/crates/storage/errors/Cargo.toml +++ b/crates/storage/errors/Cargo.toml @@ -15,7 +15,8 @@ workspace = true reth-primitives.workspace = true reth-fs-util.workspace = true -# alloy +# ethereum +alloy-eips.workspace = true alloy-primitives.workspace = true alloy-rlp.workspace = true @@ -24,4 +25,4 @@ derive_more.workspace = true [features] default = ["std"] -std = [] \ No newline at end of file +std = [] diff --git a/crates/storage/errors/src/provider.rs b/crates/storage/errors/src/provider.rs index e478ca2eb..f0ecfbea8 100644 --- a/crates/storage/errors/src/provider.rs +++ b/crates/storage/errors/src/provider.rs @@ -1,7 +1,8 @@ use crate::{db::DatabaseError, lockfile::StorageLockError, writer::UnifiedStorageWriterError}; +use alloy_eips::BlockHashOrNumber; use alloy_primitives::{Address, BlockHash, BlockNumber, TxNumber, B256, U256}; use derive_more::Display; -use reth_primitives::{BlockHashOrNumber, GotExpected, StaticFileSegment, TxHashOrNumber}; +use reth_primitives::{GotExpected, StaticFileSegment, TxHashOrNumber}; #[cfg(feature = "std")] use std::path::PathBuf; diff --git a/crates/storage/provider/Cargo.toml b/crates/storage/provider/Cargo.toml index 533cd8306..ea04ac8c6 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-eips.workspace = true alloy-primitives.workspace = true alloy-rpc-types-engine.workspace = true revm.workspace = true diff --git a/crates/storage/provider/src/providers/blockchain_provider.rs b/crates/storage/provider/src/providers/blockchain_provider.rs index 8c8cb967c..e3c1cd7b1 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_eips::{BlockHashOrNumber, BlockId, BlockNumHash, BlockNumberOrTag}; use alloy_primitives::{Address, BlockHash, BlockNumber, TxHash, TxNumber, B256, U256}; use alloy_rpc_types_engine::ForkchoiceState; use reth_chain_state::{ @@ -20,9 +21,9 @@ use reth_evm::ConfigureEvmEnv; use reth_execution_types::ExecutionOutcome; use reth_node_types::NodeTypesWithDB; use reth_primitives::{ - Account, Block, BlockHashOrNumber, BlockId, BlockNumHash, BlockNumberOrTag, BlockWithSenders, - EthereumHardforks, Header, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, - TransactionMeta, TransactionSigned, TransactionSignedNoHash, Withdrawal, Withdrawals, + Account, Block, 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 +1396,7 @@ mod tests { writer::UnifiedStorageWriter, BlockWriter, CanonChainTracker, StaticFileProviderFactory, StaticFileWriter, }; + use alloy_eips::{BlockHashOrNumber, BlockNumHash, BlockNumberOrTag}; use alloy_primitives::B256; use itertools::Itertools; use rand::Rng; @@ -1408,9 +1410,8 @@ mod tests { use reth_db::models::{AccountBeforeTx, StoredBlockBodyIndices}; use reth_execution_types::{Chain, ExecutionOutcome}; use reth_primitives::{ - BlockHashOrNumber, BlockNumHash, BlockNumberOrTag, BlockWithSenders, Receipt, SealedBlock, - SealedBlockWithSenders, StaticFileSegment, TransactionMeta, TransactionSignedNoHash, - Withdrawals, + BlockWithSenders, Receipt, SealedBlock, SealedBlockWithSenders, StaticFileSegment, + TransactionMeta, TransactionSignedNoHash, Withdrawals, }; use reth_storage_api::{ BlockHashReader, BlockIdReader, BlockNumReader, BlockReader, BlockReaderIdExt, BlockSource, diff --git a/crates/storage/provider/src/providers/database/mod.rs b/crates/storage/provider/src/providers/database/mod.rs index 57f1a88b7..830e692bf 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_eips::BlockHashOrNumber; use alloy_primitives::{Address, BlockHash, BlockNumber, TxHash, TxNumber, B256, U256}; use core::fmt; use reth_chainspec::ChainInfo; @@ -16,9 +17,9 @@ use reth_errors::{RethError, RethResult}; use reth_evm::ConfigureEvmEnv; use reth_node_types::NodeTypesWithDB; use reth_primitives::{ - Block, BlockHashOrNumber, BlockWithSenders, Header, Receipt, SealedBlock, - SealedBlockWithSenders, SealedHeader, StaticFileSegment, TransactionMeta, TransactionSigned, - TransactionSignedNoHash, Withdrawal, Withdrawals, + Block, 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}; diff --git a/crates/storage/provider/src/providers/database/provider.rs b/crates/storage/provider/src/providers/database/provider.rs index e3c7fcbba..ab8f7bb31 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_eips::BlockHashOrNumber; use alloy_primitives::{keccak256, Address, BlockHash, BlockNumber, TxHash, TxNumber, B256, U256}; use itertools::{izip, Itertools}; use rayon::slice::ParallelSliceMut; @@ -38,8 +39,8 @@ use reth_evm::ConfigureEvmEnv; use reth_execution_types::{Chain, ExecutionOutcome}; use reth_network_p2p::headers::downloader::SyncTarget; use reth_primitives::{ - Account, Block, BlockHashOrNumber, BlockWithSenders, Bytecode, GotExpected, Header, Receipt, - Requests, SealedBlock, SealedBlockWithSenders, SealedHeader, StaticFileSegment, StorageEntry, + Account, Block, BlockWithSenders, Bytecode, GotExpected, Header, Receipt, Requests, + SealedBlock, SealedBlockWithSenders, SealedHeader, StaticFileSegment, StorageEntry, TransactionMeta, TransactionSigned, TransactionSignedEcRecovered, TransactionSignedNoHash, Withdrawal, Withdrawals, }; diff --git a/crates/storage/provider/src/providers/mod.rs b/crates/storage/provider/src/providers/mod.rs index ce1ca8766..2a0413525 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_eips::{BlockHashOrNumber, BlockId, BlockNumHash, BlockNumberOrTag}; use alloy_primitives::{Address, BlockHash, BlockNumber, TxHash, TxNumber, B256, U256}; use reth_blockchain_tree_api::{ error::{CanonicalError, InsertBlockError}, @@ -20,9 +21,9 @@ use reth_db_api::models::{AccountBeforeTx, StoredBlockBodyIndices}; use reth_evm::ConfigureEvmEnv; use reth_node_types::NodeTypesWithDB; use reth_primitives::{ - Account, Block, BlockHashOrNumber, BlockId, BlockNumHash, BlockNumberOrTag, BlockWithSenders, - Header, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, TransactionMeta, - TransactionSigned, TransactionSignedNoHash, Withdrawal, Withdrawals, + Account, Block, 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/static_file/jar.rs b/crates/storage/provider/src/providers/static_file/jar.rs index 2f7b0add7..16dbb3648 100644 --- a/crates/storage/provider/src/providers/static_file/jar.rs +++ b/crates/storage/provider/src/providers/static_file/jar.rs @@ -6,13 +6,13 @@ use crate::{ to_range, BlockHashReader, BlockNumReader, HeaderProvider, ReceiptProvider, TransactionsProvider, }; +use alloy_eips::BlockHashOrNumber; 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::{ - BlockHashOrNumber, Header, Receipt, SealedHeader, TransactionMeta, TransactionSigned, - TransactionSignedNoHash, + 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 03d6f6904..074d109c3 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_eips::BlockHashOrNumber; use alloy_primitives::{keccak256, Address, BlockHash, BlockNumber, TxHash, TxNumber, B256, U256}; use dashmap::DashMap; use notify::{RecommendedWatcher, RecursiveMode, Watcher}; @@ -27,9 +28,9 @@ use reth_db_api::{ use reth_nippy_jar::{NippyJar, NippyJarChecker, CONFIG_FILE_EXTENSION}; use reth_primitives::{ static_file::{find_fixed_range, HighestStaticFiles, SegmentHeader, SegmentRangeInclusive}, - Block, BlockHashOrNumber, BlockWithSenders, Header, Receipt, SealedBlock, - SealedBlockWithSenders, SealedHeader, StaticFileSegment, TransactionMeta, TransactionSigned, - TransactionSignedNoHash, Withdrawal, Withdrawals, + Block, 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/test_utils/mock.rs b/crates/storage/provider/src/test_utils/mock.rs index 4b54e243d..09c967948 100644 --- a/crates/storage/provider/src/test_utils/mock.rs +++ b/crates/storage/provider/src/test_utils/mock.rs @@ -6,6 +6,7 @@ use crate::{ StateProviderBox, StateProviderFactory, StateReader, StateRootProvider, TransactionVariant, TransactionsProvider, WithdrawalsProvider, }; +use alloy_eips::{BlockHashOrNumber, BlockId, BlockNumberOrTag}; use alloy_primitives::{ keccak256, Address, BlockHash, BlockNumber, Bytes, StorageKey, StorageValue, TxHash, TxNumber, B256, U256, @@ -17,9 +18,9 @@ use reth_db_api::models::{AccountBeforeTx, StoredBlockBodyIndices}; use reth_evm::ConfigureEvmEnv; use reth_execution_types::{Chain, ExecutionOutcome}; use reth_primitives::{ - Account, Block, BlockHashOrNumber, BlockId, BlockNumberOrTag, BlockWithSenders, Bytecode, - GotExpected, Header, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, - TransactionMeta, TransactionSigned, TransactionSignedNoHash, Withdrawal, Withdrawals, + Account, Block, BlockWithSenders, Bytecode, GotExpected, Header, Receipt, SealedBlock, + SealedBlockWithSenders, SealedHeader, TransactionMeta, TransactionSigned, + TransactionSignedNoHash, Withdrawal, Withdrawals, }; use reth_stages_types::{StageCheckpoint, StageId}; use reth_storage_api::{ diff --git a/crates/storage/provider/src/test_utils/noop.rs b/crates/storage/provider/src/test_utils/noop.rs index 96ed401de..ee662db52 100644 --- a/crates/storage/provider/src/test_utils/noop.rs +++ b/crates/storage/provider/src/test_utils/noop.rs @@ -4,6 +4,7 @@ use std::{ sync::Arc, }; +use alloy_eips::{BlockHashOrNumber, BlockId, BlockNumberOrTag}; use alloy_primitives::{ Address, BlockHash, BlockNumber, Bytes, StorageKey, StorageValue, TxHash, TxNumber, B256, U256, }; @@ -16,9 +17,9 @@ use reth_db_api::models::{AccountBeforeTx, StoredBlockBodyIndices}; use reth_errors::ProviderError; use reth_evm::ConfigureEvmEnv; use reth_primitives::{ - Account, Block, BlockHashOrNumber, BlockId, BlockNumberOrTag, BlockWithSenders, Bytecode, - Header, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, TransactionMeta, - TransactionSigned, TransactionSignedNoHash, Withdrawal, Withdrawals, + Account, Block, 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/header_sync_gap.rs b/crates/storage/provider/src/traits/header_sync_gap.rs index e5da6f799..5ce7e1197 100644 --- a/crates/storage/provider/src/traits/header_sync_gap.rs +++ b/crates/storage/provider/src/traits/header_sync_gap.rs @@ -1,6 +1,7 @@ +use alloy_eips::BlockHashOrNumber; use alloy_primitives::{BlockNumber, B256}; use reth_network_p2p::headers::downloader::SyncTarget; -use reth_primitives::{BlockHashOrNumber, SealedHeader}; +use reth_primitives::SealedHeader; use reth_storage_errors::provider::ProviderResult; use tokio::sync::watch; diff --git a/crates/storage/storage-api/Cargo.toml b/crates/storage/storage-api/Cargo.toml index ce043213c..51d8eabfc 100644 --- a/crates/storage/storage-api/Cargo.toml +++ b/crates/storage/storage-api/Cargo.toml @@ -23,7 +23,8 @@ reth-stages-types.workspace = true reth-storage-errors.workspace = true reth-trie.workspace = true -# alloy +# ethereum +alloy-eips.workspace = true alloy-primitives.workspace = true auto_impl.workspace = true diff --git a/crates/storage/storage-api/src/block.rs b/crates/storage/storage-api/src/block.rs index 48ab5829d..82eccaa55 100644 --- a/crates/storage/storage-api/src/block.rs +++ b/crates/storage/storage-api/src/block.rs @@ -2,11 +2,11 @@ use crate::{ BlockIdReader, BlockNumReader, HeaderProvider, ReceiptProvider, ReceiptProviderIdExt, RequestsProvider, TransactionVariant, TransactionsProvider, WithdrawalsProvider, }; +use alloy_eips::{BlockHashOrNumber, BlockId, BlockNumberOrTag}; use alloy_primitives::{BlockNumber, B256}; use reth_db_models::StoredBlockBodyIndices; use reth_primitives::{ - Block, BlockHashOrNumber, BlockId, BlockNumberOrTag, BlockWithSenders, Header, Receipt, - SealedBlock, SealedBlockWithSenders, SealedHeader, + Block, BlockWithSenders, Header, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, }; use reth_storage_errors::provider::ProviderResult; use std::ops::RangeInclusive; diff --git a/crates/storage/storage-api/src/block_hash.rs b/crates/storage/storage-api/src/block_hash.rs index 84b8c2380..aa8624b83 100644 --- a/crates/storage/storage-api/src/block_hash.rs +++ b/crates/storage/storage-api/src/block_hash.rs @@ -1,5 +1,5 @@ +use alloy_eips::BlockHashOrNumber; use alloy_primitives::{BlockNumber, B256}; -use reth_primitives::BlockHashOrNumber; use reth_storage_errors::provider::ProviderResult; /// Client trait for fetching block hashes by number. diff --git a/crates/storage/storage-api/src/block_id.rs b/crates/storage/storage-api/src/block_id.rs index b96da25ad..3d9df2e32 100644 --- a/crates/storage/storage-api/src/block_id.rs +++ b/crates/storage/storage-api/src/block_id.rs @@ -1,7 +1,7 @@ use crate::BlockHashReader; +use alloy_eips::{BlockHashOrNumber, BlockId, BlockNumberOrTag}; use alloy_primitives::{BlockNumber, B256}; use reth_chainspec::ChainInfo; -use reth_primitives::{BlockHashOrNumber, BlockId, BlockNumberOrTag}; use reth_storage_errors::provider::{ProviderError, ProviderResult}; /// Client trait for getting important block numbers (such as the latest block number), converting diff --git a/crates/storage/storage-api/src/header.rs b/crates/storage/storage-api/src/header.rs index cd7e2a49f..ce984fb10 100644 --- a/crates/storage/storage-api/src/header.rs +++ b/crates/storage/storage-api/src/header.rs @@ -1,5 +1,6 @@ +use alloy_eips::BlockHashOrNumber; use alloy_primitives::{BlockHash, BlockNumber, U256}; -use reth_primitives::{BlockHashOrNumber, Header, SealedHeader}; +use reth_primitives::{Header, SealedHeader}; use reth_storage_errors::provider::ProviderResult; use std::ops::RangeBounds; diff --git a/crates/storage/storage-api/src/receipts.rs b/crates/storage/storage-api/src/receipts.rs index 7329d728c..06c6103ee 100644 --- a/crates/storage/storage-api/src/receipts.rs +++ b/crates/storage/storage-api/src/receipts.rs @@ -1,6 +1,7 @@ use crate::BlockIdReader; +use alloy_eips::{BlockHashOrNumber, BlockId, BlockNumberOrTag}; use alloy_primitives::{BlockNumber, TxHash, TxNumber}; -use reth_primitives::{BlockHashOrNumber, BlockId, BlockNumberOrTag, Receipt}; +use reth_primitives::Receipt; use reth_storage_errors::provider::ProviderResult; use std::ops::RangeBounds; diff --git a/crates/storage/storage-api/src/requests.rs b/crates/storage/storage-api/src/requests.rs index c8b13dc05..02818c429 100644 --- a/crates/storage/storage-api/src/requests.rs +++ b/crates/storage/storage-api/src/requests.rs @@ -1,4 +1,5 @@ -use reth_primitives::{BlockHashOrNumber, Requests}; +use alloy_eips::BlockHashOrNumber; +use reth_primitives::Requests; use reth_storage_errors::provider::ProviderResult; /// Client trait for fetching EIP-7685 [Requests] for blocks. diff --git a/crates/storage/storage-api/src/state.rs b/crates/storage/storage-api/src/state.rs index 16ad938b4..9a3b855ff 100644 --- a/crates/storage/storage-api/src/state.rs +++ b/crates/storage/storage-api/src/state.rs @@ -2,10 +2,11 @@ use super::{ AccountReader, BlockHashReader, BlockIdReader, StateProofProvider, StateRootProvider, StorageRootProvider, }; +use alloy_eips::{BlockId, BlockNumHash, BlockNumberOrTag}; 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, KECCAK_EMPTY}; +use reth_primitives::{Bytecode, KECCAK_EMPTY}; use reth_storage_errors::provider::{ProviderError, ProviderResult}; /// Type alias of boxed [`StateProvider`]. diff --git a/crates/storage/storage-api/src/transactions.rs b/crates/storage/storage-api/src/transactions.rs index f21365b0d..3685d6b1d 100644 --- a/crates/storage/storage-api/src/transactions.rs +++ b/crates/storage/storage-api/src/transactions.rs @@ -1,8 +1,7 @@ use crate::{BlockNumReader, BlockReader}; +use alloy_eips::BlockHashOrNumber; use alloy_primitives::{Address, BlockNumber, TxHash, TxNumber}; -use reth_primitives::{ - BlockHashOrNumber, TransactionMeta, TransactionSigned, TransactionSignedNoHash, -}; +use reth_primitives::{TransactionMeta, TransactionSigned, TransactionSignedNoHash}; use reth_storage_errors::provider::{ProviderError, ProviderResult}; use std::ops::{Range, RangeBounds, RangeInclusive}; diff --git a/crates/storage/storage-api/src/withdrawals.rs b/crates/storage/storage-api/src/withdrawals.rs index b79cd2539..2de69b34e 100644 --- a/crates/storage/storage-api/src/withdrawals.rs +++ b/crates/storage/storage-api/src/withdrawals.rs @@ -1,4 +1,5 @@ -use reth_primitives::{BlockHashOrNumber, Withdrawal, Withdrawals}; +use alloy_eips::BlockHashOrNumber; +use reth_primitives::{Withdrawal, Withdrawals}; use reth_storage_errors::provider::ProviderResult; /// Client trait for fetching [Withdrawal] related data.