removes feature-gated code revising turbine epoch stakes for shreds propagation (#35226)
This commit is contained in:
parent
012f588482
commit
d7ae65fc46
|
@ -676,7 +676,7 @@ pub mod reduce_stake_warmup_cooldown {
|
||||||
solana_sdk::declare_id!("GwtDQBghCTBgmX2cpEGNPxTEBUTQRaDMGTr5qychdGMj");
|
solana_sdk::declare_id!("GwtDQBghCTBgmX2cpEGNPxTEBUTQRaDMGTr5qychdGMj");
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod revise_turbine_epoch_stakes {
|
mod revise_turbine_epoch_stakes {
|
||||||
solana_sdk::declare_id!("BTWmtJC8U5ZLMbBUUA1k6As62sYjPEjAiNAT55xYGdJU");
|
solana_sdk::declare_id!("BTWmtJC8U5ZLMbBUUA1k6As62sYjPEjAiNAT55xYGdJU");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -362,7 +362,8 @@ impl<T: 'static> ClusterNodesCache<T> {
|
||||||
working_bank: &Bank,
|
working_bank: &Bank,
|
||||||
cluster_info: &ClusterInfo,
|
cluster_info: &ClusterInfo,
|
||||||
) -> Arc<ClusterNodes<T>> {
|
) -> 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);
|
let entry = self.get_cache_entry(epoch);
|
||||||
if let Some((_, nodes)) = entry
|
if let Some((_, nodes)) = entry
|
||||||
.read()
|
.read()
|
||||||
|
@ -382,8 +383,8 @@ impl<T: 'static> ClusterNodesCache<T> {
|
||||||
.iter()
|
.iter()
|
||||||
.find_map(|bank| bank.epoch_staked_nodes(epoch));
|
.find_map(|bank| bank.epoch_staked_nodes(epoch));
|
||||||
if epoch_staked_nodes.is_none() {
|
if epoch_staked_nodes.is_none() {
|
||||||
inc_new_counter_debug!("cluster_nodes-unknown_epoch_staked_nodes", 1);
|
inc_new_counter_info!("cluster_nodes-unknown_epoch_staked_nodes", 1);
|
||||||
if epoch != get_epoch(root_bank.slot(), root_bank) {
|
if epoch != epoch_schedule.get_epoch(root_bank.slot()) {
|
||||||
return self.get(root_bank.slot(), root_bank, working_bank, cluster_info);
|
return self.get(root_bank.slot(), root_bank, working_bank, cluster_info);
|
||||||
}
|
}
|
||||||
inc_new_counter_info!("cluster_nodes-unknown_epoch_staked_nodes_root", 1);
|
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 {
|
impl From<ContactInfo> for NodeId {
|
||||||
fn from(node: ContactInfo) -> Self {
|
fn from(node: ContactInfo) -> Self {
|
||||||
NodeId::ContactInfo(node)
|
NodeId::ContactInfo(node)
|
||||||
|
|
Loading…
Reference in New Issue