diff --git a/core/src/accounts_hash_verifier.rs b/core/src/accounts_hash_verifier.rs index 9ca5b88eb..ae8f0dbe7 100644 --- a/core/src/accounts_hash_verifier.rs +++ b/core/src/accounts_hash_verifier.rs @@ -142,6 +142,7 @@ impl AccountsHashVerifier { epoch_schedule: &accounts_package.epoch_schedule, rent_collector: &accounts_package.rent_collector, store_detailed_debug_info_on_failure: false, + full_snapshot: None, }, &sorted_storages, timings, @@ -164,6 +165,7 @@ impl AccountsHashVerifier { rent_collector: &accounts_package.rent_collector, // now that we've failed, store off the failing contents that produced a bad capitalization store_detailed_debug_info_on_failure: true, + full_snapshot: None, }, &sorted_storages, HashStats::default(), diff --git a/runtime/src/accounts_background_service.rs b/runtime/src/accounts_background_service.rs index 5f5a42970..285f47c8c 100644 --- a/runtime/src/accounts_background_service.rs +++ b/runtime/src/accounts_background_service.rs @@ -241,6 +241,7 @@ impl SnapshotRequestHandler { epoch_schedule: snapshot_root_bank.epoch_schedule(), rent_collector: snapshot_root_bank.rent_collector(), store_detailed_debug_info_on_failure: false, + full_snapshot: None, }, ).unwrap(); assert_eq!(previous_hash, this_hash); diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index 3e47395e2..0b1947dd1 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -6742,6 +6742,7 @@ impl AccountsDb { epoch_schedule, rent_collector, store_detailed_debug_info_on_failure: false, + full_snapshot: None, }, expected_capitalization, ) @@ -7023,6 +7024,7 @@ impl AccountsDb { epoch_schedule, rent_collector, store_detailed_debug_info_on_failure: false, + full_snapshot: None, }, None, )?; @@ -11626,6 +11628,7 @@ pub mod tests { epoch_schedule: &EPOCH_SCHEDULE, rent_collector: &RENT_COLLECTOR, store_detailed_debug_info_on_failure: false, + full_snapshot: None, } } } diff --git a/runtime/src/accounts_hash.rs b/runtime/src/accounts_hash.rs index a0ce69a55..ee1b96776 100644 --- a/runtime/src/accounts_hash.rs +++ b/runtime/src/accounts_hash.rs @@ -6,6 +6,7 @@ use { solana_sdk::{ hash::{Hash, Hasher}, pubkey::Pubkey, + slot_history::Slot, sysvar::epoch_schedule::EpochSchedule, }, std::{ @@ -27,6 +28,15 @@ pub struct PreviousPass { pub lamports: u64, } +#[derive(Debug)] +#[allow(dead_code)] +pub struct FullSnapshotAccountsHashInfo { + /// accounts hash over all accounts when the full snapshot was taken + hash: Hash, + /// slot where full snapshot was taken + slot: Slot, +} + /// parameters to calculate accounts hash #[derive(Debug)] pub struct CalcAccountsHashConfig<'a> { @@ -45,6 +55,8 @@ pub struct CalcAccountsHashConfig<'a> { pub rent_collector: &'a RentCollector, /// used for tracking down hash mismatches after the fact pub store_detailed_debug_info_on_failure: bool, + /// `Some` if this is an incremental snapshot which only hashes slots since the base full snapshot + pub full_snapshot: Option, } impl<'a> CalcAccountsHashConfig<'a> {