mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-08 03:01:12 -04: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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user