From d7e6ab58c459c487ce459171fbbc35441042fe4f Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Wed, 8 Sep 2021 11:26:44 -0500 Subject: [PATCH] TpuClient now uses the processed slot to seed its leader schedule cache --- client/src/tpu_client.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/src/tpu_client.rs b/client/src/tpu_client.rs index 01c902af12..59111a62a5 100644 --- a/client/src/tpu_client.rs +++ b/client/src/tpu_client.rs @@ -5,7 +5,9 @@ use crate::{ }; use bincode::serialize; use log::*; -use solana_sdk::{clock::Slot, pubkey::Pubkey, transaction::Transaction}; +use solana_sdk::{ + clock::Slot, commitment_config::CommitmentConfig, pubkey::Pubkey, transaction::Transaction, +}; use std::{ collections::{HashMap, HashSet, VecDeque}, net::{SocketAddr, UdpSocket}, @@ -242,7 +244,7 @@ struct LeaderTpuService { impl LeaderTpuService { fn new(rpc_client: Arc, websocket_url: &str, exit: Arc) -> Result { - let start_slot = rpc_client.get_max_shred_insert_slot()?; + let start_slot = rpc_client.get_slot_with_commitment(CommitmentConfig::processed())?; let recent_slots = RecentLeaderSlots::new(start_slot); let leader_tpu_cache = Arc::new(RwLock::new(LeaderTpuCache::new(&rpc_client, start_slot)));