Skip to content

Commit

Permalink
fix: added pectra configs
Browse files Browse the repository at this point in the history
(cherry picked from commit a17f8f8)
(cherry picked from commit 2450ba3)
  • Loading branch information
remoterami committed Feb 28, 2025
1 parent 43f020b commit e2fe2c7
Show file tree
Hide file tree
Showing 7 changed files with 294 additions and 7 deletions.
10 changes: 10 additions & 0 deletions backend/pkg/api/data_access/networks.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,15 @@ func (d *DataAccessService) GetAllNetworks() ([]types.NetworkInfo, error) {
Name: "sepolia",
NotificationsName: "sepolia",
},
{
ChainId: 7088110746,
Name: "pectra-devnet-5",
NotificationsName: "pectra-devnet-5",
},
{
ChainId: 7072151312,
Name: "pectra-devnet-6",
NotificationsName: "pectra-devnet-6",
},
}, nil
}
3 changes: 3 additions & 0 deletions backend/pkg/commons/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ var MekongChainYml string

//go:embed pectra-devnet-5.chain.yml
var PectraDevnet5ChainYml string

//go:embed pectra-devnet-6.chain.yml
var PectraDevnet6ChainYml string
172 changes: 172 additions & 0 deletions backend/pkg/commons/config/pectra-devnet-6.chain.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
# Extends the mainnet preset
PRESET_BASE: mainnet
CONFIG_NAME: testnet # needs to exist because of Prysm. Otherwise it conflicts with mainnet genesis

# Genesis
# ---------------------------------------------------------------
# `2**14` (= 16,384)
MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: 71000
# 2025-Feb-03 05:30:00 PM UTC
MIN_GENESIS_TIME: 1738603800
GENESIS_FORK_VERSION: 0x10585557
GENESIS_DELAY: 60


# 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: 0x20585557
ALTAIR_FORK_EPOCH: 0
# Merge
BELLATRIX_FORK_VERSION: 0x30585557
BELLATRIX_FORK_EPOCH: 0
TERMINAL_TOTAL_DIFFICULTY: 0
TERMINAL_BLOCK_HASH: 0x0000000000000000000000000000000000000000000000000000000000000000
TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH: 18446744073709551615

# Capella
CAPELLA_FORK_VERSION: 0x40585557
CAPELLA_FORK_EPOCH: 0

# DENEB
DENEB_FORK_VERSION: 0x50585557
DENEB_FORK_EPOCH: 0

# Electra
ELECTRA_FORK_VERSION: 0x60585557
ELECTRA_FORK_EPOCH: 10

# Fulu
FULU_FORK_VERSION: 0x70585557
FULU_FORK_EPOCH: 999999

# EIP7732
EIP7732_FORK_VERSION: 0x80000000
EIP7732_FORK_EPOCH: 99999

# EIP7805
EIP7805_FORK_VERSION: 0x90000000
EIP7805_FORK_EPOCH: 99999

# Time parameters
# ---------------------------------------------------------------
# 12 seconds
SECONDS_PER_SLOT: 12
# 14 (estimate from Eth1 mainnet)
SECONDS_PER_ETH1_BLOCK: 12
# 2**8 (= 256) epochs ~27 hours
MIN_VALIDATOR_WITHDRAWABILITY_DELAY: 2
# 2**8 (= 256) epochs ~27 hours
SHARD_COMMITTEE_PERIOD: 256
# 2**11 (= 2,048) Eth1 blocks ~8 hours
ETH1_FOLLOW_DISTANCE: 2048

# 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**16 (= 65,536)
CHURN_LIMIT_QUOTIENT: 128
# [New in Deneb:EIP7514] 2**3 (= 8)
MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT: 8

# 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
# ---------------------------------------------------------------
DEPOSIT_CHAIN_ID: 7072151312
DEPOSIT_NETWORK_ID: 7072151312
DEPOSIT_CONTRACT_ADDRESS: 0x4242424242424242424242424242424242424242

