randomize state can result in some exited vals for current epoch

This commit is contained in:
Danny Ryan 2021-09-09 15:56:08 -06:00
parent 989cd38041
commit 5348b9a3b9
No known key found for this signature in database
GPG Key ID: 2765A792E42CE07A

View File

@ -37,8 +37,8 @@ def exit_random_validators(spec, state, rng, fraction=None):
continue
validator = state.validators[index]
validator.exit_epoch = rng.choice([current_epoch - 1, current_epoch - 2, current_epoch - 3])
# ~1/2 are withdrawable
validator.exit_epoch = rng.choice([current_epoch, current_epoch - 1, current_epoch - 2, current_epoch - 3])
# ~1/2 are withdrawable (note, unnatural span between exit epoch and withdrawable epoch)
if rng.choice([True, False]):
validator.withdrawable_epoch = current_epoch
else: