removes feature-gated code revising turbine epoch stakes for shreds propagation (#35226)

This commit is contained in:
behzad nouri 2024-02-20 16:04:32 +00:00 committed by GitHub
parent 012f588482
commit d7ae65fc46
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 16 deletions

View File

@ -676,7 +676,7 @@ pub mod reduce_stake_warmup_cooldown {
solana_sdk::declare_id!("GwtDQBghCTBgmX2cpEGNPxTEBUTQRaDMGTr5qychdGMj");
}
pub mod revise_turbine_epoch_stakes {
mod revise_turbine_epoch_stakes {
solana_sdk::declare_id!("BTWmtJC8U5ZLMbBUUA1k6As62sYjPEjAiNAT55xYGdJU");
}

View File

@ -362,7 +362,8 @@ impl<T: 'static> ClusterNodesCache<T> {
working_bank: &Bank,
cluster_info: &ClusterInfo,
) -> Arc<ClusterNodes<T>> {
let epoch = get_epoch(shred_slot, root_bank);
let epoch_schedule = root_bank.epoch_schedule();
let epoch = epoch_schedule.get_epoch(shred_slot);
let entry = self.get_cache_entry(epoch);
if let Some((_, nodes)) = entry
.read()
@ -382,8 +383,8 @@ impl<T: 'static> ClusterNodesCache<T> {
.iter()
.find_map(|bank| bank.epoch_staked_nodes(epoch));
if epoch_staked_nodes.is_none() {
inc_new_counter_debug!("cluster_nodes-unknown_epoch_staked_nodes", 1);
if epoch != get_epoch(root_bank.slot(), root_bank) {
inc_new_counter_info!("cluster_nodes-unknown_epoch_staked_nodes", 1);
if epoch != epoch_schedule.get_epoch(root_bank.slot()) {
return self.get(root_bank.slot(), root_bank, working_bank, cluster_info);
}
inc_new_counter_info!("cluster_nodes-unknown_epoch_staked_nodes_root", 1);
@ -397,18 +398,6 @@ impl<T: 'static> ClusterNodesCache<T> {
}
}
fn get_epoch(shred_slot: Slot, root_bank: &Bank) -> Epoch {
if check_feature_activation(
&feature_set::revise_turbine_epoch_stakes::id(),
shred_slot,
root_bank,
) {
root_bank.epoch_schedule().get_epoch(shred_slot)
} else {
root_bank.get_leader_schedule_epoch(shred_slot)
}
}
impl From<ContactInfo> for NodeId {
fn from(node: ContactInfo) -> Self {
NodeId::ContactInfo(node)