Skip to content

Commit

Permalink
Sets EpochAccountsHash to Valid in accounts bench (#34420)
Browse files Browse the repository at this point in the history
Sets EAH to Valid in accounts bench
  • Loading branch information
brooksprumo authored Dec 12, 2023
1 parent 383aa04 commit 79d0a47
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions runtime/benches/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use {
},
accounts_index::{AccountSecondaryIndexes, ScanConfig},
ancestors::Ancestors,
epoch_accounts_hash::EpochAccountsHash,
rent_collector::RentCollector,
},
solana_runtime::bank::*,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 79d0a47

Please sign in to comment.