mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-15 19:02:42 +00:00
Merge remote-tracking branch 'origin/unstable' into tree-states
This commit is contained in:
@@ -34,14 +34,11 @@ pub fn slash_validator<T: EthSpec>(
|
||||
.safe_add(validator_effective_balance)?,
|
||||
)?;
|
||||
|
||||
let min_slashing_penalty_quotient = match state {
|
||||
BeaconState::Base(_) => spec.min_slashing_penalty_quotient,
|
||||
BeaconState::Altair(_) => spec.min_slashing_penalty_quotient_altair,
|
||||
};
|
||||
decrease_balance(
|
||||
state,
|
||||
slashed_index,
|
||||
validator_effective_balance.safe_div(min_slashing_penalty_quotient)?,
|
||||
validator_effective_balance
|
||||
.safe_div(spec.min_slashing_penalty_quotient_for_state(state))?,
|
||||
)?;
|
||||
|
||||
// Apply proposer and whistleblower rewards
|
||||
@@ -51,7 +48,7 @@ pub fn slash_validator<T: EthSpec>(
|
||||
validator_effective_balance.safe_div(spec.whistleblower_reward_quotient)?;
|
||||
let proposer_reward = match state {
|
||||
BeaconState::Base(_) => whistleblower_reward.safe_div(spec.proposer_reward_quotient)?,
|
||||
BeaconState::Altair(_) => whistleblower_reward
|
||||
BeaconState::Altair(_) | BeaconState::Merge(_) => whistleblower_reward
|
||||
.safe_mul(PROPOSER_WEIGHT)?
|
||||
.safe_div(WEIGHT_DENOMINATOR)?,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user