Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

includes rent_epoch in vote-accounts sanity checks (backport #29861) #29874

Merged
merged 1 commit into from
Jan 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions runtime/src/stakes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,18 +235,9 @@ impl Stakes<StakeAccount> {
None => return Err(Error::VoteAccountNotFound(*pubkey)),
Some(account) => account,
};
// Ignoring rent_epoch until the feature for
// preserve_rent_epoch_for_rent_exempt_accounts is activated.
let vote_account = vote_account.account();
if vote_account.lamports() != account.lamports()
|| vote_account.owner() != account.owner()
|| vote_account.executable() != account.executable()
|| vote_account.data() != account.data()
{
error!(
"vote account mismatch: {}, {:?}, {:?}",
pubkey, vote_account, account
);
if vote_account != &account {
error!("vote account mismatch: {pubkey}, {vote_account:?}, {account:?}");
return Err(Error::VoteAccountMismatch(*pubkey));
}
}
Expand All @@ -266,7 +257,7 @@ impl Stakes<StakeAccount> {
if VoteState::is_correct_size_and_initialized(account.data())
&& VoteAccount::try_from(account.clone()).is_ok()
{
error!("vote account not cached: {}, {:?}", pubkey, account);
error!("vote account not cached: {pubkey}, {account:?}");
return Err(Error::VoteAccountNotCached(pubkey));
}
}
Expand Down