diff --git a/account-decoder/src/parse_vote.rs b/account-decoder/src/parse_vote.rs index c1310f8be00339..7f7831f2f3ff48 100644 --- a/account-decoder/src/parse_vote.rs +++ b/account-decoder/src/parse_vote.rs @@ -8,8 +8,7 @@ use { }; pub fn parse_vote(data: &[u8]) -> Result { - let mut vote_state = - VoteState::deserialize_with_bincode(data).map_err(ParseAccountError::from)?; + let mut vote_state = VoteState::deserialize(data).map_err(ParseAccountError::from)?; let epoch_credits = vote_state .epoch_credits() .iter() diff --git a/programs/vote/src/vote_state/mod.rs b/programs/vote/src/vote_state/mod.rs index 058b385f309873..e2a0cd449e8fbe 100644 --- a/programs/vote/src/vote_state/mod.rs +++ b/programs/vote/src/vote_state/mod.rs @@ -133,7 +133,7 @@ impl From for VoteTransaction { // utility function, used by Stakes, tests pub fn from(account: &T) -> Option { - VoteState::deserialize_with_bincode(account.data()).ok() + VoteState::deserialize(account.data()).ok() } // utility function, used by Stakes, tests diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 74992a786193c4..6f5cd9a07f607b 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -2680,7 +2680,7 @@ impl Bank { // vote_accounts_cache_miss_count is shown to be always zero. let account = self.get_account_with_fixed_root(vote_pubkey)?; if account.owner() == &solana_vote_program - && VoteState::deserialize_with_bincode(account.data()).is_ok() + && VoteState::deserialize(account.data()).is_ok() { vote_accounts_cache_miss_count.fetch_add(1, Relaxed); } diff --git a/sdk/program/src/vote/state/mod.rs b/sdk/program/src/vote/state/mod.rs index 39018e213a12af..9c4ff2c6e2c344 100644 --- a/sdk/program/src/vote/state/mod.rs +++ b/sdk/program/src/vote/state/mod.rs @@ -382,20 +382,6 @@ impl VoteState { Ok(vote_state) } - // this only exists for the sake of the feature gated upgrade to the new parser; do not use it - #[doc(hidden)] - #[allow(clippy::used_underscore_binding)] - pub fn deserialize_with_bincode(_input: &[u8]) -> Result { - #[cfg(not(target_os = "solana"))] - { - bincode::deserialize::(_input) - .map(|versioned| versioned.convert_to_current()) - .map_err(|_| InstructionError::InvalidAccountData) - } - #[cfg(target_os = "solana")] - unimplemented!() - } - /// Deserializes the input buffer into the provided `VoteState` /// /// This function is exposed to allow deserialization in a BPF context directly into boxed memory. diff --git a/vote/src/vote_account.rs b/vote/src/vote_account.rs index 9e26fd751c45ab..53d9e71cba9f3a 100644 --- a/vote/src/vote_account.rs +++ b/vote/src/vote_account.rs @@ -65,13 +65,10 @@ impl VoteAccount { } pub fn vote_state(&self) -> Result<&VoteState, &Error> { - // VoteState::deserialize_with_bincode deserializes a VoteStateVersions and then - // calls VoteStateVersions::convert_to_current. + // VoteState::deserialize deserializes a VoteStateVersions directly into VoteState self.0 .vote_state - .get_or_init(|| { - VoteState::deserialize_with_bincode(self.0.account.data()).map_err(Error::from) - }) + .get_or_init(|| VoteState::deserialize(self.0.account.data()).map_err(Error::from)) .as_ref() }