[x] 1. The current spec doesn't describe how PENDING_EXIT transits to EXITED_WITHOUT_PENALTY. A draft diagram:
(Please let me know if anything incorrect or unclear.)
[x] 2. Potential min_empty_validator_index() issue: follow up this comment. Agreed with @djrtwo. IMO It doesn't make sense to allow the validators who have sent voluntary exit/withdraw message to make a top-up deposit.
edited: just noticed the second case: involuntary ACTIVE -> PENDING_EXIT when v.balance < MIN_BALANCE.
[ ] 3. COLLECTIVE_PENALTY_CALCULATION_PERIOD and "withdrawal period": In the codes, we use COLLECTIVE_PENALTY_CALCULATION_PERIOD while it is described as "withdrawal period" everywhere.
def get_active_validator_indices(validators: [ValidatorRecord]) -> List[int]:
"""
Gets indices of active validators from ``validators``.
"""
return [i for i, v in enumerate(validators) if v.status in [ACTIVE, PENDING_EXIT]]
Maybe we should rename ACTIVE status to another name?
Add the stub of the actual withdraw. For testing withdraw, maybe we can actually set v.balance=0 and note that the balance will be transferred to shard chain in phase 1.
Issues
[x] 1. The current spec doesn't describe how
PENDING_EXIT
transits toEXITED_WITHOUT_PENALTY
. A draft diagram: (Please let me know if anything incorrect or unclear.)[x] 2. Potential
min_empty_validator_index()
issue: follow up this comment. Agreed with @djrtwo. IMO It doesn't make sense to allow the validators who have sent voluntary exit/withdraw message to make a top-up deposit. edited: just noticed the second case: involuntaryACTIVE
->PENDING_EXIT
whenv.balance < MIN_BALANCE
.[ ] 3.
COLLECTIVE_PENALTY_CALCULATION_PERIOD
and "withdrawal period": In the codes, we useCOLLECTIVE_PENALTY_CALCULATION_PERIOD
while it is described as "withdrawal period" everywhere.[x] 4.
get_active_validator_indices
returns bothACTIVE
andPENDING_EXIT
validators.Maybe we should rename
ACTIVE
status to another name?Proposed solution
For issue 1
get_changed_validators()
needs to checkif state == PENDING_EXIT
and then immediately setstate = EXITED_WITHOUT_PENALTY
.v.balance=0
and note that the balance will be transferred to shard chain in phase 1.potentially related to #198?