removes pubkey references (#15050)

This commit is contained in:
behzad nouri 2021-02-03 23:02:11 +00:00 committed by GitHub
parent 2970b59853
commit 86467d825a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 172 deletions

View File

@ -1,7 +1,4 @@
use crate::{
progress_map::{LockoutIntervals, ProgressMap},
pubkey_references::PubkeyReferences,
};
use crate::progress_map::{LockoutIntervals, ProgressMap};
use chrono::prelude::*;
use solana_ledger::{ancestor_iterator::AncestorIterator, blockstore::Blockstore, blockstore_db};
use solana_measure::measure::Measure;
@ -214,7 +211,6 @@ impl Tower {
bank_slot: Slot,
vote_accounts: F,
ancestors: &HashMap<Slot, HashSet<Slot>>,
all_pubkeys: &mut PubkeyReferences,
) -> ComputedBankState
where
F: IntoIterator<Item = (Pubkey, (u64, ArcVoteAccount))>,
@ -247,7 +243,6 @@ impl Tower {
Ok(vote_state) => vote_state.clone(),
};
for vote in &vote_state.votes {
let key = all_pubkeys.get_or_insert(&key);
lockout_intervals
.entry(vote.expiration_slot())
.or_insert_with(Vec::new)
@ -1270,7 +1265,6 @@ pub mod test {
collections::HashMap,
fs::{remove_file, OpenOptions},
io::{Read, Seek, SeekFrom, Write},
rc::Rc,
sync::RwLock,
};
use tempfile::TempDir;
@ -1380,7 +1374,6 @@ pub mod test {
&VoteTracker::default(),
&ClusterSlots::default(),
&self.bank_forks,
&mut PubkeyReferences::default(),
&mut self.heaviest_subtree_fork_choice,
);
@ -1425,7 +1418,6 @@ pub mod test {
&self.bank_forks,
&mut self.progress,
&ABSRequestSender::default(),
&mut PubkeyReferences::default(),
None,
&mut self.heaviest_subtree_fork_choice,
)
@ -1467,7 +1459,7 @@ pub mod test {
.lockout_intervals
.entry(lockout_interval.1)
.or_default()
.push((lockout_interval.0, Rc::new(*vote_account_pubkey)));
.push((lockout_interval.0, *vote_account_pubkey));
}
fn can_progress_on_fork(
@ -1993,13 +1985,7 @@ pub mod test {
bank_weight,
pubkey_votes,
..
} = Tower::collect_vote_lockouts(
&Pubkey::default(),
1,
accounts.into_iter(),
&ancestors,
&mut PubkeyReferences::default(),
);
} = Tower::collect_vote_lockouts(&Pubkey::default(), 1, accounts.into_iter(), &ancestors);
assert_eq!(voted_stakes[&0], 2);
assert_eq!(total_stake, 2);
let mut pubkey_votes = Arc::try_unwrap(pubkey_votes).unwrap();
@ -2051,7 +2037,6 @@ pub mod test {
MAX_LOCKOUT_HISTORY as u64,
accounts.into_iter(),
&ancestors,
&mut PubkeyReferences::default(),
);
for i in 0..MAX_LOCKOUT_HISTORY {
assert_eq!(voted_stakes[&(i as u64)], 2);
@ -2358,7 +2343,6 @@ pub mod test {
vote_to_evaluate,
accounts.clone().into_iter(),
&ancestors,
&mut PubkeyReferences::default(),
);
assert!(tower.check_vote_stake_threshold(vote_to_evaluate, &voted_stakes, total_stake,));
@ -2375,7 +2359,6 @@ pub mod test {
vote_to_evaluate,
accounts.into_iter(),
&ancestors,
&mut PubkeyReferences::default(),
);
assert!(!tower.check_vote_stake_threshold(vote_to_evaluate, &voted_stakes, total_stake,));
}

View File

@ -1,7 +1,6 @@
use crate::{
cluster_info_vote_listener::SlotVoteTracker,
cluster_slots::SlotPubkeys,
pubkey_references::PubkeyReferences,
replay_stage::SUPERMINORITY_THRESHOLD,
{consensus::Stake, consensus::VotedStakes},
};
@ -10,13 +9,12 @@ use solana_runtime::{bank::Bank, bank_forks::BankForks, vote_account::ArcVoteAcc
use solana_sdk::{clock::Slot, hash::Hash, pubkey::Pubkey};
use std::{
collections::{BTreeMap, HashMap, HashSet},
rc::Rc,
sync::{Arc, RwLock},
};
type VotedSlot = Slot;
type ExpirationSlot = Slot;
pub(crate) type LockoutIntervals = BTreeMap<ExpirationSlot, Vec<(VotedSlot, Rc<Pubkey>)>>;
pub(crate) type LockoutIntervals = BTreeMap<ExpirationSlot, Vec<(VotedSlot, Pubkey)>>;
#[derive(Default)]
pub(crate) struct ReplaySlotStats(ConfirmationTiming);
@ -128,9 +126,7 @@ impl ForkProgress {
(
true,
info.stake,
vec![Rc::new(info.validator_vote_pubkey)]
.into_iter()
.collect(),
vec![info.validator_vote_pubkey].into_iter().collect(),
{
if info.total_epoch_stake == 0 {
true
@ -212,8 +208,8 @@ pub(crate) struct ForkStats {
#[derive(Clone, Default)]
pub(crate) struct PropagatedStats {
pub(crate) propagated_validators: HashSet<Rc<Pubkey>>,
pub(crate) propagated_node_ids: HashSet<Rc<Pubkey>>,
pub(crate) propagated_validators: HashSet<Pubkey>,
pub(crate) propagated_node_ids: HashSet<Pubkey>,
pub(crate) propagated_validators_stake: u64,
pub(crate) is_propagated: bool,
pub(crate) is_leader_slot: bool,
@ -224,25 +220,13 @@ pub(crate) struct PropagatedStats {
}
impl PropagatedStats {
pub fn add_vote_pubkey(
&mut self,
vote_pubkey: &Pubkey,
all_pubkeys: &mut PubkeyReferences,
stake: u64,
) {
if !self.propagated_validators.contains(vote_pubkey) {
let cached_pubkey = all_pubkeys.get_or_insert(vote_pubkey);
self.propagated_validators.insert(cached_pubkey);
pub fn add_vote_pubkey(&mut self, vote_pubkey: Pubkey, stake: u64) {
if self.propagated_validators.insert(vote_pubkey) {
self.propagated_validators_stake += stake;
}
}
pub fn add_node_pubkey(
&mut self,
node_pubkey: &Pubkey,
all_pubkeys: &mut PubkeyReferences,
bank: &Bank,
) {
pub fn add_node_pubkey(&mut self, node_pubkey: &Pubkey, bank: &Bank) {
if !self.propagated_node_ids.contains(node_pubkey) {
let node_vote_accounts = bank
.epoch_vote_accounts_for_node_id(&node_pubkey)
@ -251,7 +235,6 @@ impl PropagatedStats {
if let Some(node_vote_accounts) = node_vote_accounts {
self.add_node_pubkey_internal(
node_pubkey,
all_pubkeys,
node_vote_accounts,
bank.epoch_vote_accounts(bank.epoch())
.expect("Epoch stakes for bank's own epoch must exist"),
@ -263,18 +246,16 @@ impl PropagatedStats {
fn add_node_pubkey_internal(
&mut self,
node_pubkey: &Pubkey,
all_pubkeys: &mut PubkeyReferences,
vote_account_pubkeys: &[Pubkey],
epoch_vote_accounts: &HashMap<Pubkey, (u64, ArcVoteAccount)>,
) {
let cached_pubkey = all_pubkeys.get_or_insert(node_pubkey);
self.propagated_node_ids.insert(cached_pubkey);
self.propagated_node_ids.insert(*node_pubkey);
for vote_account_pubkey in vote_account_pubkeys.iter() {
let stake = epoch_vote_accounts
.get(vote_account_pubkey)
.map(|(stake, _)| *stake)
.unwrap_or(0);
self.add_vote_pubkey(vote_account_pubkey, all_pubkeys, stake);
self.add_vote_pubkey(*vote_account_pubkey, stake);
}
}
}
@ -403,34 +384,24 @@ mod test {
#[test]
fn test_add_vote_pubkey() {
let mut stats = PropagatedStats::default();
let mut all_pubkeys = PubkeyReferences::default();
let mut vote_pubkey = solana_sdk::pubkey::new_rand();
all_pubkeys.get_or_insert(&vote_pubkey);
// Add a vote pubkey, the number of references in all_pubkeys
// should be 2
stats.add_vote_pubkey(&vote_pubkey, &mut all_pubkeys, 1);
stats.add_vote_pubkey(vote_pubkey, 1);
assert!(stats.propagated_validators.contains(&vote_pubkey));
assert_eq!(stats.propagated_validators_stake, 1);
assert_eq!(
Rc::strong_count(&all_pubkeys.get_or_insert(&vote_pubkey)),
3
);
// Adding it again should change no state since the key already existed
stats.add_vote_pubkey(&vote_pubkey, &mut all_pubkeys, 1);
stats.add_vote_pubkey(vote_pubkey, 1);
assert!(stats.propagated_validators.contains(&vote_pubkey));
assert_eq!(stats.propagated_validators_stake, 1);
// Adding another pubkey should succeed
vote_pubkey = solana_sdk::pubkey::new_rand();
stats.add_vote_pubkey(&vote_pubkey, &mut all_pubkeys, 2);
stats.add_vote_pubkey(vote_pubkey, 2);
assert!(stats.propagated_validators.contains(&vote_pubkey));
assert_eq!(stats.propagated_validators_stake, 3);
assert_eq!(
Rc::strong_count(&all_pubkeys.get_or_insert(&vote_pubkey)),
3
);
}
#[test]
@ -447,35 +418,19 @@ mod test {
.collect();
let mut stats = PropagatedStats::default();
let mut all_pubkeys = PubkeyReferences::default();
let mut node_pubkey = solana_sdk::pubkey::new_rand();
all_pubkeys.get_or_insert(&node_pubkey);
// Add a vote pubkey, the number of references in all_pubkeys
// should be 2
stats.add_node_pubkey_internal(
&node_pubkey,
&mut all_pubkeys,
&vote_account_pubkeys,
&epoch_vote_accounts,
);
stats.add_node_pubkey_internal(&node_pubkey, &vote_account_pubkeys, &epoch_vote_accounts);
assert!(stats.propagated_node_ids.contains(&node_pubkey));
assert_eq!(
stats.propagated_validators_stake,
staked_vote_accounts as u64
);
assert_eq!(
Rc::strong_count(&all_pubkeys.get_or_insert(&node_pubkey)),
3
);
// Adding it again should not change any state
stats.add_node_pubkey_internal(
&node_pubkey,
&mut all_pubkeys,
&vote_account_pubkeys,
&epoch_vote_accounts,
);
stats.add_node_pubkey_internal(&node_pubkey, &vote_account_pubkeys, &epoch_vote_accounts);
assert!(stats.propagated_node_ids.contains(&node_pubkey));
assert_eq!(
stats.propagated_validators_stake,
@ -485,21 +440,12 @@ mod test {
// Adding another pubkey with same vote accounts should succeed, but stake
// shouldn't increase
node_pubkey = solana_sdk::pubkey::new_rand();
stats.add_node_pubkey_internal(
&node_pubkey,
&mut all_pubkeys,
&vote_account_pubkeys,
&epoch_vote_accounts,
);
stats.add_node_pubkey_internal(&node_pubkey, &vote_account_pubkeys, &epoch_vote_accounts);
assert!(stats.propagated_node_ids.contains(&node_pubkey));
assert_eq!(
stats.propagated_validators_stake,
staked_vote_accounts as u64
);
assert_eq!(
Rc::strong_count(&all_pubkeys.get_or_insert(&node_pubkey)),
3
);
// Adding another pubkey with different vote accounts should succeed
// and increase stake
@ -512,21 +458,12 @@ mod test {
.skip(num_vote_accounts - staked_vote_accounts)
.map(|pubkey| (*pubkey, (1, ArcVoteAccount::default())))
.collect();
stats.add_node_pubkey_internal(
&node_pubkey,
&mut all_pubkeys,
&vote_account_pubkeys,
&epoch_vote_accounts,
);
stats.add_node_pubkey_internal(&node_pubkey, &vote_account_pubkeys, &epoch_vote_accounts);
assert!(stats.propagated_node_ids.contains(&node_pubkey));
assert_eq!(
stats.propagated_validators_stake,
2 * staked_vote_accounts as u64
);
assert_eq!(
Rc::strong_count(&all_pubkeys.get_or_insert(&node_pubkey)),
3
);
}
#[test]

View File

@ -1,29 +1,9 @@
use solana_sdk::pubkey::Pubkey;
use std::{
collections::HashSet,
rc::Rc,
sync::{Arc, RwLock},
};
#[derive(Default)]
pub struct PubkeyReferences(HashSet<Rc<Pubkey>>);
impl PubkeyReferences {
pub fn get_or_insert(&mut self, pubkey: &Pubkey) -> Rc<Pubkey> {
let mut cached_pubkey: Option<Rc<Pubkey>> = self.0.get(pubkey).cloned();
if cached_pubkey.is_none() {
let new_pubkey = Rc::new(*pubkey);
self.0.insert(new_pubkey.clone());
cached_pubkey = Some(new_pubkey);
}
cached_pubkey.unwrap()
}
pub fn purge(&mut self) {
self.0.retain(|x| Rc::strong_count(x) > 1);
}
}
#[derive(Default)]
pub struct LockedPubkeyReferences(pub RwLock<HashSet<Arc<Pubkey>>>);

View File

@ -13,7 +13,6 @@ use crate::{
optimistically_confirmed_bank_tracker::{BankNotification, BankNotificationSender},
poh_recorder::{PohRecorder, GRACE_TICKS_FACTOR, MAX_GRACE_SLOTS},
progress_map::{ForkProgress, ProgressMap, PropagatedStats},
pubkey_references::PubkeyReferences,
repair_service::DuplicateSlotsResetReceiver,
result::Result,
rewards_recorder_service::RewardsRecorderSender,
@ -280,7 +279,6 @@ impl ReplayStage {
let t_replay = Builder::new()
.name("solana-replay-stage".to_string())
.spawn(move || {
let mut all_pubkeys = PubkeyReferences::default();
let verify_recyclers = VerifyRecyclers::default();
let _exit = Finalizer::new(exit.clone());
let (
@ -314,7 +312,6 @@ impl ReplayStage {
&leader_schedule_cache,
&subscriptions,
&mut progress,
&mut all_pubkeys,
);
generate_new_bank_forks_time.stop();
Self::report_memory(&allocated, "generate_new_bank_forks", start);
@ -378,7 +375,6 @@ impl ReplayStage {
&vote_tracker,
&cluster_slots,
&bank_forks,
&mut all_pubkeys,
&mut heaviest_subtree_fork_choice,
);
compute_bank_stats_time.stop();
@ -479,7 +475,6 @@ impl ReplayStage {
&lockouts_sender,
&accounts_background_request_sender,
&latest_root_senders,
&mut all_pubkeys,
&subscriptions,
&block_commitment_cache,
&mut heaviest_subtree_fork_choice,
@ -1077,7 +1072,6 @@ impl ReplayStage {
lockouts_sender: &Sender<CommitmentAggregationData>,
accounts_background_request_sender: &ABSRequestSender,
latest_root_senders: &[Sender<Slot>],
all_pubkeys: &mut PubkeyReferences,
subscriptions: &Arc<RpcSubscriptions>,
block_commitment_cache: &Arc<RwLock<BlockCommitmentCache>>,
heaviest_subtree_fork_choice: &mut HeaviestSubtreeForkChoice,
@ -1133,7 +1127,6 @@ impl ReplayStage {
&bank_forks,
progress,
accounts_background_request_sender,
all_pubkeys,
highest_confirmed_root,
heaviest_subtree_fork_choice,
);
@ -1429,7 +1422,6 @@ impl ReplayStage {
vote_tracker: &VoteTracker,
cluster_slots: &ClusterSlots,
bank_forks: &RwLock<BankForks>,
all_pubkeys: &mut PubkeyReferences,
heaviest_subtree_fork_choice: &mut dyn ForkChoice,
) -> Vec<Slot> {
frozen_banks.sort_by_key(|bank| bank.slot());
@ -1450,7 +1442,6 @@ impl ReplayStage {
bank_slot,
bank.vote_accounts().into_iter(),
&ancestors,
all_pubkeys,
);
// Notify any listeners of the votes found in this newly computed
// bank
@ -1495,7 +1486,6 @@ impl ReplayStage {
Self::update_propagation_status(
progress,
bank_slot,
all_pubkeys,
bank_forks,
vote_tracker,
cluster_slots,
@ -1517,7 +1507,6 @@ impl ReplayStage {
fn update_propagation_status(
progress: &mut ProgressMap,
slot: Slot,
all_pubkeys: &mut PubkeyReferences,
bank_forks: &RwLock<BankForks>,
vote_tracker: &VoteTracker,
cluster_slots: &ClusterSlots,
@ -1571,7 +1560,6 @@ impl ReplayStage {
cluster_slot_pubkeys,
slot,
bank_forks,
all_pubkeys,
);
}
@ -1690,7 +1678,6 @@ impl ReplayStage {
mut cluster_slot_pubkeys: Vec<impl Deref<Target = Pubkey>>,
fork_tip: Slot,
bank_forks: &RwLock<BankForks>,
all_pubkeys: &mut PubkeyReferences,
) {
let mut current_leader_slot = progress.get_latest_leader_slot(fork_tip);
let mut did_newly_reach_threshold = false;
@ -1736,7 +1723,6 @@ impl ReplayStage {
&mut cluster_slot_pubkeys,
&leader_bank,
leader_propagated_stats,
all_pubkeys,
did_newly_reach_threshold,
) || did_newly_reach_threshold;
@ -1750,7 +1736,6 @@ impl ReplayStage {
cluster_slot_pubkeys: &mut Vec<impl Deref<Target = Pubkey>>,
leader_bank: &Bank,
leader_propagated_stats: &mut PropagatedStats,
all_pubkeys: &mut PubkeyReferences,
did_child_reach_threshold: bool,
) -> bool {
// Track whether this slot newly confirm propagation
@ -1784,10 +1769,9 @@ impl ReplayStage {
newly_voted_pubkeys.retain(|vote_pubkey| {
let exists = leader_propagated_stats
.propagated_validators
.contains(&**vote_pubkey);
.contains(vote_pubkey);
leader_propagated_stats.add_vote_pubkey(
&*vote_pubkey,
all_pubkeys,
**vote_pubkey,
leader_bank.epoch_vote_account_stake(&vote_pubkey),
);
!exists
@ -1797,7 +1781,7 @@ impl ReplayStage {
let exists = leader_propagated_stats
.propagated_node_ids
.contains(&**node_pubkey);
leader_propagated_stats.add_node_pubkey(&*node_pubkey, all_pubkeys, leader_bank);
leader_propagated_stats.add_node_pubkey(&*node_pubkey, leader_bank);
!exists
});
@ -1852,21 +1836,15 @@ impl ReplayStage {
bank_forks: &RwLock<BankForks>,
progress: &mut ProgressMap,
accounts_background_request_sender: &ABSRequestSender,
all_pubkeys: &mut PubkeyReferences,
highest_confirmed_root: Option<Slot>,
heaviest_subtree_fork_choice: &mut HeaviestSubtreeForkChoice,
) {
let old_epoch = bank_forks.read().unwrap().root_bank().epoch();
bank_forks.write().unwrap().set_root(
new_root,
accounts_background_request_sender,
highest_confirmed_root,
);
let r_bank_forks = bank_forks.read().unwrap();
let new_epoch = bank_forks.read().unwrap().root_bank().epoch();
if old_epoch != new_epoch {
all_pubkeys.purge();
}
progress.handle_new_root(&r_bank_forks);
heaviest_subtree_fork_choice.set_root(new_root);
}
@ -1877,7 +1855,6 @@ impl ReplayStage {
leader_schedule_cache: &Arc<LeaderScheduleCache>,
subscriptions: &Arc<RpcSubscriptions>,
progress: &mut ProgressMap,
all_pubkeys: &mut PubkeyReferences,
) {
// Find the next slot that chains to the old slot
let forks = bank_forks.read().unwrap();
@ -1930,7 +1907,6 @@ impl ReplayStage {
vec![&leader],
parent_bank.slot(),
bank_forks,
all_pubkeys,
);
new_banks.insert(child_slot, child_bank);
}
@ -2059,7 +2035,6 @@ pub(crate) mod tests {
use std::{
fs::remove_dir_all,
iter,
rc::Rc,
sync::{Arc, RwLock},
};
use trees::tr;
@ -2200,7 +2175,6 @@ pub(crate) mod tests {
&leader_schedule_cache,
&rpc_subscriptions,
&mut progress,
&mut PubkeyReferences::default(),
);
assert!(bank_forks
.read()
@ -2223,7 +2197,6 @@ pub(crate) mod tests {
&leader_schedule_cache,
&rpc_subscriptions,
&mut progress,
&mut PubkeyReferences::default(),
);
assert!(bank_forks
.read()
@ -2277,7 +2250,6 @@ pub(crate) mod tests {
&bank_forks,
&mut progress,
&ABSRequestSender::default(),
&mut PubkeyReferences::default(),
None,
&mut heaviest_subtree_fork_choice,
);
@ -2322,7 +2294,6 @@ pub(crate) mod tests {
&bank_forks,
&mut progress,
&ABSRequestSender::default(),
&mut PubkeyReferences::default(),
Some(confirmed_root),
&mut heaviest_subtree_fork_choice,
);
@ -2860,7 +2831,6 @@ pub(crate) mod tests {
&VoteTracker::default(),
&ClusterSlots::default(),
&bank_forks,
&mut PubkeyReferences::default(),
&mut heaviest_subtree_fork_choice,
);
@ -2905,7 +2875,6 @@ pub(crate) mod tests {
&VoteTracker::default(),
&ClusterSlots::default(),
&bank_forks,
&mut PubkeyReferences::default(),
&mut heaviest_subtree_fork_choice,
);
@ -2940,7 +2909,6 @@ pub(crate) mod tests {
&VoteTracker::default(),
&ClusterSlots::default(),
&bank_forks,
&mut PubkeyReferences::default(),
&mut heaviest_subtree_fork_choice,
);
// No new stats should have been computed
@ -2977,7 +2945,6 @@ pub(crate) mod tests {
&VoteTracker::default(),
&ClusterSlots::default(),
&vote_simulator.bank_forks,
&mut PubkeyReferences::default(),
&mut heaviest_subtree_fork_choice,
);
@ -3039,7 +3006,6 @@ pub(crate) mod tests {
&VoteTracker::default(),
&ClusterSlots::default(),
&vote_simulator.bank_forks,
&mut PubkeyReferences::default(),
&mut vote_simulator.heaviest_subtree_fork_choice,
);
@ -3165,7 +3131,6 @@ pub(crate) mod tests {
..PropagatedStats::default()
};
let mut all_pubkeys = PubkeyReferences::default();
let child_reached_threshold = false;
for i in 0..std::cmp::max(new_vote_pubkeys.len(), new_node_pubkeys.len()) {
propagated_stats.is_propagated = false;
@ -3187,7 +3152,6 @@ pub(crate) mod tests {
&mut node_pubkeys,
&root_bank,
&mut propagated_stats,
&mut all_pubkeys,
child_reached_threshold,
);
@ -3238,7 +3202,6 @@ pub(crate) mod tests {
..PropagatedStats::default()
};
propagated_stats.total_epoch_stake = stake * 10;
let mut all_pubkeys = PubkeyReferences::default();
let child_reached_threshold = true;
let mut newly_voted_pubkeys: Vec<Arc<Pubkey>> = vec![];
@ -3247,7 +3210,6 @@ pub(crate) mod tests {
&mut empty,
&root_bank,
&mut propagated_stats,
&mut all_pubkeys,
child_reached_threshold,
));
@ -3258,14 +3220,12 @@ pub(crate) mod tests {
..PropagatedStats::default()
};
propagated_stats.is_propagated = true;
all_pubkeys = PubkeyReferences::default();
newly_voted_pubkeys = vec![];
assert!(!ReplayStage::update_slot_propagated_threshold_from_votes(
&mut newly_voted_pubkeys,
&mut empty,
&root_bank,
&mut propagated_stats,
&mut all_pubkeys,
child_reached_threshold,
));
@ -3275,7 +3235,6 @@ pub(crate) mod tests {
&mut empty,
&root_bank,
&mut propagated_stats,
&mut all_pubkeys,
child_reached_threshold,
));
}
@ -3335,7 +3294,6 @@ pub(crate) mod tests {
ReplayStage::update_propagation_status(
&mut progress_map,
10,
&mut PubkeyReferences::default(),
&RwLock::new(bank_forks),
&vote_tracker,
&ClusterSlots::default(),
@ -3427,7 +3385,6 @@ pub(crate) mod tests {
ReplayStage::update_propagation_status(
&mut progress_map,
10,
&mut PubkeyReferences::default(),
&RwLock::new(bank_forks),
&vote_tracker,
&ClusterSlots::default(),
@ -3497,11 +3454,8 @@ pub(crate) mod tests {
1
}
};
fork_progress.propagated_stats.propagated_validators = vote_pubkeys[0..end_range]
.iter()
.cloned()
.map(Rc::new)
.collect();
fork_progress.propagated_stats.propagated_validators =
vote_pubkeys[0..end_range].iter().copied().collect();
fork_progress.propagated_stats.propagated_validators_stake =
end_range as u64 * stake_per_validator;
progress_map.insert(i, fork_progress);
@ -3516,7 +3470,6 @@ pub(crate) mod tests {
ReplayStage::update_propagation_status(
&mut progress_map,
10,
&mut PubkeyReferences::default(),
&RwLock::new(bank_forks),
&vote_tracker,
&ClusterSlots::default(),
@ -3889,7 +3842,6 @@ pub(crate) mod tests {
&vote_tracker,
&ClusterSlots::default(),
&bank_forks,
&mut PubkeyReferences::default(),
&mut HeaviestSubtreeForkChoice::new_from_bank_forks(&bank_forks.read().unwrap()),
);