deserialize(or eof) snapshot epoch_accounts_hash (#27513)

deserialize(or eof) snapshot prior_epoch_accounts_hash
This commit is contained in:
Jeff Washington (jwash) 2022-09-01 08:35:52 -07:00 committed by GitHub
parent 0df0b94a72
commit 3e40fad46b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -1005,6 +1005,7 @@ pub struct BankFieldsToDeserialize {
pub(crate) is_delta: bool,
pub(crate) accounts_data_len: u64,
pub(crate) incremental_snapshot_persistence: Option<BankIncrementalSnapshotPersistence>,
pub(crate) epoch_accounts_hash: Option<Hash>,
}
// Bank's common fields shared by all supported snapshot versions for serialization.

View File

@ -97,6 +97,7 @@ impl From<DeserializableVersionedBank> for BankFieldsToDeserialize {
epoch_stakes: dvb.epoch_stakes,
is_delta: dvb.is_delta,
incremental_snapshot_persistence: None,
epoch_accounts_hash: None,
}
}
}
@ -317,9 +318,12 @@ impl<'a> TypeContext<'a> for Context {
.fee_rate_governor
.clone_with_lamports_per_signature(lamports_per_signature);
let incremental_snapshot_persistence = ignore_eof_error(deserialize_from(stream))?;
let incremental_snapshot_persistence = ignore_eof_error(deserialize_from(&mut stream))?;
bank_fields.incremental_snapshot_persistence = incremental_snapshot_persistence;
let epoch_accounts_hash = ignore_eof_error(deserialize_from(stream))?;
bank_fields.epoch_accounts_hash = epoch_accounts_hash;
Ok((bank_fields, accounts_db_fields))
}