Skip to content
Closed
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
7 changes: 7 additions & 0 deletions consensus/state_processing/src/common/slash_validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ pub fn slash_validator<T: EthSpec>(
validator_effective_balance.safe_div(spec.whistleblower_reward_quotient)?;
let proposer_reward = whistleblower_reward.safe_div(spec.proposer_reward_quotient)?;

// Ensure the whistleblower index is in the validator registry.
if state.validators.get(whistleblower_index).is_none() {
return Err(BeaconStateError::UnknownValidator(
whistleblower_index as u64,
));
}

increase_balance(state, proposer_index, proposer_reward)?;
increase_balance(
state,
Expand Down