Skip to content

Commit

Permalink
processed slots should be always increasing
Browse files Browse the repository at this point in the history
  • Loading branch information
godmodegalactus committed May 30, 2024
1 parent d10910e commit 5dd6515
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 6 additions & 0 deletions cluster-endpoints/src/grpc_multiplex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 0 additions & 3 deletions services/src/tpu_utils/tpu_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ lazy_static::lazy_static! {
static ref NB_OF_LEADERS_IN_SCHEDULE: GenericGauge<prometheus::core::AtomicI64> =
register_int_gauge!(opts!("literpc_cached_leader", "Number of leaders in schedule cache")).unwrap();

static ref CURRENT_SLOT: GenericGauge<prometheus::core::AtomicI64> =
register_int_gauge!(opts!("literpc_current_slot", "Current slot seen by last rpc")).unwrap();

static ref ESTIMATED_SLOT: GenericGauge<prometheus::core::AtomicI64> =
register_int_gauge!(opts!("literpc_estimated_slot", "Estimated slot seen by last rpc")).unwrap();
}
Expand Down

0 comments on commit 5dd6515

Please sign in to comment.