Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EIP-7251: Rename get_churn_limit() for clarity #3676

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions specs/electra/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
- [`get_committee_indices`](#get_committee_indices)
- [`get_validator_max_effective_balance`](#get_validator_max_effective_balance)
- [Beacon state accessors](#beacon-state-accessors)
- [New `get_churn_limit`](#new-get_churn_limit)
- [New `get_balance_churn_limit`](#new-get_balance_churn_limit)
- [New `get_activation_exit_churn_limit`](#new-get_activation_exit_churn_limit)
- [New `get_consolidation_churn_limit`](#new-get_consolidation_churn_limit)
- [New `get_active_balance`](#new-get_active_balance)
Expand Down Expand Up @@ -513,10 +513,10 @@ def get_validator_max_effective_balance(validator: Validator) -> Gwei:

### Beacon state accessors

#### New `get_churn_limit`
#### New `get_balance_churn_limit`

```python
def get_churn_limit(state: BeaconState) -> Gwei:
def get_balance_churn_limit(state: BeaconState) -> Gwei:
"""
Return the churn limit for the current epoch.
"""
Expand All @@ -534,14 +534,14 @@ def get_activation_exit_churn_limit(state: BeaconState) -> Gwei:
"""
Return the churn limit for the current epoch dedicated to activations and exits.
"""
return min(MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT, get_churn_limit(state))
return min(MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT, get_balance_churn_limit(state))
```

#### New `get_consolidation_churn_limit`

```python
def get_consolidation_churn_limit(state: BeaconState) -> Gwei:
return get_churn_limit(state) - get_activation_exit_churn_limit(state)
return get_balance_churn_limit(state) - get_activation_exit_churn_limit(state)
```

#### New `get_active_balance`
Expand Down
Loading