From 65315fa4c29627cf7ac5efe7db673705d444a75c Mon Sep 17 00:00:00 2001 From: sakridge Date: Fri, 29 Jan 2021 11:44:43 -0800 Subject: [PATCH] Use already-generated key set to populate dirty keys for clean (#14905) Don't need to scan the stores again when we already found the key set of updates per slot. Just insert it earlier. --- runtime/src/accounts_db.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index 8ccd95ffca..d36d2e765b 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -4541,6 +4541,8 @@ impl AccountsDB { // is restored from the append-vec if !accounts_map.is_empty() { let mut _reclaims: Vec<(u64, AccountInfo)> = vec![]; + let dirty_keys = accounts_map.iter().map(|(pubkey, _info)| *pubkey).collect(); + self.uncleaned_pubkeys.insert(*slot, dirty_keys); for (pubkey, account_infos) in accounts_map.into_iter() { for (_, (store_id, stored_account)) in account_infos.into_iter() { let account_info = AccountInfo { @@ -4565,7 +4567,6 @@ impl AccountsDB { // Need to add these last, otherwise older updates will be cleaned for slot in slots { - self.get_accounts_delta_hash(slot); self.accounts_index.add_root(slot, false); }