diff --git a/rust/theoros/src/services/indexer/mod.rs b/rust/theoros/src/services/indexer/mod.rs index 9e986c5..e81d15a 100644 --- a/rust/theoros/src/services/indexer/mod.rs +++ b/rust/theoros/src/services/indexer/mod.rs @@ -1,3 +1,5 @@ +use std::cmp::max; + use anyhow::{anyhow, bail, Context, Result}; use apibara_core::{ node::v1alpha2::DataFinality, @@ -61,7 +63,7 @@ impl IndexerService { current_block: u64, ) -> Result { let stream_config = Configuration::::default() - .with_starting_block(current_block - START_INDEXER_DELTA) + .with_starting_block(max(1, current_block.saturating_sub(START_INDEXER_DELTA))) .with_filter(|mut filter| { filter .with_header(HeaderFilter::weak())