From 83a59b66dbd7b17ce6bf93da2f718882da838347 Mon Sep 17 00:00:00 2001 From: Brooks Prumo Date: Thu, 18 Aug 2022 10:02:04 -0400 Subject: [PATCH] Verifying snapshot bank must always specify the snapshot slot --- runtime/src/bank.rs | 6 +++--- runtime/src/snapshot_utils.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 32ece32f8892d1..3e39c2b1c202e0 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -7124,19 +7124,19 @@ impl Bank { &self, test_hash_calculation: bool, accounts_db_skip_shrink: bool, - last_full_snapshot_slot: Option, + 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(); diff --git a/runtime/src/snapshot_utils.rs b/runtime/src/snapshot_utils.rs index 1eab70b8cb5ab7..d1b0ef95301c98 100644 --- a/runtime/src/snapshot_utils.rs +++ b/runtime/src/snapshot_utils.rs @@ -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());