add epoch_schedule and rent_collector to hash calc (#24012)

This commit is contained in:
Jeff Washington (jwash)
2022-03-31 10:51:18 -05:00
committed by GitHub
parent da001d54e5
commit 9c8dad33c7
9 changed files with 217 additions and 58 deletions

View File

@ -10,8 +10,11 @@ use {
accounts_db::AccountShrinkThreshold,
accounts_index::AccountSecondaryIndexes,
ancestors::Ancestors,
rent_collector::RentCollector,
},
solana_sdk::{
genesis_config::ClusterType, pubkey::Pubkey, sysvar::epoch_schedule::EpochSchedule,
},
solana_sdk::{genesis_config::ClusterType, pubkey::Pubkey},
std::{env, fs, path::PathBuf},
};
@ -114,7 +117,12 @@ fn main() {
} else {
let mut pubkeys: Vec<Pubkey> = vec![];
let mut time = Measure::start("hash");
let results = accounts.accounts_db.update_accounts_hash(0, &ancestors);
let results = accounts.accounts_db.update_accounts_hash(
0,
&ancestors,
&EpochSchedule::default(),
&RentCollector::default(),
);
time.stop();
let mut time_store = Measure::start("hash using store");
let results_store = accounts.accounts_db.update_accounts_hash_with_index_option(
@ -124,8 +132,8 @@ fn main() {
&ancestors,
None,
false,
None,
None,
&EpochSchedule::default(),
&RentCollector::default(),
false,
);
time_store.stop();