Skip to content

Commit

Permalink
commit config and preset to spec
Browse files Browse the repository at this point in the history
  • Loading branch information
dapplion committed Nov 9, 2023
1 parent f295cca commit c07ae11
Show file tree
Hide file tree
Showing 9 changed files with 394 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/ethereum_config_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Ethereum key checkk

on:
push:
pull_request:
schedule:
- cron: '0 0 * * *' # Daily at 00:00 UTC

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install PyYAML
run: pip install PyYAML

- name: Check keys
# --dev checks against an unpinned commit. since new vars can be added at any time unpinned commits
# are checked on a cron, not on regular flows.
run: python scripts/assert_declare_ethereum_vars.py ${{ github.event_name == 'schedule' && '--dev' || '' }}

151 changes: 151 additions & 0 deletions consensus/config/gnosis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
PRESET_BASE: 'gnosis'

# Free-form short name of the network that this configuration applies to - known
# canonical network names include:
# * 'mainnet' - there can be only one
# * 'prater' - testnet
# Must match the regex: [a-z0-9\-]
CONFIG_NAME: 'gnosis'

# Transition
# ---------------------------------------------------------------
# Estimated on Dec 5, 2022
TERMINAL_TOTAL_DIFFICULTY: 8626000000000000000000058750000000000000000000
# By default, don't use these params
TERMINAL_BLOCK_HASH: 0x0000000000000000000000000000000000000000000000000000000000000000
TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH: 18446744073709551615


# Genesis
# ---------------------------------------------------------------
# `2**12` (= 4,096)
MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: 4096
# Dec 08, 2021, 13:00 UTC
MIN_GENESIS_TIME: 1638968400
# GBC area code
GENESIS_FORK_VERSION: 0x00000064
# Customized for GBC: ~1 hour
GENESIS_DELAY: 6000


# Forking
# ---------------------------------------------------------------
# Some forks are disabled for now:
# - These may be re-assigned to another fork-version later
# - Temporarily set to max uint64 value: 2**64 - 1

# Altair
ALTAIR_FORK_VERSION: 0x01000064
ALTAIR_FORK_EPOCH: 512
# Bellatrix
BELLATRIX_FORK_VERSION: 0x02000064
BELLATRIX_FORK_EPOCH: 385536 # 2022-11-30T19:23:40.000Z
# Capella
CAPELLA_FORK_VERSION: 0x03000064
CAPELLA_FORK_EPOCH: 648704 # 2023-08-01T11:34:20.000Z
# Deneb
DENEB_FORK_VERSION: 0x04000064
DENEB_FORK_EPOCH: 18446744073709551615
# EIP6110
EIP6110_FORK_VERSION: 0x05000064 # temporary stub
EIP6110_FORK_EPOCH: 18446744073709551615
# EIP7002
EIP7002_FORK_VERSION: 0x05000064 # temporary stub
EIP7002_FORK_EPOCH: 18446744073709551615
# WHISK
WHISK_FORK_VERSION: 0x06000064 # temporary stub
WHISK_FORK_EPOCH: 18446744073709551615


# Time parameters
# ---------------------------------------------------------------
# 5 seconds
SECONDS_PER_SLOT: 5
# 6 (estimate from xDai mainnet)
SECONDS_PER_ETH1_BLOCK: 6
# 2**8 (= 256) epochs ~27 hours
MIN_VALIDATOR_WITHDRAWABILITY_DELAY: 256
# 2**8 (= 256) epochs ~27 hours
SHARD_COMMITTEE_PERIOD: 256
# 2**10 (= 1024) ~1.4 hour
ETH1_FOLLOW_DISTANCE: 1024


# Validator cycle
# ---------------------------------------------------------------
# 2**2 (= 4)
INACTIVITY_SCORE_BIAS: 4
# 2**4 (= 16)
INACTIVITY_SCORE_RECOVERY_RATE: 16
# 2**4 * 10**9 (= 16,000,000,000) Gwei
EJECTION_BALANCE: 16000000000
# 2**2 (= 4)
MIN_PER_EPOCH_CHURN_LIMIT: 4
# 2**12 (= 4096)
CHURN_LIMIT_QUOTIENT: 4096
# [New in Deneb:EIP7514] 2*
MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT: 2

# Fork choice
# ---------------------------------------------------------------
# 40%
PROPOSER_SCORE_BOOST: 40
# 20%
REORG_HEAD_WEIGHT_THRESHOLD: 20
# 160%
REORG_PARENT_WEIGHT_THRESHOLD: 160
# `2` epochs
REORG_MAX_EPOCHS_SINCE_FINALIZATION: 2


# Deposit contract
# ---------------------------------------------------------------
# xDai Mainnet
DEPOSIT_CHAIN_ID: 100
DEPOSIT_NETWORK_ID: 100
DEPOSIT_CONTRACT_ADDRESS: 0x0B98057eA310F4d31F2a452B414647007d1645d9

