mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-27 16:18:08 -05:00
FatalError in EngineHandlerEvent (#9800)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@@ -5,6 +5,7 @@ use std::{
|
||||
pin::Pin,
|
||||
task::{Context, Poll},
|
||||
};
|
||||
use tracing::*;
|
||||
|
||||
/// The type that drives the chain forward.
|
||||
///
|
||||
@@ -121,6 +122,10 @@ where
|
||||
// bubble up the event
|
||||
return Poll::Ready(ChainEvent::Handler(ev));
|
||||
}
|
||||
HandlerEvent::FatalError => {
|
||||
error!(target: "engine::tree", "Fatal error");
|
||||
return Poll::Ready(ChainEvent::FatalError)
|
||||
}
|
||||
}
|
||||
}
|
||||
Poll::Pending => {
|
||||
@@ -190,6 +195,8 @@ pub enum HandlerEvent<T> {
|
||||
BackfillAction(BackfillAction),
|
||||
/// Other event emitted by the handler
|
||||
Event(T),
|
||||
// Fatal error
|
||||
FatalError,
|
||||
}
|
||||
|
||||
/// Internal events issued by the [`ChainOrchestrator`].
|
||||
|
||||
@@ -84,6 +84,7 @@ where
|
||||
// bubble up the event
|
||||
Poll::Ready(HandlerEvent::Event(ev))
|
||||
}
|
||||
HandlerEvent::FatalError => Poll::Ready(HandlerEvent::FatalError),
|
||||
}
|
||||
}
|
||||
RequestHandlerEvent::Download(req) => {
|
||||
@@ -186,7 +187,10 @@ where
|
||||
}
|
||||
|
||||
fn poll(&mut self, cx: &mut Context<'_>) -> Poll<RequestHandlerEvent<Self::Event>> {
|
||||
let Some(ev) = ready!(self.from_tree.poll_recv(cx)) else { return Poll::Pending };
|
||||
let Some(ev) = ready!(self.from_tree.poll_recv(cx)) else {
|
||||
return Poll::Ready(RequestHandlerEvent::HandlerEvent(HandlerEvent::FatalError))
|
||||
};
|
||||
|
||||
let ev = match ev {
|
||||
EngineApiEvent::BeaconConsensus(ev) => {
|
||||
RequestHandlerEvent::HandlerEvent(HandlerEvent::Event(ev))
|
||||
|
||||
Reference in New Issue
Block a user