-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Spec 6s slot times (EIP-7782) #4484
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
base: master
Are you sure you want to change the base?
Changes from 30 commits
ff1036c
130745c
4d93844
21e0ef4
d6fa5ea
2abb059
860479b
308b42a
2aa192d
2e292be
afc83f0
8f22a08
f6f869b
0d381c4
1725283
4d24d40
e776aa5
cfbff41
312bef5
370840f
4a29a82
490cf8c
24f67e7
fc61023
fd1277c
0214feb
16e5872
ea877a8
3af084e
6a36694
67f7ad2
5516c49
704fa18
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,8 @@ jobs: | |
| - deneb | ||
| - electra | ||
| - fulu | ||
| - eip7732 | ||
| - eip7782 | ||
| - gloas | ||
| - eip7805 | ||
| - eip7928 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,6 +66,8 @@ jobs: | |
| - deneb | ||
| - electra | ||
| - fulu | ||
| - eip7732 | ||
| - eip7782 | ||
| - gloas | ||
| - eip7805 | ||
| - eip7928 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,8 @@ ALL_EXECUTABLE_SPEC_NAMES = \ | |
| gloas \ | ||
| eip6800 \ | ||
| eip7441 \ | ||
| eip7732 \ | ||
| eip7782 \ | ||
| eip7805 \ | ||
| eip7928 | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| from ..constants import EIP7782 | ||
| from .base import BaseSpecBuilder | ||
|
|
||
|
|
||
| class EIP7782SpecBuilder(BaseSpecBuilder): | ||
| fork: str = EIP7782 | ||
|
|
||
| @classmethod | ||
| def imports(cls, preset_name: str): | ||
| return f""" | ||
| from eth2spec.fulu import {preset_name} as fulu | ||
| """ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,146 @@ | ||
| # EIP-7782 -- The Beacon Chain | ||
|
|
||
| <!-- mdformat-toc start --slug=github --no-anchors --maxlevel=6 --minlevel=2 --> | ||
|
|
||
| - [Time parameters](#time-parameters) | ||
| - [Rewards and penalties](#rewards-and-penalties) | ||
| - [Configuration](#configuration) | ||
| - [Time parameters](#time-parameters-1) | ||
| - [EIP-7782 timing parameters](#eip-7782-timing-parameters) | ||
| - [EIP-7782 sync committee parameters](#eip-7782-sync-committee-parameters) | ||
| - [EIP-7782 churn limit parameters](#eip-7782-churn-limit-parameters) | ||
| - [Modified churn limit functions](#modified-churn-limit-functions) | ||
| - [Modified `get_balance_churn_limit`](#modified-get_balance_churn_limit) | ||
| - [Modified `get_activation_exit_churn_limit`](#modified-get_activation_exit_churn_limit) | ||
| - [Modified `get_activation_exit_churn_limit`](#modified-get_activation_exit_churn_limit-1) | ||
| - [Modified sync committee functions](#modified-sync-committee-functions) | ||
| - [Modified `get_sync_committee_period`](#modified-get_sync_committee_period) | ||
| - [Modified `get_sync_committee_period_at_slot`](#modified-get_sync_committee_period_at_slot) | ||
| - [Rewards and penalties](#rewards-and-penalties-1) | ||
| - [Helpers](#helpers) | ||
| - [`get_base_reward_per_increment`](#get_base_reward_per_increment) | ||
|
|
||
| <!-- mdformat-toc end --> | ||
|
|
||
| ### Time parameters | ||
|
|
||
| ### Rewards and penalties | ||
|
|
||
| | Name | Value | | ||
| | ---------------------------- | --------------------- | | ||
| | `BASE_REWARD_FACTOR_EIP7782` | `uint64(2**5)` (= 32) | | ||
|
|
||
| ## Configuration | ||
|
|
||
| ### Time parameters | ||
|
|
||
| | Name | Value | Unit | Duration | | ||
| | -------------------------- | -------------- | :----------: | :-------: | | ||
| | `SLOT_DURATION_MS_EIP7782` | `uint64(6000)` | milliseconds | 6 seconds | | ||
|
|
||
| ### EIP-7782 timing parameters | ||
|
|
||
| | Name | Value | Unit | Duration | | ||
| | ------------------------------ | -------------- | :----------: | :----------: | | ||
| | `ATTESTATION_DUE_BPS_EIP7782` | `uint64(5000)` | basis points | ~50% of slot | | ||
| | `AGGREGRATE_DUE_BPS_EIP7782` | `uint64(7500)` | basis points | ~75% of slot | | ||
| | `SYNC_MESSAGE_DUE_BPS_EIP7782` | `uint64(3333)` | basis points | ~33% of slot | | ||
| | `CONTRIBUTION_DUE_BPS_EIP7782` | `uint64(6667)` | basis points | ~67% of slot | | ||
|
|
||
| ### EIP-7782 sync committee parameters | ||
|
|
||
| | Name | Value | Unit | Duration | | ||
| | ---------------------------------------------- | -------------- | :--: | :------: | | ||
| | `EPOCHS_PER_SYNC_COMMITTEE_PERIOD_EIP7782` | `uint64(512)` | epochs | ~27 hours | | ||
|
|
||
| *Note*: EIP-7782 uses the blob schedule mechanism to reduce blob throughput. The | ||
| blob schedule entry for EIP-7782 sets `MAX_BLOBS_PER_BLOCK` to 3 (half of the | ||
| current 6 blobs) to maintain constant throughput per unit time with 6-second | ||
| slots. Transaction limits remain unchanged. | ||
|
|
||
| *Note*: EIP-7782 also halves the churn limits to maintain timing constants with | ||
| 6-second slots. This ensures that validator activation/exit rates remain | ||
| proportional to time rather than slot count. | ||
|
|
||
| *Note*: EIP-7782 doubles the sync committee period to maintain the same time duration (~27 hours) with 6-second slots. | ||
|
|
||
| ### EIP-7782 churn limit parameters | ||
|
|
||
| | Name | Value | Unit | Description | | ||
| | --------------------------------------------------- | -------------------- | :--: | :-----------------------------: | | ||
| | `MIN_PER_EPOCH_CHURN_LIMIT_EIP7782` | `Gwei(64000000000)` | Gwei | Minimum balance per epoch | | ||
| | `MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT_EIP7782` | `Gwei(128000000000)` | Gwei | Maximum activation/exit balance | | ||
|
|
||
| ### Modified churn limit functions | ||
|
|
||
| #### Modified `get_balance_churn_limit` | ||
|
|
||
| ```python | ||
| def get_balance_churn_limit(state: BeaconState) -> Gwei: | ||
| """ | ||
| Return the churn limit for the current epoch. | ||
| """ | ||
| churn = max( | ||
| MIN_PER_EPOCH_CHURN_LIMIT_EIP7782, | ||
| get_total_active_balance(state) // CHURN_LIMIT_QUOTIENT, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to double
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Weak subjectivity is epoch based so this is possibly ok, but may ask @mkalinin
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it should be doubled as well, as we want to keep all other things equal, will add. |
||
| ) | ||
| return churn - churn % EFFECTIVE_BALANCE_INCREMENT | ||
| ``` | ||
|
|
||
| #### Modified `get_activation_exit_churn_limit` | ||
|
|
||
| ```python | ||
| 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_EIP7782, get_balance_churn_limit(state)) | ||
| ``` | ||
|
|
||
| #### Modified `get_activation_exit_churn_limit` | ||
|
|
||
| ```python | ||
| 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_EIP7782, get_balance_churn_limit(state)) | ||
| ``` | ||
|
|
||
| ### Modified sync committee functions | ||
|
|
||
| #### Modified `get_sync_committee_period` | ||
|
|
||
| ```python | ||
| def get_sync_committee_period(epoch: Epoch) -> uint64: | ||
| """ | ||
| Return the sync committee period at ``epoch``. | ||
| """ | ||
| return epoch // EPOCHS_PER_SYNC_COMMITTEE_PERIOD_EIP7782 | ||
| ``` | ||
|
|
||
| #### Modified `get_sync_committee_period_at_slot` | ||
|
|
||
| ```python | ||
| def get_sync_committee_period_at_slot(slot: Slot) -> uint64: | ||
| """ | ||
| Return the sync committee period at ``slot``. | ||
| """ | ||
| epoch = compute_epoch_at_slot(slot) | ||
| return get_sync_committee_period(epoch) | ||
| ``` | ||
|
|
||
| ## Rewards and penalties | ||
|
|
||
| ### Helpers | ||
|
|
||
| #### `get_base_reward_per_increment` | ||
|
|
||
| ```python | ||
| def get_base_reward_per_increment(state: BeaconState) -> Gwei: | ||
| return Gwei( | ||
| EFFECTIVE_BALANCE_INCREMENT | ||
| * BASE_REWARD_FACTOR_EIP7782 | ||
| // integer_squareroot(get_total_active_balance(state)) | ||
| ) | ||
| ``` | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might also need to double
MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS, otherwise the data availability window goes down from ~18 days to just ~9 daysThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i was just thinking about this one :)