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

Conversation

bw-solana
Copy link

@bw-solana bw-solana commented Jul 2, 2024

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.

@bw-solana bw-solana marked this pull request as ready for review July 3, 2024 02:50
@bw-solana bw-solana requested a review from steviez July 3, 2024 02:50
@bw-solana bw-solana mentioned this pull request Jul 3, 2024
@bw-solana bw-solana force-pushed the ledger_tool_warp_slot_fix branch from ed2d24d to c1312b8 Compare July 4, 2024 13:43
@bw-solana bw-solana force-pushed the ledger_tool_warp_slot_fix branch from c1312b8 to bc65638 Compare July 26, 2024 20:50
Copy link

@steviez steviez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and sorry about this one slipping through the cracks

@bw-solana bw-solana merged commit 0b02f8c into anza-xyz:master Aug 6, 2024
41 checks passed
ray-kast pushed a commit to abklabs/agave that referenced this pull request Nov 27, 2024
nibty pushed a commit to x1-labs/tachyon that referenced this pull request Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants