diff --git a/Cargo.lock b/Cargo.lock index eb66ba34ab..3efd3c97fd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7994,12 +7994,14 @@ dependencies = [ "metrics", "reth-consensus", "reth-db", - "reth-interfaces", + "reth-errors", "reth-metrics", + "reth-network-p2p", "reth-primitives", "reth-provider", "reth-prune", "reth-static-file", + "reth-testing-utils", "reth-tokio-util", "thiserror", "tokio", diff --git a/crates/stages-api/Cargo.toml b/crates/stages-api/Cargo.toml index 32c4258538..51c1bc54af 100644 --- a/crates/stages-api/Cargo.toml +++ b/crates/stages-api/Cargo.toml @@ -15,11 +15,12 @@ workspace = true reth-primitives.workspace = true reth-provider.workspace = true reth-db.workspace = true -reth-interfaces.workspace = true reth-static-file.workspace = true +reth-network-p2p.workspace = true reth-tokio-util.workspace = true reth-consensus.workspace = true reth-prune.workspace = true +reth-errors.workspace = true # metrics reth-metrics.workspace = true @@ -38,8 +39,8 @@ auto_impl.workspace = true [dev-dependencies] assert_matches.workspace = true reth-provider = { workspace = true, features = ["test-utils"] } -reth-interfaces = { workspace = true, features = ["test-utils"] } tokio-stream.workspace = true +reth-testing-utils.workspace = true [features] test-utils = [] diff --git a/crates/stages-api/src/error.rs b/crates/stages-api/src/error.rs index 40b998bc1f..9b75653559 100644 --- a/crates/stages-api/src/error.rs +++ b/crates/stages-api/src/error.rs @@ -1,8 +1,7 @@ use crate::PipelineEvent; use reth_consensus::ConsensusError; -use reth_interfaces::{ - db::DatabaseError as DbError, executor, p2p::error::DownloadError, RethError, -}; +use reth_errors::{BlockExecutionError, DatabaseError, RethError}; +use reth_network_p2p::error::DownloadError; use reth_primitives::{BlockNumber, SealedHeader, StaticFileSegment, TxNumber}; use reth_provider::ProviderError; use thiserror::Error; @@ -16,7 +15,7 @@ pub enum BlockErrorKind { Validation(#[from] ConsensusError), /// The block encountered an execution error. #[error("execution error: {0}")] - Execution(#[from] executor::BlockExecutionError), + Execution(#[from] BlockExecutionError), } impl BlockErrorKind { @@ -66,7 +65,7 @@ pub enum StageError { MissingSyncGap, /// The stage encountered a database error. #[error("internal database error occurred: {0}")] - Database(#[from] DbError), + Database(#[from] DatabaseError), /// Invalid pruning configuration #[error(transparent)] PruningConfiguration(#[from] reth_primitives::PruneSegmentError), @@ -167,7 +166,7 @@ pub enum PipelineError { Stage(#[from] StageError), /// The pipeline encountered a database error. #[error(transparent)] - Database(#[from] DbError), + Database(#[from] DatabaseError), /// Provider error. #[error(transparent)] Provider(#[from] ProviderError), diff --git a/crates/stages-api/src/pipeline/mod.rs b/crates/stages-api/src/pipeline/mod.rs index 66a87a0f8a..c223c7192c 100644 --- a/crates/stages-api/src/pipeline/mod.rs +++ b/crates/stages-api/src/pipeline/mod.rs @@ -4,7 +4,6 @@ pub use crate::pipeline::ctrl::ControlFlow; pub use event::*; use futures_util::Future; use reth_db::database::Database; -use reth_interfaces::RethResult; use reth_primitives::{ constants::BEACON_CONSENSUS_REORG_UNWIND_DEPTH, stage::{PipelineTarget, StageCheckpoint, StageId}, @@ -32,6 +31,7 @@ use crate::{ }; pub use builder::*; use progress::*; +use reth_errors::RethResult; pub use set::*; /// A container for a queued stage. @@ -589,12 +589,10 @@ mod tests { use crate::{test_utils::TestStage, UnwindOutput}; use assert_matches::assert_matches; use reth_consensus::ConsensusError; - use reth_interfaces::{ - provider::ProviderError, - test_utils::{generators, generators::random_header}, - }; + use reth_errors::ProviderError; use reth_primitives::PruneModes; use reth_provider::test_utils::create_test_provider_factory; + use reth_testing_utils::{generators, generators::random_header}; use tokio_stream::StreamExt; #[test] diff --git a/crates/storage/provider/src/lib.rs b/crates/storage/provider/src/lib.rs index 0d23253188..021372bb64 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_storage_errors::provider::ProviderError; +pub use reth_storage_errors::provider::{ProviderError, ProviderResult}; pub use reth_execution_types::*;