mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: make reth-stages independent of concrete DatabaseProvider (#10934)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@ -10,7 +10,6 @@ use reth_network_p2p::{
|
||||
full_block::{FetchFullBlockFuture, FetchFullBlockRangeFuture, FullBlockClient},
|
||||
BlockClient,
|
||||
};
|
||||
use reth_node_types::NodeTypesWithDB;
|
||||
use reth_primitives::SealedBlock;
|
||||
use reth_provider::providers::ProviderNodeTypes;
|
||||
use reth_stages_api::{ControlFlow, Pipeline, PipelineError, PipelineTarget, PipelineWithResult};
|
||||
@ -34,7 +33,7 @@ use tracing::trace;
|
||||
/// database while the pipeline is still active.
|
||||
pub(crate) struct EngineSyncController<N, Client>
|
||||
where
|
||||
N: NodeTypesWithDB,
|
||||
N: ProviderNodeTypes,
|
||||
Client: BlockClient,
|
||||
{
|
||||
/// A downloader that can download full blocks from the network.
|
||||
@ -394,14 +393,14 @@ pub(crate) enum EngineSyncEvent {
|
||||
/// running, it acquires the write lock over the database. This means that we cannot forward to the
|
||||
/// blockchain tree any messages that would result in database writes, since it would result in a
|
||||
/// deadlock.
|
||||
enum PipelineState<N: NodeTypesWithDB> {
|
||||
enum PipelineState<N: ProviderNodeTypes> {
|
||||
/// Pipeline is idle.
|
||||
Idle(Option<Pipeline<N>>),
|
||||
/// Pipeline is running and waiting for a response
|
||||
Running(oneshot::Receiver<PipelineWithResult<N>>),
|
||||
}
|
||||
|
||||
impl<N: NodeTypesWithDB> PipelineState<N> {
|
||||
impl<N: ProviderNodeTypes> PipelineState<N> {
|
||||
/// Returns `true` if the state matches idle.
|
||||
const fn is_idle(&self) -> bool {
|
||||
matches!(self, Self::Idle(_))
|
||||
|
||||
Reference in New Issue
Block a user