Renames fn to calculate_accounts_hash_from_storages() (#28566)

This commit is contained in:
Brooks Prumo 2022-10-24 21:07:00 -04:00 committed by GitHub
parent f703275fc4
commit bc02789c43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 12 deletions

View File

@ -159,6 +159,6 @@ fn main() {
info!("update_accounts_hash(us),{}", x);
}
for x in elapsed_store {
info!("calculate_accounts_hash_without_index(us),{}", x);
info!("calculate_accounts_hash_from_storages(us),{}", x);
}
}

View File

@ -223,7 +223,7 @@ impl AccountsHashVerifier {
let (accounts_hash, lamports) = accounts_package
.accounts
.accounts_db
.calculate_accounts_hash_without_index(
.calculate_accounts_hash_from_storages(
&CalcAccountsHashConfig {
use_bg_thread_pool: true,
check_hash: false,
@ -263,7 +263,7 @@ impl AccountsHashVerifier {
let _ = accounts_package
.accounts
.accounts_db
.calculate_accounts_hash_without_index(
.calculate_accounts_hash_from_storages(
&CalcAccountsHashConfig {
use_bg_thread_pool: false,
check_hash: false,

View File

@ -2753,7 +2753,7 @@ impl AccountsDb {
std::cmp::max(*accounts_hash_complete_one_epoch_old, one_epoch_old_slot);
let accounts_hash_complete_one_epoch_old = *accounts_hash_complete_one_epoch_old;
// now that calculate_accounts_hash_without_index is complete, we can remove old historical roots
// now that accounts hash calculation is complete, we can remove old historical roots
self.remove_old_historical_roots(accounts_hash_complete_one_epoch_old);
}
@ -7276,7 +7276,7 @@ impl AccountsDb {
};
timings.calc_storage_size_quartiles(&combined_maps);
self.calculate_accounts_hash_without_index(config, &storages, timings)
self.calculate_accounts_hash_from_storages(config, &storages, timings)
} else {
self.calculate_accounts_hash_from_index(slot, config)
}
@ -7459,7 +7459,7 @@ impl AccountsDb {
// modeled after get_accounts_delta_hash
// intended to be faster than calculate_accounts_hash
pub fn calculate_accounts_hash_without_index(
pub fn calculate_accounts_hash_from_storages(
&self,
config: &CalcAccountsHashConfig<'_>,
storages: &SortedStorages<'_>,
@ -7529,7 +7529,7 @@ impl AccountsDb {
}
info!(
"calculate_accounts_hash_without_index: slot: {} {:?}",
"calculate_accounts_hash_from_storages: slot: {} {:?}",
storages.max_slot_inclusive(),
final_result
);
@ -10183,13 +10183,13 @@ pub mod tests {
}
#[test]
fn test_accountsdb_calculate_accounts_hash_without_index_simple() {
fn test_accountsdb_calculate_accounts_hash_from_storages_simple() {
solana_logger::setup();
let (storages, _size, _slot_expected) = sample_storage();
let db = AccountsDb::new(Vec::new(), &ClusterType::Development);
let result = db
.calculate_accounts_hash_without_index(
.calculate_accounts_hash_from_storages(
&CalcAccountsHashConfig::default(),
&get_storage_refs(&storages),
HashStats::default(),
@ -10200,7 +10200,7 @@ pub mod tests {
}
#[test]
fn test_accountsdb_calculate_accounts_hash_without_index() {
fn test_accountsdb_calculate_accounts_hash_from_storages() {
solana_logger::setup();
let (storages, raw_expected) = sample_storages_and_accounts();
@ -10211,7 +10211,7 @@ pub mod tests {
let sum = raw_expected.iter().map(|item| item.lamports).sum();
let db = AccountsDb::new(Vec::new(), &ClusterType::Development);
let result = db
.calculate_accounts_hash_without_index(
.calculate_accounts_hash_from_storages(
&CalcAccountsHashConfig::default(),
&get_storage_refs(&storages),
HashStats::default(),

View File

@ -145,7 +145,7 @@ impl HashStats {
+ self.collect_snapshots_us
+ self.storage_sort_us;
datapoint_info!(
"calculate_accounts_hash_without_index",
"calculate_accounts_hash_from_storages",
("mark_time_us", self.mark_time_us, i64),
("accounts_scan_us", self.scan_time_total_us, i64),
("eliminate_zeros_us", self.zeros_time_total_us, i64),