Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
While playing with ledger tool, I discovered a problem with the
warp-slot
command that results in asserting at this line:https://github.com/anza-xyz/agave/blob/master/accounts-db/src/accounts_index.rs#L1923
When we run create-snapshot with --warp-slot param, we will add the current bank (derived from optimistically confirmed slot) as a root. However, there can be several parents of this slot that are not rooted. When we go to save a snapshot as part of the subsequent steps, we will squash this bank, attempt to add the unrooted parents as roots, and assert because we are adding roots out of order.
Summary of Changes
Use squash to root the current bank slot as well as all of its parents. This better matches what a real world scenario would look like (all blocks on a fork should get rooted). It also resolves the panic described above because when we go to save the snapshot, we won't attempt to add parents as roots because they've already been rooted.