This commit is contained in:
Danny Ryan 2018-12-10 16:30:25 -06:00
parent 0c281c8113
commit 70765a205e
No known key found for this signature in database
GPG Key ID: 2765A792E42CE07A
1 changed files with 7 additions and 7 deletions

View File

@ -77,8 +77,8 @@
- [`integer_squareroot`](#integer_squareroot)
- [`BLSVerify`](#blsverify)
- [On startup](#on-startup)
- [Routine for activating a validator](#routine-for-activating-a-validator)
- [Routine for exiting a validator](#routine-for-exiting-a-validator)
- [Routine for processing deposits](#routine-for-processing-deposits)
- [Routine for updating validator status](#routine-for-updating-validator-status)
- [Per-slot processing](#per-slot-processing)
- [Proposer signature](#proposer-signature)
- [RANDAO](#randao)
@ -1177,7 +1177,7 @@ def process_deposit(state: BeaconState,
return index
```
### Routines for updating validator status
### Routine for updating validator status
```python
def update_validator_status(index: int,
@ -1550,7 +1550,7 @@ def update_validator_registry(state: BeaconState) -> None:
# Activate validators within the allowable balance churn
balance_churn = 0
for i, validator in enumerate(state.validator_registry):
for index, validator in enumerate(state.validator_registry):
if validator.status == PENDING_ACTIVATION and validator.balance >= MAX_DEPOSIT:
# Check the balance churn would be within the allowance
balance_churn += get_effective_balance(validator)
@ -1558,11 +1558,11 @@ def update_validator_registry(state: BeaconState) -> None:
break
# Activate validator
update_validator_status(i, state, new_status=ACTIVE)
update_validator_status(index, state, new_status=ACTIVE)
# Exit validators within the allowable balance churn
balance_churn = 0
for i, validator in enumerate(state.validator_registry):
for index, validator in enumerate(state.validator_registry):
if validator.status == ACTIVE_PENDING_EXIT:
# Check the balance churn would be within the allowance
balance_churn += get_effective_balance(validator)
@ -1570,7 +1570,7 @@ def update_validator_registry(state: BeaconState) -> None:
break
# Exit validator
update_validator_status(i, state, new_status=EXITED_WITHOUT_PENALTY)
update_validator_status(index, state, new_status=EXITED_WITHOUT_PENALTY)
# Calculate the total ETH that has been penalized in the last ~2-3 withdrawal periods