# Networking
# ---------------------------------------------------------------
# `10 * 2**20` (= 10485760, 10 MiB)
GOSSIP_MAX_SIZE: 10485760
# `2**10` (= 1024)
MAX_REQUEST_BLOCKS: 1024
# `2**8` (= 256)
EPOCHS_PER_SUBNET_SUBSCRIPTION: 256
# `MIN_VALIDATOR_WITHDRAWABILITY_DELAY + CHURN_LIMIT_QUOTIENT // 2` (= 33024, ~5 months)
MIN_EPOCHS_FOR_BLOCK_REQUESTS: 33024
# `10 * 2**20` (=10485760, 10 MiB)
MAX_CHUNK_SIZE: 10485760
# 5s
TTFB_TIMEOUT: 5
# 10s
RESP_TIMEOUT: 10
ATTESTATION_PROPAGATION_SLOT_RANGE: 32
# 500ms
MAXIMUM_GOSSIP_CLOCK_DISPARITY: 500
MESSAGE_DOMAIN_INVALID_SNAPPY: 0x00000000
MESSAGE_DOMAIN_VALID_SNAPPY: 0x01000000
# 2 subnets per node
SUBNETS_PER_NODE: 2
# 2**8 (= 64)
ATTESTATION_SUBNET_COUNT: 64
ATTESTATION_SUBNET_EXTRA_BITS: 0
# ceillog2(ATTESTATION_SUBNET_COUNT) + ATTESTATION_SUBNET_EXTRA_BITS
ATTESTATION_SUBNET_PREFIX_BITS: 6

# Deneb
# `2**7` (=128)
MAX_REQUEST_BLOCKS_DENEB: 128
# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK
MAX_REQUEST_BLOB_SIDECARS: 768
# `2**14` (= 16384 epochs, ~15 days)
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 16384
# `6`
BLOB_SIDECAR_SUBNET_COUNT: 6

# Whisk
# `Epoch(2**8)`
WHISK_EPOCHS_PER_SHUFFLING_PHASE: 256
# `Epoch(2)`
WHISK_PROPOSER_SELECTION_GAP: 2
26 changes: 26 additions & 0 deletions consensus/preset/gnosis/altair.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Mainnet preset - Altair

# Updated penalty values
# ---------------------------------------------------------------
# 3 * 2**24 (= 50,331,648)
INACTIVITY_PENALTY_QUOTIENT_ALTAIR: 50331648
# 2**6 (= 64)
MIN_SLASHING_PENALTY_QUOTIENT_ALTAIR: 64
# 2
PROPORTIONAL_SLASHING_MULTIPLIER_ALTAIR: 2


# Sync committee
# ---------------------------------------------------------------
# 2**9 (= 512)
SYNC_COMMITTEE_SIZE: 512
# 2**9 (= 512)
EPOCHS_PER_SYNC_COMMITTEE_PERIOD: 512


# Sync protocol
# ---------------------------------------------------------------
# 1
MIN_SYNC_COMMITTEE_PARTICIPANTS: 1
# SLOTS_PER_EPOCH * EPOCHS_PER_SYNC_COMMITTEE_PERIOD (= 32 * 256)
UPDATE_TIMEOUT: 8192
21 changes: 21 additions & 0 deletions consensus/preset/gnosis/bellatrix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Mainnet preset - Bellatrix

# Updated penalty values
# ---------------------------------------------------------------
# 2**24 (= 16,777,216)
INACTIVITY_PENALTY_QUOTIENT_BELLATRIX: 16777216
# 2**5 (= 32)
MIN_SLASHING_PENALTY_QUOTIENT_BELLATRIX: 32
# 3
PROPORTIONAL_SLASHING_MULTIPLIER_BELLATRIX: 3

# Execution
# ---------------------------------------------------------------
# 2**30 (= 1,073,741,824)
MAX_BYTES_PER_TRANSACTION: 1073741824
# 2**20 (= 1,048,576)
MAX_TRANSACTIONS_PER_PAYLOAD: 1048576
# 2**8 (= 256)
BYTES_PER_LOGS_BLOOM: 256
# 2**5 (= 32)
MAX_EXTRA_DATA_BYTES: 32
17 changes: 17 additions & 0 deletions consensus/preset/gnosis/capella.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Mainnet preset - Capella

# Misc
# Max operations per block
# ---------------------------------------------------------------
# 2**4 (= 16)
MAX_BLS_TO_EXECUTION_CHANGES: 16

# Execution
# ---------------------------------------------------------------
# 2**3 (= 8) withdrawals
MAX_WITHDRAWALS_PER_PAYLOAD: 8

# Withdrawals processing
# ---------------------------------------------------------------
# 2**13 (= 8192) validators
MAX_VALIDATORS_PER_WITHDRAWALS_SWEEP: 8192
30 changes: 30 additions & 0 deletions consensus/preset/gnosis/custody_game.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Mainnet preset - Custody Game

