From 0056f2f097f572a6089da5d733cfea8bcbd83537 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Sat, 25 May 2024 12:01:29 +0200 Subject: [PATCH] chore(deps): use error imports directly (#8388) --- Cargo.lock | 2 ++ crates/storage/provider/Cargo.toml | 2 ++ .../bundle_state/bundle_state_with_receipts.rs | 2 +- .../provider/src/bundle_state/state_changes.rs | 2 +- .../provider/src/bundle_state/state_reverts.rs | 2 +- crates/storage/provider/src/chain.rs | 7 +++---- crates/storage/provider/src/lib.rs | 2 +- .../src/providers/bundle_state_provider.rs | 2 +- .../provider/src/providers/consistent_view.rs | 4 ++-- .../provider/src/providers/database/mod.rs | 5 +++-- .../provider/src/providers/state/historical.rs | 4 ++-- .../provider/src/providers/state/latest.rs | 2 +- .../provider/src/providers/state/macros.rs | 16 ++++++++-------- .../provider/src/providers/static_file/jar.rs | 2 +- .../src/providers/static_file/manager.rs | 2 +- .../provider/src/providers/static_file/mod.rs | 2 +- .../provider/src/providers/static_file/writer.rs | 2 +- crates/storage/provider/src/test_utils/mock.rs | 2 +- crates/storage/provider/src/test_utils/noop.rs | 2 +- crates/storage/provider/src/traits/account.rs | 2 +- crates/storage/provider/src/traits/block.rs | 2 +- crates/storage/provider/src/traits/block_hash.rs | 2 +- crates/storage/provider/src/traits/block_id.rs | 2 +- .../provider/src/traits/database_provider.rs | 2 +- crates/storage/provider/src/traits/evm_env.rs | 2 +- crates/storage/provider/src/traits/hashing.rs | 2 +- crates/storage/provider/src/traits/header.rs | 2 +- crates/storage/provider/src/traits/history.rs | 2 +- .../provider/src/traits/prune_checkpoint.rs | 2 +- crates/storage/provider/src/traits/receipts.rs | 2 +- .../provider/src/traits/stage_checkpoint.rs | 2 +- crates/storage/provider/src/traits/state.rs | 2 +- crates/storage/provider/src/traits/stats.rs | 2 +- crates/storage/provider/src/traits/storage.rs | 2 +- .../storage/provider/src/traits/transactions.rs | 2 +- crates/storage/provider/src/traits/trie.rs | 2 +- .../storage/provider/src/traits/withdrawals.rs | 2 +- 37 files changed, 52 insertions(+), 48 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a1a91c6b50..a1e9d1de31 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7621,11 +7621,13 @@ dependencies = [ "reth-codecs", "reth-db", "reth-evm", + "reth-execution-errors", "reth-fs-util", "reth-interfaces", "reth-metrics", "reth-nippy-jar", "reth-primitives", + "reth-storage-errors", "reth-trie", "revm", "strum", diff --git a/crates/storage/provider/Cargo.toml b/crates/storage/provider/Cargo.toml index 52f41c7f80..d9a5551619 100644 --- a/crates/storage/provider/Cargo.toml +++ b/crates/storage/provider/Cargo.toml @@ -13,8 +13,10 @@ workspace = true [dependencies] # reth +reth-execution-errors.workspace = true reth-primitives.workspace = true reth-fs-util.workspace = true +reth-storage-errors.workspace = true reth-interfaces.workspace = true reth-db.workspace = true reth-trie = { workspace = true, features = ["metrics"] } diff --git a/crates/storage/provider/src/bundle_state/bundle_state_with_receipts.rs b/crates/storage/provider/src/bundle_state/bundle_state_with_receipts.rs index fe76714d30..52c9366fde 100644 --- a/crates/storage/provider/src/bundle_state/bundle_state_with_receipts.rs +++ b/crates/storage/provider/src/bundle_state/bundle_state_with_receipts.rs @@ -8,13 +8,13 @@ use reth_db::{ transaction::{DbTx, DbTxMut}, }; use reth_evm::execute::BatchBlockExecutionOutput; -use reth_interfaces::provider::{ProviderError, ProviderResult}; use reth_primitives::{ logs_bloom, revm::compat::{into_reth_acc, into_revm_acc}, Account, Address, BlockHash, BlockNumber, Bloom, Bytecode, Log, Receipt, Receipts, StaticFileSegment, StorageEntry, B256, U256, }; +use reth_storage_errors::provider::{ProviderError, ProviderResult}; use reth_trie::HashedPostState; pub use revm::db::states::OriginalValuesKnown; use revm::{ diff --git a/crates/storage/provider/src/bundle_state/state_changes.rs b/crates/storage/provider/src/bundle_state/state_changes.rs index 7f7bde79e3..71551fe692 100644 --- a/crates/storage/provider/src/bundle_state/state_changes.rs +++ b/crates/storage/provider/src/bundle_state/state_changes.rs @@ -4,8 +4,8 @@ use reth_db::{ tables, transaction::{DbTx, DbTxMut}, }; -use reth_interfaces::db::DatabaseError; use reth_primitives::{revm::compat::into_reth_acc, Bytecode, StorageEntry, U256}; +use reth_storage_errors::db::DatabaseError; use revm::db::states::{PlainStorageChangeset, StateChangeset}; /// A change to the state of the world. diff --git a/crates/storage/provider/src/bundle_state/state_reverts.rs b/crates/storage/provider/src/bundle_state/state_reverts.rs index cc16a50cca..1fe7a34819 100644 --- a/crates/storage/provider/src/bundle_state/state_reverts.rs +++ b/crates/storage/provider/src/bundle_state/state_reverts.rs @@ -5,8 +5,8 @@ use reth_db::{ tables, transaction::{DbTx, DbTxMut}, }; -use reth_interfaces::db::DatabaseError; use reth_primitives::{revm::compat::into_reth_acc, BlockNumber, StorageEntry, B256, U256}; +use reth_storage_errors::db::DatabaseError; use revm::db::states::{PlainStateReverts, PlainStorageRevert, RevertToSlot}; use std::iter::Peekable; diff --git a/crates/storage/provider/src/chain.rs b/crates/storage/provider/src/chain.rs index 2ff70bc4ad..bc419aa3f0 100644 --- a/crates/storage/provider/src/chain.rs +++ b/crates/storage/provider/src/chain.rs @@ -1,7 +1,7 @@ //! Contains [Chain], a chain of blocks and their final state. use crate::bundle_state::BundleStateWithReceipts; -use reth_interfaces::{executor::BlockExecutionError, RethResult}; +use reth_execution_errors::BlockExecutionError; use reth_primitives::{ Address, BlockHash, BlockNumHash, BlockNumber, ForkBlock, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, TransactionSigned, TransactionSignedEcRecovered, TxHash, @@ -235,15 +235,14 @@ impl Chain { /// Merge two chains by appending the given chain into the current one. /// /// The state of accounts for this chain is set to the state of the newest chain. - pub fn append_chain(&mut self, other: Chain) -> RethResult<()> { + pub fn append_chain(&mut self, other: Chain) -> Result<(), BlockExecutionError> { let chain_tip = self.tip(); let other_fork_block = other.fork_block(); if chain_tip.hash() != other_fork_block.hash { return Err(BlockExecutionError::AppendChainDoesntConnect { chain_tip: Box::new(chain_tip.num_hash()), other_chain_fork: Box::new(other_fork_block), - } - .into()) + }) } // Insert blocks from other chain diff --git a/crates/storage/provider/src/lib.rs b/crates/storage/provider/src/lib.rs index 2b146245ef..864a962414 100644 --- a/crates/storage/provider/src/lib.rs +++ b/crates/storage/provider/src/lib.rs @@ -29,7 +29,7 @@ pub use providers::{ pub mod test_utils; /// Re-export provider error. -pub use reth_interfaces::provider::ProviderError; +pub use reth_storage_errors::provider::ProviderError; pub mod chain; pub use chain::{Chain, DisplayBlocksChain}; diff --git a/crates/storage/provider/src/providers/bundle_state_provider.rs b/crates/storage/provider/src/providers/bundle_state_provider.rs index e3364cadb2..bc042b3276 100644 --- a/crates/storage/provider/src/providers/bundle_state_provider.rs +++ b/crates/storage/provider/src/providers/bundle_state_provider.rs @@ -1,8 +1,8 @@ use crate::{ AccountReader, BlockHashReader, BundleStateDataProvider, StateProvider, StateRootProvider, }; -use reth_interfaces::provider::{ProviderError, ProviderResult}; use reth_primitives::{trie::AccountProof, Account, Address, BlockNumber, Bytecode, B256}; +use reth_storage_errors::provider::{ProviderError, ProviderResult}; use reth_trie::updates::TrieUpdates; use revm::db::BundleState; diff --git a/crates/storage/provider/src/providers/consistent_view.rs b/crates/storage/provider/src/providers/consistent_view.rs index 07d3614efe..b956768130 100644 --- a/crates/storage/provider/src/providers/consistent_view.rs +++ b/crates/storage/provider/src/providers/consistent_view.rs @@ -1,10 +1,10 @@ use crate::{BlockNumReader, DatabaseProviderFactory, DatabaseProviderRO, HeaderProvider}; use reth_db::database::Database; -use reth_interfaces::provider::ProviderResult; use reth_primitives::{GotExpected, B256}; +use reth_storage_errors::provider::ProviderResult; use std::marker::PhantomData; -pub use reth_interfaces::provider::ConsistentViewError; +pub use reth_storage_errors::provider::ConsistentViewError; /// A consistent view over state in the database. /// diff --git a/crates/storage/provider/src/providers/database/mod.rs b/crates/storage/provider/src/providers/database/mod.rs index c84e9d8cec..60dc635eb3 100644 --- a/crates/storage/provider/src/providers/database/mod.rs +++ b/crates/storage/provider/src/providers/database/mod.rs @@ -9,7 +9,7 @@ use crate::{ }; use reth_db::{database::Database, init_db, models::StoredBlockBodyIndices, DatabaseEnv}; use reth_evm::ConfigureEvmEnv; -use reth_interfaces::{provider::ProviderResult, RethError, RethResult}; +use reth_interfaces::{RethError, RethResult}; use reth_primitives::{ stage::{StageCheckpoint, StageId}, Address, Block, BlockHash, BlockHashOrNumber, BlockNumber, BlockWithSenders, ChainInfo, @@ -30,6 +30,7 @@ mod provider; pub use provider::{DatabaseProvider, DatabaseProviderRO, DatabaseProviderRW}; use reth_db::mdbx::DatabaseArguments; +use reth_storage_errors::provider::ProviderResult; /// A common provider that fetches data from a database or static file. /// @@ -583,7 +584,6 @@ mod tests { test_utils::{create_test_static_files_dir, ERROR_TEMPDIR}, }; use reth_interfaces::{ - provider::ProviderError, test_utils::{ generators, generators::{random_block, random_header}, @@ -594,6 +594,7 @@ mod tests { hex_literal::hex, ChainSpecBuilder, PruneMode, PruneModes, SealedBlock, StaticFileSegment, TxNumber, B256, U256, }; + use reth_storage_errors::provider::ProviderError; use std::{ops::RangeInclusive, sync::Arc}; use tokio::sync::watch; diff --git a/crates/storage/provider/src/providers/state/historical.rs b/crates/storage/provider/src/providers/state/historical.rs index ed64314aa2..f815c282d5 100644 --- a/crates/storage/provider/src/providers/state/historical.rs +++ b/crates/storage/provider/src/providers/state/historical.rs @@ -10,11 +10,11 @@ use reth_db::{ transaction::DbTx, BlockNumberList, }; -use reth_interfaces::provider::ProviderResult; use reth_primitives::{ constants::EPOCH_SLOTS, trie::AccountProof, Account, Address, BlockNumber, Bytecode, StaticFileSegment, StorageKey, StorageValue, B256, }; +use reth_storage_errors::provider::ProviderResult; use reth_trie::{updates::TrieUpdates, HashedPostState}; use revm::db::BundleState; use std::fmt::Debug; @@ -413,8 +413,8 @@ mod tests { transaction::{DbTx, DbTxMut}, BlockNumberList, }; - use reth_interfaces::provider::ProviderError; use reth_primitives::{address, b256, Account, Address, StorageEntry, B256, U256}; + use reth_storage_errors::provider::ProviderError; const ADDRESS: Address = address!("0000000000000000000000000000000000000001"); const HIGHER_ADDRESS: Address = address!("0000000000000000000000000000000000000005"); diff --git a/crates/storage/provider/src/providers/state/latest.rs b/crates/storage/provider/src/providers/state/latest.rs index d3c8af6b7f..5079a15d75 100644 --- a/crates/storage/provider/src/providers/state/latest.rs +++ b/crates/storage/provider/src/providers/state/latest.rs @@ -7,11 +7,11 @@ use reth_db::{ tables, transaction::DbTx, }; -use reth_interfaces::provider::{ProviderError, ProviderResult}; use reth_primitives::{ trie::AccountProof, Account, Address, BlockNumber, Bytecode, StaticFileSegment, StorageKey, StorageValue, B256, }; +use reth_storage_errors::provider::{ProviderError, ProviderResult}; use reth_trie::{proof::Proof, updates::TrieUpdates, HashedPostState}; use revm::db::BundleState; diff --git a/crates/storage/provider/src/providers/state/macros.rs b/crates/storage/provider/src/providers/state/macros.rs index 0e2f088bfe..0efd8d9c7d 100644 --- a/crates/storage/provider/src/providers/state/macros.rs +++ b/crates/storage/provider/src/providers/state/macros.rs @@ -31,20 +31,20 @@ macro_rules! delegate_provider_impls { $crate::providers::state::macros::delegate_impls_to_as_ref!( for $target => StateRootProvider $(where [$($generics)*])? { - fn state_root(&self, state: &revm::db::BundleState) -> reth_interfaces::provider::ProviderResult; - fn state_root_with_updates(&self, state: &revm::db::BundleState) -> reth_interfaces::provider::ProviderResult<(reth_primitives::B256, reth_trie::updates::TrieUpdates)>; + fn state_root(&self, state: &revm::db::BundleState) -> reth_storage_errors::provider::ProviderResult; + fn state_root_with_updates(&self, state: &revm::db::BundleState) -> reth_storage_errors::provider::ProviderResult<(reth_primitives::B256, reth_trie::updates::TrieUpdates)>; } AccountReader $(where [$($generics)*])? { - fn basic_account(&self, address: reth_primitives::Address) -> reth_interfaces::provider::ProviderResult>; + fn basic_account(&self, address: reth_primitives::Address) -> reth_storage_errors::provider::ProviderResult>; } BlockHashReader $(where [$($generics)*])? { - fn block_hash(&self, number: u64) -> reth_interfaces::provider::ProviderResult>; - fn canonical_hashes_range(&self, start: reth_primitives::BlockNumber, end: reth_primitives::BlockNumber) -> reth_interfaces::provider::ProviderResult>; + 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>; } StateProvider $(where [$($generics)*])?{ - fn storage(&self, account: reth_primitives::Address, storage_key: reth_primitives::StorageKey) -> reth_interfaces::provider::ProviderResult>; - fn proof(&self, address: reth_primitives::Address, keys: &[reth_primitives::B256]) -> reth_interfaces::provider::ProviderResult; - fn bytecode_by_hash(&self, code_hash: reth_primitives::B256) -> reth_interfaces::provider::ProviderResult>; + fn storage(&self, account: reth_primitives::Address, storage_key: reth_primitives::StorageKey) -> reth_storage_errors::provider::ProviderResult>; + fn proof(&self, address: reth_primitives::Address, keys: &[reth_primitives::B256]) -> reth_storage_errors::provider::ProviderResult; + fn bytecode_by_hash(&self, code_hash: reth_primitives::B256) -> 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 6dc75e3074..7f4b14fee3 100644 --- a/crates/storage/provider/src/providers/static_file/jar.rs +++ b/crates/storage/provider/src/providers/static_file/jar.rs @@ -10,11 +10,11 @@ use reth_db::{ codecs::CompactU256, static_file::{HeaderMask, ReceiptMask, StaticFileCursor, TransactionMask}, }; -use reth_interfaces::provider::{ProviderError, ProviderResult}; use reth_primitives::{ Address, BlockHash, BlockHashOrNumber, BlockNumber, ChainInfo, Header, Receipt, SealedHeader, TransactionMeta, TransactionSigned, TransactionSignedNoHash, TxHash, TxNumber, B256, U256, }; +use reth_storage_errors::provider::{ProviderError, ProviderResult}; use std::{ ops::{Deref, RangeBounds}, sync::Arc, diff --git a/crates/storage/provider/src/providers/static_file/manager.rs b/crates/storage/provider/src/providers/static_file/manager.rs index 610021d70c..275c8935e1 100644 --- a/crates/storage/provider/src/providers/static_file/manager.rs +++ b/crates/storage/provider/src/providers/static_file/manager.rs @@ -16,7 +16,6 @@ use reth_db::{ table::Table, tables, }; -use reth_interfaces::provider::{ProviderError, ProviderResult}; use reth_nippy_jar::NippyJar; use reth_primitives::{ keccak256, @@ -26,6 +25,7 @@ use reth_primitives::{ TransactionSigned, TransactionSignedNoHash, TxHash, TxNumber, Withdrawal, Withdrawals, B256, U256, }; +use reth_storage_errors::provider::{ProviderError, ProviderResult}; use std::{ collections::{hash_map::Entry, BTreeMap, HashMap}, ops::{Deref, Range, RangeBounds, RangeInclusive}, diff --git a/crates/storage/provider/src/providers/static_file/mod.rs b/crates/storage/provider/src/providers/static_file/mod.rs index 46a1b7453e..cb9f879dde 100644 --- a/crates/storage/provider/src/providers/static_file/mod.rs +++ b/crates/storage/provider/src/providers/static_file/mod.rs @@ -9,9 +9,9 @@ pub use writer::{StaticFileProviderRW, StaticFileProviderRWRefMut}; mod metrics; -use reth_interfaces::provider::{ProviderError, ProviderResult}; use reth_nippy_jar::NippyJar; use reth_primitives::{static_file::SegmentHeader, StaticFileSegment}; +use reth_storage_errors::provider::{ProviderError, ProviderResult}; use std::{ops::Deref, sync::Arc}; const BLOCKS_PER_STATIC_FILE: u64 = 500_000; diff --git a/crates/storage/provider/src/providers/static_file/writer.rs b/crates/storage/provider/src/providers/static_file/writer.rs index a81ef5b005..2a2fcf12ad 100644 --- a/crates/storage/provider/src/providers/static_file/writer.rs +++ b/crates/storage/provider/src/providers/static_file/writer.rs @@ -6,13 +6,13 @@ use super::{ use dashmap::mapref::one::RefMut; use reth_codecs::Compact; use reth_db::codecs::CompactU256; -use reth_interfaces::provider::{ProviderError, ProviderResult}; 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, }; +use reth_storage_errors::provider::{ProviderError, ProviderResult}; use std::{ path::{Path, PathBuf}, sync::{Arc, Weak}, diff --git a/crates/storage/provider/src/test_utils/mock.rs b/crates/storage/provider/src/test_utils/mock.rs index 893bd052d0..7dd7c5b4dc 100644 --- a/crates/storage/provider/src/test_utils/mock.rs +++ b/crates/storage/provider/src/test_utils/mock.rs @@ -8,7 +8,6 @@ use crate::{ use parking_lot::Mutex; use reth_db::models::{AccountBeforeTx, StoredBlockBodyIndices}; use reth_evm::ConfigureEvmEnv; -use reth_interfaces::provider::{ProviderError, ProviderResult}; use reth_primitives::{ keccak256, trie::AccountProof, Account, Address, Block, BlockHash, BlockHashOrNumber, BlockId, BlockNumber, BlockWithSenders, Bytecode, Bytes, ChainInfo, ChainSpec, Header, Receipt, @@ -16,6 +15,7 @@ use reth_primitives::{ TransactionSigned, TransactionSignedNoHash, TxHash, TxNumber, Withdrawal, Withdrawals, B256, U256, }; +use reth_storage_errors::provider::{ProviderError, ProviderResult}; use reth_trie::updates::TrieUpdates; use revm::{ db::BundleState, diff --git a/crates/storage/provider/src/test_utils/noop.rs b/crates/storage/provider/src/test_utils/noop.rs index 02890eaf19..6593b74ccf 100644 --- a/crates/storage/provider/src/test_utils/noop.rs +++ b/crates/storage/provider/src/test_utils/noop.rs @@ -8,7 +8,6 @@ use crate::{ }; use reth_db::models::{AccountBeforeTx, StoredBlockBodyIndices}; use reth_evm::ConfigureEvmEnv; -use reth_interfaces::provider::ProviderResult; use reth_primitives::{ stage::{StageCheckpoint, StageId}, trie::AccountProof, @@ -18,6 +17,7 @@ use reth_primitives::{ TransactionSigned, TransactionSignedNoHash, TxHash, TxNumber, Withdrawal, Withdrawals, B256, MAINNET, U256, }; +use reth_storage_errors::provider::ProviderResult; use reth_trie::updates::TrieUpdates; use revm::{ db::BundleState, diff --git a/crates/storage/provider/src/traits/account.rs b/crates/storage/provider/src/traits/account.rs index 16042bce12..09161d31bb 100644 --- a/crates/storage/provider/src/traits/account.rs +++ b/crates/storage/provider/src/traits/account.rs @@ -1,7 +1,7 @@ use auto_impl::auto_impl; use reth_db::models::AccountBeforeTx; -use reth_interfaces::provider::ProviderResult; use reth_primitives::{Account, Address, BlockNumber}; +use reth_storage_errors::provider::ProviderResult; use std::{ collections::{BTreeMap, BTreeSet}, ops::{RangeBounds, RangeInclusive}, diff --git a/crates/storage/provider/src/traits/block.rs b/crates/storage/provider/src/traits/block.rs index 1b767f350a..99984d346b 100644 --- a/crates/storage/provider/src/traits/block.rs +++ b/crates/storage/provider/src/traits/block.rs @@ -4,11 +4,11 @@ use crate::{ }; use auto_impl::auto_impl; use reth_db::models::StoredBlockBodyIndices; -use reth_interfaces::provider::ProviderResult; use reth_primitives::{ Block, BlockHashOrNumber, BlockId, BlockNumber, BlockNumberOrTag, BlockWithSenders, Header, PruneModes, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader, B256, }; +use reth_storage_errors::provider::ProviderResult; use reth_trie::{updates::TrieUpdates, HashedPostState}; use std::ops::RangeInclusive; diff --git a/crates/storage/provider/src/traits/block_hash.rs b/crates/storage/provider/src/traits/block_hash.rs index 8bb334c8b8..7413bb09c2 100644 --- a/crates/storage/provider/src/traits/block_hash.rs +++ b/crates/storage/provider/src/traits/block_hash.rs @@ -1,6 +1,6 @@ use auto_impl::auto_impl; -use reth_interfaces::provider::ProviderResult; use reth_primitives::{BlockHashOrNumber, BlockNumber, B256}; +use reth_storage_errors::provider::ProviderResult; /// Client trait for fetching block hashes by number. #[auto_impl(&, Arc, Box)] diff --git a/crates/storage/provider/src/traits/block_id.rs b/crates/storage/provider/src/traits/block_id.rs index fd52f6c326..8ca2c98f8b 100644 --- a/crates/storage/provider/src/traits/block_id.rs +++ b/crates/storage/provider/src/traits/block_id.rs @@ -1,6 +1,6 @@ use super::BlockHashReader; -use reth_interfaces::provider::{ProviderError, ProviderResult}; use reth_primitives::{BlockHashOrNumber, BlockId, BlockNumber, BlockNumberOrTag, ChainInfo, B256}; +use reth_storage_errors::provider::{ProviderError, ProviderResult}; /// Client trait for getting important block numbers (such as the latest block number), converting /// block hashes to numbers, and fetching a block hash from its block number. diff --git a/crates/storage/provider/src/traits/database_provider.rs b/crates/storage/provider/src/traits/database_provider.rs index 4335917cc1..152c4935fd 100644 --- a/crates/storage/provider/src/traits/database_provider.rs +++ b/crates/storage/provider/src/traits/database_provider.rs @@ -1,6 +1,6 @@ use crate::DatabaseProviderRO; use reth_db::database::Database; -use reth_interfaces::provider::ProviderResult; +use reth_storage_errors::provider::ProviderResult; /// Database provider factory. pub trait DatabaseProviderFactory { diff --git a/crates/storage/provider/src/traits/evm_env.rs b/crates/storage/provider/src/traits/evm_env.rs index 8c82198460..cecedad0c9 100644 --- a/crates/storage/provider/src/traits/evm_env.rs +++ b/crates/storage/provider/src/traits/evm_env.rs @@ -1,6 +1,6 @@ use reth_evm::ConfigureEvmEnv; -use reth_interfaces::provider::ProviderResult; use reth_primitives::{BlockHashOrNumber, Header}; +use reth_storage_errors::provider::ProviderResult; use revm::primitives::{BlockEnv, CfgEnv, CfgEnvWithHandlerCfg, SpecId}; /// A provider type that knows chain specific information required to configure an diff --git a/crates/storage/provider/src/traits/hashing.rs b/crates/storage/provider/src/traits/hashing.rs index 7978a4b194..4e0375c7c4 100644 --- a/crates/storage/provider/src/traits/hashing.rs +++ b/crates/storage/provider/src/traits/hashing.rs @@ -1,7 +1,7 @@ use auto_impl::auto_impl; use reth_db::models::BlockNumberAddress; -use reth_interfaces::provider::ProviderResult; use reth_primitives::{Account, Address, BlockNumber, StorageEntry, B256}; +use reth_storage_errors::provider::ProviderResult; use std::{ collections::{BTreeMap, BTreeSet, HashMap}, ops::{Range, RangeInclusive}, diff --git a/crates/storage/provider/src/traits/header.rs b/crates/storage/provider/src/traits/header.rs index ad04f52ac9..4719470a77 100644 --- a/crates/storage/provider/src/traits/header.rs +++ b/crates/storage/provider/src/traits/header.rs @@ -1,6 +1,6 @@ use auto_impl::auto_impl; -use reth_interfaces::provider::ProviderResult; use reth_primitives::{BlockHash, BlockHashOrNumber, BlockNumber, Header, SealedHeader, U256}; +use reth_storage_errors::provider::ProviderResult; use std::ops::RangeBounds; /// Client trait for fetching `Header` related data. diff --git a/crates/storage/provider/src/traits/history.rs b/crates/storage/provider/src/traits/history.rs index daef02b9f3..ec9625bdcd 100644 --- a/crates/storage/provider/src/traits/history.rs +++ b/crates/storage/provider/src/traits/history.rs @@ -1,7 +1,7 @@ use auto_impl::auto_impl; use reth_db::models::BlockNumberAddress; -use reth_interfaces::provider::ProviderResult; use reth_primitives::{Address, BlockNumber, B256}; +use reth_storage_errors::provider::ProviderResult; use std::{ collections::BTreeMap, ops::{Range, RangeInclusive}, diff --git a/crates/storage/provider/src/traits/prune_checkpoint.rs b/crates/storage/provider/src/traits/prune_checkpoint.rs index 60470bfecd..a872e27b33 100644 --- a/crates/storage/provider/src/traits/prune_checkpoint.rs +++ b/crates/storage/provider/src/traits/prune_checkpoint.rs @@ -1,5 +1,5 @@ -use reth_interfaces::provider::ProviderResult; use reth_primitives::{PruneCheckpoint, PruneSegment}; +use reth_storage_errors::provider::ProviderResult; /// The trait for fetching prune checkpoint related data. #[auto_impl::auto_impl(&, Arc)] diff --git a/crates/storage/provider/src/traits/receipts.rs b/crates/storage/provider/src/traits/receipts.rs index 8ac2917d77..138adcfa77 100644 --- a/crates/storage/provider/src/traits/receipts.rs +++ b/crates/storage/provider/src/traits/receipts.rs @@ -1,7 +1,7 @@ use std::ops::RangeBounds; -use reth_interfaces::provider::ProviderResult; use reth_primitives::{BlockHashOrNumber, BlockId, BlockNumberOrTag, Receipt, TxHash, TxNumber}; +use reth_storage_errors::provider::ProviderResult; use crate::BlockIdReader; diff --git a/crates/storage/provider/src/traits/stage_checkpoint.rs b/crates/storage/provider/src/traits/stage_checkpoint.rs index ff58fa3eaf..1eca807638 100644 --- a/crates/storage/provider/src/traits/stage_checkpoint.rs +++ b/crates/storage/provider/src/traits/stage_checkpoint.rs @@ -1,8 +1,8 @@ -use reth_interfaces::provider::ProviderResult; use reth_primitives::{ stage::{StageCheckpoint, StageId}, BlockNumber, }; +use reth_storage_errors::provider::ProviderResult; /// The trait for fetching stage checkpoint related data. #[auto_impl::auto_impl(&, Arc)] diff --git a/crates/storage/provider/src/traits/state.rs b/crates/storage/provider/src/traits/state.rs index ac72d52f9f..f31469a3de 100644 --- a/crates/storage/provider/src/traits/state.rs +++ b/crates/storage/provider/src/traits/state.rs @@ -5,11 +5,11 @@ use crate::{ }; use auto_impl::auto_impl; use reth_db::transaction::{DbTx, DbTxMut}; -use reth_interfaces::provider::{ProviderError, ProviderResult}; use reth_primitives::{ trie::AccountProof, Address, BlockHash, BlockId, BlockNumHash, BlockNumber, BlockNumberOrTag, Bytecode, StorageKey, StorageValue, B256, KECCAK_EMPTY, U256, }; +use reth_storage_errors::provider::{ProviderError, ProviderResult}; use revm::db::OriginalValuesKnown; /// Type alias of boxed [StateProvider]. diff --git a/crates/storage/provider/src/traits/stats.rs b/crates/storage/provider/src/traits/stats.rs index dece75e287..97052cf594 100644 --- a/crates/storage/provider/src/traits/stats.rs +++ b/crates/storage/provider/src/traits/stats.rs @@ -1,5 +1,5 @@ use reth_db::table::Table; -use reth_interfaces::provider::ProviderResult; +use reth_storage_errors::provider::ProviderResult; /// The trait for fetching provider statistics. #[auto_impl::auto_impl(&, Arc)] diff --git a/crates/storage/provider/src/traits/storage.rs b/crates/storage/provider/src/traits/storage.rs index 302acad8b1..04cb3a0d2d 100644 --- a/crates/storage/provider/src/traits/storage.rs +++ b/crates/storage/provider/src/traits/storage.rs @@ -4,8 +4,8 @@ use std::{ }; use auto_impl::auto_impl; -use reth_interfaces::provider::ProviderResult; use reth_primitives::{Address, BlockNumber, StorageEntry, B256}; +use reth_storage_errors::provider::ProviderResult; /// Storage reader #[auto_impl(&, Arc, Box)] diff --git a/crates/storage/provider/src/traits/transactions.rs b/crates/storage/provider/src/traits/transactions.rs index 3e798bb419..d693c52f80 100644 --- a/crates/storage/provider/src/traits/transactions.rs +++ b/crates/storage/provider/src/traits/transactions.rs @@ -1,9 +1,9 @@ use crate::{BlockNumReader, BlockReader}; -use reth_interfaces::provider::{ProviderError, ProviderResult}; use reth_primitives::{ Address, BlockHashOrNumber, BlockNumber, TransactionMeta, TransactionSigned, TransactionSignedNoHash, TxHash, TxNumber, }; +use reth_storage_errors::provider::{ProviderError, ProviderResult}; use std::ops::{Range, RangeBounds, RangeInclusive}; /// Client trait for fetching [TransactionSigned] related data. diff --git a/crates/storage/provider/src/traits/trie.rs b/crates/storage/provider/src/traits/trie.rs index 1fa5d780ba..52f3317a3f 100644 --- a/crates/storage/provider/src/traits/trie.rs +++ b/crates/storage/provider/src/traits/trie.rs @@ -1,6 +1,6 @@ use auto_impl::auto_impl; -use reth_interfaces::provider::ProviderResult; use reth_primitives::B256; +use reth_storage_errors::provider::ProviderResult; use reth_trie::updates::TrieUpdates; use revm::db::BundleState; diff --git a/crates/storage/provider/src/traits/withdrawals.rs b/crates/storage/provider/src/traits/withdrawals.rs index a54dc7db81..b79cd25397 100644 --- a/crates/storage/provider/src/traits/withdrawals.rs +++ b/crates/storage/provider/src/traits/withdrawals.rs @@ -1,5 +1,5 @@ -use reth_interfaces::provider::ProviderResult; use reth_primitives::{BlockHashOrNumber, Withdrawal, Withdrawals}; +use reth_storage_errors::provider::ProviderResult; /// Client trait for fetching [Withdrawal] related data. #[auto_impl::auto_impl(&, Arc)]