Make linter happy
This commit is contained in:
parent
b35f8fff74
commit
eed2df37f4
|
@ -1555,10 +1555,11 @@ def process_registry_updates(state: BeaconState) -> None:
|
||||||
def process_slashings(state: BeaconState) -> None:
|
def process_slashings(state: BeaconState) -> None:
|
||||||
epoch = get_current_epoch(state)
|
epoch = get_current_epoch(state)
|
||||||
total_balance = get_total_active_balance(state)
|
total_balance = get_total_active_balance(state)
|
||||||
|
adjusted_total_slashing_balance = min(sum(state.slashings) * PROPORTIONAL_SLASHING_MULTIPLIER, total_balance)
|
||||||
for index, validator in enumerate(state.validators):
|
for index, validator in enumerate(state.validators):
|
||||||
if validator.slashed and epoch + EPOCHS_PER_SLASHINGS_VECTOR // 2 == validator.withdrawable_epoch:
|
if validator.slashed and epoch + EPOCHS_PER_SLASHINGS_VECTOR // 2 == validator.withdrawable_epoch:
|
||||||
increment = EFFECTIVE_BALANCE_INCREMENT # Factored out from penalty numerator to avoid uint64 overflow
|
increment = EFFECTIVE_BALANCE_INCREMENT # Factored out from penalty numerator to avoid uint64 overflow
|
||||||
penalty_numerator = validator.effective_balance // increment * min(sum(state.slashings) * PROPORTIONAL_SLASHING_MULTIPLIER, total_balance)
|
penalty_numerator = validator.effective_balance // increment * adjusted_total_slashing_balance
|
||||||
penalty = penalty_numerator // total_balance * increment
|
penalty = penalty_numerator // total_balance * increment
|
||||||
decrease_balance(state, ValidatorIndex(index), penalty)
|
decrease_balance(state, ValidatorIndex(index), penalty)
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue