mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-28 00:28:20 -05:00
feat: provide backfill outcome in finished event (#9692)
This commit is contained in:
@@ -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<T> {
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum FromOrchestrator {
|
||||
/// Invoked when backfill sync finished
|
||||
BackfillSyncFinished,
|
||||
BackfillSyncFinished(ControlFlow),
|
||||
/// Invoked when backfill sync started
|
||||
BackfillSyncStarted,
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user