diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 24bd72ef76fc87..dab15c8244a5ac 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -6659,13 +6659,6 @@ impl Bank { Some(epoch_accounts_hash) } - /// Return the epoch_reward_status field on the bank to serialize - /// Returns none if we are NOT in the reward interval. - pub(crate) fn get_epoch_reward_status_to_serialize(&self) -> Option<&EpochRewardStatus> { - matches!(self.epoch_reward_status, EpochRewardStatus::Active(_)) - .then_some(&self.epoch_reward_status) - } - /// Convenience fn to get the Epoch Accounts Hash pub fn epoch_accounts_hash(&self) -> Option { self.rc diff --git a/runtime/src/bank/serde_snapshot.rs b/runtime/src/bank/serde_snapshot.rs index 5a4369b451bfd4..b7e7ca004bba5e 100644 --- a/runtime/src/bank/serde_snapshot.rs +++ b/runtime/src/bank/serde_snapshot.rs @@ -18,7 +18,6 @@ mod tests { }, status_cache::StatusCache, }, - assert_matches::assert_matches, solana_accounts_db::{ account_storage::{AccountStorageMap, AccountStorageReference}, accounts_db::{ @@ -531,11 +530,9 @@ mod tests { // Defaults to 0 assert_eq!(0, dbank.fee_rate_governor.lamports_per_signature); - // epoch_reward status should default to `Inactive` - let epoch_reward_status = dbank - .get_epoch_reward_status_to_serialize() - .unwrap_or(&EpochRewardStatus::Inactive); - assert_matches!(epoch_reward_status, EpochRewardStatus::Inactive); + // The snapshot epoch_reward_status always equals `None`, so the bank + // field should default to `Inactive` + assert_eq!(dbank.epoch_reward_status, EpochRewardStatus::Inactive); } #[cfg(RUSTC_WITH_SPECIALIZATION)] @@ -544,7 +541,7 @@ mod tests { // This some what long test harness is required to freeze the ABI of // Bank's serialization due to versioned nature - #[frozen_abi(digest = "ENUEoDA5CYu9NLLCuaj23qpfKBZzCvxK3T5VsUFA9sti")] + #[frozen_abi(digest = "8pZwgyMdvxExLgN9GMKnCdofb5CQJgsZ8Dt88hfVd9bf")] #[derive(Serialize, AbiExample)] pub struct BankAbiTestWrapperNewer { #[serde(serialize_with = "wrapper_newer")] diff --git a/runtime/src/serde_snapshot/newer.rs b/runtime/src/serde_snapshot/newer.rs index d9c73d04422199..c5fada5be20ec4 100644 --- a/runtime/src/serde_snapshot/newer.rs +++ b/runtime/src/serde_snapshot/newer.rs @@ -201,9 +201,6 @@ impl<'a> TypeContext<'a> for Context { let ancestors = HashMap::from(&serializable_bank.bank.ancestors); let fields = serializable_bank.bank.get_fields_to_serialize(&ancestors); let lamports_per_signature = fields.fee_rate_governor.lamports_per_signature; - let epoch_reward_status = serializable_bank - .bank - .get_epoch_reward_status_to_serialize(); match get_serialize_bank_fields( SerializableVersionedBank::from(fields), SerializableAccountsDb::<'a, Self> { @@ -221,7 +218,7 @@ impl<'a> TypeContext<'a> for Context { .bank .get_epoch_accounts_hash_to_serialize() .map(|epoch_accounts_hash| *epoch_accounts_hash.as_ref()), - epoch_reward_status, + None, // epoch_reward_status always unpopulated ) { BankFieldsToSerialize::WithoutEpochRewardStatus(data) => data.serialize(serializer), BankFieldsToSerialize::WithEpochRewardStatus(data) => data.serialize(serializer), @@ -380,7 +377,6 @@ impl<'a> TypeContext<'a> for Context { let hard_forks = RwLock::new(std::mem::take(&mut rhs.hard_forks)); let lamports_per_signature = rhs.fee_rate_governor.lamports_per_signature; let epoch_accounts_hash = rhs.epoch_accounts_hash.as_ref(); - let epoch_reward_status = rhs.epoch_reward_status; let bank = SerializableVersionedBank { blockhash_queue: &blockhash_queue, @@ -423,8 +419,7 @@ impl<'a> TypeContext<'a> for Context { lamports_per_signature, incremental_snapshot_persistence.cloned(), epoch_accounts_hash.copied(), - matches!(epoch_reward_status, EpochRewardStatus::Active(_)) - .then_some(&epoch_reward_status), + None, // epoch_reward_status always unpopulated ) { BankFieldsToSerialize::WithoutEpochRewardStatus(data) => { bincode::serialize_into(stream_writer, &data)