Update 0beacon-chain-validator.md

This commit is contained in:
Ivan Martinez 2019-06-04 18:20:16 +09:00 committed by GitHub
parent e578c95837
commit 1b5370f8e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -115,12 +115,11 @@ Once a validator has been processed and added to the beacon state's `validator_r
In normal operation, the validator is quickly activated at which point the validator is added to the shuffling and begins validation after an additional `ACTIVATION_EXIT_DELAY` epochs (25.6 minutes). In normal operation, the validator is quickly activated at which point the validator is added to the shuffling and begins validation after an additional `ACTIVATION_EXIT_DELAY` epochs (25.6 minutes).
The function [`is_active_validator`](../core/0_beacon-chain.md#is_active_validator) can be used to check if a validator is active during a given shuffling epoch. Note that the `BeaconState` contains a field `current_shuffling_epoch` which dictates from which epoch the current active validators are taken. Usage is as follows: The function [`is_active_validator`](../core/0_beacon-chain.md#is_active_validator) can be used to check if a validator is active during a given epoch. Usage is as follows:
```python ```python
shuffling_epoch = state.current_shuffling_epoch
validator = state.validator_registry[validator_index] validator = state.validator_registry[validator_index]
is_active = is_active_validator(validator, shuffling_epoch) is_active = is_active_validator(validator, get_current_epoch(state))
``` ```
Once a validator is activated, the validator is assigned [responsibilities](#beacon-chain-responsibilities) until exited. Once a validator is activated, the validator is assigned [responsibilities](#beacon-chain-responsibilities) until exited.