From 5dd65155bf6d3228564b9446346e24a935f55daa Mon Sep 17 00:00:00 2001 From: godmodegalactus Date: Thu, 30 May 2024 13:43:49 +0200 Subject: [PATCH] processed slots should be always increasing --- cluster-endpoints/src/grpc_multiplex.rs | 6 ++++++ services/src/tpu_utils/tpu_service.rs | 3 --- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cluster-endpoints/src/grpc_multiplex.rs b/cluster-endpoints/src/grpc_multiplex.rs index 2d0f05f3..6a8bac17 100644 --- a/cluster-endpoints/src/grpc_multiplex.rs +++ b/cluster-endpoints/src/grpc_multiplex.rs @@ -498,12 +498,18 @@ pub fn create_grpc_multiplex_processed_slots_subscription( }) .collect_vec(); + let mut last_slot = 0; 'recv_loop: loop { let next = tokio::time::timeout(Duration::from_secs(30), slots_rx.recv()).await; match next { Ok(Some(Message::GeyserSubscribeUpdate(slot_update))) => { let mapfilter = map_slot_from_yellowstone_update(*slot_update); if let Some(slot) = mapfilter { + if last_slot > slot { + continue; + } + last_slot = slot; + let _span = debug_span!("grpc_multiplex_processed_slots_stream", ?slot) .entered(); let send_started_at = Instant::now(); diff --git a/services/src/tpu_utils/tpu_service.rs b/services/src/tpu_utils/tpu_service.rs index 82a48eb2..7e3ca354 100644 --- a/services/src/tpu_utils/tpu_service.rs +++ b/services/src/tpu_utils/tpu_service.rs @@ -28,9 +28,6 @@ lazy_static::lazy_static! { static ref NB_OF_LEADERS_IN_SCHEDULE: GenericGauge = register_int_gauge!(opts!("literpc_cached_leader", "Number of leaders in schedule cache")).unwrap(); - static ref CURRENT_SLOT: GenericGauge = - register_int_gauge!(opts!("literpc_current_slot", "Current slot seen by last rpc")).unwrap(); - static ref ESTIMATED_SLOT: GenericGauge = register_int_gauge!(opts!("literpc_estimated_slot", "Estimated slot seen by last rpc")).unwrap(); }