diff --git a/eth2/state_processing/src/per_epoch_processing/process_slashings.rs b/eth2/state_processing/src/per_epoch_processing/process_slashings.rs index b684dd33b..e9b814376 100644 --- a/eth2/state_processing/src/per_epoch_processing/process_slashings.rs +++ b/eth2/state_processing/src/per_epoch_processing/process_slashings.rs @@ -2,7 +2,7 @@ use types::{BeaconStateError as Error, *}; /// Process slashings. /// -/// Spec v0.5.1 +/// Spec v0.6.1 pub fn process_slashings( state: &mut BeaconState, current_total_balance: u64, @@ -24,10 +24,10 @@ pub fn process_slashings( let penalty = std::cmp::max( effective_balance * std::cmp::min(total_penalities * 3, current_total_balance) / current_total_balance, - effective_balance / 1, /* FIXME(sproul): spec.min_penalty_quotient, */ + effective_balance / spec.min_slashing_penalty_quotient, ); - state.balances[index] -= penalty; + safe_sub_assign!(state.balances[index], penalty); } }