Skip to content

Commit 559d0ff

Browse files
committed
graph, core/subgraph: Remove BlockStreamError::Fatal
That variant is never constructed
1 parent 39f0702 commit 559d0ff

File tree

3 files changed

+3
-31
lines changed

3 files changed

+3
-31
lines changed

core/src/subgraph/runner/mod.rs

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use crate::subgraph::state::IndexingState;
1111
use crate::subgraph::stream::new_block_stream;
1212
use anyhow::Context as _;
1313
use graph::blockchain::block_stream::{
14-
BlockStream, BlockStreamError, BlockStreamEvent, BlockWithTriggers, FirehoseCursor,
14+
BlockStream, BlockStreamEvent, BlockWithTriggers, FirehoseCursor,
1515
};
1616
use graph::blockchain::{
1717
Block, BlockTime, Blockchain, DataSource as _, SubgraphFilter, Trigger, TriggerFilter as _,
@@ -34,7 +34,7 @@ use graph::ext::futures::Cancelable;
3434
use graph::futures03::stream::StreamExt;
3535
use graph::prelude::{
3636
anyhow, hex, retry, thiserror, BlockNumber, BlockPtr, BlockState, CancelGuard, CancelHandle,
37-
CancelToken as _, CancelableError, CheapClone as _, EntityCache, EntityModification, Error,
37+
CancelToken as _, CheapClone as _, EntityCache, EntityModification, Error,
3838
InstanceDSTemplateInfo, LogCode, RunnerMetrics, RuntimeHostBuilder, StopwatchMetrics,
3939
StoreError, StreamExtension, UnfailOutcome, Value, ENV_VARS,
4040
};
@@ -349,22 +349,7 @@ where
349349
// Log and drop the errors from the block_stream
350350
// The block stream will continue attempting to produce blocks
351351
Some(Err(e)) => {
352-
// Handle fatal errors by stopping
353-
if let CancelableError::Error(BlockStreamError::Fatal(msg)) = &e {
354-
error!(
355-
&self.logger,
356-
"The block stream encountered a substreams fatal error and will not retry: {}",
357-
msg
358-
);
359-
360-
self.fail_subgraph(msg.clone(), None, true).await?;
361-
362-
return Ok(RunnerState::Stopped {
363-
reason: StopReason::DeterministicError,
364-
});
365-
}
366-
367-
// Non-fatal error: log and continue waiting for blocks
352+
// Log error and continue waiting for blocks
368353
debug!(
369354
&self.logger,
370355
"Block stream produced a non-fatal error";
@@ -472,9 +457,6 @@ where
472457
StopReason::StreamEnded => {
473458
info!(self.logger, "Stopping subgraph - stream ended");
474459
}
475-
StopReason::DeterministicError => {
476-
info!(self.logger, "Stopping subgraph - deterministic error");
477-
}
478460
}
479461

480462
self.inputs.store.flush().await?;

core/src/subgraph/runner/state.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,4 @@ pub enum StopReason {
9595
Unassigned,
9696
/// The block stream ended (typically in tests).
9797
StreamEnded,
98-
/// A deterministic error occurred.
99-
DeterministicError,
10098
}

graph/src/blockchain/block_stream.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -705,14 +705,6 @@ pub enum BlockStreamError {
705705
ProtobufDecodingError(#[from] prost::DecodeError),
706706
#[error("block stream error {0}")]
707707
Unknown(#[from] anyhow::Error),
708-
#[error("block stream fatal error {0}")]
709-
Fatal(String),
710-
}
711-
712-
impl BlockStreamError {
713-
pub fn is_deterministic(&self) -> bool {
714-
matches!(self, Self::Fatal(_))
715-
}
716708
}
717709

718710
#[derive(Debug)]

0 commit comments

Comments
 (0)