renames solana_runtime::vote_account::VoteAccount
Rename: VoteAccount -> VoteAccountInner # the private type ArcVoteAccount -> VoteAccount # the public type
This commit is contained in:
@ -8,7 +8,7 @@ use {
|
||||
solana_ledger::{ancestor_iterator::AncestorIterator, blockstore::Blockstore, blockstore_db},
|
||||
solana_runtime::{
|
||||
bank::Bank, bank_forks::BankForks, commitment::VOTE_THRESHOLD_SIZE,
|
||||
vote_account::ArcVoteAccount,
|
||||
vote_account::VoteAccount,
|
||||
},
|
||||
solana_sdk::{
|
||||
clock::{Slot, UnixTimestamp},
|
||||
@ -209,7 +209,7 @@ impl Tower {
|
||||
latest_validator_votes_for_frozen_banks: &mut LatestValidatorVotesForFrozenBanks,
|
||||
) -> ComputedBankState
|
||||
where
|
||||
F: IntoIterator<Item = (Pubkey, (u64, ArcVoteAccount))>,
|
||||
F: IntoIterator<Item = (Pubkey, (u64, VoteAccount))>,
|
||||
{
|
||||
let mut vote_slots = HashSet::new();
|
||||
let mut voted_stakes = HashMap::new();
|
||||
@ -555,7 +555,7 @@ impl Tower {
|
||||
descendants: &HashMap<Slot, HashSet<u64>>,
|
||||
progress: &ProgressMap,
|
||||
total_stake: u64,
|
||||
epoch_vote_accounts: &HashMap<Pubkey, (u64, ArcVoteAccount)>,
|
||||
epoch_vote_accounts: &HashMap<Pubkey, (u64, VoteAccount)>,
|
||||
latest_validator_votes_for_frozen_banks: &LatestValidatorVotesForFrozenBanks,
|
||||
heaviest_subtree_fork_choice: &HeaviestSubtreeForkChoice,
|
||||
) -> SwitchForkDecision {
|
||||
@ -825,7 +825,7 @@ impl Tower {
|
||||
descendants: &HashMap<Slot, HashSet<u64>>,
|
||||
progress: &ProgressMap,
|
||||
total_stake: u64,
|
||||
epoch_vote_accounts: &HashMap<Pubkey, (u64, ArcVoteAccount)>,
|
||||
epoch_vote_accounts: &HashMap<Pubkey, (u64, VoteAccount)>,
|
||||
latest_validator_votes_for_frozen_banks: &LatestValidatorVotesForFrozenBanks,
|
||||
heaviest_subtree_fork_choice: &HeaviestSubtreeForkChoice,
|
||||
) -> SwitchForkDecision {
|
||||
@ -1398,7 +1398,7 @@ pub mod test {
|
||||
use tempfile::TempDir;
|
||||
use trees::tr;
|
||||
|
||||
fn gen_stakes(stake_votes: &[(u64, &[u64])]) -> Vec<(Pubkey, (u64, ArcVoteAccount))> {
|
||||
fn gen_stakes(stake_votes: &[(u64, &[u64])]) -> Vec<(Pubkey, (u64, VoteAccount))> {
|
||||
let mut stakes = vec![];
|
||||
for (lamports, votes) in stake_votes {
|
||||
let mut account = AccountSharedData::from(Account {
|
||||
@ -1417,7 +1417,7 @@ pub mod test {
|
||||
.expect("serialize state");
|
||||
stakes.push((
|
||||
solana_sdk::pubkey::new_rand(),
|
||||
(*lamports, ArcVoteAccount::from(account)),
|
||||
(*lamports, VoteAccount::from(account)),
|
||||
));
|
||||
}
|
||||
stakes
|
||||
|
@ -1,15 +1,17 @@
|
||||
use crate::{
|
||||
cluster_info_vote_listener::SlotVoteTracker,
|
||||
cluster_slots::SlotPubkeys,
|
||||
replay_stage::SUPERMINORITY_THRESHOLD,
|
||||
{consensus::Stake, consensus::VotedStakes},
|
||||
};
|
||||
use solana_ledger::blockstore_processor::{ConfirmationProgress, ConfirmationTiming};
|
||||
use solana_runtime::{bank::Bank, bank_forks::BankForks, vote_account::ArcVoteAccount};
|
||||
use solana_sdk::{clock::Slot, hash::Hash, pubkey::Pubkey};
|
||||
use std::{
|
||||
collections::{BTreeMap, HashMap, HashSet},
|
||||
sync::{Arc, RwLock},
|
||||
use {
|
||||
crate::{
|
||||
cluster_info_vote_listener::SlotVoteTracker,
|
||||
cluster_slots::SlotPubkeys,
|
||||
replay_stage::SUPERMINORITY_THRESHOLD,
|
||||
{consensus::Stake, consensus::VotedStakes},
|
||||
},
|
||||
solana_ledger::blockstore_processor::{ConfirmationProgress, ConfirmationTiming},
|
||||
solana_runtime::{bank::Bank, bank_forks::BankForks, vote_account::VoteAccount},
|
||||
solana_sdk::{clock::Slot, hash::Hash, pubkey::Pubkey},
|
||||
std::{
|
||||
collections::{BTreeMap, HashMap, HashSet},
|
||||
sync::{Arc, RwLock},
|
||||
},
|
||||
};
|
||||
|
||||
type VotedSlot = Slot;
|
||||
@ -326,7 +328,7 @@ impl PropagatedStats {
|
||||
&mut self,
|
||||
node_pubkey: &Pubkey,
|
||||
vote_account_pubkeys: &[Pubkey],
|
||||
epoch_vote_accounts: &HashMap<Pubkey, (u64, ArcVoteAccount)>,
|
||||
epoch_vote_accounts: &HashMap<Pubkey, (u64, VoteAccount)>,
|
||||
) {
|
||||
self.propagated_node_ids.insert(*node_pubkey);
|
||||
for vote_account_pubkey in vote_account_pubkeys.iter() {
|
||||
@ -522,7 +524,7 @@ mod test {
|
||||
let epoch_vote_accounts: HashMap<_, _> = vote_account_pubkeys
|
||||
.iter()
|
||||
.skip(num_vote_accounts - staked_vote_accounts)
|
||||
.map(|pubkey| (*pubkey, (1, ArcVoteAccount::default())))
|
||||
.map(|pubkey| (*pubkey, (1, VoteAccount::default())))
|
||||
.collect();
|
||||
|
||||
let mut stats = PropagatedStats::default();
|
||||
@ -564,7 +566,7 @@ mod test {
|
||||
let epoch_vote_accounts: HashMap<_, _> = vote_account_pubkeys
|
||||
.iter()
|
||||
.skip(num_vote_accounts - staked_vote_accounts)
|
||||
.map(|pubkey| (*pubkey, (1, ArcVoteAccount::default())))
|
||||
.map(|pubkey| (*pubkey, (1, VoteAccount::default())))
|
||||
.collect();
|
||||
stats.add_node_pubkey_internal(&node_pubkey, &vote_account_pubkeys, &epoch_vote_accounts);
|
||||
assert!(stats.propagated_node_ids.contains(&node_pubkey));
|
||||
|
Reference in New Issue
Block a user