Skip to content

Commit

Permalink
debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoranYi committed Mar 11, 2024
1 parent e2082c4 commit 135b3ca
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions accounts-db/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8156,14 +8156,17 @@ impl AccountsDb {
let old = pubkeys
.iter()
.map(|k| {
if let Some((_account, hash)) = r_written_accounts_before.get(k) {
if let Some((account, hash)) = r_written_accounts_before.get(k) {
// Get old `lt_hash` from cache of writes in parent slots
cache_hits += 1;
Some(hash.unwrap()) // TODO on demand calculate, calculate in bg
} else {
self.load_with_fixed_root(&old_ancestors, k)
.map(|(account, _)| Self::lt_hash_account(&account, k))
if let Some(hash) = hash {
cache_hits += 1;
return Some(*hash); // TODO on demand calculate, calculate in bg
} else {
warn!("Expect in lt hash cache {} {:?} {:?}", k, account, hash);
}
}
self.load_with_fixed_root(&old_ancestors, k)
.map(|(account, _)| Self::lt_hash_account(&account, k))
})
.collect::<Vec<_>>();
drop(r_written_accounts_before);
Expand Down

0 comments on commit 135b3ca

Please sign in to comment.