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

Startup only sets latest_full_snapshot_slot if generating snapshots #3633

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions accounts-db/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1614,6 +1614,7 @@ pub struct AccountsDb {
pub epoch_accounts_hash_manager: EpochAccountsHashManager,

/// The latest full snapshot slot dictates how to handle zero lamport accounts
/// Note, this is None if we're told to *not* take snapshots
latest_full_snapshot_slot: SeqLock<Option<Slot>>,

/// Flag to indicate if the experimental accounts lattice hash is enabled.
Expand Down
18 changes: 14 additions & 4 deletions ledger/src/bank_forks_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,20 @@ fn bank_forks_from_snapshot(
// We must inform accounts-db of the latest full snapshot slot, which is used by the background
// processes to handle zero lamport accounts. Since we've now successfully loaded the bank
// from snapshots, this is a good time to do that update.
bank.rc
.accounts
.accounts_db
.set_latest_full_snapshot_slot(full_snapshot_archive_info.slot());
// Note, this must only be set if we should generate snapshots.
if snapshot_config.should_generate_snapshots() {
bank.rc
.accounts
.accounts_db
.set_latest_full_snapshot_slot(full_snapshot_archive_info.slot());
} else {
assert!(bank
.rc
.accounts
.accounts_db
.latest_full_snapshot_slot()
.is_none());
}

let full_snapshot_hash = FullSnapshotHash((
full_snapshot_archive_info.slot(),
Expand Down
Loading