parent
91a0c1ba5f
commit
0039613628
|
@ -1377,17 +1377,14 @@ def initiate_validator_exit(state: BeaconState, index: ValidatorIndex) -> None:
|
||||||
```python
|
```python
|
||||||
def exit_validator(state: BeaconState, index: ValidatorIndex) -> None:
|
def exit_validator(state: BeaconState, index: ValidatorIndex) -> None:
|
||||||
"""
|
"""
|
||||||
Exit the validator of the given ``index``.
|
Exit the validator with the given ``index``.
|
||||||
Note that this function mutates ``state``.
|
Note that this function mutates ``state``.
|
||||||
"""
|
"""
|
||||||
validator = state.validator_registry[index]
|
validator = state.validator_registry[index]
|
||||||
delayed_activation_exit_epoch = get_delayed_activation_exit_epoch(get_current_epoch(state))
|
|
||||||
|
|
||||||
# The following updates only occur if not previous exited
|
# Update validator exit epoch if not previously exited
|
||||||
if validator.exit_epoch <= delayed_activation_exit_epoch:
|
if validator.exit_epoch == FAR_FUTURE_EPOCH:
|
||||||
return
|
validator.exit_epoch = get_delayed_activation_exit_epoch(get_current_epoch(state))
|
||||||
else:
|
|
||||||
validator.exit_epoch = delayed_activation_exit_epoch
|
|
||||||
```
|
```
|
||||||
|
|
||||||
#### `slash_validator`
|
#### `slash_validator`
|
||||||
|
|
Loading…
Reference in New Issue