Update 0_beacon-chain.md

This commit is contained in:
Justin 2019-03-19 20:43:05 +00:00 committed by GitHub
parent ef0b3d2948
commit b664453a34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -2435,8 +2435,9 @@ def process_voluntary_exit(state: BeaconState, exit: VoluntaryExit) -> None:
assert validator.initiated_exit is False
# Exits must specify an epoch when they become valid; they are not valid before then
assert get_current_epoch(state) >= exit.epoch
# Must have been in the validator set long enough
assert validator.activation_epoch != FAR_FUTURE_EPOCH
# Verify the validator is active
assert is_active_validator(validator, state)
# Verify the validator has been active long enough
assert get_current_epoch(state) - validator.activation_epoch >= PERSISTENT_COMMITTEE_PERIOD
# Verify signature
assert bls_verify(
@ -2445,7 +2446,7 @@ def process_voluntary_exit(state: BeaconState, exit: VoluntaryExit) -> None:
signature=exit.signature,
domain=get_domain(state.fork, exit.epoch, DOMAIN_VOLUNTARY_EXIT)
)
# Run the exit
# Initiate exit
initiate_validator_exit(state, exit.validator_index)
```