From 25e2b24257182e78398dd9b7261f9e99c818e68d Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Wed, 29 May 2024 11:28:25 +0200 Subject: [PATCH] chore: rm reth-interfaces from provider (#8457) --- Cargo.lock | 4 +++- crates/storage/provider/Cargo.toml | 5 +++-- crates/storage/provider/src/providers/database/mod.rs | 10 +++++----- .../provider/src/providers/database/provider.rs | 2 +- .../storage/provider/src/providers/static_file/mod.rs | 2 +- crates/storage/provider/src/traits/header_sync_gap.rs | 5 ++--- 6 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 845a1a207..e0477cb29 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7723,15 +7723,17 @@ dependencies = [ "reth-blockchain-tree-api", "reth-codecs", "reth-db", + "reth-errors", "reth-evm", "reth-execution-types", "reth-fs-util", - "reth-interfaces", "reth-metrics", + "reth-network-p2p", "reth-nippy-jar", "reth-primitives", "reth-storage-api", "reth-storage-errors", + "reth-testing-utils", "reth-trie", "revm", "strum", diff --git a/crates/storage/provider/Cargo.toml b/crates/storage/provider/Cargo.toml index 1bc9ff7ce..c9482ce58 100644 --- a/crates/storage/provider/Cargo.toml +++ b/crates/storage/provider/Cargo.toml @@ -17,9 +17,10 @@ reth-blockchain-tree-api.workspace = true reth-execution-types.workspace = true reth-primitives.workspace = true reth-fs-util.workspace = true +reth-errors.workspace = true reth-storage-errors.workspace = true -reth-interfaces.workspace = true reth-storage-api.workspace = true +reth-network-p2p.workspace = true reth-db.workspace = true reth-trie = { workspace = true, features = ["metrics"] } reth-nippy-jar.workspace = true @@ -59,7 +60,7 @@ rayon.workspace = true reth-db = { workspace = true, features = ["test-utils"] } reth-primitives = { workspace = true, features = ["arbitrary", "test-utils"] } reth-trie = { workspace = true, features = ["test-utils"] } -reth-interfaces = { workspace = true, features = ["test-utils"] } +reth-testing-utils.workspace = true alloy-rlp.workspace = true parking_lot.workspace = true diff --git a/crates/storage/provider/src/providers/database/mod.rs b/crates/storage/provider/src/providers/database/mod.rs index 354b56937..f7ab2e574 100644 --- a/crates/storage/provider/src/providers/database/mod.rs +++ b/crates/storage/provider/src/providers/database/mod.rs @@ -12,8 +12,8 @@ use reth_db::{ database::Database, init_db, mdbx::DatabaseArguments, models::StoredBlockBodyIndices, DatabaseEnv, }; +use reth_errors::{RethError, RethResult}; use reth_evm::ConfigureEvmEnv; -use reth_interfaces::{RethError, RethResult}; use reth_primitives::{ stage::{StageCheckpoint, StageId}, Address, Block, BlockHash, BlockHashOrNumber, BlockNumber, BlockWithSenders, ChainInfo, @@ -599,15 +599,15 @@ mod tests { tables, test_utils::{create_test_static_files_dir, ERROR_TEMPDIR}, }; - use reth_interfaces::test_utils::{ - generators, - generators::{random_block, random_header}, - }; use reth_primitives::{ hex_literal::hex, ChainSpecBuilder, PruneMode, PruneModes, SealedBlock, StaticFileSegment, TxNumber, B256, U256, }; use reth_storage_errors::provider::ProviderError; + use reth_testing_utils::{ + generators, + generators::{random_block, random_header}, + }; use std::{ops::RangeInclusive, sync::Arc}; use tokio::sync::watch; diff --git a/crates/storage/provider/src/providers/database/provider.rs b/crates/storage/provider/src/providers/database/provider.rs index 3a571bbd0..0a0d318e6 100644 --- a/crates/storage/provider/src/providers/database/provider.rs +++ b/crates/storage/provider/src/providers/database/provider.rs @@ -28,7 +28,7 @@ use reth_db::{ BlockNumberList, DatabaseError, }; use reth_evm::ConfigureEvmEnv; -use reth_interfaces::p2p::headers::downloader::SyncTarget; +use reth_network_p2p::headers::downloader::SyncTarget; use reth_primitives::{ keccak256, revm::{config::revm_spec, env::fill_block_env}, diff --git a/crates/storage/provider/src/providers/static_file/mod.rs b/crates/storage/provider/src/providers/static_file/mod.rs index cb9f879dd..9243afff9 100644 --- a/crates/storage/provider/src/providers/static_file/mod.rs +++ b/crates/storage/provider/src/providers/static_file/mod.rs @@ -65,8 +65,8 @@ mod tests { transaction::{DbTx, DbTxMut}, CanonicalHeaders, HeaderNumbers, HeaderTerminalDifficulties, Headers, RawTable, }; - use reth_interfaces::test_utils::generators::{self, random_header_range}; use reth_primitives::{static_file::find_fixed_range, BlockNumber, B256, U256}; + use reth_testing_utils::generators::{self, random_header_range}; #[test] fn test_snap() { diff --git a/crates/storage/provider/src/traits/header_sync_gap.rs b/crates/storage/provider/src/traits/header_sync_gap.rs index 8a60eb15a..54556101a 100644 --- a/crates/storage/provider/src/traits/header_sync_gap.rs +++ b/crates/storage/provider/src/traits/header_sync_gap.rs @@ -1,5 +1,4 @@ -use auto_impl::auto_impl; -use reth_interfaces::p2p::headers::downloader::SyncTarget; +use reth_network_p2p::headers::downloader::SyncTarget; use reth_primitives::{BlockHashOrNumber, BlockNumber, SealedHeader, B256}; use reth_storage_errors::provider::ProviderResult; use tokio::sync::watch; @@ -37,7 +36,7 @@ impl HeaderSyncGap { } /// Client trait for determining the current headers sync gap. -#[auto_impl(&, Arc)] +#[auto_impl::auto_impl(&, Arc)] pub trait HeaderSyncGapProvider: Send + Sync { /// Find a current sync gap for the headers depending on the [HeaderSyncMode] and the last /// uninterrupted block number. Last uninterrupted block represents the block number before