TpuClient now uses the processed slot to seed its leader schedule cache
This commit is contained in:
committed by
mergify[bot]
parent
a0e6a7c73b
commit
d7e6ab58c4
@ -5,7 +5,9 @@ use crate::{
|
|||||||
};
|
};
|
||||||
use bincode::serialize;
|
use bincode::serialize;
|
||||||
use log::*;
|
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::{
|
use std::{
|
||||||
collections::{HashMap, HashSet, VecDeque},
|
collections::{HashMap, HashSet, VecDeque},
|
||||||
net::{SocketAddr, UdpSocket},
|
net::{SocketAddr, UdpSocket},
|
||||||
@ -242,7 +244,7 @@ struct LeaderTpuService {
|
|||||||
|
|
||||||
impl LeaderTpuService {
|
impl LeaderTpuService {
|
||||||
fn new(rpc_client: Arc<RpcClient>, websocket_url: &str, exit: Arc<AtomicBool>) -> Result<Self> {
|
fn new(rpc_client: Arc<RpcClient>, websocket_url: &str, exit: Arc<AtomicBool>) -> Result<Self> {
|
||||||
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 recent_slots = RecentLeaderSlots::new(start_slot);
|
||||||
let leader_tpu_cache = Arc::new(RwLock::new(LeaderTpuCache::new(&rpc_client, start_slot)));
|
let leader_tpu_cache = Arc::new(RwLock::new(LeaderTpuCache::new(&rpc_client, start_slot)));
|
||||||
|
Reference in New Issue
Block a user