diff --git a/sdk/src/feature_set.rs b/sdk/src/feature_set.rs index 2201ed5c4..826876732 100644 --- a/sdk/src/feature_set.rs +++ b/sdk/src/feature_set.rs @@ -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"); } diff --git a/turbine/src/cluster_nodes.rs b/turbine/src/cluster_nodes.rs index 8079178cf..0c55cb41e 100644 --- a/turbine/src/cluster_nodes.rs +++ b/turbine/src/cluster_nodes.rs @@ -362,7 +362,8 @@ impl ClusterNodesCache { working_bank: &Bank, cluster_info: &ClusterInfo, ) -> Arc> { - 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 ClusterNodesCache { .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 ClusterNodesCache { } } -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 for NodeId { fn from(node: ContactInfo) -> Self { NodeId::ContactInfo(node)