Moves BankHashInfo into serde_snapshot (#30120)

This commit is contained in:
Brooks 2023-02-03 13:17:50 -05:00 committed by GitHub
parent 4293f11cf1
commit 06e801a8a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 11 deletions

View File

@ -1188,13 +1188,6 @@ impl BankHashStats {
}
}
#[derive(Clone, Default, Debug, Serialize, Deserialize, PartialEq, Eq, AbiExample)]
pub struct BankHashInfo {
pub accounts_delta_hash: AccountsDeltaHash,
pub accounts_hash: AccountsHash,
pub stats: BankHashStats,
}
#[derive(Default, Debug)]
pub struct StoreAccountsTiming {
store_accounts_elapsed: u64,

View File

@ -3,9 +3,9 @@ use {
accounts::Accounts,
accounts_db::{
AccountShrinkThreshold, AccountStorageEntry, AccountsDb, AccountsDbConfig, AppendVecId,
AtomicAppendVecId, BankHashInfo, IndexGenerationInfo,
AtomicAppendVecId, BankHashStats, IndexGenerationInfo,
},
accounts_hash::AccountsHash,
accounts_hash::{AccountsDeltaHash, AccountsHash},
accounts_index::AccountSecondaryIndexes,
accounts_update_notifier_interface::AccountsUpdateNotifier,
append_vec::{AppendVec, StoredMetaWriteVersion},
@ -80,6 +80,13 @@ pub struct AccountsDbFields<T>(
Vec<(Slot, Hash)>,
);
#[derive(Clone, Default, Debug, Serialize, Deserialize, PartialEq, Eq, AbiExample)]
struct BankHashInfo {
accounts_delta_hash: AccountsDeltaHash,
accounts_hash: AccountsHash,
stats: BankHashStats,
}
/// Helper type to wrap BufReader streams when deserializing and reconstructing from either just a
/// full snapshot, or both a full and incremental snapshot
pub struct SnapshotStreams<'a, R> {

View File

@ -5,7 +5,6 @@ use {
*,
},
crate::{
accounts_db::BankHashInfo,
accounts_hash::AccountsHash,
ancestors::AncestorsForSerialization,
stakes::{serde_stakes_enum_compat, StakesEnum},

View File

@ -718,7 +718,7 @@ mod test_bank_serialize {
// This some what long test harness is required to freeze the ABI of
// Bank's serialization due to versioned nature
#[frozen_abi(digest = "DVS6Qqzxe2w86mdaEuVnsdZqXQVXaPab54uCJG2GypT6")]
#[frozen_abi(digest = "Eg6gt9thiY8Sn6gDKvpyyHADtWpSt6ur9Z4Zwh1BrCgv")]
#[derive(Serialize, AbiExample)]
pub struct BankAbiTestWrapperNewer {
#[serde(serialize_with = "wrapper_newer")]