From 39f35e812fdde78dba964c36d8f458796bf75e46 Mon Sep 17 00:00:00 2001 From: jacob kaufmann Date: Wed, 28 May 2025 16:02:09 -0600 Subject: [PATCH 1/5] feat: add minimal/mainnet presets via git submodule --- .gitmodules | 3 ++ consensus-specs | 1 + preset.go | 117 ++++++++++++++++++++++++++++++++++++++++++++++++ preset_test.go | 14 ++++++ 4 files changed, 135 insertions(+) create mode 100644 .gitmodules create mode 160000 consensus-specs create mode 100644 preset.go create mode 100644 preset_test.go diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..dc0d331e1 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "consensus-specs"] + path = consensus-specs + url = https://github.com/ethereum/consensus-specs.git diff --git a/consensus-specs b/consensus-specs new file mode 160000 index 000000000..a58c80d3a --- /dev/null +++ b/consensus-specs @@ -0,0 +1 @@ +Subproject commit a58c80d3a76ed7b0c1b4f318647675268f3d1abf diff --git a/preset.go b/preset.go new file mode 100644 index 000000000..c85045b5e --- /dev/null +++ b/preset.go @@ -0,0 +1,117 @@ +package client + +import _ "embed" +import "fmt" +import "log" + +import "gopkg.in/yaml.v3" + +//go:embed consensus-specs/presets/mainnet/phase0.yaml +var mainnetPhase0 []byte + +//go:embed consensus-specs/presets/mainnet/altair.yaml +var mainnetAltair []byte + +//go:embed consensus-specs/presets/mainnet/bellatrix.yaml +var mainnetBellatrix []byte + +//go:embed consensus-specs/presets/mainnet/capella.yaml +var mainnetCapella []byte + +//go:embed consensus-specs/presets/mainnet/deneb.yaml +var mainnetDeneb []byte + +//go:embed consensus-specs/presets/mainnet/electra.yaml +var mainnetElectra []byte + +//go:embed consensus-specs/presets/mainnet/fulu.yaml +var mainnetFulu []byte + +//go:embed consensus-specs/presets/minimal/phase0.yaml +var minimalPhase0 []byte + +//go:embed consensus-specs/presets/minimal/altair.yaml +var minimalAltair []byte + +//go:embed consensus-specs/presets/minimal/bellatrix.yaml +var minimalBellatrix []byte + +//go:embed consensus-specs/presets/minimal/capella.yaml +var minimalCapella []byte + +//go:embed consensus-specs/presets/minimal/deneb.yaml +var minimalDeneb []byte + +//go:embed consensus-specs/presets/minimal/electra.yaml +var minimalElectra []byte + +//go:embed consensus-specs/presets/minimal/fulu.yaml +var minimalFulu []byte + +var ( + MainnetPreset map[string]interface{} + MinimalPreset map[string]interface{} +) + +func init() { + err := yaml.Unmarshal(minimalPhase0, &MinimalPreset) + if err != nil { + log.Fatal(err) + } + err = yaml.Unmarshal(minimalAltair, &MinimalPreset) + if err != nil { + log.Fatal(err) + } + err = yaml.Unmarshal(minimalBellatrix, &MinimalPreset) + if err != nil { + log.Fatal(err) + } + err = yaml.Unmarshal(minimalCapella, &MinimalPreset) + if err != nil { + log.Fatal(err) + } + err = yaml.Unmarshal(minimalDeneb, &MinimalPreset) + if err != nil { + log.Fatal(err) + } + err = yaml.Unmarshal(minimalElectra, &MinimalPreset) + if err != nil { + log.Fatal(err) + } + err = yaml.Unmarshal(minimalFulu, &MinimalPreset) + if err != nil { + log.Fatal(err) + } + + err = yaml.Unmarshal(mainnetPhase0, &MainnetPreset) + if err != nil { + log.Fatal(err) + } + err = yaml.Unmarshal(mainnetAltair, &MainnetPreset) + if err != nil { + log.Fatal(err) + } + err = yaml.Unmarshal(mainnetBellatrix, &MainnetPreset) + if err != nil { + log.Fatal(err) + } + err = yaml.Unmarshal(mainnetCapella, &MainnetPreset) + if err != nil { + log.Fatal(err) + } + err = yaml.Unmarshal(mainnetDeneb, &MainnetPreset) + if err != nil { + log.Fatal(err) + } + err = yaml.Unmarshal(mainnetElectra, &MainnetPreset) + if err != nil { + log.Fatal(err) + } + err = yaml.Unmarshal(mainnetFulu, &MainnetPreset) + if err != nil { + log.Fatal(err) + } + + fmt.Printf("minimal preset: %v\n", MinimalPreset) + fmt.Printf("mainnet preset: %v\n", MainnetPreset) +} diff --git a/preset_test.go b/preset_test.go new file mode 100644 index 000000000..dece9f5e4 --- /dev/null +++ b/preset_test.go @@ -0,0 +1,14 @@ +package client + +import "testing" + +func TestPresetInitialization(t *testing.T) { + t.Run("consensus-specs presets init", func(t *testing.T) { + if MainnetPreset == nil { + t.Error("MainnetConfig should be initialized") + } + if MinimalPreset == nil { + t.Error("MinimalConfig should be initialized") + } + }) +} From 5f241b4aa8a49a0091172553d2b930e9ae5fcdaa Mon Sep 17 00:00:00 2001 From: jacob kaufmann Date: Thu, 29 May 2025 17:13:27 -0600 Subject: [PATCH 2/5] remove git submodule in favor of local copy of presets --- .gitmodules | 3 -- consensus-specs | 1 - preset.go | 28 ++++++------ presets/mainnet/altair.yaml | 24 ++++++++++ presets/mainnet/bellatrix.yaml | 21 +++++++++ presets/mainnet/capella.yaml | 16 +++++++ presets/mainnet/deneb.yaml | 16 +++++++ presets/mainnet/electra.yaml | 50 ++++++++++++++++++++ presets/mainnet/fulu.yaml | 13 ++++++ presets/mainnet/phase0.yaml | 83 ++++++++++++++++++++++++++++++++++ presets/minimal/altair.yaml | 24 ++++++++++ presets/minimal/bellatrix.yaml | 21 +++++++++ presets/minimal/capella.yaml | 16 +++++++ presets/minimal/deneb.yaml | 16 +++++++ presets/minimal/electra.yaml | 50 ++++++++++++++++++++ presets/minimal/fulu.yaml | 13 ++++++ presets/minimal/phase0.yaml | 83 ++++++++++++++++++++++++++++++++++ 17 files changed, 460 insertions(+), 18 deletions(-) delete mode 100644 .gitmodules delete mode 160000 consensus-specs create mode 100644 presets/mainnet/altair.yaml create mode 100644 presets/mainnet/bellatrix.yaml create mode 100644 presets/mainnet/capella.yaml create mode 100644 presets/mainnet/deneb.yaml create mode 100644 presets/mainnet/electra.yaml create mode 100644 presets/mainnet/fulu.yaml create mode 100644 presets/mainnet/phase0.yaml create mode 100644 presets/minimal/altair.yaml create mode 100644 presets/minimal/bellatrix.yaml create mode 100644 presets/minimal/capella.yaml create mode 100644 presets/minimal/deneb.yaml create mode 100644 presets/minimal/electra.yaml create mode 100644 presets/minimal/fulu.yaml create mode 100644 presets/minimal/phase0.yaml diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index dc0d331e1..000000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "consensus-specs"] - path = consensus-specs - url = https://github.com/ethereum/consensus-specs.git diff --git a/consensus-specs b/consensus-specs deleted file mode 160000 index a58c80d3a..000000000 --- a/consensus-specs +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a58c80d3a76ed7b0c1b4f318647675268f3d1abf diff --git a/preset.go b/preset.go index c85045b5e..d73cbf925 100644 --- a/preset.go +++ b/preset.go @@ -6,46 +6,46 @@ import "log" import "gopkg.in/yaml.v3" -//go:embed consensus-specs/presets/mainnet/phase0.yaml +//go:embed presets/mainnet/phase0.yaml var mainnetPhase0 []byte -//go:embed consensus-specs/presets/mainnet/altair.yaml +//go:embed presets/mainnet/altair.yaml var mainnetAltair []byte -//go:embed consensus-specs/presets/mainnet/bellatrix.yaml +//go:embed presets/mainnet/bellatrix.yaml var mainnetBellatrix []byte -//go:embed consensus-specs/presets/mainnet/capella.yaml +//go:embed presets/mainnet/capella.yaml var mainnetCapella []byte -//go:embed consensus-specs/presets/mainnet/deneb.yaml +//go:embed presets/mainnet/deneb.yaml var mainnetDeneb []byte -//go:embed consensus-specs/presets/mainnet/electra.yaml +//go:embed presets/mainnet/electra.yaml var mainnetElectra []byte -//go:embed consensus-specs/presets/mainnet/fulu.yaml +//go:embed presets/mainnet/fulu.yaml var mainnetFulu []byte -//go:embed consensus-specs/presets/minimal/phase0.yaml +//go:embed presets/minimal/phase0.yaml var minimalPhase0 []byte -//go:embed consensus-specs/presets/minimal/altair.yaml +//go:embed presets/minimal/altair.yaml var minimalAltair []byte -//go:embed consensus-specs/presets/minimal/bellatrix.yaml +//go:embed presets/minimal/bellatrix.yaml var minimalBellatrix []byte -//go:embed consensus-specs/presets/minimal/capella.yaml +//go:embed presets/minimal/capella.yaml var minimalCapella []byte -//go:embed consensus-specs/presets/minimal/deneb.yaml +//go:embed presets/minimal/deneb.yaml var minimalDeneb []byte -//go:embed consensus-specs/presets/minimal/electra.yaml +//go:embed presets/minimal/electra.yaml var minimalElectra []byte -//go:embed consensus-specs/presets/minimal/fulu.yaml +//go:embed presets/minimal/fulu.yaml var minimalFulu []byte var ( diff --git a/presets/mainnet/altair.yaml b/presets/mainnet/altair.yaml new file mode 100644 index 000000000..0d8c7a63f --- /dev/null +++ b/presets/mainnet/altair.yaml @@ -0,0 +1,24 @@ +# Mainnet preset - Altair + +# Rewards and penalties +# --------------------------------------------------------------- +# 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) participants +SYNC_COMMITTEE_SIZE: 512 +# 2**8 (= 256) epochs +EPOCHS_PER_SYNC_COMMITTEE_PERIOD: 256 + +# Sync protocol +# --------------------------------------------------------------- +# 2**0 (= 1) participants +MIN_SYNC_COMMITTEE_PARTICIPANTS: 1 +# SLOTS_PER_EPOCH * EPOCHS_PER_SYNC_COMMITTEE_PERIOD (= 32 * 256) epochs +UPDATE_TIMEOUT: 8192 diff --git a/presets/mainnet/bellatrix.yaml b/presets/mainnet/bellatrix.yaml new file mode 100644 index 000000000..268a0e75f --- /dev/null +++ b/presets/mainnet/bellatrix.yaml @@ -0,0 +1,21 @@ +# Mainnet preset - Bellatrix + +# Rewards and penalties +# --------------------------------------------------------------- +# 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) bytes +MAX_BYTES_PER_TRANSACTION: 1073741824 +# 2**20 (= 1,048,576) transactions +MAX_TRANSACTIONS_PER_PAYLOAD: 1048576 +# 2**8 (= 256) bytes +BYTES_PER_LOGS_BLOOM: 256 +# 2**5 (= 32) bytes +MAX_EXTRA_DATA_BYTES: 32 diff --git a/presets/mainnet/capella.yaml b/presets/mainnet/capella.yaml new file mode 100644 index 000000000..3cd83759d --- /dev/null +++ b/presets/mainnet/capella.yaml @@ -0,0 +1,16 @@ +# Mainnet preset - Capella + +# Max operations per block +# --------------------------------------------------------------- +# 2**4 (= 16) credential changes +MAX_BLS_TO_EXECUTION_CHANGES: 16 + +# Execution +# --------------------------------------------------------------- +# 2**4 (= 16) withdrawals +MAX_WITHDRAWALS_PER_PAYLOAD: 16 + +# Withdrawals processing +# --------------------------------------------------------------- +# 2**14 (= 16384) validators +MAX_VALIDATORS_PER_WITHDRAWALS_SWEEP: 16384 diff --git a/presets/mainnet/deneb.yaml b/presets/mainnet/deneb.yaml new file mode 100644 index 000000000..e5547612e --- /dev/null +++ b/presets/mainnet/deneb.yaml @@ -0,0 +1,16 @@ +# Mainnet preset - Deneb + +# Execution +# --------------------------------------------------------------- +# 2**12 (= 4,096) blob commitments +MAX_BLOB_COMMITMENTS_PER_BLOCK: 4096 + +# Networking +# --------------------------------------------------------------- +# 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 + +# Blob +# --------------------------------------------------------------- +# 2**12 (= 4,096) field elements +FIELD_ELEMENTS_PER_BLOB: 4096 diff --git a/presets/mainnet/electra.yaml b/presets/mainnet/electra.yaml new file mode 100644 index 000000000..55308d5b1 --- /dev/null +++ b/presets/mainnet/electra.yaml @@ -0,0 +1,50 @@ +# Mainnet preset - Electra + +# Gwei values +# --------------------------------------------------------------- +# 2**5 * 10**9 (= 32,000,000,000) Gwei +MIN_ACTIVATION_BALANCE: 32000000000 +# 2**11 * 10**9 (= 2,048,000,000,000) Gwei +MAX_EFFECTIVE_BALANCE_ELECTRA: 2048000000000 + +# Rewards and penalties +# --------------------------------------------------------------- +# 2**12 (= 4,096) +MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA: 4096 +# 2**12 (= 4,096) +WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA: 4096 + +# State list lengths +# --------------------------------------------------------------- +# 2**27 (= 134,217,728) pending deposits +PENDING_DEPOSITS_LIMIT: 134217728 +# 2**27 (= 134,217,728) pending partial withdrawals +PENDING_PARTIAL_WITHDRAWALS_LIMIT: 134217728 +# 2**18 (= 262,144) pending consolidations +PENDING_CONSOLIDATIONS_LIMIT: 262144 + +# Max operations per block +# --------------------------------------------------------------- +# 2**0 (= 1) attester slashings +MAX_ATTESTER_SLASHINGS_ELECTRA: 1 +# 2**3 (= 8) attestations +MAX_ATTESTATIONS_ELECTRA: 8 + +# Execution +# --------------------------------------------------------------- +# 2**13 (= 8,192) deposit requests +MAX_DEPOSIT_REQUESTS_PER_PAYLOAD: 8192 +# 2**4 (= 16) withdrawal requests +MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD: 16 +# 2**1 (= 2) consolidation requests +MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD: 2 + +# Withdrawals processing +# --------------------------------------------------------------- +# 2**3 (= 8) pending withdrawals +MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP: 8 + +# Pending deposits processing +# --------------------------------------------------------------- +# 2**4 (= 16) pending deposits +MAX_PENDING_DEPOSITS_PER_EPOCH: 16 diff --git a/presets/mainnet/fulu.yaml b/presets/mainnet/fulu.yaml new file mode 100644 index 000000000..82ab37ce2 --- /dev/null +++ b/presets/mainnet/fulu.yaml @@ -0,0 +1,13 @@ +# Mainnet preset - Fulu + +# Networking +# --------------------------------------------------------------- +# floorlog2(get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments') (= 4) +KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH: 4 + +# Blob +# --------------------------------------------------------------- +# 2**6 (= 64) +FIELD_ELEMENTS_PER_CELL: 64 +# 2**1 * FIELD_ELEMENTS_PER_BLOB (= 8,192) +FIELD_ELEMENTS_PER_EXT_BLOB: 8192 diff --git a/presets/mainnet/phase0.yaml b/presets/mainnet/phase0.yaml new file mode 100644 index 000000000..bb55e0cc6 --- /dev/null +++ b/presets/mainnet/phase0.yaml @@ -0,0 +1,83 @@ +# Mainnet preset - Phase0 + +# Misc +# --------------------------------------------------------------- +# 2**6 (= 64) committees +MAX_COMMITTEES_PER_SLOT: 64 +# 2**7 (= 128) committees +TARGET_COMMITTEE_SIZE: 128 +# 2**11 (= 2,048) validators +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 +# --------------------------------------------------------------- +# 2**0 (= 1) slots, 12 seconds +MIN_ATTESTATION_INCLUSION_DELAY: 1 +# 2**5 (= 32) slots, 6.4 minutes +SLOTS_PER_EPOCH: 32 +# 2**0 (= 1) epochs, 6.4 minutes +MIN_SEED_LOOKAHEAD: 1 +# 2**2 (= 4) epochs, 25.6 minutes +MAX_SEED_LOOKAHEAD: 4 +# 2**6 (= 64) epochs, ~6.8 hours +EPOCHS_PER_ETH1_VOTING_PERIOD: 64 +# 2**13 (= 8,192) slots, ~27 hours +SLOTS_PER_HISTORICAL_ROOT: 8192 +# 2**2 (= 4) epochs, 25.6 minutes +MIN_EPOCHS_TO_INACTIVITY_PENALTY: 4 + +# State list lengths +# --------------------------------------------------------------- +# 2**16 (= 65,536) epochs, ~0.8 years +EPOCHS_PER_HISTORICAL_VECTOR: 65536 +# 2**13 (= 8,192) epochs, ~36 days +EPOCHS_PER_SLASHINGS_VECTOR: 8192 +# 2**24 (= 16,777,216) historical roots, ~52,262 years +HISTORICAL_ROOTS_LIMIT: 16777216 +# 2**40 (= 1,099,511,627,776) validator spots +VALIDATOR_REGISTRY_LIMIT: 1099511627776 + +# Rewards and penalties +# --------------------------------------------------------------- +# 2**6 (= 64) +BASE_REWARD_FACTOR: 64 +# 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 Phase0 genesis) +MIN_SLASHING_PENALTY_QUOTIENT: 128 +# 1 (lower safety margin at Phase0 genesis) +PROPORTIONAL_SLASHING_MULTIPLIER: 1 + +# Max operations per block +# --------------------------------------------------------------- +# 2**4 (= 16) proposer slashings +MAX_PROPOSER_SLASHINGS: 16 +# 2**1 (= 2) attester slashings +MAX_ATTESTER_SLASHINGS: 2 +# 2**7 (= 128) attestations +MAX_ATTESTATIONS: 128 +# 2**4 (= 16) deposits +MAX_DEPOSITS: 16 +# 2**4 (= 16) voluntary exits +MAX_VOLUNTARY_EXITS: 16 diff --git a/presets/minimal/altair.yaml b/presets/minimal/altair.yaml new file mode 100644 index 000000000..cbb5d7eb1 --- /dev/null +++ b/presets/minimal/altair.yaml @@ -0,0 +1,24 @@ +# Minimal preset - Altair + +# Rewards and penalties +# --------------------------------------------------------------- +# 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 +# --------------------------------------------------------------- +# [customized] 2**5 (= 32) participants +SYNC_COMMITTEE_SIZE: 32 +# [customized] 2**3 (= 8) epochs +EPOCHS_PER_SYNC_COMMITTEE_PERIOD: 8 + +# Sync protocol +# --------------------------------------------------------------- +# 2**0 (= 1) participants +MIN_SYNC_COMMITTEE_PARTICIPANTS: 1 +# [customized] SLOTS_PER_EPOCH * EPOCHS_PER_SYNC_COMMITTEE_PERIOD (= 8 * 8) epochs +UPDATE_TIMEOUT: 64 diff --git a/presets/minimal/bellatrix.yaml b/presets/minimal/bellatrix.yaml new file mode 100644 index 000000000..79b5002e8 --- /dev/null +++ b/presets/minimal/bellatrix.yaml @@ -0,0 +1,21 @@ +# Minimal preset - Bellatrix + +# Rewards and penalties +# --------------------------------------------------------------- +# 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) bytes +MAX_BYTES_PER_TRANSACTION: 1073741824 +# 2**20 (= 1,048,576) transactions +MAX_TRANSACTIONS_PER_PAYLOAD: 1048576 +# 2**8 (= 256) bytes +BYTES_PER_LOGS_BLOOM: 256 +# 2**5 (= 32) bytes +MAX_EXTRA_DATA_BYTES: 32 diff --git a/presets/minimal/capella.yaml b/presets/minimal/capella.yaml new file mode 100644 index 000000000..979f4118c --- /dev/null +++ b/presets/minimal/capella.yaml @@ -0,0 +1,16 @@ +# Minimal preset - Capella + +# Max operations per block +# --------------------------------------------------------------- +# 2**4 (= 16) credential changes +MAX_BLS_TO_EXECUTION_CHANGES: 16 + +# Execution +# --------------------------------------------------------------- +# [customized] 2**2 (= 4) withdrawals +MAX_WITHDRAWALS_PER_PAYLOAD: 4 + +# Withdrawals processing +# --------------------------------------------------------------- +# [customized] 2**4 (= 16) validators +MAX_VALIDATORS_PER_WITHDRAWALS_SWEEP: 16 diff --git a/presets/minimal/deneb.yaml b/presets/minimal/deneb.yaml new file mode 100644 index 000000000..460d845b6 --- /dev/null +++ b/presets/minimal/deneb.yaml @@ -0,0 +1,16 @@ +# Minimal preset - Deneb + +# Execution +# --------------------------------------------------------------- +# [customized] 2**5 (= 32) blob commitments +MAX_BLOB_COMMITMENTS_PER_BLOCK: 32 + +# Networking +# --------------------------------------------------------------- +# [customized] floorlog2(get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments')) + 1 + ceillog2(MAX_BLOB_COMMITMENTS_PER_BLOCK) (= 4 + 1 + 5 = 10) +KZG_COMMITMENT_INCLUSION_PROOF_DEPTH: 10 + +# Blob +# --------------------------------------------------------------- +# 2**12 (= 4,096) field elements +FIELD_ELEMENTS_PER_BLOB: 4096 diff --git a/presets/minimal/electra.yaml b/presets/minimal/electra.yaml new file mode 100644 index 000000000..22e26e402 --- /dev/null +++ b/presets/minimal/electra.yaml @@ -0,0 +1,50 @@ +# Minimal preset - Electra + +# Gwei values +# --------------------------------------------------------------- +# 2**5 * 10**9 (= 32,000,000,000) Gwei +MIN_ACTIVATION_BALANCE: 32000000000 +# 2**11 * 10**9 (= 2,048,000,000,000) Gwei +MAX_EFFECTIVE_BALANCE_ELECTRA: 2048000000000 + +# Rewards and penalties +# --------------------------------------------------------------- +# 2**12 (= 4,096) +MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA: 4096 +# 2**12 (= 4,096) +WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA: 4096 + +# State list lengths +# --------------------------------------------------------------- +# 2**27 (= 134,217,728) pending deposits +PENDING_DEPOSITS_LIMIT: 134217728 +# [customized] 2**6 (= 64) pending partial withdrawals +PENDING_PARTIAL_WITHDRAWALS_LIMIT: 64 +# [customized] 2**6 (= 64) pending consolidations +PENDING_CONSOLIDATIONS_LIMIT: 64 + +# Max operations per block +# --------------------------------------------------------------- +# 2**0 (= 1) attester slashings +MAX_ATTESTER_SLASHINGS_ELECTRA: 1 +# 2**3 (= 8) attestations +MAX_ATTESTATIONS_ELECTRA: 8 + +# Execution +# --------------------------------------------------------------- +# 2**13 (= 8,192) deposit requests +MAX_DEPOSIT_REQUESTS_PER_PAYLOAD: 8192 +# 2**4 (= 16) withdrawal requests +MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD: 16 +# 2**1 (= 2) consolidation requests +MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD: 2 + +# Withdrawals processing +# --------------------------------------------------------------- +# 2**1 (= 2) pending withdrawals +MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP: 2 + +# Pending deposits processing +# --------------------------------------------------------------- +# 2**4 (= 16) pending deposits +MAX_PENDING_DEPOSITS_PER_EPOCH: 16 diff --git a/presets/minimal/fulu.yaml b/presets/minimal/fulu.yaml new file mode 100644 index 000000000..48b4d7a07 --- /dev/null +++ b/presets/minimal/fulu.yaml @@ -0,0 +1,13 @@ +# Minimal preset - Fulu + +# Networking +# --------------------------------------------------------------- +# floorlog2(get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments') (= 4) +KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH: 4 + +# Blob +# --------------------------------------------------------------- +# 2**6 (= 64) +FIELD_ELEMENTS_PER_CELL: 64 +# 2**1 * FIELD_ELEMENTS_PER_BLOB (= 8,192) +FIELD_ELEMENTS_PER_EXT_BLOB: 8192 diff --git a/presets/minimal/phase0.yaml b/presets/minimal/phase0.yaml new file mode 100644 index 000000000..a4c8a5c42 --- /dev/null +++ b/presets/minimal/phase0.yaml @@ -0,0 +1,83 @@ +# Minimal preset - Phase0 + +# Misc +# --------------------------------------------------------------- +# [customized] 2**2 (= 4) committees +MAX_COMMITTEES_PER_SLOT: 4 +# [customized] 2**2 (= 4) committees +TARGET_COMMITTEE_SIZE: 4 +# 2**11 (= 2,048) validators +MAX_VALIDATORS_PER_COMMITTEE: 2048 +# [customized] +SHUFFLE_ROUND_COUNT: 10 +# 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 +# --------------------------------------------------------------- +# 2**0 (= 1) slots, 6 seconds +MIN_ATTESTATION_INCLUSION_DELAY: 1 +# 2**5 (= 32) slots, 48 seconds +SLOTS_PER_EPOCH: 8 +# 2**0 (= 1) epochs, 48 seconds +MIN_SEED_LOOKAHEAD: 1 +# 2**2 (= 4) epochs, 3.2 minutes +MAX_SEED_LOOKAHEAD: 4 +# [customized] 2**2 (= 4) epochs, 3.2 minutes +EPOCHS_PER_ETH1_VOTING_PERIOD: 4 +# [customized] 2**6 (= 64) slots, 51.2 minutes +SLOTS_PER_HISTORICAL_ROOT: 64 +# 2**2 (= 4) epochs, 3.2 minutes +MIN_EPOCHS_TO_INACTIVITY_PENALTY: 4 + +# State list lengths +# --------------------------------------------------------------- +# [customized] 2**6 (= 64) epochs, 51.2 minutes +EPOCHS_PER_HISTORICAL_VECTOR: 64 +# [customized] 2**6 (= 64) epochs, 51.2 minutes +EPOCHS_PER_SLASHINGS_VECTOR: 64 +# 2**24 (= 16,777,216) historical roots, ~204 years +HISTORICAL_ROOTS_LIMIT: 16777216 +# 2**40 (= 1,099,511,627,776) validator spots +VALIDATOR_REGISTRY_LIMIT: 1099511627776 + +# Rewards and penalties +# --------------------------------------------------------------- +# 2**6 (= 64) +BASE_REWARD_FACTOR: 64 +# 2**9 (= 512) +WHISTLEBLOWER_REWARD_QUOTIENT: 512 +# 2**3 (= 8) +PROPOSER_REWARD_QUOTIENT: 8 +# [customized] 2**25 (= 33,554,432) +INACTIVITY_PENALTY_QUOTIENT: 33554432 +# [customized] 2**6 (= 64) +MIN_SLASHING_PENALTY_QUOTIENT: 64 +# [customized] 2 (lower safety margin than Phase0 genesis but different than mainnet config for testing) +PROPORTIONAL_SLASHING_MULTIPLIER: 2 + +# Max operations per block +# --------------------------------------------------------------- +# 2**4 (= 16) proposer slashings +MAX_PROPOSER_SLASHINGS: 16 +# 2**1 (= 2) attester slashings +MAX_ATTESTER_SLASHINGS: 2 +# 2**7 (= 128) attestations +MAX_ATTESTATIONS: 128 +# 2**4 (= 16) deposits +MAX_DEPOSITS: 16 +# 2**4 (= 16) voluntary exits +MAX_VOLUNTARY_EXITS: 16 From a44559b89c0cb51a8a49f0616b62d637dd56c30e Mon Sep 17 00:00:00 2001 From: jacob kaufmann Date: Tue, 3 Jun 2025 15:34:47 -0600 Subject: [PATCH 3/5] remove print statements from preset init func --- preset.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/preset.go b/preset.go index d73cbf925..b0d442412 100644 --- a/preset.go +++ b/preset.go @@ -1,7 +1,6 @@ package client import _ "embed" -import "fmt" import "log" import "gopkg.in/yaml.v3" @@ -111,7 +110,4 @@ func init() { if err != nil { log.Fatal(err) } - - fmt.Printf("minimal preset: %v\n", MinimalPreset) - fmt.Printf("mainnet preset: %v\n", MainnetPreset) } From 8497d0d452de114ae7cbdd92b2047f5e9770346c Mon Sep 17 00:00:00 2001 From: jacob kaufmann Date: Tue, 3 Jun 2025 15:37:09 -0600 Subject: [PATCH 4/5] remove fulu presets --- presets/mainnet/fulu.yaml | 13 ------------- presets/minimal/fulu.yaml | 13 ------------- 2 files changed, 26 deletions(-) delete mode 100644 presets/mainnet/fulu.yaml delete mode 100644 presets/minimal/fulu.yaml diff --git a/presets/mainnet/fulu.yaml b/presets/mainnet/fulu.yaml deleted file mode 100644 index 82ab37ce2..000000000 --- a/presets/mainnet/fulu.yaml +++ /dev/null @@ -1,13 +0,0 @@ -# Mainnet preset - Fulu - -# Networking -# --------------------------------------------------------------- -# floorlog2(get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments') (= 4) -KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH: 4 - -# Blob -# --------------------------------------------------------------- -# 2**6 (= 64) -FIELD_ELEMENTS_PER_CELL: 64 -# 2**1 * FIELD_ELEMENTS_PER_BLOB (= 8,192) -FIELD_ELEMENTS_PER_EXT_BLOB: 8192 diff --git a/presets/minimal/fulu.yaml b/presets/minimal/fulu.yaml deleted file mode 100644 index 48b4d7a07..000000000 --- a/presets/minimal/fulu.yaml +++ /dev/null @@ -1,13 +0,0 @@ -# Minimal preset - Fulu - -# Networking -# --------------------------------------------------------------- -# floorlog2(get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments') (= 4) -KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH: 4 - -# Blob -# --------------------------------------------------------------- -# 2**6 (= 64) -FIELD_ELEMENTS_PER_CELL: 64 -# 2**1 * FIELD_ELEMENTS_PER_BLOB (= 8,192) -FIELD_ELEMENTS_PER_EXT_BLOB: 8192 From d3fc44dd4cb6b1c469a04b5c9a4d852792485772 Mon Sep 17 00:00:00 2001 From: jacob kaufmann Date: Tue, 3 Jun 2025 15:51:36 -0600 Subject: [PATCH 5/5] fix: remove references to fulu presets --- preset.go | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/preset.go b/preset.go index b0d442412..966b1b840 100644 --- a/preset.go +++ b/preset.go @@ -23,9 +23,6 @@ var mainnetDeneb []byte //go:embed presets/mainnet/electra.yaml var mainnetElectra []byte -//go:embed presets/mainnet/fulu.yaml -var mainnetFulu []byte - //go:embed presets/minimal/phase0.yaml var minimalPhase0 []byte @@ -44,9 +41,6 @@ var minimalDeneb []byte //go:embed presets/minimal/electra.yaml var minimalElectra []byte -//go:embed presets/minimal/fulu.yaml -var minimalFulu []byte - var ( MainnetPreset map[string]interface{} MinimalPreset map[string]interface{} @@ -77,10 +71,6 @@ func init() { if err != nil { log.Fatal(err) } - err = yaml.Unmarshal(minimalFulu, &MinimalPreset) - if err != nil { - log.Fatal(err) - } err = yaml.Unmarshal(mainnetPhase0, &MainnetPreset) if err != nil { @@ -106,8 +96,4 @@ func init() { if err != nil { log.Fatal(err) } - err = yaml.Unmarshal(mainnetFulu, &MainnetPreset) - if err != nil { - log.Fatal(err) - } }