# 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**12` (= 4096 epochs, ~18 days)
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 4096
# `6`
BLOB_SIDECAR_SUBNET_COUNT: 6
## `uint64(6)`
MAX_BLOBS_PER_BLOCK: 6

# Electra
# 2**7 * 10**9 (= 128,000,000,000)
MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 128000000000
# 2**8 * 10**9 (= 256,000,000,000)
MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 256000000000
# `9`
BLOB_SIDECAR_SUBNET_COUNT_ELECTRA: 9
# `uint64(6)`
TARGET_BLOBS_PER_BLOCK_ELECTRA: 6
# `uint64(9)`
MAX_BLOBS_PER_BLOCK_ELECTRA: 9
# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_ELECTRA
MAX_REQUEST_BLOB_SIDECARS_ELECTRA: 1152

# Whisk
# `Epoch(2**8)`
WHISK_EPOCHS_PER_SHUFFLING_PHASE: 256
# `Epoch(2)`
WHISK_PROPOSER_SELECTION_GAP: 2

# Fulu
NUMBER_OF_COLUMNS: 128
NUMBER_OF_CUSTODY_GROUPS: 128
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 128
MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384
SAMPLES_PER_SLOT: 8
CUSTODY_REQUIREMENT: 4
MAX_BLOBS_PER_BLOCK_FULU: 12
MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS: 4096

# EIP7732
MAX_REQUEST_PAYLOADS: 128
17 changes: 17 additions & 0 deletions backend/pkg/commons/types/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,21 @@ type ClChainConfig struct {
FieldElementsPerBlob uint64 `yaml:"FIELD_ELEMENTS_PER_BLOB"`
MaxBlobCommitmentsPerBlock uint64 `yaml:"MAX_BLOB_COMMITMENTS_PER_BLOCK"`
MaxBlobsPerBlock uint64 `yaml:"MAX_BLOBS_PER_BLOCK"`

// electra
// https://github.com/ethereum/consensus-specs/blob/dev/presets/mainnet/electra.yaml
MinActivationBalance uint64 `yaml:"MIN_ACTIVATION_BALANCE"`
MaxEffectiveBalanceElectra uint64 `yaml:"MAX_EFFECTIVE_BALANCE_ELECTRA"`
PendingDepositsLimit uint64 `yaml:"PENDING_DEPOSITS_LIMIT"`
PendingPartialWithdrawalsLimit uint64 `yaml:"PENDING_PARTIAL_WITHDRAWALS_LIMIT"`
PendingConsolidationsLimit uint64 `yaml:"PENDING_CONSOLIDATIONS_LIMIT"`
MinSlashingPenaltyQuotientElectra uint64 `yaml:"MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA"`
WhistleblowerRewardQuotientElectra uint64 `yaml:"WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA"`
MaxAttesterSlashingsElectra uint64 `yaml:"MAX_ATTESTER_SLASHINGS_ELECTRA"`
MaxAttestationsElectra uint64 `yaml:"MAX_ATTESTATIONS_ELECTRA"`
MaxConsolidationRequestsPerPayload uint64 `yaml:"MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD"`
MaxDepositRequestsPerPayload uint64 `yaml:"MAX_DEPOSIT_REQUESTS_PER_PAYLOAD"`
MaxWithdrawalRequestsPerPayload uint64 `yaml:"MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD"`
MaxPendingPartialsPerWithdrawalsSweep uint64 `yaml:"MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP"`
MaxPendingDepositsPerEpoch uint64 `yaml:"MAX_PENDING_DEPOSITS_PER_EPOCH"`
}
27 changes: 21 additions & 6 deletions backend/pkg/commons/utils/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ func ReadConfig(cfg *types.Config, path string) error {
cfg.Chain.GenesisTimestamp = 1638993340
case "holesky":
cfg.Chain.GenesisTimestamp = 1695902400
case "pectra-devnet-5":
cfg.Chain.GenesisTimestamp = 1737034260
case "pectra-devnet-6":
cfg.Chain.GenesisTimestamp = 1738603860
default:
return fmt.Errorf("tried to set known genesis-timestamp, but unknown chain-name")
}
Expand Down Expand Up @@ -319,6 +323,8 @@ func setELConfig(cfg *types.Config) error {
err = yaml.Unmarshal([]byte(config.MekongChainYml), &minimalCfg)
case "pectra-devnet-5":
err = yaml.Unmarshal([]byte(config.PectraDevnet5ChainYml), &minimalCfg)
case "pectra-devnet-6":
err = yaml.Unmarshal([]byte(config.PectraDevnet6ChainYml), &minimalCfg)
default:
return fmt.Errorf("tried to set known chain-config, but unknown chain-name: %v (path: %v)", cfg.Chain.Name, cfg.Chain.ElConfigPath)
}
Expand Down Expand Up @@ -352,6 +358,8 @@ func setELConfig(cfg *types.Config) error {
return nil
}

