Skip to content

Commit

Permalink
Refactors full accounts hash calculation during startup verify (#1200)
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo authored May 6, 2024
1 parent f46e3ca commit aa6c69a
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions accounts-db/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7526,15 +7526,11 @@ impl AccountsDb {
}
}
} else {
let (calculated_accounts_hash, calculated_lamports) = self
.calculate_accounts_hash_with_verify_from(
CalcAccountsHashDataSource::Storages,
config.test_hash_calculation,
slot,
calc_config,
None,
);

let (storages, slots) = self.get_snapshot_storages(..=slot);
let sorted_storages =
SortedStorages::new_with_slots(storages.iter().zip(slots), None, None);
let (calculated_accounts_hash, calculated_lamports) =
self.calculate_accounts_hash(&calc_config, &sorted_storages, HashStats::default());
if calculated_lamports != total_lamports {
warn!(
"Mismatched total lamports: {} calculated: {}",
Expand All @@ -7545,7 +7541,6 @@ impl AccountsDb {
total_lamports,
));
}

let (found_accounts_hash, _) = self
.get_accounts_hash(slot)
.ok_or(AccountsHashVerificationError::MissingAccountsHash)?;
Expand Down

0 comments on commit aa6c69a

Please sign in to comment.