Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use squash to add all roots #1981

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions ledger-tool/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2150,9 +2150,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