We need to prevent validators from exiting voluntarily if any of these conditions are fulfilled:
- Open chunk/bit challenges
- Custody keys not revealed
This was originally implemented by the function below, but the function and its attachment point was lost over some refactoring of the exit queue:
def eligible(state: BeaconState, index: ValidatorIndex) -> bool:
validator = state.validator_registry[index]
# Cannot exit if there are still open chunk challenges
if len([record for record in state.custody_chunk_challenge_records if record.responder_index == index]) > 0:
return False
# Cannot exit if there are still open bit challenges
if len([record for record in state.custody_bit_challenge_records if record.responder_index == index]) > 0:
return False
# Cannot exit if you have not revealed all of your custody keys
elif validator.next_custody_reveal_period <= get_validators_custody_reveal_period(state, index, validator.exit_epoch):
return False
# Cannot exit if you already have
elif validator.withdrawable_epoch < FAR_FUTURE_EPOCH:
return False
# Return minimum time
else:
return current_epoch >= validator.exit_epoch + MIN_VALIDATOR_WITHDRAWAL_EPOCHS
We need to prevent validators from exiting voluntarily if any of these conditions are fulfilled:
This was originally implemented by the function below, but the function and its attachment point was lost over some refactoring of the exit queue: