mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-05 18:42:19 +00:00
b7606dcccb
* added networkConfig.go and mainnet config * added goerli and sepolia networkConfig * using map * renaming to poop * proper name * fixed a bunch of stuff Co-authored-by: giuliorebuffo <giuliorebuffo@system76-pc.localdomain>
134 lines
10 KiB
Go
134 lines
10 KiB
Go
package clparams
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type NetworkType int
|
|
|
|
var (
|
|
Mainnet NetworkType = 0
|
|
Goerli NetworkType = 1
|
|
Sepolia NetworkType = 2
|
|
)
|
|
|
|
var (
|
|
MainnetBootstrapNodes = []string{
|
|
// Teku team's bootnode
|
|
"enr:-KG4QOtcP9X1FbIMOe17QNMKqDxCpm14jcX5tiOE4_TyMrFqbmhPZHK_ZPG2Gxb1GE2xdtodOfx9-cgvNtxnRyHEmC0ghGV0aDKQ9aX9QgAAAAD__________4JpZIJ2NIJpcIQDE8KdiXNlY3AyNTZrMaEDhpehBDbZjM_L9ek699Y7vhUJ-eAdMyQW_Fil522Y0fODdGNwgiMog3VkcIIjKA",
|
|
"enr:-KG4QL-eqFoHy0cI31THvtZjpYUu_Jdw_MO7skQRJxY1g5HTN1A0epPCU6vi0gLGUgrzpU-ygeMSS8ewVxDpKfYmxMMGhGV0aDKQtTA_KgAAAAD__________4JpZIJ2NIJpcIQ2_DUbiXNlY3AyNTZrMaED8GJ2vzUqgL6-KD1xalo1CsmY4X1HaDnyl6Y_WayCo9GDdGNwgiMog3VkcIIjKA",
|
|
// Prylab team's bootnodes
|
|
"enr:-Ku4QImhMc1z8yCiNJ1TyUxdcfNucje3BGwEHzodEZUan8PherEo4sF7pPHPSIB1NNuSg5fZy7qFsjmUKs2ea1Whi0EBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpD1pf1CAAAAAP__________gmlkgnY0gmlwhBLf22SJc2VjcDI1NmsxoQOVphkDqal4QzPMksc5wnpuC3gvSC8AfbFOnZY_On34wIN1ZHCCIyg",
|
|
"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6uLCipsms6j-8BdsOJfTWAs7CLF9HJnVqFE728O-JYUDCxzKvRdeMqBSauHVCMdaCAVWHYXR0bmV0c4j__________4RldGgykIL0pysCABAghLYBAAAAAACCaWSCdjSCaXCEQWxOdolzZWNwMjU2azGhA7Qmod9fK86WidPOzLsn5_8QyzL7ZcJ1Reca7RnD54vuiHN5bmNuZXRzD4N0Y3CCIyiDdWRwgiMo",
|
|
"enr:-KG4QCIzJZTY_fs_2vqWEatJL9RrtnPwDCv-jRBuO5FQ2qBrfJubWOWazri6s9HsyZdu-fRUfEzkebhf1nvO42_FVzwDhGV0aDKQed8EKAAAECD__________4JpZIJ2NIJpcISHtbYziXNlY3AyNTZrMaED4m9AqVs6F32rSCGsjtYcsyfQE2K8nDiGmocUY_iq-TSDdGNwgiMog3VkcIIjKA",
|
|
}
|
|
|
|
SepoliaBootstrapNodes = []string{
|
|
// EF boot nodes
|
|
"enr:-Iq4QMCTfIMXnow27baRUb35Q8iiFHSIDBJh6hQM5Axohhf4b6Kr_cOCu0htQ5WvVqKvFgY28893DHAg8gnBAXsAVqmGAX53x8JggmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk",
|
|
"enr:-KG4QE5OIg5ThTjkzrlVF32WT_-XT14WeJtIz2zoTqLLjQhYAmJlnk4ItSoH41_2x0RX0wTFIe5GgjRzU2u7Q1fN4vADhGV0aDKQqP7o7pAAAHAyAAAAAAAAAIJpZIJ2NIJpcISlFsStiXNlY3AyNTZrMaEC-Rrd_bBZwhKpXzFCrStKp1q_HmGOewxY3KwM8ofAj_ODdGNwgiMog3VkcIIjKA",
|
|
// Teku boot node
|
|
"enr:-Ly4QFoZTWR8ulxGVsWydTNGdwEESueIdj-wB6UmmjUcm-AOPxnQi7wprzwcdo7-1jBW_JxELlUKJdJES8TDsbl1EdNlh2F0dG5ldHOI__78_v2bsV-EZXRoMpA2-lATkAAAcf__________gmlkgnY0gmlwhBLYJjGJc2VjcDI1NmsxoQI0gujXac9rMAb48NtMqtSTyHIeNYlpjkbYpWJw46PmYYhzeW5jbmV0cw-DdGNwgiMog3VkcIIjKA",
|
|
}
|
|
)
|
|
|
|
type NetworkConfig struct {
|
|
GossipMaxSize uint64 `json:"gossip_max_size"` // The maximum allowed size of uncompressed gossip messages.
|
|
MaxRequestBlocks uint64 `json:"max_request_blocks"` // Maximum number of blocks in a single request
|
|
MinEpochsForBlockRequests uint64 `json:"min_epochs_for_block_requests"` // The minimum epoch range over which a node must serve blocks
|
|
MaxChunkSize uint64 `json:"max_chunk_size"` // The maximum allowed size of uncompressed req/resp chunked responses.
|
|
AttestationSubnetCount uint64 `json:"attestation_subnet_count"` // The number of attestation subnets used in the gossipsub protocol.
|
|
TtfbTimeout time.Duration `json:"ttfbt_timeout"` // The maximum time to wait for first byte of request response (time-to-first-byte).
|
|
RespTimeout time.Duration `json:"resp_timeout"` // The maximum time for complete response transfer.
|
|
AttestationPropagationSlotRange uint64 `json:"attestation_propagation_slot_range"` // The maximum number of slots during which an attestation can be propagated.
|
|
MaximumGossipClockDisparity time.Duration `json:"maximum_gossip_clock_disparity"` // The maximum milliseconds of clock disparity assumed between honest nodes.
|
|
MessageDomainInvalidSnappy [4]byte `json:"message_domain_invalid_snappy"` // 4-byte domain for gossip message-id isolation of invalid snappy messages
|
|
MessageDomainValidSnappy [4]byte `json:"message_domain_valid_snappy"` // 4-byte domain for gossip message-id isolation of valid snappy messages
|
|
|
|
// DiscoveryV5 Config
|
|
Eth2key string // ETH2Key is the ENR key of the Ethereum consensus object in an enr.
|
|
AttSubnetKey string // AttSubnetKey is the ENR key of the subnet bitfield in the enr.
|
|
SyncCommsSubnetKey string // SyncCommsSubnetKey is the ENR key of the sync committee subnet bitfield in the enr.
|
|
MinimumPeersInSubnetSearch uint64 // PeersInSubnetSearch is the required amount of peers that we need to be able to lookup in a subnet search.
|
|
|
|
ContractDeploymentBlock uint64 // the eth1 block in which the deposit contract is deployed.
|
|
bootNodes []string
|
|
}
|
|
|
|
var NetworkConfigs map[NetworkType]NetworkConfig = map[NetworkType]NetworkConfig{
|
|
Mainnet: {
|
|
GossipMaxSize: 1 << 20, // 1 MiB
|
|
MaxChunkSize: 1 << 20, // 1 MiB
|
|
AttestationSubnetCount: 64,
|
|
AttestationPropagationSlotRange: 32,
|
|
MaxRequestBlocks: 1 << 10, // 1024
|
|
TtfbTimeout: 5 * time.Second,
|
|
RespTimeout: 10 * time.Second,
|
|
MaximumGossipClockDisparity: 500 * time.Millisecond,
|
|
MessageDomainInvalidSnappy: [4]byte{00, 00, 00, 00},
|
|
MessageDomainValidSnappy: [4]byte{01, 00, 00, 00},
|
|
Eth2key: "eth2",
|
|
AttSubnetKey: "attnets",
|
|
SyncCommsSubnetKey: "syncnets",
|
|
MinimumPeersInSubnetSearch: 20,
|
|
ContractDeploymentBlock: 11184524,
|
|
bootNodes: MainnetBootstrapNodes,
|
|
},
|
|
|
|
Sepolia: {
|
|
GossipMaxSize: 1 << 20, // 1 MiB
|
|
MaxChunkSize: 1 << 20, // 1 MiB
|
|
AttestationSubnetCount: 64,
|
|
AttestationPropagationSlotRange: 32,
|
|
MaxRequestBlocks: 1 << 10, // 1024
|
|
TtfbTimeout: 5 * time.Second,
|
|
RespTimeout: 10 * time.Second,
|
|
MaximumGossipClockDisparity: 500 * time.Millisecond,
|
|
MessageDomainInvalidSnappy: [4]byte{00, 00, 00, 00},
|
|
MessageDomainValidSnappy: [4]byte{01, 00, 00, 00},
|
|
Eth2key: "eth2",
|
|
AttSubnetKey: "attnets",
|
|
SyncCommsSubnetKey: "syncnets",
|
|
MinimumPeersInSubnetSearch: 20,
|
|
ContractDeploymentBlock: 1273020,
|
|
bootNodes: SepoliaBootstrapNodes,
|
|
},
|
|
|
|
Goerli: {
|
|
GossipMaxSize: 1 << 20, // 1 MiB
|
|
MaxChunkSize: 1 << 20, // 1 MiB
|
|
AttestationSubnetCount: 64,
|
|
AttestationPropagationSlotRange: 32,
|
|
MaxRequestBlocks: 1 << 10, // 1024
|
|
TtfbTimeout: 5 * time.Second,
|
|
RespTimeout: 10 * time.Second,
|
|
MaximumGossipClockDisparity: 500 * time.Millisecond,
|
|
MessageDomainInvalidSnappy: [4]byte{00, 00, 00, 00},
|
|
MessageDomainValidSnappy: [4]byte{01, 00, 00, 00},
|
|
Eth2key: "eth2",
|
|
AttSubnetKey: "attnets",
|
|
SyncCommsSubnetKey: "syncnets",
|
|
MinimumPeersInSubnetSearch: 20,
|
|
ContractDeploymentBlock: 4367322,
|
|
bootNodes: GoerliBootstrapNodes,
|
|
},
|
|
}
|