update configs for phase1

This commit is contained in:
protolambda 2020-01-13 19:47:33 +01:00
parent 419b6a3250
commit 702b253361
No known key found for this signature in database
GPG Key ID: EC89FDBB2B4C7623
5 changed files with 135 additions and 19 deletions

View File

@ -94,9 +94,6 @@ PERSISTENT_COMMITTEE_PERIOD: 2048
MAX_EPOCHS_PER_CROSSLINK: 64 MAX_EPOCHS_PER_CROSSLINK: 64
# 2**2 (= 4) epochs 25.6 minutes # 2**2 (= 4) epochs 25.6 minutes
MIN_EPOCHS_TO_INACTIVITY_PENALTY: 4 MIN_EPOCHS_TO_INACTIVITY_PENALTY: 4
# 2**14 (= 16,384) epochs ~73 days
EARLY_DERIVED_SECRET_PENALTY_MAX_FUTURE_EPOCHS: 16384
# State vector lengths # State vector lengths
@ -146,12 +143,73 @@ DOMAIN_BEACON_ATTESTER: 0x01000000
DOMAIN_RANDAO: 0x02000000 DOMAIN_RANDAO: 0x02000000
DOMAIN_DEPOSIT: 0x03000000 DOMAIN_DEPOSIT: 0x03000000
DOMAIN_VOLUNTARY_EXIT: 0x04000000 DOMAIN_VOLUNTARY_EXIT: 0x04000000
# Phase 1
DOMAIN_SHARD_PROPOSAL: 0x80000000 DOMAIN_SHARD_PROPOSAL: 0x80000000
DOMAIN_SHARD_COMMITTEE: 0x81000000 DOMAIN_SHARD_COMMITTEE: 0x81000000
DOMAIN_LIGHT_CLIENT: 0x82000000 DOMAIN_LIGHT_CLIENT: 0x82000000
DOMAIN_CUSTODY_BIT_SLASHING: 0x83000000 DOMAIN_CUSTODY_BIT_SLASHING: 0x83000000
# Phase 1 # Phase 1: Upgrade from Phase 0
# --------------------------------------------------------------- # ---------------------------------------------------------------
PHASE_1_FORK_VERSION: 0x01000000
INITIAL_ACTIVE_SHARDS: 64 INITIAL_ACTIVE_SHARDS: 64
# Placeholder
INITIAL_GASPRICE: 10
# Phase 1: General
# ---------------------------------------------------------------
# 2**10` (= 1024)
MAX_SHARDS: 1024
# 2**3 (= 8) | online epochs | ~51 min
ONLINE_PERIOD: 8
# 2**7 (= 128)
LIGHT_CLIENT_COMMITTEE_SIZE: 128
# 2**8 (= 256) | epochs | ~27 hours
LIGHT_CLIENT_COMMITTEE_PERIOD: 256
# 2**8 (= 256) | epochs | ~27 hours
SHARD_COMMITTEE_PERIOD: 256
# 2**18 (= 262,144)
SHARD_BLOCK_CHUNK_SIZE: 262144
# 2**2 (= 4)
MAX_SHARD_BLOCK_CHUNKS: 4
# 3 * 2**16` (= 196,608)
TARGET_SHARD_BLOCK_SIZE: 196608
# Note: MAX_SHARD_BLOCKS_PER_ATTESTATION is derived from the list length.
SHARD_BLOCK_OFFSETS: [1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233]
# len(SHARD_BLOCK_OFFSETS)
MAX_SHARD_BLOCKS_PER_ATTESTATION: 12
# 2**14 (= 16,384) Gwei
MAX_GASPRICE: 16384
# 2**5 (= 32) Gwei
MIN_GASPRICE: 32
# 2**3 (= 8)
GASPRICE_ADJUSTMENT_COEFFICIENT: 8
# Phase 1: Custody Game
# ---------------------------------------------------------------
# Time parameters
# 2**1 (= 2) epochs, 12.8 minutes
RANDAO_PENALTY_EPOCHS: 2
# 2**14 (= 16,384) epochs ~73 days
EARLY_DERIVED_SECRET_PENALTY_MAX_FUTURE_EPOCHS: 16384
# 2**11 (= 2,048) epochs, ~9 days
EPOCHS_PER_CUSTODY_PERIOD: 2048
# 2**11 (= 2,048) epochs, ~9 days
CUSTODY_PERIOD_TO_RANDAO_PADDING: 2048
# 2**7 (= 128) epochs, ~14 hours
MAX_REVEAL_LATENESS_DECREMENT: 128
# Max operations
# 2**8 (= 256)
MAX_CUSTODY_KEY_REVEALS: 256
MAX_EARLY_DERIVED_SECRET_REVEALS: 1
MAX_CUSTODY_SLASHINGS: 1
# Reward and penalty quotients
EARLY_DERIVED_SECRET_REVEAL_SLOT_REWARD_MULTIPLE: 2
# 2**8 (= 256)
MINOR_REWARD_QUOTIENT: 256

