move Ancestors to its own module (#17316)
This commit is contained in:
parent
0781fe1b4f
commit
ed9cbd50f0
|
@ -6,7 +6,8 @@ use rayon::prelude::*;
|
||||||
use solana_measure::measure::Measure;
|
use solana_measure::measure::Measure;
|
||||||
use solana_runtime::{
|
use solana_runtime::{
|
||||||
accounts::{create_test_accounts, update_accounts_bench, Accounts},
|
accounts::{create_test_accounts, update_accounts_bench, Accounts},
|
||||||
accounts_index::{AccountSecondaryIndexes, Ancestors},
|
accounts_index::AccountSecondaryIndexes,
|
||||||
|
ancestors::Ancestors,
|
||||||
};
|
};
|
||||||
use solana_sdk::{genesis_config::ClusterType, pubkey::Pubkey};
|
use solana_sdk::{genesis_config::ClusterType, pubkey::Pubkey};
|
||||||
use std::{env, fs, path::PathBuf};
|
use std::{env, fs, path::PathBuf};
|
||||||
|
|
|
@ -8,7 +8,8 @@ use rand::Rng;
|
||||||
use rayon::iter::{IntoParallelRefIterator, ParallelIterator};
|
use rayon::iter::{IntoParallelRefIterator, ParallelIterator};
|
||||||
use solana_runtime::{
|
use solana_runtime::{
|
||||||
accounts::{create_test_accounts, AccountAddressFilter, Accounts},
|
accounts::{create_test_accounts, AccountAddressFilter, Accounts},
|
||||||
accounts_index::{AccountSecondaryIndexes, Ancestors},
|
accounts_index::AccountSecondaryIndexes,
|
||||||
|
ancestors::Ancestors,
|
||||||
bank::*,
|
bank::*,
|
||||||
};
|
};
|
||||||
use solana_sdk::{
|
use solana_sdk::{
|
||||||
|
|
|
@ -2,7 +2,8 @@ use crate::{
|
||||||
accounts_db::{
|
accounts_db::{
|
||||||
AccountsDb, BankHashInfo, ErrorCounters, LoadHint, LoadedAccount, ScanStorageResult,
|
AccountsDb, BankHashInfo, ErrorCounters, LoadHint, LoadedAccount, ScanStorageResult,
|
||||||
},
|
},
|
||||||
accounts_index::{AccountSecondaryIndexes, Ancestors, IndexKey},
|
accounts_index::{AccountSecondaryIndexes, IndexKey},
|
||||||
|
ancestors::Ancestors,
|
||||||
bank::{
|
bank::{
|
||||||
NonceRollbackFull, NonceRollbackInfo, TransactionCheckResult, TransactionExecutionResult,
|
NonceRollbackFull, NonceRollbackInfo, TransactionCheckResult, TransactionExecutionResult,
|
||||||
},
|
},
|
||||||
|
|
|
@ -23,8 +23,9 @@ use crate::{
|
||||||
accounts_hash::{AccountsHash, CalculateHashIntermediate, HashStats, PreviousPass},
|
accounts_hash::{AccountsHash, CalculateHashIntermediate, HashStats, PreviousPass},
|
||||||
accounts_index::{
|
accounts_index::{
|
||||||
AccountIndexGetResult, AccountSecondaryIndexes, AccountsIndex, AccountsIndexRootsStats,
|
AccountIndexGetResult, AccountSecondaryIndexes, AccountsIndex, AccountsIndexRootsStats,
|
||||||
Ancestors, IndexKey, IsCached, SlotList, SlotSlice, ZeroLamport,
|
IndexKey, IsCached, SlotList, SlotSlice, ZeroLamport,
|
||||||
},
|
},
|
||||||
|
ancestors::Ancestors,
|
||||||
append_vec::{AppendVec, StoredAccountMeta, StoredMeta, StoredMetaWriteVersion},
|
append_vec::{AppendVec, StoredAccountMeta, StoredMeta, StoredMetaWriteVersion},
|
||||||
contains::Contains,
|
contains::Contains,
|
||||||
read_only_accounts_cache::ReadOnlyAccountsCache,
|
read_only_accounts_cache::ReadOnlyAccountsCache,
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
|
ancestors::Ancestors,
|
||||||
contains::Contains,
|
contains::Contains,
|
||||||
inline_spl_token_v2_0::{self, SPL_TOKEN_ACCOUNT_MINT_OFFSET, SPL_TOKEN_ACCOUNT_OWNER_OFFSET},
|
inline_spl_token_v2_0::{self, SPL_TOKEN_ACCOUNT_MINT_OFFSET, SPL_TOKEN_ACCOUNT_OWNER_OFFSET},
|
||||||
secondary_index::*,
|
secondary_index::*,
|
||||||
|
@ -15,7 +16,7 @@ use solana_sdk::{
|
||||||
use std::{
|
use std::{
|
||||||
collections::{
|
collections::{
|
||||||
btree_map::{self, BTreeMap},
|
btree_map::{self, BTreeMap},
|
||||||
HashMap, HashSet,
|
HashSet,
|
||||||
},
|
},
|
||||||
ops::{
|
ops::{
|
||||||
Bound,
|
Bound,
|
||||||
|
@ -32,7 +33,6 @@ pub const ITER_BATCH_SIZE: usize = 1000;
|
||||||
|
|
||||||
pub type SlotList<T> = Vec<(Slot, T)>;
|
pub type SlotList<T> = Vec<(Slot, T)>;
|
||||||
pub type SlotSlice<'s, T> = &'s [(Slot, T)];
|
pub type SlotSlice<'s, T> = &'s [(Slot, T)];
|
||||||
pub type Ancestors = HashMap<Slot, usize>;
|
|
||||||
|
|
||||||
pub type RefCount = u64;
|
pub type RefCount = u64;
|
||||||
pub type AccountMap<K, V> = BTreeMap<K, V>;
|
pub type AccountMap<K, V> = BTreeMap<K, V>;
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
use solana_sdk::clock::Slot;
|
||||||
|
use std::collections::HashMap;
|
||||||
|
|
||||||
|
pub type Ancestors = HashMap<Slot, usize>;
|
|
@ -39,7 +39,8 @@ use crate::{
|
||||||
TransactionLoadResult, TransactionLoaders,
|
TransactionLoadResult, TransactionLoaders,
|
||||||
},
|
},
|
||||||
accounts_db::{ErrorCounters, SnapshotStorages},
|
accounts_db::{ErrorCounters, SnapshotStorages},
|
||||||
accounts_index::{AccountSecondaryIndexes, Ancestors, IndexKey},
|
accounts_index::{AccountSecondaryIndexes, IndexKey},
|
||||||
|
ancestors::Ancestors,
|
||||||
blockhash_queue::BlockhashQueue,
|
blockhash_queue::BlockhashQueue,
|
||||||
builtins::{self, ActivationType},
|
builtins::{self, ActivationType},
|
||||||
epoch_stakes::{EpochStakes, NodeVoteAccounts},
|
epoch_stakes::{EpochStakes, NodeVoteAccounts},
|
||||||
|
@ -5185,9 +5186,8 @@ pub(crate) mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::{
|
use crate::{
|
||||||
accounts_db::SHRINK_RATIO,
|
accounts_db::SHRINK_RATIO,
|
||||||
accounts_index::{
|
accounts_index::{AccountIndex, AccountMap, AccountSecondaryIndexes, ITER_BATCH_SIZE},
|
||||||
AccountIndex, AccountMap, AccountSecondaryIndexes, Ancestors, ITER_BATCH_SIZE,
|
ancestors::Ancestors,
|
||||||
},
|
|
||||||
genesis_utils::{
|
genesis_utils::{
|
||||||
activate_all_features, bootstrap_validator_stake_lamports,
|
activate_all_features, bootstrap_validator_stake_lamports,
|
||||||
create_genesis_config_with_leader, create_genesis_config_with_vote_accounts,
|
create_genesis_config_with_leader, create_genesis_config_with_vote_accounts,
|
||||||
|
|
|
@ -6,6 +6,7 @@ pub mod accounts_cache;
|
||||||
pub mod accounts_db;
|
pub mod accounts_db;
|
||||||
pub mod accounts_hash;
|
pub mod accounts_hash;
|
||||||
pub mod accounts_index;
|
pub mod accounts_index;
|
||||||
|
pub mod ancestors;
|
||||||
pub mod append_vec;
|
pub mod append_vec;
|
||||||
pub mod bank;
|
pub mod bank;
|
||||||
pub mod bank_client;
|
pub mod bank_client;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
accounts::Accounts, accounts_index::Ancestors, instruction_recorder::InstructionRecorder,
|
accounts::Accounts, ancestors::Ancestors, instruction_recorder::InstructionRecorder,
|
||||||
log_collector::LogCollector, native_loader::NativeLoader, rent_collector::RentCollector,
|
log_collector::LogCollector, native_loader::NativeLoader, rent_collector::RentCollector,
|
||||||
};
|
};
|
||||||
use log::*;
|
use log::*;
|
||||||
|
|
|
@ -2,7 +2,8 @@ use {
|
||||||
crate::{
|
crate::{
|
||||||
accounts::Accounts,
|
accounts::Accounts,
|
||||||
accounts_db::{AccountStorageEntry, AccountsDb, AppendVecId, BankHashInfo},
|
accounts_db::{AccountStorageEntry, AccountsDb, AppendVecId, BankHashInfo},
|
||||||
accounts_index::{AccountSecondaryIndexes, Ancestors},
|
accounts_index::AccountSecondaryIndexes,
|
||||||
|
ancestors::Ancestors,
|
||||||
append_vec::{AppendVec, StoredMetaWriteVersion},
|
append_vec::{AppendVec, StoredMetaWriteVersion},
|
||||||
bank::{Bank, BankFieldsToDeserialize, BankRc, Builtins},
|
bank::{Bank, BankFieldsToDeserialize, BankRc, Builtins},
|
||||||
blockhash_queue::BlockhashQueue,
|
blockhash_queue::BlockhashQueue,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::accounts_index::Ancestors;
|
use crate::ancestors::Ancestors;
|
||||||
|
|
||||||
use log::*;
|
use log::*;
|
||||||
use rand::{thread_rng, Rng};
|
use rand::{thread_rng, Rng};
|
||||||
|
|
|
@ -3,7 +3,7 @@ use rand::{thread_rng, Rng};
|
||||||
use rayon::prelude::*;
|
use rayon::prelude::*;
|
||||||
use solana_runtime::{
|
use solana_runtime::{
|
||||||
accounts_db::{AccountsDb, LoadHint},
|
accounts_db::{AccountsDb, LoadHint},
|
||||||
accounts_index::Ancestors,
|
ancestors::Ancestors,
|
||||||
};
|
};
|
||||||
use solana_sdk::genesis_config::ClusterType;
|
use solana_sdk::genesis_config::ClusterType;
|
||||||
use solana_sdk::{
|
use solana_sdk::{
|
||||||
|
|
Loading…
Reference in New Issue