Skip to content

Commit

Permalink
Verifying snapshot bank must always specify the snapshot slot
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo committed Aug 18, 2022
1 parent 3fc4ba7 commit 83a59b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7124,19 +7124,19 @@ impl Bank {
&self,
test_hash_calculation: bool,
accounts_db_skip_shrink: bool,
last_full_snapshot_slot: Option<Slot>,
last_full_snapshot_slot: Slot,
) -> bool {
let mut clean_time = Measure::start("clean");
if !accounts_db_skip_shrink && self.slot() > 0 {
info!("cleaning..");
self.clean_accounts(true, true, last_full_snapshot_slot);
self.clean_accounts(true, true, Some(last_full_snapshot_slot));
}
clean_time.stop();

let mut shrink_all_slots_time = Measure::start("shrink_all_slots");
if !accounts_db_skip_shrink && self.slot() > 0 {
info!("shrinking..");
self.shrink_all_slots(true, last_full_snapshot_slot);
self.shrink_all_slots(true, Some(last_full_snapshot_slot));
}
shrink_all_slots_time.stop();

Expand Down
2 changes: 1 addition & 1 deletion runtime/src/snapshot_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ pub fn bank_from_snapshot_archives(
if !bank.verify_snapshot_bank(
test_hash_calculation,
accounts_db_skip_shrink || !full_snapshot_archive_info.is_remote(),
Some(full_snapshot_archive_info.slot()),
full_snapshot_archive_info.slot(),
) && limit_load_slot_count_from_snapshot.is_none()
{
panic!("Snapshot bank for slot {} failed to verify", bank.slot());
Expand Down

0 comments on commit 83a59b6

Please sign in to comment.