var MaxForkEpoch = uint64(18446744073709551615)

func setCLConfig(cfg *types.Config) error {
var err error
if cfg.Chain.ClConfigPath == "" {
Expand All @@ -369,6 +377,10 @@ func setCLConfig(cfg *types.Config) error {
err = yaml.Unmarshal([]byte(config.GnosisChainYml), &cfg.Chain.ClConfig)
case "holesky":
err = yaml.Unmarshal([]byte(config.HoleskyChainYml), &cfg.Chain.ClConfig)
case "pectra-devnet-5":
err = yaml.Unmarshal([]byte(config.PectraDevnet5ChainYml), &cfg.Chain.ClConfig)
case "pectra-devnet-6":
err = yaml.Unmarshal([]byte(config.PectraDevnet6ChainYml), &cfg.Chain.ClConfig)
default:
return fmt.Errorf("tried to set known chain-config, but unknown chain-name: %v (path: %v)", cfg.Chain.Name, cfg.Chain.ClConfigPath)
}
Expand All @@ -388,23 +400,25 @@ func setCLConfig(cfg *types.Config) error {
return err
}

maxForkEpoch := uint64(18446744073709551615)

if jr.Data.AltairForkEpoch == nil {
log.Warnf("AltairForkEpoch not set, defaulting to maxForkEpoch")
jr.Data.AltairForkEpoch = &maxForkEpoch
jr.Data.AltairForkEpoch = &MaxForkEpoch
}
if jr.Data.BellatrixForkEpoch == nil {
log.Warnf("BellatrixForkEpoch not set, defaulting to maxForkEpoch")
jr.Data.BellatrixForkEpoch = &maxForkEpoch
jr.Data.BellatrixForkEpoch = &MaxForkEpoch
}
if jr.Data.CapellaForkEpoch == nil {
log.Warnf("CapellaForkEpoch not set, defaulting to maxForkEpoch")
jr.Data.CapellaForkEpoch = &maxForkEpoch
jr.Data.CapellaForkEpoch = &MaxForkEpoch
}
if jr.Data.DenebForkEpoch == nil {
log.Warnf("DenebForkEpoch not set, defaulting to maxForkEpoch")
jr.Data.DenebForkEpoch = &maxForkEpoch
jr.Data.DenebForkEpoch = &MaxForkEpoch
}
if jr.Data.ElectraForkEpoch == nil {
log.Warnf("ElectraForkEpoch not set, defaulting to maxForkEpoch")
jr.Data.ElectraForkEpoch = &MaxForkEpoch
}

chainCfg := types.ClChainConfig{
Expand Down Expand Up @@ -490,6 +504,7 @@ func setCLConfig(cfg *types.Config) error {
MaxWithdrawalsPerPayload: uint64(jr.Data.MaxWithdrawalsPerPayload),
MaxValidatorsPerWithdrawalSweep: uint64(jr.Data.MaxValidatorsPerWithdrawalsSweep),
MaxBlsToExecutionChange: uint64(jr.Data.MaxBlsToExecutionChanges),
MaxEffectiveBalanceElectra: uint64(jr.Data.MaxEffectiveBalanceElectra),
}

cfg.Chain.ClConfig = chainCfg
Expand Down
15 changes: 15 additions & 0 deletions backend/pkg/consapi/types/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,19 @@ type StandardSpec struct {
MaxRequestBlobSidecars *uint64 `json:"MAX_REQUEST_BLOB_SIDECARS,string"`
MinEpochsForBlobSidecarsRequests *uint64 `json:"MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS,string"`
BlobSidecarSubnetCount *uint64 `json:"BLOB_SIDECAR_SUBNET_COUNT,string"`
// ELECTRA
MinActivationBalance int64 `json:"MIN_ACTIVATION_BALANCE,string"`
MaxEffectiveBalanceElectra int64 `json:"MAX_EFFECTIVE_BALANCE_ELECTRA,string"`
PendingDepositsLimit int64 `json:"PENDING_DEPOSITS_LIMIT,string"`
PendingPartialWithdrawalsLimit int64 `json:"PENDING_PARTIAL_WITHDRAWALS_LIMIT,string"`
PendingConsolidationsLimit int64 `json:"PENDING_CONSOLIDATIONS_LIMIT,string"`
MinSlashingPenaltyQuotientElectra int64 `json:"MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA,string"`
WhistleblowerRewardQuotientElectra int64 `json:"WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA,string"`
MaxAttesterSlashingsElectra int64 `json:"MAX_ATTESTER_SLASHINGS_ELECTRA,string"`
MaxAttestationsElectra int64 `json:"MAX_ATTESTATIONS_ELECTRA,string"`
MaxConsolidationRequestsPerPayload int64 `json:"MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD,string"`
MaxDepositRequestsPerPayload int64 `json:"MAX_DEPOSIT_REQUESTS_PER_PAYLOAD,string"`
MaxWithdrawalRequestsPerPayload int64 `json:"MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD,string"`
MaxPendingPartialsPerWithdrawalsSweep int64 `json:"MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP,string"`
MaxPendingDepositsPerEpoch int64 `json:"MAX_PENDING_DEPOSITS_PER_EPOCH,string"`
}
57 changes: 56 additions & 1 deletion frontend/types/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ const ChainIDs = {
Gnosis: 100,

Holesky: 17000,

Pectra_Devnet_5: 7088110746,
Pectra_Devnet_6: 7072151312,
Sepolia: 11155111,
} as const

Expand Down Expand Up @@ -151,6 +152,60 @@ export const ChainInfo: Record<ChainId, ChainInfoFields> = {
slotsPerEpoch: 32,
timeStampSlot0: 1695902400,
},
[ChainIDs.Pectra_Devnet_5]: {
clCurrency: 'ETH',
description: 'Devnet',
displayCurrencyDefault: {
consensusLayer: 'ETH',
executionLayer: 'ETH',
fiat: 'USD',
main: 'ETH',
},
hasRocketPool: false,
elCurrency: 'ETH',
family: ChainFamily.Ethereum,
mainCurrency: 'ETH',
mainNet: ChainIDs.Ethereum,
name: 'Ethereum Pectra Devnet 5',
nameParts: [
'Ethereum',
'Pectra',
'Devnet',
'5',
],
priority: 41,
secondsPerSlot: 12,
shortName: 'Pectra',
slotsPerEpoch: 32,
timeStampSlot0: 1737034260,
},
[ChainIDs.Pectra_Devnet_6]: {
clCurrency: 'ETH',
description: 'Devnet',
displayCurrencyDefault: {
consensusLayer: 'ETH',
executionLayer: 'ETH',
fiat: 'USD',
main: 'ETH',
},
hasRocketPool: false,
elCurrency: 'ETH',
family: ChainFamily.Ethereum,
mainCurrency: 'ETH',
mainNet: ChainIDs.Ethereum,
name: 'Ethereum Pectra Devnet 6',
nameParts: [
'Ethereum',
'Pectra',
'Devnet',
'6',
],
priority: 42,
secondsPerSlot: 12,
shortName: 'Pectra',
slotsPerEpoch: 32,
timeStampSlot0: 1738603860,
},
[ChainIDs.Sepolia]: {
clCurrency: 'ETH',
description: 'Testnet',
Expand Down

0 comments on commit e2fe2c7

Please sign in to comment.