Skip to content

Commit

Permalink
delayed_activation_exit_epoch -> compute_activation_exit_epoch
Browse files Browse the repository at this point in the history
  • Loading branch information
djrtwo committed Jun 30, 2019
1 parent d1bc2f0 commit 6be1404
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions specs/core/0_beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
- [`validate_indexed_attestation`](#validate_indexed_attestation)
- [`slot_to_epoch`](#slot_to_epoch)
- [`epoch_start_slot`](#epoch_start_slot)
- [`delayed_activation_exit_epoch`](#delayed_activation_exit_epoch)
- [`compute_activation_exit_epoch`](#compute_activation_exit_epoch)
- [`bls_domain`](#bls_domain)
- [Beacon state accessors](#beacon-state-accessors)
- [`get_current_epoch`](#get_current_epoch)
Expand Down Expand Up @@ -754,10 +754,10 @@ def epoch_start_slot(epoch: Epoch) -> Slot:
return Slot(epoch * SLOTS_PER_EPOCH)
```

#### `delayed_activation_exit_epoch`
#### `compute_activation_exit_epoch`

```python
def delayed_activation_exit_epoch(epoch: Epoch) -> Epoch:
def compute_activation_exit_epoch(epoch: Epoch) -> Epoch:
"""
Return the epoch during which validator activations and exits initiated in ``epoch`` take effect.
"""
Expand Down Expand Up @@ -1075,7 +1075,7 @@ def initiate_validator_exit(state: BeaconState, index: ValidatorIndex) -> None:

# Compute exit queue epoch
exit_epochs = [v.exit_epoch for v in state.validators if v.exit_epoch != FAR_FUTURE_EPOCH]
exit_queue_epoch = max(exit_epochs + [delayed_activation_exit_epoch(get_current_epoch(state))])
exit_queue_epoch = max(exit_epochs + [compute_activation_exit_epoch(get_current_epoch(state))])
exit_queue_churn = len([v for v in state.validators if v.exit_epoch == exit_queue_epoch])
if exit_queue_churn >= get_validator_churn_limit(state):
exit_queue_epoch += Epoch(1)
Expand Down Expand Up @@ -1450,13 +1450,13 @@ def process_registry_updates(state: BeaconState) -> None:
activation_queue = sorted([
index for index, validator in enumerate(state.validators) if
validator.activation_eligibility_epoch != FAR_FUTURE_EPOCH and
validator.activation_epoch >= delayed_activation_exit_epoch(state.finalized_checkpoint.epoch)
validator.activation_epoch >= compute_activation_exit_epoch(state.finalized_checkpoint.epoch)
], key=lambda index: state.validators[index].activation_eligibility_epoch)
# Dequeued validators for activation up to churn limit (without resetting activation epoch)
for index in activation_queue[:get_validator_churn_limit(state)]:
validator = state.validators[index]
if validator.activation_epoch == FAR_FUTURE_EPOCH:
validator.activation_epoch = delayed_activation_exit_epoch(get_current_epoch(state))
validator.activation_epoch = compute_activation_exit_epoch(get_current_epoch(state))
```

#### Slashings
Expand Down

0 comments on commit 6be1404

Please sign in to comment.