diff --git a/crates/engine/tree/src/chain.rs b/crates/engine/tree/src/chain.rs index 09197c090e..10a19776fd 100644 --- a/crates/engine/tree/src/chain.rs +++ b/crates/engine/tree/src/chain.rs @@ -1,6 +1,6 @@ use crate::backfill::{BackfillAction, BackfillEvent, BackfillSync}; use futures::Stream; -use reth_stages_api::PipelineTarget; +use reth_stages_api::{ControlFlow, PipelineTarget}; use std::{ pin::Pin, task::{Context, Poll}, @@ -88,10 +88,10 @@ where } BackfillEvent::Finished(res) => { return match res { - Ok(event) => { - tracing::debug!(?event, "backfill sync finished"); + Ok(ctrl) => { + tracing::debug!(?ctrl, "backfill sync finished"); // notify handler that backfill sync finished - this.handler.on_event(FromOrchestrator::BackfillSyncFinished); + this.handler.on_event(FromOrchestrator::BackfillSyncFinished(ctrl)); Poll::Ready(ChainEvent::BackfillSyncFinished) } Err(err) => { @@ -196,7 +196,7 @@ pub enum HandlerEvent { #[derive(Clone, Debug)] pub enum FromOrchestrator { /// Invoked when backfill sync finished - BackfillSyncFinished, + BackfillSyncFinished(ControlFlow), /// Invoked when backfill sync started BackfillSyncStarted, } diff --git a/crates/engine/tree/src/tree/mod.rs b/crates/engine/tree/src/tree/mod.rs index df1e157caa..05c3d95ccc 100644 --- a/crates/engine/tree/src/tree/mod.rs +++ b/crates/engine/tree/src/tree/mod.rs @@ -387,7 +387,7 @@ where debug!(target: "consensus::engine", "received backfill sync started event"); self.is_backfill_active = true; } - FromOrchestrator::BackfillSyncFinished => { + FromOrchestrator::BackfillSyncFinished(_ctrl) => { debug!(target: "consensus::engine", "received backfill sync finished event"); self.is_backfill_active = false; } diff --git a/crates/stages/api/src/pipeline/ctrl.rs b/crates/stages/api/src/pipeline/ctrl.rs index 8fc64c2ab7..1618575524 100644 --- a/crates/stages/api/src/pipeline/ctrl.rs +++ b/crates/stages/api/src/pipeline/ctrl.rs @@ -4,7 +4,7 @@ use reth_primitives_traits::SealedHeader; /// Determines the control flow during pipeline execution. /// /// See [`Pipeline::run_loop`](crate::Pipeline::run_loop) for more information. -#[derive(Debug, Eq, PartialEq)] +#[derive(Debug, Clone, Eq, PartialEq)] pub enum ControlFlow { /// An unwind was requested and must be performed before continuing. Unwind {