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

Add max epoch churn limit (EIP-7514) #3448

Closed
wants to merge 1 commit into from
Closed
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
52 changes: 52 additions & 0 deletions specs/_features/limit_churn/beacon_chain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
Limit churn -- The Beacon Chain

## Table of contents

<!-- TOC -->
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [Introduction](#introduction)
- [Configuration](#configuration)
- [Validator cycle](#validator-cycle)
- [Helper functions](#helper-functions)
- [Beacon state accessors](#beacon-state-accessors)
- [modified `get_validator_churn_limit`](#modified-get_validator_churn_limit)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<!-- /TOC -->

## Introduction

This is the beacon chain specification to limit the max churn value, motivated to limit the validator active set growth rate.

*Note:* This specification is built upon [Capella](../../capella/beacon_chain.md) and is under active development.

## Configuration

### Validator cycle

| Name | Value |
| - | - |
| `MAX_PER_EPOCH_CHURN_LIMIT` | `uint64(12)` (= 12) |

## Helper functions

### Beacon state accessors

#### modified `get_validator_churn_limit`

```python
def get_validator_churn_limit(state: BeaconState) -> uint64:
"""
Return the validator churn limit for the current epoch.
"""
active_validator_indices = get_active_validator_indices(state, get_current_epoch(state))
return min(
MAX_PER_EPOCH_CHURN_LIMIT,
max(
MIN_PER_EPOCH_CHURN_LIMIT,
uint64(len(active_validator_indices)) // CHURN_LIMIT_QUOTIENT
)
)
```