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

@@ -1,4 +1,5 @@
use crate::{
accounts_index::AccountIndex,
bank::{Bank, BankSlotDelta, Builtins},
bank_forks::CompressionType,
hardened_unpack::{unpack_snapshot, UnpackError},
@@ -592,6 +593,7 @@ pub fn bank_from_archive<P: AsRef<Path>>(
genesis_config: &GenesisConfig,
debug_keys: Option<Arc<HashSet<Pubkey>>>,
additional_builtins: Option<&Builtins>,
account_indexes: HashSet<AccountIndex>,
) -> Result<Bank> {
// Untar the snapshot into a temporary directory
let unpack_dir = tempfile::Builder::new()
@@ -616,6 +618,7 @@ pub fn bank_from_archive<P: AsRef<Path>>(
genesis_config,
debug_keys,
additional_builtins,
account_indexes,
)?;
if !bank.verify_snapshot_bank() {
@@ -775,6 +778,7 @@ fn rebuild_bank_from_snapshots<P>(
genesis_config: &GenesisConfig,
debug_keys: Option<Arc<HashSet<Pubkey>>>,
additional_builtins: Option<&Builtins>,
account_indexes: HashSet<AccountIndex>,
) -> Result<Bank>
where
P: AsRef<Path>,
@@ -808,6 +812,7 @@ where
frozen_account_pubkeys,
debug_keys,
additional_builtins,
account_indexes,
),
}?)
})?;