mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-10 03:31:20 +00:00
a069738c20
* update shared/params * update eth2-types deps * update protobufs * update shared/* * fix testutil/state * update beacon-chain/state * update beacon-chain/db * update tests * fix test * update beacon-chain/core * update beacon-chain/blockchain * update beacon-chain/cache * beacon-chain/forkchoice * update beacon-chain/operations * update beacon-chain/p2p * update beacon-chain/rpc * update sync/initial-sync * update deps * update deps * go fmt * update beacon-chain/sync * update endtoend/ * bazel build //beacon-chain - works w/o issues * update slasher code * udpate tools/ * update validator/ * update fastssz * fix build * fix test building * update tests * update ethereumapis deps * fix tests * update state/stategen * fix build * fix test * add FarFutureSlot * go imports * Radek's suggestions * Ivan's suggestions * type conversions * Nishant's suggestions * add more tests to rpc_send_request * fix test * clean up * fix conflicts Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com> Co-authored-by: nisdas <nishdas93@gmail.com>
56 lines
3.3 KiB
Go
56 lines
3.3 KiB
Go
package params
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/mohae/deepcopy"
|
|
"github.com/prysmaticlabs/eth2-types"
|
|
)
|
|
|
|
// NetworkConfig defines the spec based network parameters.
|
|
type NetworkConfig struct {
|
|
GossipMaxSize uint64 `yaml:"GOSSIP_MAX_SIZE"` // GossipMaxSize is the maximum allowed size of uncompressed gossip messages.
|
|
MaxChunkSize uint64 `yaml:"MAX_CHUNK_SIZE"` // MaxChunkSize is the the maximum allowed size of uncompressed req/resp chunked responses.
|
|
AttestationSubnetCount uint64 `yaml:"ATTESTATION_SUBNET_COUNT"` // AttestationSubnetCount is the number of attestation subnets used in the gossipsub protocol.
|
|
AttestationPropagationSlotRange types.Slot `yaml:"ATTESTATION_PROPAGATION_SLOT_RANGE"` // AttestationPropagationSlotRange is the maximum number of slots during which an attestation can be propagated.
|
|
MaxRequestBlocks uint64 `yaml:"MAX_REQUEST_BLOCKS"` // MaxRequestBlocks is the maximum number of blocks in a single request.
|
|
TtfbTimeout time.Duration `yaml:"TTFB_TIMEOUT"` // TtfbTimeout is the maximum time to wait for first byte of request response (time-to-first-byte).
|
|
RespTimeout time.Duration `yaml:"RESP_TIMEOUT"` // RespTimeout is the maximum time for complete response transfer.
|
|
MaximumGossipClockDisparity time.Duration `yaml:"MAXIMUM_GOSSIP_CLOCK_DISPARITY"` // MaximumGossipClockDisparity is the maximum milliseconds of clock disparity assumed between honest nodes.
|
|
MessageDomainInvalidSnappy [4]byte `yaml:"MESSAGE_DOMAIN_INVALID_SNAPPY"` // MessageDomainInvalidSnappy is the 4-byte domain for gossip message-id isolation of invalid snappy messages.
|
|
MessageDomainValidSnappy [4]byte `yaml:"MESSAGE_DOMAIN_VALID_SNAPPY"` // MessageDomainValidSnappy is the 4-byte domain for gossip message-id isolation of valid snappy messages.
|
|
|
|
// DiscoveryV5 Config
|
|
ETH2Key string // ETH2Key is the ENR key of the eth2 object in an enr.
|
|
AttSubnetKey string // AttSubnetKey is the ENR key of the subnet bitfield in the enr.
|
|
MinimumPeersInSubnet uint64 // MinimumPeersInSubnet is the required amount of peers that a node is to have its in subnet.
|
|
MinimumPeersInSubnetSearch uint64 // PeersInSubnetSearch is the required amount of peers that we need to be able to lookup in a subnet search.
|
|
|
|
// Chain Network Config
|
|
ContractDeploymentBlock uint64 // ContractDeploymentBlock is the eth1 block in which the deposit contract is deployed.
|
|
BootstrapNodes []string // BootstrapNodes are the addresses of the bootnodes.
|
|
}
|
|
|
|
var networkConfig = mainnetNetworkConfig
|
|
|
|
// BeaconNetworkConfig returns the current network config for
|
|
// the beacon chain.
|
|
func BeaconNetworkConfig() *NetworkConfig {
|
|
return networkConfig
|
|
}
|
|
|
|
// OverrideBeaconNetworkConfig will override the network
|
|
// config with the added argument.
|
|
func OverrideBeaconNetworkConfig(cfg *NetworkConfig) {
|
|
networkConfig = cfg.Copy()
|
|
}
|
|
|
|
// Copy returns Copy of the config object.
|
|
func (c *NetworkConfig) Copy() *NetworkConfig {
|
|
config, ok := deepcopy.Copy(*c).(NetworkConfig)
|
|
if !ok {
|
|
config = *networkConfig
|
|
}
|
|
return &config
|
|
}
|