Cleans *up to* the last full snapshot slot in verify_snapshot_bank() (#30818)

Cleans up to the last full snapshot slot in verify_snapshot_bank()
This commit is contained in:
Brooks 2023-03-21 11:49:49 -04:00 committed by GitHub
parent 4aac7ead50
commit 836494fc5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -7328,8 +7328,12 @@ impl Bank {
let should_clean = !accounts_db_skip_shrink && self.slot() > 0;
if should_clean {
info!("Cleaning...");
// We cannot clean past the last full snapshot's slot because we are about to
// perform an accounts hash calculation *up to that slot*. If we cleaned *past*
// that slot, then accounts could be removed from older storages, which would
// change the accounts hash.
self.rc.accounts.accounts_db.clean_accounts(
None,
Some(last_full_snapshot_slot),
true,
Some(last_full_snapshot_slot),
);