Include recently slashed churn in churn queue

Addresses #527 in combination with #784.
This commit is contained in:
Justin 2019-03-15 13:12:03 +00:00 committed by GitHub
parent 15bf3c4258
commit e912ed7fca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2102,7 +2102,9 @@ def update_validator_registry(state: BeaconState) -> None:
activate_validator(state, index, is_genesis=False)
# Exit validators within the allowable balance churn
balance_churn = 0
total_at_start = state.latest_slashed_balances[(current_epoch + 1) % LATEST_SLASHED_EXIT_LENGTH]
total_at_end = state.latest_slashed_balances[current_epoch % LATEST_SLASHED_EXIT_LENGTH]
balance_churn = total_at_end - total_at_start
for index, validator in enumerate(state.validator_registry):
if validator.exit_epoch == FAR_FUTURE_EPOCH and validator.initiated_exit:
# Check the balance churn would be within the allowance