Add secondary indexes (#14212)

This commit is contained in:
carllin
2020-12-31 18:06:03 -08:00
committed by GitHub
parent 4a3d217839
commit 5affd8aa72
20 changed files with 1875 additions and 234 deletions

View File

@ -68,6 +68,7 @@ pub fn load(
genesis_config,
process_options.debug_keys.clone(),
Some(&crate::builtins::get(process_options.bpf_jit)),
process_options.account_indexes.clone(),
)
.expect("Load from snapshot failed");
if let Some(shrink_paths) = shrink_paths {

View File

@ -15,6 +15,7 @@ use solana_measure::{measure::Measure, thread_mem_usage};
use solana_metrics::{datapoint_error, inc_new_counter_debug};
use solana_rayon_threadlimit::get_thread_count;
use solana_runtime::{
accounts_index::AccountIndex,
bank::{
Bank, InnerInstructionsList, TransactionBalancesSet, TransactionExecutionResult,
TransactionLogMessages, TransactionResults,
@ -344,6 +345,7 @@ pub struct ProcessOptions {
pub new_hard_forks: Option<Vec<Slot>>,
pub frozen_accounts: Vec<Pubkey>,
pub debug_keys: Option<Arc<HashSet<Pubkey>>>,
pub account_indexes: HashSet<AccountIndex>,
}
pub fn process_blockstore(
@ -368,6 +370,7 @@ pub fn process_blockstore(
&opts.frozen_accounts,
opts.debug_keys.clone(),
Some(&crate::builtins::get(opts.bpf_jit)),
opts.account_indexes.clone(),
);
let bank0 = Arc::new(bank0);
info!("processing ledger for slot 0...");
@ -2891,7 +2894,14 @@ pub mod tests {
genesis_config: &GenesisConfig,
account_paths: Vec<PathBuf>,
) -> EpochSchedule {
let bank = Bank::new_with_paths(&genesis_config, account_paths, &[], None, None);
let bank = Bank::new_with_paths(
&genesis_config,
account_paths,
&[],
None,
None,
HashSet::new(),
);
*bank.epoch_schedule()
}