Skip to content

Commit

Permalink
use squash to add all roots (#1981)
Browse files Browse the repository at this point in the history
  • Loading branch information
bw-solana authored Aug 6, 2024
1 parent c84900d commit 0b02f8c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ledger-tool/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2224,9 +2224,13 @@ fn main() {
};

let bank = if let Some(warp_slot) = warp_slot {
// need to flush the write cache in order to use Storages to calculate
// the accounts hash, and need to root `bank` before flushing the cache
bank.rc.accounts.accounts_db.add_root(bank.slot());
// Need to flush the write cache in order to use
// Storages to calculate the accounts hash, and need to
// root `bank` before flushing the cache. Use squash to
// root all unrooted parents as well and avoid panicking
// during snapshot creation if we try to add roots out
// of order.
bank.squash();
bank.force_flush_accounts_cache();
Arc::new(Bank::warp_from_parent(
bank.clone(),
Expand Down

0 comments on commit 0b02f8c

Please sign in to comment.