verify bank hash on startup with ledger tool option (#17939)

This commit is contained in:
Jeff Washington (jwash)
2021-06-15 11:52:12 -05:00
committed by GitHub
parent 1b1d34da59
commit f558b9b6bf
7 changed files with 59 additions and 39 deletions

View File

@ -114,7 +114,15 @@ fn test_accounts_hash_bank_hash(bencher: &mut Bencher) {
create_test_accounts(&accounts, &mut pubkeys, num_accounts, slot);
let ancestors = Ancestors::from(vec![0]);
let (_, total_lamports) = accounts.accounts_db.update_accounts_hash(0, &ancestors);
bencher.iter(|| assert!(accounts.verify_bank_hash_and_lamports(0, &ancestors, total_lamports)));
let test_hash_calculation = false;
bencher.iter(|| {
assert!(accounts.verify_bank_hash_and_lamports(
0,
&ancestors,
total_lamports,
test_hash_calculation
))
});
}
#[bench]