View File

@ -21,14 +21,13 @@ MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: 64
# Jan 3, 2020 # Jan 3, 2020
MIN_GENESIS_TIME: 1578009600 MIN_GENESIS_TIME: 1578009600
#
#
# Fork Choice # Fork Choice
# --------------------------------------------------------------- # ---------------------------------------------------------------
# 2**1 (= 1) # 2**1 (= 1)
SAFE_SLOTS_TO_UPDATE_JUSTIFIED: 2 SAFE_SLOTS_TO_UPDATE_JUSTIFIED: 2
#
# Validator # Validator
# --------------------------------------------------------------- # ---------------------------------------------------------------
# [customized] process deposits more quickly, but insecure # [customized] process deposits more quickly, but insecure
@ -94,12 +93,6 @@ PERSISTENT_COMMITTEE_PERIOD: 2048
MAX_EPOCHS_PER_CROSSLINK: 4 MAX_EPOCHS_PER_CROSSLINK: 4
# 2**2 (= 4) epochs # 2**2 (= 4) epochs
MIN_EPOCHS_TO_INACTIVITY_PENALTY: 4 MIN_EPOCHS_TO_INACTIVITY_PENALTY: 4
# [customized] 2**12 (= 4,096) epochs
EARLY_DERIVED_SECRET_PENALTY_MAX_FUTURE_EPOCHS: 4096
# 2**2 (= 4) epochs
EPOCHS_PER_CUSTODY_PERIOD: 4
# 2**2 (= 4) epochs
CUSTODY_PERIOD_TO_RANDAO_PADDING: 4
# State vector lengths # State vector lengths
@ -149,13 +142,75 @@ DOMAIN_BEACON_ATTESTER: 0x01000000
DOMAIN_RANDAO: 0x02000000 DOMAIN_RANDAO: 0x02000000
DOMAIN_DEPOSIT: 0x03000000 DOMAIN_DEPOSIT: 0x03000000
DOMAIN_VOLUNTARY_EXIT: 0x04000000 DOMAIN_VOLUNTARY_EXIT: 0x04000000
# Phase 1
DOMAIN_SHARD_PROPOSAL: 0x80000000 DOMAIN_SHARD_PROPOSAL: 0x80000000
DOMAIN_SHARD_COMMITTEE: 0x81000000 DOMAIN_SHARD_COMMITTEE: 0x81000000
DOMAIN_LIGHT_CLIENT: 0x82000000 DOMAIN_LIGHT_CLIENT: 0x82000000
DOMAIN_CUSTODY_BIT_SLASHING: 0x83000000 DOMAIN_CUSTODY_BIT_SLASHING: 0x83000000
# Phase 1 # Phase 1: Upgrade from Phase 0
# --------------------------------------------------------------- # ---------------------------------------------------------------
# [customized] for testnet distinction
PHASE_1_FORK_VERSION: 0x01000001
# [customized] reduced for testing # [customized] reduced for testing
INITIAL_ACTIVE_SHARDS: 4 INITIAL_ACTIVE_SHARDS: 4
# Placeholder
INITIAL_GASPRICE: 10
# Phase 1: General
# ---------------------------------------------------------------
# [customized] reduced for testing
MAX_SHARDS: 8
# 2**3 (= 8) | online epochs
ONLINE_PERIOD: 8
# 2**7 (= 128)
LIGHT_CLIENT_COMMITTEE_SIZE: 128
# 2**8 (= 256) | epochs
LIGHT_CLIENT_COMMITTEE_PERIOD: 256
# 2**8 (= 256) | epochs
SHARD_COMMITTEE_PERIOD: 256
# 2**18 (= 262,144)
SHARD_BLOCK_CHUNK_SIZE: 262144
# 2**2 (= 4)
MAX_SHARD_BLOCK_CHUNKS: 4
# 3 * 2**16` (= 196,608)
TARGET_SHARD_BLOCK_SIZE: 196608
# Note: MAX_SHARD_BLOCKS_PER_ATTESTATION is derived from the list length.
SHARD_BLOCK_OFFSETS: [1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233]
# len(SHARD_BLOCK_OFFSETS)
MAX_SHARD_BLOCKS_PER_ATTESTATION: 12
# 2**14 (= 16,384) Gwei
MAX_GASPRICE: 16384
# 2**5 (= 32) Gwei
MIN_GASPRICE: 32
# 2**3 (= 8)
GASPRICE_ADJUSTMENT_COEFFICIENT: 8
# Phase 1: Custody Game
# ---------------------------------------------------------------
# Time parameters
# 2**1 (= 2) epochs
RANDAO_PENALTY_EPOCHS: 2
# [customized] quicker for testing
EARLY_DERIVED_SECRET_PENALTY_MAX_FUTURE_EPOCHS: 4096
# 2**11 (= 2,048) epochs,
EPOCHS_PER_CUSTODY_PERIOD: 2048
# 2**11 (= 2,048) epochs,
CUSTODY_PERIOD_TO_RANDAO_PADDING: 2048
# 2**7 (= 128) epochs,
MAX_REVEAL_LATENESS_DECREMENT: 128
# Max operations
# 2**8 (= 256)
MAX_CUSTODY_KEY_REVEALS: 256
MAX_EARLY_DERIVED_SECRET_REVEALS: 1
MAX_CUSTODY_SLASHINGS: 1
# Reward and penalty quotients
EARLY_DERIVED_SECRET_REVEAL_SLOT_REWARD_MULTIPLE: 2
# 2**8 (= 256)
MINOR_REWARD_QUOTIENT: 256

