Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include recently slashed churn in exit churn queue #785

Merged
merged 7 commits into from
Mar 19, 2019
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion specs/core/0_beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ The types are defined topologically to aid in facilitating an executable version
'validator_registry': [Validator],
'validator_balances': ['uint64'],
'validator_registry_update_epoch': 'uint64',
'validator_registry_update_slashed_balances': 'uint64',

# Randomness and committees
'latest_randao_mixes': ['bytes32', LATEST_RANDAO_MIXES_LENGTH],
Expand Down Expand Up @@ -2102,7 +2103,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.validator_registry_update_slashed_balances
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
Expand All @@ -2114,6 +2117,7 @@ def update_validator_registry(state: BeaconState) -> None:
exit_validator(state, index)

state.validator_registry_update_epoch = current_epoch
state.validator_registry_update_slashed_balances = total_at_end
JustinDrake marked this conversation as resolved.
Show resolved Hide resolved
```

Run the following function:
Expand Down