From a4dd65cc7b4944b10939c7d99b298b912eeb413e Mon Sep 17 00:00:00 2001 From: pmantica11 <151664502+pmantica11@users.noreply.github.com> Date: Fri, 1 Nov 2024 16:01:35 -0600 Subject: [PATCH] Fix block polling bug (#238) --- src/ingester/fetchers/grpc.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ingester/fetchers/grpc.rs b/src/ingester/fetchers/grpc.rs index abf4b87..343910f 100644 --- a/src/ingester/fetchers/grpc.rs +++ b/src/ingester/fetchers/grpc.rs @@ -78,6 +78,10 @@ pub fn get_grpc_stream_with_rpc_fallback( panic!("gRPC stream ended unexpectedly"); } Either::Right((Some(rpc_blocks), _)) => { + let rpc_blocks: Vec = rpc_blocks + .into_iter() + .filter(|b| b.metadata.slot > last_indexed_slot) + .collect(); let blocks_len = rpc_blocks.len(); let parent_slot = rpc_blocks.first().unwrap().metadata.parent_slot; let last_slot = rpc_blocks.last().unwrap().metadata.slot;