* Reject close of active vote accounts (#22651)
* 10461 Reject close of vote accounts unless it earned no credits in the previous epoch. This is checked by comparing current epoch (from clock sysvar) with the most recent epoch with credits in vote state.
(cherry picked from commit 75563f6c7b
)
# Conflicts:
# programs/vote/src/vote_processor.rs
# sdk/src/feature_set.rs
* Resolve merge conflicts
Co-authored-by: Will Hickey <csu_hickey@yahoo.com>
Co-authored-by: Will Hickey <will.hickey@solana.com>
This commit is contained in:
@@ -113,6 +113,7 @@ enum InstructionErrorType {
|
||||
UNSUPPORTED_SYSVAR = 48;
|
||||
ILLEGAL_OWNER = 49;
|
||||
ACCOUNTS_DATA_BUDGET_EXCEEDED = 50;
|
||||
ACTIVE_VOTE_ACCOUNT_CLOSE = 51;
|
||||
}
|
||||
|
||||
message UnixTimestamp {
|
||||
|
@@ -537,6 +537,7 @@ impl TryFrom<tx_by_addr::TransactionError> for TransactionError {
|
||||
48 => InstructionError::UnsupportedSysvar,
|
||||
49 => InstructionError::IllegalOwner,
|
||||
50 => InstructionError::AccountsDataBudgetExceeded,
|
||||
51 => InstructionError::ActiveVoteAccountClose,
|
||||
_ => return Err("Invalid InstructionError"),
|
||||
};
|
||||
|
||||
@@ -827,6 +828,9 @@ impl From<TransactionError> for tx_by_addr::TransactionError {
|
||||
InstructionError::AccountsDataBudgetExceeded => {
|
||||
tx_by_addr::InstructionErrorType::AccountsDataBudgetExceeded
|
||||
}
|
||||
InstructionError::ActiveVoteAccountClose => {
|
||||
tx_by_addr::InstructionErrorType::ActiveVoteAccountClose
|
||||
}
|
||||
} as i32,
|
||||
custom: match instruction_error {
|
||||
InstructionError::Custom(custom) => {
|
||||
|
Reference in New Issue
Block a user