From bb2846134d55fd5dd4fec2e82c4faab86e3c450d Mon Sep 17 00:00:00 2001 From: Darun Seethammagari Date: Tue, 6 Aug 2024 13:03:03 -0700 Subject: [PATCH] Address off by one issues --- block-streamer/src/block_stream.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block-streamer/src/block_stream.rs b/block-streamer/src/block_stream.rs index 2e4a61e0..9e536070 100644 --- a/block-streamer/src/block_stream.rs +++ b/block-streamer/src/block_stream.rs @@ -132,7 +132,7 @@ impl BlockStream { let stalled_timeout_seconds = 120; async move { - let mut last_processed_block = Some(start_block_height); + let mut last_processed_block = Some(start_block_height - 1); loop { tokio::time::sleep(std::time::Duration::from_secs(stalled_timeout_seconds)) .await; @@ -352,7 +352,7 @@ pub(crate) async fn start_block_stream( .context("Failed while fetching and streaming bitmap indexer blocks")?; let last_indexed_near_lake_block = process_near_lake_blocks( - last_bitmap_indexer_block, + last_bitmap_indexer_block + 1, lake_s3_client, lake_prefetch_size, redis,