acct idx can no longer use write cache (#28150)
This commit is contained in:
parent
82558226f7
commit
cfc124c825
|
@ -135,7 +135,6 @@ fn main() {
|
||||||
solana_sdk::clock::Slot::default(),
|
solana_sdk::clock::Slot::default(),
|
||||||
&ancestors,
|
&ancestors,
|
||||||
None,
|
None,
|
||||||
false,
|
|
||||||
&EpochSchedule::default(),
|
&EpochSchedule::default(),
|
||||||
&RentCollector::default(),
|
&RentCollector::default(),
|
||||||
false,
|
false,
|
||||||
|
|
|
@ -147,7 +147,6 @@ impl AccountsHashVerifier {
|
||||||
use_bg_thread_pool: true,
|
use_bg_thread_pool: true,
|
||||||
check_hash: false,
|
check_hash: false,
|
||||||
ancestors: None,
|
ancestors: None,
|
||||||
use_write_cache: false,
|
|
||||||
epoch_schedule: &accounts_package.epoch_schedule,
|
epoch_schedule: &accounts_package.epoch_schedule,
|
||||||
rent_collector: &accounts_package.rent_collector,
|
rent_collector: &accounts_package.rent_collector,
|
||||||
store_detailed_debug_info_on_failure: false,
|
store_detailed_debug_info_on_failure: false,
|
||||||
|
@ -171,7 +170,6 @@ impl AccountsHashVerifier {
|
||||||
use_bg_thread_pool: false,
|
use_bg_thread_pool: false,
|
||||||
check_hash: false,
|
check_hash: false,
|
||||||
ancestors: None,
|
ancestors: None,
|
||||||
use_write_cache: false,
|
|
||||||
epoch_schedule: &accounts_package.epoch_schedule,
|
epoch_schedule: &accounts_package.epoch_schedule,
|
||||||
rent_collector: &accounts_package.rent_collector,
|
rent_collector: &accounts_package.rent_collector,
|
||||||
store_detailed_debug_info_on_failure: false,
|
store_detailed_debug_info_on_failure: false,
|
||||||
|
@ -191,7 +189,6 @@ impl AccountsHashVerifier {
|
||||||
use_bg_thread_pool: false,
|
use_bg_thread_pool: false,
|
||||||
check_hash: false,
|
check_hash: false,
|
||||||
ancestors: None,
|
ancestors: None,
|
||||||
use_write_cache: false,
|
|
||||||
epoch_schedule: &accounts_package.epoch_schedule,
|
epoch_schedule: &accounts_package.epoch_schedule,
|
||||||
rent_collector: &accounts_package.rent_collector,
|
rent_collector: &accounts_package.rent_collector,
|
||||||
// now that we've failed, store off the failing contents that produced a bad capitalization
|
// now that we've failed, store off the failing contents that produced a bad capitalization
|
||||||
|
|
|
@ -1545,11 +1545,9 @@ fn load_frozen_forks(
|
||||||
|
|
||||||
fn run_final_hash_calc(bank: &Bank, on_halt_store_hash_raw_data_for_debug: bool) {
|
fn run_final_hash_calc(bank: &Bank, on_halt_store_hash_raw_data_for_debug: bool) {
|
||||||
bank.force_flush_accounts_cache();
|
bank.force_flush_accounts_cache();
|
||||||
let can_cached_slot_be_unflushed = false;
|
|
||||||
// note that this slot may not be a root
|
// note that this slot may not be a root
|
||||||
let _ = bank.verify_bank_hash(VerifyBankHash {
|
let _ = bank.verify_bank_hash(VerifyBankHash {
|
||||||
test_hash_calculation: false,
|
test_hash_calculation: false,
|
||||||
can_cached_slot_be_unflushed,
|
|
||||||
ignore_mismatch: true,
|
ignore_mismatch: true,
|
||||||
require_rooted_bank: false,
|
require_rooted_bank: false,
|
||||||
run_in_background: false,
|
run_in_background: false,
|
||||||
|
|
|
@ -112,7 +112,6 @@ fn test_accounts_hash_bank_hash(bencher: &mut Bencher) {
|
||||||
&RentCollector::default(),
|
&RentCollector::default(),
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
|
||||||
true,
|
true,
|
||||||
))
|
))
|
||||||
});
|
});
|
||||||
|
|
|
@ -814,7 +814,6 @@ impl Accounts {
|
||||||
&self,
|
&self,
|
||||||
ancestors: &Ancestors,
|
ancestors: &Ancestors,
|
||||||
slot: Slot,
|
slot: Slot,
|
||||||
can_cached_slot_be_unflushed: bool,
|
|
||||||
debug_verify: bool,
|
debug_verify: bool,
|
||||||
epoch_schedule: &EpochSchedule,
|
epoch_schedule: &EpochSchedule,
|
||||||
rent_collector: &RentCollector,
|
rent_collector: &RentCollector,
|
||||||
|
@ -832,7 +831,6 @@ impl Accounts {
|
||||||
slot,
|
slot,
|
||||||
ancestors,
|
ancestors,
|
||||||
None,
|
None,
|
||||||
can_cached_slot_be_unflushed,
|
|
||||||
epoch_schedule,
|
epoch_schedule,
|
||||||
rent_collector,
|
rent_collector,
|
||||||
is_startup,
|
is_startup,
|
||||||
|
@ -852,7 +850,6 @@ impl Accounts {
|
||||||
test_hash_calculation: bool,
|
test_hash_calculation: bool,
|
||||||
epoch_schedule: &EpochSchedule,
|
epoch_schedule: &EpochSchedule,
|
||||||
rent_collector: &RentCollector,
|
rent_collector: &RentCollector,
|
||||||
can_cached_slot_be_unflushed: bool,
|
|
||||||
ignore_mismatch: bool,
|
ignore_mismatch: bool,
|
||||||
store_detailed_debug_info: bool,
|
store_detailed_debug_info: bool,
|
||||||
enable_rehashing: bool,
|
enable_rehashing: bool,
|
||||||
|
@ -864,7 +861,6 @@ impl Accounts {
|
||||||
test_hash_calculation,
|
test_hash_calculation,
|
||||||
epoch_schedule,
|
epoch_schedule,
|
||||||
rent_collector,
|
rent_collector,
|
||||||
can_cached_slot_be_unflushed,
|
|
||||||
ignore_mismatch,
|
ignore_mismatch,
|
||||||
store_detailed_debug_info,
|
store_detailed_debug_info,
|
||||||
enable_rehashing,
|
enable_rehashing,
|
||||||
|
|
|
@ -218,7 +218,6 @@ impl SnapshotRequestHandler {
|
||||||
use_bg_thread_pool: true,
|
use_bg_thread_pool: true,
|
||||||
check_hash,
|
check_hash,
|
||||||
ancestors: None,
|
ancestors: None,
|
||||||
use_write_cache: false,
|
|
||||||
epoch_schedule: snapshot_root_bank.epoch_schedule(),
|
epoch_schedule: snapshot_root_bank.epoch_schedule(),
|
||||||
rent_collector: snapshot_root_bank.rent_collector(),
|
rent_collector: snapshot_root_bank.rent_collector(),
|
||||||
store_detailed_debug_info_on_failure: false,
|
store_detailed_debug_info_on_failure: false,
|
||||||
|
|
|
@ -6715,7 +6715,6 @@ impl AccountsDb {
|
||||||
slot,
|
slot,
|
||||||
ancestors,
|
ancestors,
|
||||||
None,
|
None,
|
||||||
false,
|
|
||||||
epoch_schedule,
|
epoch_schedule,
|
||||||
rent_collector,
|
rent_collector,
|
||||||
false,
|
false,
|
||||||
|
@ -6731,7 +6730,6 @@ impl AccountsDb {
|
||||||
slot,
|
slot,
|
||||||
ancestors,
|
ancestors,
|
||||||
None,
|
None,
|
||||||
false,
|
|
||||||
&EpochSchedule::default(),
|
&EpochSchedule::default(),
|
||||||
&RentCollector::default(),
|
&RentCollector::default(),
|
||||||
false,
|
false,
|
||||||
|
@ -6935,9 +6933,8 @@ impl AccountsDb {
|
||||||
// if we're using the write cache, then we can't rely on cached append vecs since the append vecs may not include every account
|
// if we're using the write cache, then we can't rely on cached append vecs since the append vecs may not include every account
|
||||||
// Single cached slots get cached and full chunks get cached.
|
// Single cached slots get cached and full chunks get cached.
|
||||||
// chunks that don't divide evenly would include some cached append vecs that are no longer part of this range and some that are, so we have to ignore caching on non-evenly dividing chunks.
|
// chunks that don't divide evenly would include some cached append vecs that are no longer part of this range and some that are, so we have to ignore caching on non-evenly dividing chunks.
|
||||||
let eligible_for_caching = !config.use_write_cache
|
let eligible_for_caching = single_cached_slot
|
||||||
&& (single_cached_slot
|
|| end_exclusive.saturating_sub(start) == MAX_ITEMS_PER_CHUNK;
|
||||||
|| end_exclusive.saturating_sub(start) == MAX_ITEMS_PER_CHUNK);
|
|
||||||
|
|
||||||
if eligible_for_caching || config.store_detailed_debug_info_on_failure {
|
if eligible_for_caching || config.store_detailed_debug_info_on_failure {
|
||||||
let range = bin_range.end - bin_range.start;
|
let range = bin_range.end - bin_range.start;
|
||||||
|
@ -6954,7 +6951,6 @@ impl AccountsDb {
|
||||||
.saturating_sub(slots_per_epoch);
|
.saturating_sub(slots_per_epoch);
|
||||||
|
|
||||||
let mut file_name = String::default();
|
let mut file_name = String::default();
|
||||||
// if we're using the write cache, we can't cache the hash calc results because not all accounts are in append vecs.
|
|
||||||
if (should_cache_hash_data && eligible_for_caching)
|
if (should_cache_hash_data && eligible_for_caching)
|
||||||
|| config.store_detailed_debug_info_on_failure
|
|| config.store_detailed_debug_info_on_failure
|
||||||
{
|
{
|
||||||
|
@ -7033,30 +7029,6 @@ impl AccountsDb {
|
||||||
|
|
||||||
for (slot, sub_storages) in snapshot_storages.iter_range(start..end_exclusive) {
|
for (slot, sub_storages) in snapshot_storages.iter_range(start..end_exclusive) {
|
||||||
scanner.set_slot(slot);
|
scanner.set_slot(slot);
|
||||||
let valid_slot = sub_storages.is_some();
|
|
||||||
if config.use_write_cache {
|
|
||||||
let ancestors = config.ancestors.as_ref().unwrap();
|
|
||||||
if let Some(slot_cache) = self.accounts_cache.slot_cache(slot) {
|
|
||||||
if valid_slot
|
|
||||||
|| ancestors.contains_key(&slot)
|
|
||||||
|| self.accounts_index.is_alive_root(slot)
|
|
||||||
{
|
|
||||||
let keys = slot_cache.get_all_pubkeys();
|
|
||||||
for key in keys {
|
|
||||||
if scanner.filter(&key) {
|
|
||||||
if let Some(cached_account) = slot_cache.get_cloned(&key) {
|
|
||||||
let mut accessor = LoadedAccountAccessor::Cached(Some(
|
|
||||||
Cow::Owned(cached_account),
|
|
||||||
));
|
|
||||||
let account = accessor.get_loaded_account().unwrap();
|
|
||||||
scanner.found_account(&account);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(sub_storages) = sub_storages {
|
if let Some(sub_storages) = sub_storages {
|
||||||
Self::scan_multiple_account_storages_one_slot(sub_storages, &mut scanner);
|
Self::scan_multiple_account_storages_one_slot(sub_storages, &mut scanner);
|
||||||
}
|
}
|
||||||
|
@ -7118,7 +7090,7 @@ impl AccountsDb {
|
||||||
config: &CalcAccountsHashConfig<'_>,
|
config: &CalcAccountsHashConfig<'_>,
|
||||||
) -> Result<(Hash, u64), BankHashVerificationError> {
|
) -> Result<(Hash, u64), BankHashVerificationError> {
|
||||||
if !use_index {
|
if !use_index {
|
||||||
if !config.use_write_cache && self.accounts_cache.contains_any_slots(slot) {
|
if self.accounts_cache.contains_any_slots(slot) {
|
||||||
// this indicates a race condition
|
// this indicates a race condition
|
||||||
inc_new_counter_info!("accounts_hash_items_in_write_cache", 1);
|
inc_new_counter_info!("accounts_hash_items_in_write_cache", 1);
|
||||||
}
|
}
|
||||||
|
@ -7181,7 +7153,6 @@ impl AccountsDb {
|
||||||
slot: Slot,
|
slot: Slot,
|
||||||
ancestors: &Ancestors,
|
ancestors: &Ancestors,
|
||||||
expected_capitalization: Option<u64>,
|
expected_capitalization: Option<u64>,
|
||||||
can_cached_slot_be_unflushed: bool,
|
|
||||||
epoch_schedule: &EpochSchedule,
|
epoch_schedule: &EpochSchedule,
|
||||||
rent_collector: &RentCollector,
|
rent_collector: &RentCollector,
|
||||||
is_startup: bool,
|
is_startup: bool,
|
||||||
|
@ -7197,7 +7168,6 @@ impl AccountsDb {
|
||||||
use_bg_thread_pool: !is_startup,
|
use_bg_thread_pool: !is_startup,
|
||||||
check_hash,
|
check_hash,
|
||||||
ancestors: Some(ancestors),
|
ancestors: Some(ancestors),
|
||||||
use_write_cache: can_cached_slot_be_unflushed,
|
|
||||||
epoch_schedule,
|
epoch_schedule,
|
||||||
rent_collector,
|
rent_collector,
|
||||||
store_detailed_debug_info_on_failure: false,
|
store_detailed_debug_info_on_failure: false,
|
||||||
|
@ -7346,11 +7316,6 @@ impl AccountsDb {
|
||||||
let _guard = self.active_stats.activate(ActiveStatItem::Hash);
|
let _guard = self.active_stats.activate(ActiveStatItem::Hash);
|
||||||
stats.oldest_root = storages.range().start;
|
stats.oldest_root = storages.range().start;
|
||||||
|
|
||||||
assert!(
|
|
||||||
!(config.store_detailed_debug_info_on_failure && config.use_write_cache),
|
|
||||||
"cannot accurately capture all data for debugging if accounts cache is being used"
|
|
||||||
);
|
|
||||||
|
|
||||||
self.mark_old_slots_as_dirty(storages, config.epoch_schedule.slots_per_epoch, &mut stats);
|
self.mark_old_slots_as_dirty(storages, config.epoch_schedule.slots_per_epoch, &mut stats);
|
||||||
|
|
||||||
let (num_hash_scan_passes, bins_per_pass) = Self::bins_per_pass(self.num_hash_scan_passes);
|
let (num_hash_scan_passes, bins_per_pass) = Self::bins_per_pass(self.num_hash_scan_passes);
|
||||||
|
@ -7452,7 +7417,6 @@ impl AccountsDb {
|
||||||
test_hash_calculation: bool,
|
test_hash_calculation: bool,
|
||||||
epoch_schedule: &EpochSchedule,
|
epoch_schedule: &EpochSchedule,
|
||||||
rent_collector: &RentCollector,
|
rent_collector: &RentCollector,
|
||||||
can_cached_slot_be_unflushed: bool,
|
|
||||||
enable_rehashing: bool,
|
enable_rehashing: bool,
|
||||||
) -> Result<(), BankHashVerificationError> {
|
) -> Result<(), BankHashVerificationError> {
|
||||||
self.verify_bank_hash_and_lamports_new(
|
self.verify_bank_hash_and_lamports_new(
|
||||||
|
@ -7462,7 +7426,6 @@ impl AccountsDb {
|
||||||
test_hash_calculation,
|
test_hash_calculation,
|
||||||
epoch_schedule,
|
epoch_schedule,
|
||||||
rent_collector,
|
rent_collector,
|
||||||
can_cached_slot_be_unflushed,
|
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
enable_rehashing,
|
enable_rehashing,
|
||||||
|
@ -7479,7 +7442,6 @@ impl AccountsDb {
|
||||||
test_hash_calculation: bool,
|
test_hash_calculation: bool,
|
||||||
epoch_schedule: &EpochSchedule,
|
epoch_schedule: &EpochSchedule,
|
||||||
rent_collector: &RentCollector,
|
rent_collector: &RentCollector,
|
||||||
can_cached_slot_be_unflushed: bool,
|
|
||||||
ignore_mismatch: bool,
|
ignore_mismatch: bool,
|
||||||
store_hash_raw_data_for_debug: bool,
|
store_hash_raw_data_for_debug: bool,
|
||||||
enable_rehashing: bool,
|
enable_rehashing: bool,
|
||||||
|
@ -7499,7 +7461,6 @@ impl AccountsDb {
|
||||||
use_bg_thread_pool: !is_startup,
|
use_bg_thread_pool: !is_startup,
|
||||||
check_hash,
|
check_hash,
|
||||||
ancestors: Some(ancestors),
|
ancestors: Some(ancestors),
|
||||||
use_write_cache: can_cached_slot_be_unflushed,
|
|
||||||
epoch_schedule,
|
epoch_schedule,
|
||||||
rent_collector,
|
rent_collector,
|
||||||
store_detailed_debug_info_on_failure: store_hash_raw_data_for_debug,
|
store_detailed_debug_info_on_failure: store_hash_raw_data_for_debug,
|
||||||
|
@ -11777,7 +11738,6 @@ pub mod tests {
|
||||||
true,
|
true,
|
||||||
&EpochSchedule::default(),
|
&EpochSchedule::default(),
|
||||||
&RentCollector::default(),
|
&RentCollector::default(),
|
||||||
false,
|
|
||||||
true,
|
true,
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -12109,7 +12069,6 @@ pub mod tests {
|
||||||
use_bg_thread_pool: false,
|
use_bg_thread_pool: false,
|
||||||
check_hash: false,
|
check_hash: false,
|
||||||
ancestors: None,
|
ancestors: None,
|
||||||
use_write_cache: false,
|
|
||||||
epoch_schedule: &EPOCH_SCHEDULE,
|
epoch_schedule: &EPOCH_SCHEDULE,
|
||||||
rent_collector: &RENT_COLLECTOR,
|
rent_collector: &RENT_COLLECTOR,
|
||||||
store_detailed_debug_info_on_failure: false,
|
store_detailed_debug_info_on_failure: false,
|
||||||
|
@ -12183,7 +12142,6 @@ pub mod tests {
|
||||||
true,
|
true,
|
||||||
&EpochSchedule::default(),
|
&EpochSchedule::default(),
|
||||||
&RentCollector::default(),
|
&RentCollector::default(),
|
||||||
false,
|
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
Ok(_)
|
Ok(_)
|
||||||
|
@ -12198,7 +12156,6 @@ pub mod tests {
|
||||||
true,
|
true,
|
||||||
&EpochSchedule::default(),
|
&EpochSchedule::default(),
|
||||||
&RentCollector::default(),
|
&RentCollector::default(),
|
||||||
false,
|
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
Err(MissingBankHash)
|
Err(MissingBankHash)
|
||||||
|
@ -12222,7 +12179,6 @@ pub mod tests {
|
||||||
true,
|
true,
|
||||||
&EpochSchedule::default(),
|
&EpochSchedule::default(),
|
||||||
&RentCollector::default(),
|
&RentCollector::default(),
|
||||||
false,
|
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
Err(MismatchedBankHash)
|
Err(MismatchedBankHash)
|
||||||
|
@ -12252,7 +12208,6 @@ pub mod tests {
|
||||||
true,
|
true,
|
||||||
&EpochSchedule::default(),
|
&EpochSchedule::default(),
|
||||||
&RentCollector::default(),
|
&RentCollector::default(),
|
||||||
false,
|
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
Ok(_)
|
Ok(_)
|
||||||
|
@ -12275,14 +12230,13 @@ pub mod tests {
|
||||||
true,
|
true,
|
||||||
&EpochSchedule::default(),
|
&EpochSchedule::default(),
|
||||||
&RentCollector::default(),
|
&RentCollector::default(),
|
||||||
false,
|
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
Ok(_)
|
Ok(_)
|
||||||
);
|
);
|
||||||
|
|
||||||
assert_matches!(
|
assert_matches!(
|
||||||
db.verify_bank_hash_and_lamports(some_slot, &ancestors, 10, true, &EpochSchedule::default(), &RentCollector::default(), false, true,),
|
db.verify_bank_hash_and_lamports(some_slot, &ancestors, 10, true, &EpochSchedule::default(), &RentCollector::default(), true,),
|
||||||
Err(MismatchedTotalLamports(expected, actual)) if expected == 2 && actual == 10
|
Err(MismatchedTotalLamports(expected, actual)) if expected == 2 && actual == 10
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -12309,7 +12263,6 @@ pub mod tests {
|
||||||
true,
|
true,
|
||||||
&EpochSchedule::default(),
|
&EpochSchedule::default(),
|
||||||
&RentCollector::default(),
|
&RentCollector::default(),
|
||||||
false,
|
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
Ok(_)
|
Ok(_)
|
||||||
|
@ -12354,7 +12307,6 @@ pub mod tests {
|
||||||
true,
|
true,
|
||||||
&EpochSchedule::default(),
|
&EpochSchedule::default(),
|
||||||
&RentCollector::default(),
|
&RentCollector::default(),
|
||||||
false,
|
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
Err(MismatchedBankHash)
|
Err(MismatchedBankHash)
|
||||||
|
@ -12975,7 +12927,6 @@ pub mod tests {
|
||||||
true,
|
true,
|
||||||
&EpochSchedule::default(),
|
&EpochSchedule::default(),
|
||||||
&RentCollector::default(),
|
&RentCollector::default(),
|
||||||
false,
|
|
||||||
true,
|
true,
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -12989,7 +12940,6 @@ pub mod tests {
|
||||||
true,
|
true,
|
||||||
&EpochSchedule::default(),
|
&EpochSchedule::default(),
|
||||||
&RentCollector::default(),
|
&RentCollector::default(),
|
||||||
false,
|
|
||||||
true,
|
true,
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
|
@ -44,12 +44,10 @@ pub struct CalcAccountsHashConfig<'a> {
|
||||||
/// verify every hash in append vec/write cache with a recalculated hash
|
/// verify every hash in append vec/write cache with a recalculated hash
|
||||||
/// this option will be removed
|
/// this option will be removed
|
||||||
pub check_hash: bool,
|
pub check_hash: bool,
|
||||||
/// 'ancestors' is used to get storages and also used if 'use_write_cache' is true to
|
/// 'ancestors' is used to get storages
|
||||||
/// get account data from the write cache
|
|
||||||
pub ancestors: Option<&'a Ancestors>,
|
pub ancestors: Option<&'a Ancestors>,
|
||||||
/// does hash calc need to consider account data that exists in the write cache?
|
/// does hash calc need to consider account data that exists in the write cache?
|
||||||
/// if so, 'ancestors' will be used for this purpose as well as storages.
|
/// if so, 'ancestors' will be used for this purpose as well as storages.
|
||||||
pub use_write_cache: bool,
|
|
||||||
pub epoch_schedule: &'a EpochSchedule,
|
pub epoch_schedule: &'a EpochSchedule,
|
||||||
pub rent_collector: &'a RentCollector,
|
pub rent_collector: &'a RentCollector,
|
||||||
/// used for tracking down hash mismatches after the fact
|
/// used for tracking down hash mismatches after the fact
|
||||||
|
|
|
@ -175,7 +175,6 @@ use {
|
||||||
/// params to `verify_bank_hash`
|
/// params to `verify_bank_hash`
|
||||||
pub struct VerifyBankHash {
|
pub struct VerifyBankHash {
|
||||||
pub test_hash_calculation: bool,
|
pub test_hash_calculation: bool,
|
||||||
pub can_cached_slot_be_unflushed: bool,
|
|
||||||
pub ignore_mismatch: bool,
|
pub ignore_mismatch: bool,
|
||||||
pub require_rooted_bank: bool,
|
pub require_rooted_bank: bool,
|
||||||
pub run_in_background: bool,
|
pub run_in_background: bool,
|
||||||
|
@ -6997,7 +6996,6 @@ impl Bank {
|
||||||
config.test_hash_calculation,
|
config.test_hash_calculation,
|
||||||
&epoch_schedule,
|
&epoch_schedule,
|
||||||
&rent_collector,
|
&rent_collector,
|
||||||
config.can_cached_slot_be_unflushed,
|
|
||||||
config.ignore_mismatch,
|
config.ignore_mismatch,
|
||||||
config.store_hash_raw_data_for_debug,
|
config.store_hash_raw_data_for_debug,
|
||||||
enable_rehashing,
|
enable_rehashing,
|
||||||
|
@ -7019,7 +7017,6 @@ impl Bank {
|
||||||
config.test_hash_calculation,
|
config.test_hash_calculation,
|
||||||
epoch_schedule,
|
epoch_schedule,
|
||||||
rent_collector,
|
rent_collector,
|
||||||
config.can_cached_slot_be_unflushed,
|
|
||||||
config.ignore_mismatch,
|
config.ignore_mismatch,
|
||||||
config.store_hash_raw_data_for_debug,
|
config.store_hash_raw_data_for_debug,
|
||||||
enable_rehashing,
|
enable_rehashing,
|
||||||
|
@ -7115,13 +7112,11 @@ impl Bank {
|
||||||
Ok(sanitized_tx)
|
Ok(sanitized_tx)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// only called at startup vs steady-state runtime
|
/// only called from ledger-tool or tests
|
||||||
fn calculate_capitalization(&self, debug_verify: bool) -> u64 {
|
fn calculate_capitalization(&self, debug_verify: bool) -> u64 {
|
||||||
let can_cached_slot_be_unflushed = true; // implied yes
|
|
||||||
self.rc.accounts.calculate_capitalization(
|
self.rc.accounts.calculate_capitalization(
|
||||||
&self.ancestors,
|
&self.ancestors,
|
||||||
self.slot(),
|
self.slot(),
|
||||||
can_cached_slot_be_unflushed,
|
|
||||||
debug_verify,
|
debug_verify,
|
||||||
self.epoch_schedule(),
|
self.epoch_schedule(),
|
||||||
&self.rent_collector,
|
&self.rent_collector,
|
||||||
|
@ -7129,7 +7124,7 @@ impl Bank {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// only called at startup vs steady-state runtime
|
/// only called from tests or ledger tool
|
||||||
pub fn calculate_and_verify_capitalization(&self, debug_verify: bool) -> bool {
|
pub fn calculate_and_verify_capitalization(&self, debug_verify: bool) -> bool {
|
||||||
let calculated = self.calculate_capitalization(debug_verify);
|
let calculated = self.calculate_capitalization(debug_verify);
|
||||||
let expected = self.capitalization();
|
let expected = self.capitalization();
|
||||||
|
@ -7185,7 +7180,6 @@ impl Bank {
|
||||||
self.slot(),
|
self.slot(),
|
||||||
&self.ancestors,
|
&self.ancestors,
|
||||||
Some(self.capitalization()),
|
Some(self.capitalization()),
|
||||||
false,
|
|
||||||
self.epoch_schedule(),
|
self.epoch_schedule(),
|
||||||
&self.rent_collector,
|
&self.rent_collector,
|
||||||
is_startup,
|
is_startup,
|
||||||
|
@ -7212,7 +7206,6 @@ impl Bank {
|
||||||
self.slot(),
|
self.slot(),
|
||||||
&self.ancestors,
|
&self.ancestors,
|
||||||
Some(self.capitalization()),
|
Some(self.capitalization()),
|
||||||
false,
|
|
||||||
self.epoch_schedule(),
|
self.epoch_schedule(),
|
||||||
&self.rent_collector,
|
&self.rent_collector,
|
||||||
is_startup,
|
is_startup,
|
||||||
|
@ -7267,7 +7260,6 @@ impl Bank {
|
||||||
let mut verify_time = Measure::start("verify_bank_hash");
|
let mut verify_time = Measure::start("verify_bank_hash");
|
||||||
let verify = self.verify_bank_hash(VerifyBankHash {
|
let verify = self.verify_bank_hash(VerifyBankHash {
|
||||||
test_hash_calculation,
|
test_hash_calculation,
|
||||||
can_cached_slot_be_unflushed: false,
|
|
||||||
ignore_mismatch: false,
|
ignore_mismatch: false,
|
||||||
require_rooted_bank: false,
|
require_rooted_bank: false,
|
||||||
run_in_background: true,
|
run_in_background: true,
|
||||||
|
@ -10482,7 +10474,6 @@ pub(crate) mod tests {
|
||||||
fn default_for_test() -> Self {
|
fn default_for_test() -> Self {
|
||||||
Self {
|
Self {
|
||||||
test_hash_calculation: true,
|
test_hash_calculation: true,
|
||||||
can_cached_slot_be_unflushed: false,
|
|
||||||
ignore_mismatch: false,
|
ignore_mismatch: false,
|
||||||
require_rooted_bank: false,
|
require_rooted_bank: false,
|
||||||
run_in_background: false,
|
run_in_background: false,
|
||||||
|
|
Loading…
Reference in New Issue