# Time parameters
# ---------------------------------------------------------------
RANDAO_PENALTY_EPOCHS: 2
EARLY_DERIVED_SECRET_PENALTY_MAX_FUTURE_EPOCHS: 32768
EPOCHS_PER_CUSTODY_PERIOD: 16384
CUSTODY_PERIOD_TO_RANDAO_PADDING: 2048
MAX_CHUNK_CHALLENGE_DELAY: 32768


# Max operations
# ---------------------------------------------------------------
# 2**8 (= 256)
MAX_CUSTODY_KEY_REVEALS: 256
# 2**0 (= 1)
MAX_EARLY_DERIVED_SECRET_REVEALS: 1
# 2**2 (= 2)
MAX_CUSTODY_CHUNK_CHALLENGES: 4
# 2** 4 (= 16)
MAX_CUSTODY_CHUNK_CHALLENGE_RESP: 16
# 2**0 (= 1)
MAX_CUSTODY_SLASHINGS: 1


# Reward and penalty quotients
# ---------------------------------------------------------------
EARLY_DERIVED_SECRET_REVEAL_SLOT_REWARD_MULTIPLE: 2
# 2**8 (= 256)
MINOR_REWARD_QUOTIENT: 256
12 changes: 12 additions & 0 deletions consensus/preset/gnosis/deneb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Mainnet preset - Deneb

# Misc
# ---------------------------------------------------------------
# `uint64(4096)`
FIELD_ELEMENTS_PER_BLOB: 4096
# `uint64(2**12)` (= 4096)
MAX_BLOB_COMMITMENTS_PER_BLOCK: 4096
# `uint64(6)`
MAX_BLOBS_PER_BLOCK: 6
# `floorlog2(get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments')) + 1 + ceillog2(MAX_BLOB_COMMITMENTS_PER_BLOCK)` = 4 + 1 + 12 = 17
KZG_COMMITMENT_INCLUSION_PROOF_DEPTH: 17
77 changes: 77 additions & 0 deletions consensus/preset/gnosis/phase0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Mainnet preset - Phase0

# Misc
# ---------------------------------------------------------------
# 2**6 (= 64)
MAX_COMMITTEES_PER_SLOT: 64
# 2**7 (= 128)
TARGET_COMMITTEE_SIZE: 128
# 2**11 (= 2,048)
MAX_VALIDATORS_PER_COMMITTEE: 2048
# See issue 563
SHUFFLE_ROUND_COUNT: 90
# 4
HYSTERESIS_QUOTIENT: 4
# 1 (minus 0.25)
HYSTERESIS_DOWNWARD_MULTIPLIER: 1
# 5 (plus 1.25)
HYSTERESIS_UPWARD_MULTIPLIER: 5


# Gwei values
# ---------------------------------------------------------------
# 2**0 * 10**9 (= 1,000,000,000) Gwei
MIN_DEPOSIT_AMOUNT: 1000000000
# 2**5 * 10**9 (= 32,000,000,000) Gwei
MAX_EFFECTIVE_BALANCE: 32000000000
# 2**0 * 10**9 (= 1,000,000,000) Gwei
EFFECTIVE_BALANCE_INCREMENT: 1000000000


# Time parameters
# ---------------------------------------------------------------
MIN_ATTESTATION_INCLUSION_DELAY: 1
SLOTS_PER_EPOCH: 16
MIN_SEED_LOOKAHEAD: 1
MAX_SEED_LOOKAHEAD: 4
EPOCHS_PER_ETH1_VOTING_PERIOD: 64
SLOTS_PER_HISTORICAL_ROOT: 8192
MIN_EPOCHS_TO_INACTIVITY_PENALTY: 4


# State list lengths
# ---------------------------------------------------------------
EPOCHS_PER_HISTORICAL_VECTOR: 65536
EPOCHS_PER_SLASHINGS_VECTOR: 8192
HISTORICAL_ROOTS_LIMIT: 16777216
VALIDATOR_REGISTRY_LIMIT: 1099511627776


# Reward and penalty quotients
# ---------------------------------------------------------------
# 2**6 (= 64)
BASE_REWARD_FACTOR: 25
# 2**9 (= 512)
WHISTLEBLOWER_REWARD_QUOTIENT: 512
# 2**3 (= 8)
PROPOSER_REWARD_QUOTIENT: 8
# 2**26 (= 67,108,864)
INACTIVITY_PENALTY_QUOTIENT: 67108864
# 2**7 (= 128) (lower safety margin at Phase 0 genesis)
MIN_SLASHING_PENALTY_QUOTIENT: 128
# 1 (lower safety margin at Phase 0 genesis)
PROPORTIONAL_SLASHING_MULTIPLIER: 1


# Max operations per block
# ---------------------------------------------------------------
# 2**4 (= 16)
MAX_PROPOSER_SLASHINGS: 16
# 2**1 (= 2)
MAX_ATTESTER_SLASHINGS: 2
# 2**7 (= 128)
MAX_ATTESTATIONS: 128
# 2**4 (= 16)
MAX_DEPOSITS: 16
# 2**4 (= 16)
MAX_VOLUNTARY_EXITS: 16
Loading

0 comments on commit c07ae11

Please sign in to comment.