Merge pull request #746 from ethereum/min-time-to-exit
Cannot exit until 2048 epochs (#675 item 21) [redo]
This commit is contained in:
commit
8ca303efc5
|
@ -231,6 +231,7 @@ Code snippets appearing in `this style` are to be interpreted as Python code.
|
|||
| `EPOCHS_PER_ETH1_VOTING_PERIOD` | `2**4` (= 16) | epochs | ~1.7 hours |
|
||||
| `SLOTS_PER_HISTORICAL_ROOT` | `2**13` (= 8,192) | slots | ~13 hours |
|
||||
| `MIN_VALIDATOR_WITHDRAWABILITY_DELAY` | `2**8` (= 256) | epochs | ~27 hours |
|
||||
| `PERSISTENT_COMMITTEE_PERIOD` | `2**11` (= 2,048) | epochs | 9 days |
|
||||
|
||||
### State list lengths
|
||||
|
||||
|
@ -2465,6 +2466,8 @@ 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 get_current_epoch(state) - validator.activation_epoch >= PERSISTENT_COMMITTEE_PERIOD
|
||||
# Verify signature
|
||||
assert bls_verify(
|
||||
pubkey=validator.pubkey,
|
||||
|
|
Loading…
Reference in New Issue