Update slashing precompute to use config instead of hardcoded value (#7473)

This commit is contained in:
terence tsao 2020-10-08 19:49:20 -07:00 committed by GitHub
parent 8f64eb622e
commit 6b5265d2d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,7 @@ func ProcessSlashingsPrecompute(state *stateTrie.BeaconState, pBal *Balance) err
totalSlashing += slashing
}
minSlashing := mathutil.Min(totalSlashing*3, pBal.ActiveCurrentEpoch)
minSlashing := mathutil.Min(totalSlashing*params.BeaconConfig().ProportionalSlashingMultiplier, pBal.ActiveCurrentEpoch)
epochToWithdraw := currentEpoch + exitLength/2
increment := params.BeaconConfig().EffectiveBalanceIncrement
validatorFunc := func(idx int, val *ethpb.Validator) (bool, error) {