View File

@ -107,7 +107,6 @@ Configuration is not namespaced. Instead it is strictly an extension;
| `TARGET_SHARD_BLOCK_SIZE` | `3 * 2**16` (= 196,608) | | | `TARGET_SHARD_BLOCK_SIZE` | `3 * 2**16` (= 196,608) | |
| `SHARD_BLOCK_OFFSETS` | `[1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233]` | | | `SHARD_BLOCK_OFFSETS` | `[1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233]` | |
| `MAX_SHARD_BLOCKS_PER_ATTESTATION` | `len(SHARD_BLOCK_OFFSETS)` | | | `MAX_SHARD_BLOCKS_PER_ATTESTATION` | `len(SHARD_BLOCK_OFFSETS)` | |
| `EMPTY_CHUNK_ROOT` | `hash_tree_root(ByteList[SHARD_BLOCK_CHUNK_SIZE]())` | |
| `MAX_GASPRICE` | `Gwei(2**14)` (= 16,384) | Gwei | | | `MAX_GASPRICE` | `Gwei(2**14)` (= 16,384) | Gwei | |
| `MIN_GASPRICE` | `Gwei(2**5)` (= 32) | Gwei | | | `MIN_GASPRICE` | `Gwei(2**5)` (= 32) | Gwei | |
| `GASPRICE_ADJUSTMENT_COEFFICIENT` | `2**3` (= 8) | | | `GASPRICE_ADJUSTMENT_COEFFICIENT` | `2**3` (= 8) | |
@ -406,8 +405,9 @@ def committee_to_compact_committee(state: BeaconState, committee: Sequence[Valid
```python ```python
def chunks_to_body_root(chunks: List[Bytes32, MAX_SHARD_BLOCK_CHUNKS]) -> Root: def chunks_to_body_root(chunks: List[Bytes32, MAX_SHARD_BLOCK_CHUNKS]) -> Root:
empty_chunk_root = hash_tree_root(ByteList[SHARD_BLOCK_CHUNK_SIZE]())
return hash_tree_root(Vector[Bytes32, MAX_SHARD_BLOCK_CHUNKS]( return hash_tree_root(Vector[Bytes32, MAX_SHARD_BLOCK_CHUNKS](
chunks + [EMPTY_CHUNK_ROOT] * (MAX_SHARD_BLOCK_CHUNKS - len(chunks)) chunks + [empty_chunk_root] * (MAX_SHARD_BLOCK_CHUNKS - len(chunks))
)) ))
``` ```

View File

@ -45,18 +45,20 @@ This document details the beacon chain additions and changes in Phase 1 of Ether
## Constants ## Constants
### Misc ### Misc
| Name | Value | Unit | | Name | Value | Unit |
| - | - | | - | - |
| `BLS12_381_Q` | `4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559787` | | `BLS12_381_Q` | `4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559787` |
| `MINOR_REWARD_QUOTIENT` | `2**8` (= 256) |
| `BYTES_PER_CUSTODY_ATOM` | `48` | bytes | | `BYTES_PER_CUSTODY_ATOM` | `48` | bytes |
## Configuration
### Time parameters ### Time parameters
| Name | Value | Unit | Duration | | Name | Value | Unit | Duration |
| - | - | :-: | :-: | | - | - | :-: | :-: |
| `RANDAO_PENALTY_EPOCHS` | `2**1` (= 2) | epochs | 12.8 minutes | | `RANDAO_PENALTY_EPOCHS` | `2**1` (= 2) | epochs | 12.8 minutes |
| `EARLY_DERIVED_SECRET_PENALTY_MAX_FUTURE_EPOCHS` | `2**14` | epochs | ~73 days | | `EARLY_DERIVED_SECRET_PENALTY_MAX_FUTURE_EPOCHS` | `2**14` (= 16,384) | epochs | ~73 days |
| `EPOCHS_PER_CUSTODY_PERIOD` | `2**11` (= 2,048) | epochs | ~9 days | | `EPOCHS_PER_CUSTODY_PERIOD` | `2**11` (= 2,048) | epochs | ~9 days |
| `CUSTODY_PERIOD_TO_RANDAO_PADDING` | `2**11` (= 2,048) | epochs | ~9 days | | `CUSTODY_PERIOD_TO_RANDAO_PADDING` | `2**11` (= 2,048) | epochs | ~9 days |
| `MAX_REVEAL_LATENESS_DECREMENT` | `2**7` (= 128) | epochs | ~14 hours | | `MAX_REVEAL_LATENESS_DECREMENT` | `2**7` (= 128) | epochs | ~14 hours |
@ -74,6 +76,7 @@ This document details the beacon chain additions and changes in Phase 1 of Ether
| Name | Value | | Name | Value |
| - | - | | - | - |
| `EARLY_DERIVED_SECRET_REVEAL_SLOT_REWARD_MULTIPLE` | `2**1` (= 2) | | `EARLY_DERIVED_SECRET_REVEAL_SLOT_REWARD_MULTIPLE` | `2**1` (= 2) |
| `MINOR_REWARD_QUOTIENT` | `2**8` (= 256) |
### Signature domain types ### Signature domain types

View File

@ -34,7 +34,7 @@ Warning: this configuration is not definitive.
| Name | Value | | Name | Value |
| - | - | - | | - | - | - |
| `PHASE_1_FORK_VERSION` | `Version('0x00000001')` | | `PHASE_1_FORK_VERSION` | `Version('0x01000000')` |
| `INITIAL_ACTIVE_SHARDS` | `2**6` (= 64) | | `INITIAL_ACTIVE_SHARDS` | `2**6` (= 64) |
| `INITIAL_GASPRICE` | `Gwei(10)` | | `INITIAL_GASPRICE` | `Gwei(10)` |