run hash calc with index on failure (#27279)

This commit is contained in:
Jeff Washington (jwash) 2022-08-22 10:58:04 -05:00 committed by GitHub
parent ab0731728a
commit fc1a4dd11a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 1 deletions

View File

@ -152,6 +152,26 @@ impl AccountsHashVerifier {
if accounts_package.expected_capitalization != lamports {
// before we assert, run the hash calc again. This helps track down whether it could have been a failure in a race condition possibly with shrink.
// We could add diagnostics to the hash calc here to produce a per bin cap or something to help narrow down how many pubkeys are different.
let result_with_index = accounts_package
.accounts
.accounts_db
.calculate_accounts_hash(
accounts_package.slot,
&CalcAccountsHashConfig {
use_bg_thread_pool: false,
check_hash: false,
ancestors: None,
use_write_cache: false,
epoch_schedule: &accounts_package.epoch_schedule,
rent_collector: &accounts_package.rent_collector,
store_detailed_debug_info_on_failure: false,
full_snapshot: None,
},
);
info!(
"hash calc with index: {}, {:?}",
accounts_package.slot, result_with_index
);
let _ = accounts_package
.accounts
.accounts_db

View File

@ -6156,7 +6156,7 @@ impl AccountsDb {
AccountsHash::checked_cast_for_capitalization(balances.map(|b| b as u128).sum::<u128>())
}
fn calculate_accounts_hash(
pub fn calculate_accounts_hash(
&self,
max_slot: Slot,
config: &CalcAccountsHashConfig<'_>,