From 8e638b785a55bb9e6517be0283f205656462eae2 Mon Sep 17 00:00:00 2001 From: behzad nouri Date: Mon, 8 May 2023 18:12:35 +0000 Subject: [PATCH] removes feature gate code sending votes to tpu-vote-port (#31529) --- core/src/next_leader.rs | 7 ------- core/src/replay_stage.rs | 3 --- core/src/tvu.rs | 1 - core/src/voting_service.rs | 19 ++++++------------- runtime/src/bank.rs | 5 ----- 5 files changed, 6 insertions(+), 29 deletions(-) diff --git a/core/src/next_leader.rs b/core/src/next_leader.rs index cff8454df..2957562ed 100644 --- a/core/src/next_leader.rs +++ b/core/src/next_leader.rs @@ -7,13 +7,6 @@ use { std::{net::SocketAddr, sync::RwLock}, }; -pub(crate) fn next_leader_tpu( - cluster_info: &ClusterInfo, - poh_recorder: &RwLock, -) -> Option<(Pubkey, SocketAddr)> { - next_leader_x(cluster_info, poh_recorder, ContactInfo::tpu) -} - pub(crate) fn next_leader_tpu_forwards( cluster_info: &ClusterInfo, poh_recorder: &RwLock, diff --git a/core/src/replay_stage.rs b/core/src/replay_stage.rs index a846271af..d8f0e1c60 100644 --- a/core/src/replay_stage.rs +++ b/core/src/replay_stage.rs @@ -6684,7 +6684,6 @@ pub(crate) mod tests { &poh_recorder, &tower_storage, vote_info, - false, ); let mut cursor = Cursor::default(); @@ -6749,7 +6748,6 @@ pub(crate) mod tests { &poh_recorder, &tower_storage, vote_info, - false, ); let votes = cluster_info.get_votes(&mut cursor); assert_eq!(votes.len(), 1); @@ -6825,7 +6823,6 @@ pub(crate) mod tests { &poh_recorder, &tower_storage, vote_info, - false, ); assert!(last_vote_refresh_time.last_refresh_time > clone_refresh_time); diff --git a/core/src/tvu.rs b/core/src/tvu.rs index cc0f53158..552ce77ec 100644 --- a/core/src/tvu.rs +++ b/core/src/tvu.rs @@ -257,7 +257,6 @@ impl Tvu { cluster_info.clone(), poh_recorder.clone(), tower_storage, - bank_forks.clone(), ); let warm_quic_cache_service = if connection_cache.use_quic() { diff --git a/core/src/voting_service.rs b/core/src/voting_service.rs index 1ce1950c0..3bae80f9f 100644 --- a/core/src/voting_service.rs +++ b/core/src/voting_service.rs @@ -1,10 +1,12 @@ use { - crate::tower_storage::{SavedTowerVersions, TowerStorage}, + crate::{ + next_leader::next_leader_tpu_vote, + tower_storage::{SavedTowerVersions, TowerStorage}, + }, crossbeam_channel::Receiver, solana_gossip::cluster_info::ClusterInfo, solana_measure::measure::Measure, solana_poh::poh_recorder::PohRecorder, - solana_runtime::bank_forks::BankForks, solana_sdk::{clock::Slot, transaction::Transaction}, std::{ sync::{Arc, RwLock}, @@ -43,20 +45,16 @@ impl VotingService { cluster_info: Arc, poh_recorder: Arc>, tower_storage: Arc, - bank_forks: Arc>, ) -> Self { let thread_hdl = Builder::new() .name("solVoteService".to_string()) .spawn(move || { for vote_op in vote_receiver.iter() { - let rooted_bank = bank_forks.read().unwrap().root_bank().clone(); - let send_to_tpu_vote_port = rooted_bank.send_to_tpu_vote_port_enabled(); Self::handle_vote( &cluster_info, &poh_recorder, tower_storage.as_ref(), vote_op, - send_to_tpu_vote_port, ); } }) @@ -69,7 +67,6 @@ impl VotingService { poh_recorder: &RwLock, tower_storage: &dyn TowerStorage, vote_op: VoteOp, - send_to_tpu_vote_port: bool, ) { if let VoteOp::PushVote { saved_tower, .. } = &vote_op { let mut measure = Measure::start("tower_save-ms"); @@ -81,14 +78,10 @@ impl VotingService { inc_new_counter_info!("tower_save-ms", measure.as_ms() as usize); } - let pubkey_and_target_address = if send_to_tpu_vote_port { - crate::next_leader::next_leader_tpu_vote(cluster_info, poh_recorder) - } else { - crate::next_leader::next_leader_tpu(cluster_info, poh_recorder) - }; let _ = cluster_info.send_transaction( vote_op.tx(), - pubkey_and_target_address.map(|(_pubkey, target_addr)| target_addr), + next_leader_tpu_vote(cluster_info, poh_recorder) + .map(|(_pubkey, target_addr)| target_addr), ); match vote_op { diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 96c8f0baa..d06f5b961 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -7471,11 +7471,6 @@ impl Bank { .is_active(&feature_set::credits_auto_rewind::id()) } - pub fn send_to_tpu_vote_port_enabled(&self) -> bool { - self.feature_set - .is_active(&feature_set::send_to_tpu_vote_port::id()) - } - pub fn read_cost_tracker(&self) -> LockResult> { self.cost_tracker.read() }