Skip to content

Commit

Permalink
add 'oldest_root' stat in hash calc (solana-labs#26896)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington authored Aug 3, 2022
1 parent 6706be0 commit 0732a6c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions runtime/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6886,6 +6886,8 @@ impl AccountsDb {
) -> Result<(Hash, u64), BankHashVerificationError> {
let _guard = self.active_stats.activate(ActiveStatItem::Hash);

stats.oldest_root = storages.range().start;

self.mark_old_slots_as_dirty(storages, Some(config.epoch_schedule.slots_per_epoch));

let (num_hash_scan_passes, bins_per_pass) = Self::bins_per_pass(self.num_hash_scan_passes);
Expand Down
2 changes: 2 additions & 0 deletions runtime/src/accounts_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ pub struct HashStats {
pub rehash_required: AtomicUsize,
/// # rehashes that took place and were UNnecessary
pub rehash_unnecessary: AtomicUsize,
pub oldest_root: Slot,
pub roots_older_than_epoch: AtomicUsize,
pub accounts_in_roots_older_than_epoch: AtomicUsize,
pub append_vec_sizes_older_than_epoch: AtomicUsize,
Expand Down Expand Up @@ -218,6 +219,7 @@ impl HashStats {
self.roots_older_than_epoch.load(Ordering::Relaxed) as i64,
i64
),
("oldest_root", self.oldest_root as i64, i64),
(
"ancient_append_vecs",
self.ancient_append_vecs.load(Ordering::Relaxed) as i64,
Expand Down

0 comments on commit 0732a6c

Please sign in to comment.