Skip to content

Commit

Permalink
add message to add root assert (#1982)
Browse files Browse the repository at this point in the history
  • Loading branch information
bw-solana authored Jul 3, 2024
1 parent 1bd0203 commit bfde5e0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion accounts-db/src/accounts_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1920,7 +1920,12 @@ impl<T: IndexValue, U: DiskIndexValue + From<T> + Into<T>> AccountsIndex<T, U> {
self.roots_added.fetch_add(1, Ordering::Relaxed);
let mut w_roots_tracker = self.roots_tracker.write().unwrap();
// `AccountsDb::flush_accounts_cache()` relies on roots being added in order
assert!(slot >= w_roots_tracker.alive_roots.max_inclusive());
assert!(
slot >= w_roots_tracker.alive_roots.max_inclusive(),
"Roots must be added in order: {} < {}",
slot,
w_roots_tracker.alive_roots.max_inclusive()
);
// 'slot' is a root, so it is both 'root' and 'original'
w_roots_tracker.alive_roots.insert(slot);
}
Expand Down

0 comments on commit bfde5e0

Please sign in to comment.