removes feature gate code sending votes to tpu-vote-port (#31529)
This commit is contained in:
parent
8d98589c85
commit
8e638b785a
|
@ -7,13 +7,6 @@ use {
|
|||
std::{net::SocketAddr, sync::RwLock},
|
||||
};
|
||||
|
||||
pub(crate) fn next_leader_tpu(
|
||||
cluster_info: &ClusterInfo,
|
||||
poh_recorder: &RwLock<PohRecorder>,
|
||||
) -> 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<PohRecorder>,
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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<ClusterInfo>,
|
||||
poh_recorder: Arc<RwLock<PohRecorder>>,
|
||||
tower_storage: Arc<dyn TowerStorage>,
|
||||
bank_forks: Arc<RwLock<BankForks>>,
|
||||
) -> 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<PohRecorder>,
|
||||
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 {
|
||||
|
|
|
@ -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<RwLockReadGuard<CostTracker>> {
|
||||
self.cost_tracker.read()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue