mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-13 12:14:19 +00:00
Disallow duplicate voluntary exits
Stricter processing of voluntary exits to remove an edge case
This commit is contained in:
parent
0f3e0ef2ad
commit
b7376aea5c
@ -2460,7 +2460,9 @@ def process_exit(state: BeaconState, exit: VoluntaryExit) -> None:
|
|||||||
"""
|
"""
|
||||||
validator = state.validator_registry[exit.validator_index]
|
validator = state.validator_registry[exit.validator_index]
|
||||||
# Verify the validator has not yet exited
|
# Verify the validator has not yet exited
|
||||||
assert validator.exit_epoch > get_delayed_activation_exit_epoch(get_current_epoch(state))
|
assert validator.exit_epoch == FAR_FUTURE_EPOCH
|
||||||
|
# Verify the validator has not initiated an exit
|
||||||
|
assert validator.initiated_exit is False
|
||||||
# Exits must specify an epoch when they become valid; they are not valid before then
|
# Exits must specify an epoch when they become valid; they are not valid before then
|
||||||
assert get_current_epoch(state) >= exit.epoch
|
assert get_current_epoch(state) >= exit.epoch
|
||||||
# Verify signature
|
# Verify signature
|
||||||
|
Loading…
x
Reference in New Issue
Block a user