-
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 25 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
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 |
|---|---|---|
|
|
@@ -32,6 +32,7 @@ jobs: | |
| - electra | ||
| - fulu | ||
| - eip7732 | ||
| - eip7782 | ||
| - eip7805 | ||
| steps: | ||
| - name: Checkout repository | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,6 +67,7 @@ jobs: | |
| - electra | ||
| - fulu | ||
| - eip7732 | ||
| - eip7782 | ||
| - eip7805 | ||
| steps: | ||
| - name: Checkout repository | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -57,6 +57,9 @@ EIP7441_FORK_EPOCH: 18446744073709551615 | |||||
| # [customized] EIP7732 | ||||||
| EIP7732_FORK_VERSION: 0x09000001 | ||||||
| EIP7732_FORK_EPOCH: 18446744073709551615 | ||||||
| # [customized] EIP7782 | ||||||
| EIP7782_FORK_VERSION: 0x0b000001 | ||||||
| EIP7782_FORK_EPOCH: 18446744073709551615 | ||||||
| # [customized] EIP7805 | ||||||
| EIP7805_FORK_VERSION: 0x0a000001 | ||||||
| EIP7805_FORK_EPOCH: 18446744073709551615 | ||||||
|
|
@@ -100,6 +103,18 @@ CONTRIBUTION_DUE_BPS_EIP7732: 5000 | |||||
| # 7500 basis points, 75% of SLOT_DURATION_MS | ||||||
| PAYLOAD_ATTESTATION_DUE_BPS: 7500 | ||||||
|
|
||||||
| # EIP-7782 | ||||||
| # [customized] 3000 milliseconds, 3 seconds | ||||||
|
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.
Suggested change
|
||||||
| SLOT_DURATION_MS_EIP7782: 6000 | ||||||
| # 5000 basis points, 50% of SLOT_DURATION_MS_EIP7782 | ||||||
| ATTESTATION_DUE_BPS_EIP7782: 5000 | ||||||
| # 7500 basis points, 75% of SLOT_DURATION_MS_EIP7782 | ||||||
| AGGREGRATE_DUE_BPS_EIP7782: 7500 | ||||||
| # 3333 basis points, ~33% of SLOT_DURATION_MS_EIP7782 | ||||||
| SYNC_MESSAGE_DUE_BPS_EIP7782: 3333 | ||||||
| # 6667 basis points, ~67% of SLOT_DURATION_MS_EIP7782 | ||||||
| CONTRIBUTION_DUE_BPS_EIP7782: 6667 | ||||||
|
|
||||||
| # EIP-7805 | ||||||
| # 7500 basis points, 75% of SLOT_DURATION_MS | ||||||
| VIEW_FREEZE_CUTOFF_BPS: 7500 | ||||||
|
|
@@ -131,6 +146,12 @@ MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 64000000000 | |||||
| # [customized] 2**7 * 10**9 (= 128,000,000,000) Gwei | ||||||
| MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 128000000000 | ||||||
|
|
||||||
| # EIP-7782 | ||||||
| # [customized] 2**5 * 10**9 (= 32,000,000,000) Gwei | ||||||
| MIN_PER_EPOCH_CHURN_LIMIT_EIP7782: 32000000000 | ||||||
| # [customized] 2**6 * 10**9 (= 64,000,000,000) Gwei | ||||||
| MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT_EIP7782: 64000000000 | ||||||
|
|
||||||
| # Fork choice | ||||||
| # --------------------------------------------------------------- | ||||||
| # 40% | ||||||
|
|
@@ -237,4 +258,6 @@ MAX_BYTES_PER_INCLUSION_LIST: 8192 | |||||
| # Blob Scheduling | ||||||
| # --------------------------------------------------------------- | ||||||
|
|
||||||
| BLOB_SCHEDULE: [] | ||||||
| BLOB_SCHEDULE: | ||||||
| - EPOCH: 18446744073709551615 # EIP7782_FORK_EPOCH (TBD) | ||||||
| MAX_BLOBS_PER_BLOCK: 3 | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ | |
| EIP6800 = "eip6800" | ||
| EIP7441 = "eip7441" | ||
| EIP7732 = "eip7732" | ||
| EIP7782 = "eip7782" | ||
| EIP7805 = "eip7805" | ||
|
|
||
|
|
||
|
|
||
| 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,100 @@ | ||
| # 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 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) | ||
| - [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 | | ||
|
|
||
| *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. | ||
|
|
||
| ### 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, | ||
|
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 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 |
||
| ) | ||
| 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)) | ||
| ``` | ||
|
|
||
| ## 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 :)