Merge pull request #1191 from ethereum/constats-config
split constants vs configuration
This commit is contained in:
commit
7298b3e290
|
@ -15,8 +15,6 @@ MAX_INDICES_PER_ATTESTATION: 4096
|
||||||
MIN_PER_EPOCH_CHURN_LIMIT: 4
|
MIN_PER_EPOCH_CHURN_LIMIT: 4
|
||||||
# 2**16 (= 65,536)
|
# 2**16 (= 65,536)
|
||||||
CHURN_LIMIT_QUOTIENT: 65536
|
CHURN_LIMIT_QUOTIENT: 65536
|
||||||
# Normalizes base rewards
|
|
||||||
BASE_REWARDS_PER_EPOCH: 5
|
|
||||||
# See issue 563
|
# See issue 563
|
||||||
SHUFFLE_ROUND_COUNT: 90
|
SHUFFLE_ROUND_COUNT: 90
|
||||||
|
|
||||||
|
@ -25,8 +23,6 @@ SHUFFLE_ROUND_COUNT: 90
|
||||||
# ---------------------------------------------------------------
|
# ---------------------------------------------------------------
|
||||||
# **TBD**
|
# **TBD**
|
||||||
DEPOSIT_CONTRACT_ADDRESS: 0x1234567890123456789012345678901234567890
|
DEPOSIT_CONTRACT_ADDRESS: 0x1234567890123456789012345678901234567890
|
||||||
# 2**5 (= 32)
|
|
||||||
DEPOSIT_CONTRACT_TREE_DEPTH: 32
|
|
||||||
|
|
||||||
|
|
||||||
# Gwei values
|
# Gwei values
|
||||||
|
@ -46,8 +42,6 @@ EFFECTIVE_BALANCE_INCREMENT: 1000000000
|
||||||
GENESIS_FORK_VERSION: 0x00000000
|
GENESIS_FORK_VERSION: 0x00000000
|
||||||
# 0, GENESIS_EPOCH is derived from this constant
|
# 0, GENESIS_EPOCH is derived from this constant
|
||||||
GENESIS_SLOT: 0
|
GENESIS_SLOT: 0
|
||||||
# 2**64 - 1
|
|
||||||
FAR_FUTURE_EPOCH: 18446744073709551615
|
|
||||||
BLS_WITHDRAWAL_PREFIX: 0
|
BLS_WITHDRAWAL_PREFIX: 0
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,6 @@ MAX_INDICES_PER_ATTESTATION: 4096
|
||||||
MIN_PER_EPOCH_CHURN_LIMIT: 4
|
MIN_PER_EPOCH_CHURN_LIMIT: 4
|
||||||
# 2**16 (= 65,536)
|
# 2**16 (= 65,536)
|
||||||
CHURN_LIMIT_QUOTIENT: 65536
|
CHURN_LIMIT_QUOTIENT: 65536
|
||||||
# Normalizes base rewards
|
|
||||||
BASE_REWARDS_PER_EPOCH: 5
|
|
||||||
# [customized] Faster, but unsecure.
|
# [customized] Faster, but unsecure.
|
||||||
SHUFFLE_ROUND_COUNT: 10
|
SHUFFLE_ROUND_COUNT: 10
|
||||||
|
|
||||||
|
@ -24,8 +22,6 @@ SHUFFLE_ROUND_COUNT: 10
|
||||||
# ---------------------------------------------------------------
|
# ---------------------------------------------------------------
|
||||||
# **TBD**
|
# **TBD**
|
||||||
DEPOSIT_CONTRACT_ADDRESS: 0x1234567890123456789012345678901234567890
|
DEPOSIT_CONTRACT_ADDRESS: 0x1234567890123456789012345678901234567890
|
||||||
# 2**5 (= 32)
|
|
||||||
DEPOSIT_CONTRACT_TREE_DEPTH: 32
|
|
||||||
|
|
||||||
|
|
||||||
# Gwei values
|
# Gwei values
|
||||||
|
@ -45,8 +41,6 @@ EFFECTIVE_BALANCE_INCREMENT: 1000000000
|
||||||
GENESIS_FORK_VERSION: 0x00000000
|
GENESIS_FORK_VERSION: 0x00000000
|
||||||
# 0, GENESIS_EPOCH is derived from this constant
|
# 0, GENESIS_EPOCH is derived from this constant
|
||||||
GENESIS_SLOT: 0
|
GENESIS_SLOT: 0
|
||||||
# 2**64 - 1
|
|
||||||
FAR_FUTURE_EPOCH: 18446744073709551615
|
|
||||||
BLS_WITHDRAWAL_PREFIX: 0
|
BLS_WITHDRAWAL_PREFIX: 0
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
- [Notation](#notation)
|
- [Notation](#notation)
|
||||||
- [Terminology](#terminology)
|
- [Terminology](#terminology)
|
||||||
- [Constants](#constants)
|
- [Constants](#constants)
|
||||||
|
- [Configuration](#configuration)
|
||||||
- [Misc](#misc)
|
- [Misc](#misc)
|
||||||
- [Deposit contract](#deposit-contract)
|
- [Deposit contract](#deposit-contract)
|
||||||
- [Gwei values](#gwei-values)
|
- [Gwei values](#gwei-values)
|
||||||
|
@ -152,7 +153,18 @@ Code snippets appearing in `this style` are to be interpreted as Python code.
|
||||||
|
|
||||||
## Constants
|
## Constants
|
||||||
|
|
||||||
*Note*: The default mainnet values for the constants are included here for spec-design purposes.
|
The following values are (non-configurable) constants used throughout the specification.
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
|
| - | - |
|
||||||
|
| `FAR_FUTURE_EPOCH` | `2**64 - 1` |
|
||||||
|
| `ZERO_HASH` | `b'\x00' * 32` |
|
||||||
|
| `BASE_REWARDS_PER_EPOCH` | `5` |
|
||||||
|
| `DEPOSIT_CONTRACT_TREE_DEPTH` | `2**5` (= 32) |
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
*Note*: The default mainnet configuration values are included here for spec-design purposes.
|
||||||
The different configurations for mainnet, testnets, and YAML-based testing can be found in the `configs/constant_presets/` directory.
|
The different configurations for mainnet, testnets, and YAML-based testing can be found in the `configs/constant_presets/` directory.
|
||||||
These configurations are updated for releases, but may be out of sync during `dev` changes.
|
These configurations are updated for releases, but may be out of sync during `dev` changes.
|
||||||
|
|
||||||
|
@ -165,17 +177,10 @@ These configurations are updated for releases, but may be out of sync during `de
|
||||||
| `MAX_INDICES_PER_ATTESTATION` | `2**12` (= 4,096) |
|
| `MAX_INDICES_PER_ATTESTATION` | `2**12` (= 4,096) |
|
||||||
| `MIN_PER_EPOCH_CHURN_LIMIT` | `2**2` (= 4) |
|
| `MIN_PER_EPOCH_CHURN_LIMIT` | `2**2` (= 4) |
|
||||||
| `CHURN_LIMIT_QUOTIENT` | `2**16` (= 65,536) |
|
| `CHURN_LIMIT_QUOTIENT` | `2**16` (= 65,536) |
|
||||||
| `BASE_REWARDS_PER_EPOCH` | `5` |
|
|
||||||
| `SHUFFLE_ROUND_COUNT` | `90` |
|
| `SHUFFLE_ROUND_COUNT` | `90` |
|
||||||
|
|
||||||
* For the safety of crosslinks `TARGET_COMMITTEE_SIZE` exceeds [the recommended minimum committee size of 111](https://vitalik.ca/files/Ithaca201807_Sharding.pdf); with sufficient active validators (at least `SLOTS_PER_EPOCH * TARGET_COMMITTEE_SIZE`), the shuffling algorithm ensures committee sizes of at least `TARGET_COMMITTEE_SIZE`. (Unbiasable randomness with a Verifiable Delay Function (VDF) will improve committee robustness and lower the safe minimum committee size.)
|
* For the safety of crosslinks `TARGET_COMMITTEE_SIZE` exceeds [the recommended minimum committee size of 111](https://vitalik.ca/files/Ithaca201807_Sharding.pdf); with sufficient active validators (at least `SLOTS_PER_EPOCH * TARGET_COMMITTEE_SIZE`), the shuffling algorithm ensures committee sizes of at least `TARGET_COMMITTEE_SIZE`. (Unbiasable randomness with a Verifiable Delay Function (VDF) will improve committee robustness and lower the safe minimum committee size.)
|
||||||
|
|
||||||
### Deposit contract
|
|
||||||
|
|
||||||
| Name | Value |
|
|
||||||
| - | - |
|
|
||||||
| `DEPOSIT_CONTRACT_TREE_DEPTH` | `2**5` (= 32) |
|
|
||||||
|
|
||||||
### Gwei values
|
### Gwei values
|
||||||
|
|
||||||
| Name | Value | Unit |
|
| Name | Value | Unit |
|
||||||
|
@ -191,8 +196,6 @@ These configurations are updated for releases, but may be out of sync during `de
|
||||||
| - | - |
|
| - | - |
|
||||||
| `GENESIS_SLOT` | `0` |
|
| `GENESIS_SLOT` | `0` |
|
||||||
| `GENESIS_EPOCH` | `0` |
|
| `GENESIS_EPOCH` | `0` |
|
||||||
| `FAR_FUTURE_EPOCH` | `2**64 - 1` |
|
|
||||||
| `ZERO_HASH` | `b'\x00' * 32` |
|
|
||||||
| `BLS_WITHDRAWAL_PREFIX` | `0` |
|
| `BLS_WITHDRAWAL_PREFIX` | `0` |
|
||||||
|
|
||||||
### Time parameters
|
### Time parameters
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
- [Table of contents](#table-of-contents)
|
- [Table of contents](#table-of-contents)
|
||||||
- [Introduction](#introduction)
|
- [Introduction](#introduction)
|
||||||
- [Prerequisites](#prerequisites)
|
- [Prerequisites](#prerequisites)
|
||||||
- [Constants](#constants)
|
- [Configuration](#configuration)
|
||||||
- [Time parameters](#time-parameters)
|
- [Time parameters](#time-parameters)
|
||||||
- [Beacon chain processing](#beacon-chain-processing)
|
- [Beacon chain processing](#beacon-chain-processing)
|
||||||
- [Beacon chain fork choice rule](#beacon-chain-fork-choice-rule)
|
- [Beacon chain fork choice rule](#beacon-chain-fork-choice-rule)
|
||||||
|
@ -26,7 +26,7 @@ This document represents the specification for the beacon chain fork choice rule
|
||||||
|
|
||||||
All terminology, constants, functions, and protocol mechanics defined in the [Phase 0 -- The Beacon Chain](./0_beacon-chain.md) doc are requisite for this document and used throughout. Please see the Phase 0 doc before continuing and use as a reference throughout.
|
All terminology, constants, functions, and protocol mechanics defined in the [Phase 0 -- The Beacon Chain](./0_beacon-chain.md) doc are requisite for this document and used throughout. Please see the Phase 0 doc before continuing and use as a reference throughout.
|
||||||
|
|
||||||
## Constants
|
## Configuration
|
||||||
|
|
||||||
### Time parameters
|
### Time parameters
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,9 @@
|
||||||
- [Ethereum 2.0 Phase 1 -- Shard Data Chains](#ethereum-20-phase-1----shard-data-chains)
|
- [Ethereum 2.0 Phase 1 -- Shard Data Chains](#ethereum-20-phase-1----shard-data-chains)
|
||||||
- [Table of contents](#table-of-contents)
|
- [Table of contents](#table-of-contents)
|
||||||
- [Introduction](#introduction)
|
- [Introduction](#introduction)
|
||||||
- [Constants](#constants)
|
- [Configuration](#configuration)
|
||||||
- [Misc](#misc)
|
- [Misc](#misc)
|
||||||
|
- [Initial values](#initial-values)
|
||||||
- [Time parameters](#time-parameters)
|
- [Time parameters](#time-parameters)
|
||||||
- [Signature domains](#signature-domains)
|
- [Signature domains](#signature-domains)
|
||||||
- [Data structures](#data-structures)
|
- [Data structures](#data-structures)
|
||||||
|
@ -38,7 +39,7 @@
|
||||||
|
|
||||||
This document describes the shard data layer and the shard fork choice rule in Phase 1 of Ethereum 2.0.
|
This document describes the shard data layer and the shard fork choice rule in Phase 1 of Ethereum 2.0.
|
||||||
|
|
||||||
## Constants
|
## Configuration
|
||||||
|
|
||||||
### Misc
|
### Misc
|
||||||
|
|
||||||
|
@ -46,6 +47,10 @@ This document describes the shard data layer and the shard fork choice rule in P
|
||||||
| - | - |
|
| - | - |
|
||||||
| `BYTES_PER_SHARD_BLOCK_BODY` | `2**14` (= 16,384) |
|
| `BYTES_PER_SHARD_BLOCK_BODY` | `2**14` (= 16,384) |
|
||||||
| `MAX_SHARD_ATTESTIONS` | `2**4` (= 16) |
|
| `MAX_SHARD_ATTESTIONS` | `2**4` (= 16) |
|
||||||
|
|
||||||
|
### Initial values
|
||||||
|
|
||||||
|
| Name | Value |
|
||||||
| `PHASE_1_FORK_EPOCH` | **TBD** |
|
| `PHASE_1_FORK_EPOCH` | **TBD** |
|
||||||
| `PHASE_1_FORK_SLOT` | **TBD** |
|
| `PHASE_1_FORK_SLOT` | **TBD** |
|
||||||
| `GENESIS_SHARD_SLOT` | 0 |
|
| `GENESIS_SHARD_SLOT` | 0 |
|
||||||
|
|
Loading…
Reference in New Issue