chore: remove reth-primitives dependency from reth-stages-api (#8902)

This commit is contained in:
joshieDo
2024-06-17 20:01:35 +02:00
committed by GitHub
parent d05be8a467
commit de6cdff7e3
10 changed files with 27 additions and 19 deletions

4
Cargo.lock generated
View File

@@ -8133,6 +8133,7 @@ dependencies = [
name = "reth-stages-api"
version = "1.0.0-rc.1"
dependencies = [
"alloy-primitives",
"aquamarine",
"assert_matches",
"auto_impl",
@@ -8143,11 +8144,12 @@ dependencies = [
"reth-errors",
"reth-metrics",
"reth-network-p2p",
"reth-primitives",
"reth-primitives-traits",
"reth-provider",
"reth-prune",
"reth-stages-types",
"reth-static-file",
"reth-static-file-types",
"reth-testing-utils",
"reth-tokio-util",
"thiserror",

View File

@@ -12,7 +12,7 @@ workspace = true
[dependencies]
# reth
reth-primitives.workspace = true
reth-primitives-traits.workspace = true
reth-provider.workspace = true
reth-db-api.workspace = true
reth-static-file.workspace = true
@@ -22,6 +22,9 @@ reth-consensus.workspace = true
reth-prune.workspace = true
reth-errors.workspace = true
reth-stages-types.workspace = true
reth-static-file-types.workspace = true
alloy-primitives.workspace = true
# metrics
reth-metrics.workspace = true

View File

@@ -1,9 +1,11 @@
use crate::PipelineEvent;
use alloy_primitives::{BlockNumber, TxNumber};
use reth_consensus::ConsensusError;
use reth_errors::{BlockExecutionError, DatabaseError, RethError};
use reth_network_p2p::error::DownloadError;
use reth_primitives::{BlockNumber, SealedHeader, StaticFileSegment, TxNumber};
use reth_primitives_traits::SealedHeader;
use reth_provider::ProviderError;
use reth_static_file_types::StaticFileSegment;
use thiserror::Error;
use tokio::sync::broadcast::error::SendError;

View File

@@ -1,5 +1,6 @@
use crate::{metrics::SyncMetrics, StageCheckpoint, StageId};
use reth_primitives::{constants::MGAS_TO_GAS, BlockNumber};
use alloy_primitives::BlockNumber;
use reth_primitives_traits::constants::MGAS_TO_GAS;
use std::{
future::Future,
pin::Pin,

View File

@@ -1,6 +1,6 @@
use crate::{pipeline::BoxedStage, MetricEventsSender, Pipeline, Stage, StageId, StageSet};
use alloy_primitives::{BlockNumber, B256};
use reth_db_api::database::Database;
use reth_primitives::{BlockNumber, B256};
use reth_provider::ProviderFactory;
use reth_static_file::StaticFileProducer;
use tokio::sync::watch;

View File

@@ -1,4 +1,5 @@
use reth_primitives::{BlockNumber, SealedHeader};
use alloy_primitives::BlockNumber;
use reth_primitives_traits::SealedHeader;
/// Determines the control flow during pipeline execution.
///

View File

@@ -2,7 +2,7 @@ use crate::{
stage::{ExecOutput, UnwindInput, UnwindOutput},
StageCheckpoint, StageId,
};
use reth_primitives::BlockNumber;
use alloy_primitives::BlockNumber;
use std::fmt::{Display, Formatter};
/// An event emitted by a [Pipeline][crate::Pipeline].

View File

@@ -2,19 +2,18 @@ mod ctrl;
mod event;
pub use crate::pipeline::ctrl::ControlFlow;
use crate::{PipelineTarget, StageCheckpoint, StageId};
use alloy_primitives::{BlockNumber, B256};
pub use event::*;
use futures_util::Future;
use reth_db_api::database::Database;
use reth_primitives::{
constants::BEACON_CONSENSUS_REORG_UNWIND_DEPTH, static_file::HighestStaticFiles, BlockNumber,
B256,
};
use reth_primitives_traits::constants::BEACON_CONSENSUS_REORG_UNWIND_DEPTH;
use reth_provider::{
providers::StaticFileWriter, FinalizedBlockReader, FinalizedBlockWriter, ProviderFactory,
StageCheckpointReader, StageCheckpointWriter, StaticFileProviderFactory,
};
use reth_prune::PrunerBuilder;
use reth_static_file::StaticFileProducer;
use reth_static_file_types::HighestStaticFiles;
use reth_tokio_util::{EventSender, EventStream};
use std::pin::Pin;
use tokio::sync::watch;
@@ -237,13 +236,13 @@ where
/// Run [static file producer](StaticFileProducer) and [pruner](reth_prune::Pruner) to **move**
/// all data from the database to static files for corresponding
/// [segments](reth_primitives::static_file::StaticFileSegment), according to their [stage
/// [segments](reth_static_file_types::StaticFileSegment), according to their [stage
/// checkpoints](StageCheckpoint):
/// - [`StaticFileSegment::Headers`](reth_primitives::static_file::StaticFileSegment::Headers)
/// -> [`StageId::Headers`]
/// - [`StaticFileSegment::Receipts`](reth_primitives::static_file::StaticFileSegment::Receipts)
/// -> [`StageId::Execution`]
/// - [`StaticFileSegment::Transactions`](reth_primitives::static_file::StaticFileSegment::Transactions)
/// - [`StaticFileSegment::Headers`](reth_static_file_types::StaticFileSegment::Headers) ->
/// [`StageId::Headers`]
/// - [`StaticFileSegment::Receipts`](reth_static_file_types::StaticFileSegment::Receipts) ->
/// [`StageId::Execution`]
/// - [`StaticFileSegment::Transactions`](reth_static_file_types::StaticFileSegment::Transactions)
/// -> [`StageId::Bodies`]
///
/// CAUTION: This method locks the static file producer Mutex, hence can block the thread if the

View File

@@ -1,5 +1,5 @@
use crate::{util::opt, ControlFlow};
use reth_primitives::BlockNumber;
use alloy_primitives::BlockNumber;
#[derive(Debug, Default)]
pub(crate) struct PipelineProgress {

View File

@@ -1,6 +1,6 @@
use crate::{error::StageError, StageCheckpoint, StageId};
use alloy_primitives::{BlockNumber, TxNumber};
use reth_db_api::database::Database;
use reth_primitives::{BlockNumber, TxNumber};
use reth_provider::{BlockReader, DatabaseProviderRW, ProviderError, TransactionsProvider};
use std::{
cmp::{max, min},