verify acct size in index can easily be recalculated (#29601)

This commit is contained in:
Jeff Washington (jwash) 2023-01-10 15:33:36 -06:00 committed by GitHub
parent 61e2da45f8
commit c3353c27c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -7807,6 +7807,15 @@ impl AccountsDb {
"AccountsDB::accounts_index corrupted. Storage pointed to: {}, expected: {}, should only point to one slot",
store.slot(), *slot
);
let account = store.accounts.get_account(account_info.offset()).unwrap();
if account.1
!= account_info
.offset()
.saturating_add(account_info.stored_size() as usize)
{
// this should never happen. This is a metrics based assert at the moment.
inc_new_counter_info!("remove_dead_accounts-stored_size_mismatch", 1);
}
let count =
store.remove_account(account_info.stored_size() as usize, reset_accounts);
if count == 0 {