From 79d0a47d78c3056bb1e2461dde43c81c91be0e61 Mon Sep 17 00:00:00 2001 From: Brooks Date: Tue, 12 Dec 2023 15:48:15 -0500 Subject: [PATCH] Sets EpochAccountsHash to Valid in accounts bench (#34420) Sets EAH to Valid in accounts bench --- runtime/benches/accounts.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/runtime/benches/accounts.rs b/runtime/benches/accounts.rs index 993c22d2a04e18..ac74f32eb50af8 100644 --- a/runtime/benches/accounts.rs +++ b/runtime/benches/accounts.rs @@ -15,6 +15,7 @@ use { }, accounts_index::{AccountSecondaryIndexes, ScanConfig}, ancestors::Ancestors, + epoch_accounts_hash::EpochAccountsHash, rent_collector::RentCollector, }, solana_runtime::bank::*, @@ -70,6 +71,15 @@ fn test_accounts_squash(bencher: &mut Bencher) { deposit_many(&prev_bank, &mut pubkeys, 250_000).unwrap(); prev_bank.freeze(); + // Need to set the EAH to Valid so that `Bank::new_from_parent()` doesn't panic during + // freeze when parent is in the EAH calculation window. + prev_bank + .rc + .accounts + .accounts_db + .epoch_accounts_hash_manager + .set_valid(EpochAccountsHash::new(Hash::new_unique()), 0); + // Measures the performance of the squash operation. // This mainly consists of the freeze operation which calculates the // merkle hash of the account state and distribution of fees and rent