Skip to content

Commit

Permalink
Merge branch 'BEDS-1179/pectra-api'
Browse files Browse the repository at this point in the history
  • Loading branch information
remoterami committed Jan 31, 2025
1 parent 47b766b commit 06b7939
Show file tree
Hide file tree
Showing 27 changed files with 902 additions and 148 deletions.
5 changes: 2 additions & 3 deletions backend/cmd/exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"github.com/gobitfly/beaconchain/pkg/commons/version"
"github.com/gobitfly/beaconchain/pkg/exporter/modules"
"github.com/gobitfly/beaconchain/pkg/exporter/services"
"github.com/gobitfly/beaconchain/pkg/monitoring"
)

func Run() {
Expand Down Expand Up @@ -138,8 +137,8 @@ func Run() {
wg.Wait()

// enable light-weight db connection monitoring
monitoring.Init(false)
monitoring.Start()
// monitoring.Init(false)
// monitoring.Start()

if utils.Config.TieredCacheProvider != "redis" {
log.Fatal(fmt.Errorf("no cache provider set, please set TierdCacheProvider (example redis)"), "", 0)
Expand Down
23 changes: 13 additions & 10 deletions backend/cmd/misc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,13 @@ func Run() {
requires, ok := REQUIRES_LIST[opts.Command]
if !ok {
requires = misctypes.Requires{
Bigtable: true,
Redis: true,
ClNode: true,
ElNode: true,
UserDBs: true,
NetworkDBs: true,
Bigtable: true,
Redis: true,
ClNode: true,
ElNode: true,
UserDBs: true,
NetworkDBs: true,
ClickhouseDBs: false,
}
}

Expand Down Expand Up @@ -195,9 +196,11 @@ func Run() {
}

// clickhouse
db.ClickHouseWriter, db.ClickHouseReader = db.MustInitDB(&cfg.ClickHouse.WriterDatabase, &cfg.ClickHouse.ReaderDatabase, "clickhouse", "clickhouse")
defer db.ClickHouseReader.Close()
defer db.ClickHouseWriter.Close()
if requires.ClickhouseDBs {
db.ClickHouseWriter, db.ClickHouseReader = db.MustInitDB(&cfg.ClickHouse.WriterDatabase, &cfg.ClickHouse.ReaderDatabase, "clickhouse", "clickhouse")
defer db.ClickHouseReader.Close()
defer db.ClickHouseWriter.Close()
}

// Initialize the persistent redis client
if requires.Redis {
Expand Down Expand Up @@ -1142,7 +1145,7 @@ func debugBlocks(clClient *rpc.LighthouseClient) error {
} else if clBlock.ExecutionPayload.BlockNumber != i {
log.Warnf("clBlock.ExecutionPayload.BlockNumber != i: %v != %v", clBlock.ExecutionPayload.BlockNumber, i)
} else {
logFields["cl.txs"] = len(clBlock.ExecutionPayload.Transactions)
logFields["cl.txs"] = clBlock.ExecutionPayload.TransactionsCount
}

log.InfoWithFields(logFields, "debug block")
Expand Down
13 changes: 7 additions & 6 deletions backend/cmd/misc/misctypes/requires.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package misctypes

type Requires struct {
Bigtable bool
Redis bool
ClNode bool
ElNode bool
NetworkDBs bool
UserDBs bool
Bigtable bool
Redis bool
ClNode bool
ElNode bool
NetworkDBs bool
UserDBs bool
ClickhouseDBs bool
}
6 changes: 6 additions & 0 deletions backend/pkg/commons/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@ var GnosisChainYml string

//go:embed holesky.chain.yml
var HoleskyChainYml string

//go:embed mekong.chain.yml
var MekongChainYml string

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

# Genesis
# ---------------------------------------------------------------
# `2**14` (= 16,384)
MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: 100000
# 2024-Nov-05 03:59:00 PM UTC
MIN_GENESIS_TIME: 1730822340
GENESIS_FORK_VERSION: 0x10637624
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: 0x20637624
ALTAIR_FORK_EPOCH: 0
# Merge
BELLATRIX_FORK_VERSION: 0x30637624
BELLATRIX_FORK_EPOCH: 0
TERMINAL_TOTAL_DIFFICULTY: 0
TERMINAL_BLOCK_HASH: 0x0000000000000000000000000000000000000000000000000000000000000000
TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH: 18446744073709551615

# Capella
CAPELLA_FORK_VERSION: 0x40637624
CAPELLA_FORK_EPOCH: 0

# DENEB
DENEB_FORK_VERSION: 0x50637624
DENEB_FORK_EPOCH: 0

# Electra
ELECTRA_FORK_VERSION: 0x60637624
ELECTRA_FORK_EPOCH: 256

# Fulu
FULU_FORK_VERSION: 0x70000000
FULU_FORK_EPOCH: 99999

# EIP7594 - Peerdas
EIP7594_FORK_VERSION: 0x70000000
EIP7594_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: 30000000000
# 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: 7078815900
DEPOSIT_NETWORK_ID: 7078815900
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

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

# EIP7594
NUMBER_OF_COLUMNS: 128
MAX_CELLS_IN_EXTENDED_MATRIX: 768
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 128
MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384
SAMPLES_PER_SLOT: 8
CUSTODY_REQUIREMENT: 4

# [New in Electra:EIP7251]
MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 128000000000 # 2**7 * 10**9 (= 128,000,000,000)
MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 256000000000 # 2**8 * 10**9 (= 256,000,000,000)
Loading

0 comments on commit 06b7939

Please sign in to comment.