Skip to content

Commit

Permalink
Create RootBankCache earlier for unified scheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
ryoqun committed Dec 15, 2024
1 parent f78ec54 commit 736b2d0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/cluster_info_vote_listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ impl ClusterInfoVoteListener {
verified_packets_sender: BankingPacketSender,
vote_tracker: Arc<VoteTracker>,
bank_forks: Arc<RwLock<BankForks>>,
mut root_bank_cache: RootBankCache,
subscriptions: Arc<RpcSubscriptions>,
verified_vote_sender: VerifiedVoteSender,
gossip_verified_vote_hash_sender: GossipVerifiedVoteHashSender,
Expand All @@ -205,7 +206,6 @@ impl ClusterInfoVoteListener {
let (verified_vote_transactions_sender, verified_vote_transactions_receiver) = unbounded();
let listen_thread = {
let exit = exit.clone();
let mut root_bank_cache = RootBankCache::new(bank_forks.clone());
Builder::new()
.name("solCiVoteLstnr".to_string())
.spawn(move || {
Expand Down
3 changes: 3 additions & 0 deletions core/src/tpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ use {
solana_runtime::{
bank_forks::BankForks,
prioritization_fee_cache::PrioritizationFeeCache,
root_bank_cache::RootBankCache,
vote_sender_types::{ReplayVoteReceiver, ReplayVoteSender},
},
solana_sdk::{clock::Slot, pubkey::Pubkey, quic::NotifyKeyUpdate, signature::Keypair},
Expand Down Expand Up @@ -99,6 +100,7 @@ impl Tpu {
shred_version: u16,
vote_tracker: Arc<VoteTracker>,
bank_forks: Arc<RwLock<BankForks>>,
root_bank_cache: RootBankCache,
verified_vote_sender: VerifiedVoteSender,
gossip_verified_vote_hash_sender: GossipVerifiedVoteHashSender,
replay_vote_receiver: ReplayVoteReceiver,
Expand Down Expand Up @@ -258,6 +260,7 @@ impl Tpu {
gossip_vote_sender,
vote_tracker,
bank_forks.clone(),
root_bank_cache,
subscriptions.clone(),
verified_vote_sender,
gossip_verified_vote_hash_sender,
Expand Down
3 changes: 3 additions & 0 deletions core/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ use {
bank_forks::BankForks,
commitment::BlockCommitmentCache,
prioritization_fee_cache::PrioritizationFeeCache,
root_bank_cache::RootBankCache,
runtime_config::RuntimeConfig,
snapshot_archive_info::SnapshotArchiveInfoGetter,
snapshot_bank_utils::{self, DISABLED_SNAPSHOT_ARCHIVE_INTERVAL},
Expand Down Expand Up @@ -1409,6 +1410,7 @@ impl Validator {
let cluster_slots =
Arc::new(crate::cluster_slots_service::cluster_slots::ClusterSlots::default());

let root_bank_cache = RootBankCache::new(bank_forks.clone());
let tvu = Tvu::new(
vote_account,
authorized_voter_keypairs,
Expand Down Expand Up @@ -1517,6 +1519,7 @@ impl Validator {
node.info.shred_version(),
vote_tracker,
bank_forks.clone(),
root_bank_cache,
verified_vote_sender,
gossip_verified_vote_hash_sender,
replay_vote_receiver,
Expand Down

0 comments on commit 736b2d0

Please sign in to comment.