Skip to content

Commit

Permalink
only READ BankIncrementalSnapshotPersistence in 1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington committed Aug 23, 2022
1 parent c6ea14c commit 8cbbd25
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions runtime/src/serde_snapshot/newer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ impl<'a> TypeContext<'a> for Context {
// we can grab it on restart.
// TODO: if we do a snapshot version bump, consider moving this out.
lamports_per_signature,
None::<BankIncrementalSnapshotPersistence>,
// None::<BankIncrementalSnapshotPersistence>, this will be saved starting in 1.12
)
.serialize(serializer)
}
Expand Down Expand Up @@ -339,7 +339,7 @@ impl<'a> TypeContext<'a> for Context {
stream_reader: &mut BufReader<R>,
stream_writer: &mut BufWriter<W>,
accounts_hash: &Hash,
incremental_snapshot_persistence: Option<&BankIncrementalSnapshotPersistence>,
_incremental_snapshot_persistence: Option<&BankIncrementalSnapshotPersistence>,
) -> std::result::Result<(), Box<bincode::ErrorKind>>
where
R: Read,
Expand Down Expand Up @@ -394,7 +394,7 @@ impl<'a> TypeContext<'a> for Context {
bank,
accounts_db_fields,
lamports_per_signature,
incremental_snapshot_persistence,
// incremental_snapshot_persistence, this will be saved starting in 1.12
),
)
}
Expand Down
7 changes: 5 additions & 2 deletions runtime/src/serde_snapshot/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,12 @@ fn test_bank_serialize_style(
serde_style: SerdeStyle,
reserialize_accounts_hash: bool,
update_accounts_hash: bool,
incremental_snapshot_persistence: bool,
_incremental_snapshot_persistence: bool,
) {
solana_logger::setup();

// in 1.11, don't test incremental snapshot persistence because we are not writing it - only reading it and ignoring it
let incremental_snapshot_persistence = false;
let (genesis_config, _) = create_genesis_config(500);
let bank0 = Arc::new(Bank::new_for_tests(&genesis_config));
let bank1 = Bank::new_from_parent(&bank0, &Pubkey::default(), 1);
Expand Down Expand Up @@ -581,7 +584,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 = "5py4Wkuj5fV2sLyA1MrPg4pGNwMEaygQLnpLyY8MMLGC")]
#[frozen_abi(digest = "9vGBt7YfymKUTPWLHVVpQbDtPD7dFDwXRMFkCzwujNqJ")]
#[derive(Serialize, AbiExample)]
pub struct BankAbiTestWrapperNewer {
#[serde(serialize_with = "wrapper_newer")]
Expand Down

0 comments on commit 8cbbd25

Please sign in to comment.