github.com/prysmaticlabs/prysm@v1.4.4/shared/params/mainnet_config.go (about)

     1  package params
     2  
     3  import (
     4  	"time"
     5  
     6  	types "github.com/prysmaticlabs/eth2-types"
     7  	"github.com/prysmaticlabs/prysm/shared/bytesutil"
     8  )
     9  
    10  // MainnetConfig returns the configuration to be used in the main network.
    11  func MainnetConfig() *BeaconChainConfig {
    12  	return mainnetBeaconConfig
    13  }
    14  
    15  // UseMainnetConfig for beacon chain services.
    16  func UseMainnetConfig() {
    17  	beaconConfig = MainnetConfig()
    18  }
    19  
    20  var mainnetNetworkConfig = &NetworkConfig{
    21  	GossipMaxSize:                   1 << 20, // 1 MiB
    22  	MaxChunkSize:                    1 << 20, // 1 MiB
    23  	AttestationSubnetCount:          64,
    24  	AttestationPropagationSlotRange: 32,
    25  	MaxRequestBlocks:                1 << 10, // 1024
    26  	TtfbTimeout:                     5 * time.Second,
    27  	RespTimeout:                     10 * time.Second,
    28  	MaximumGossipClockDisparity:     500 * time.Millisecond,
    29  	MessageDomainInvalidSnappy:      [4]byte{00, 00, 00, 00},
    30  	MessageDomainValidSnappy:        [4]byte{01, 00, 00, 00},
    31  	ETH2Key:                         "eth2",
    32  	AttSubnetKey:                    "attnets",
    33  	MinimumPeersInSubnet:            4,
    34  	MinimumPeersInSubnetSearch:      20,
    35  	ContractDeploymentBlock:         11184524, // Note: contract was deployed in block 11052984 but no transactions were sent until 11184524.
    36  	BootstrapNodes: []string{
    37  		// Teku team's bootnode
    38  		"enr:-KG4QOtcP9X1FbIMOe17QNMKqDxCpm14jcX5tiOE4_TyMrFqbmhPZHK_ZPG2Gxb1GE2xdtodOfx9-cgvNtxnRyHEmC0ghGV0aDKQ9aX9QgAAAAD__________4JpZIJ2NIJpcIQDE8KdiXNlY3AyNTZrMaEDhpehBDbZjM_L9ek699Y7vhUJ-eAdMyQW_Fil522Y0fODdGNwgiMog3VkcIIjKA",
    39  		"enr:-KG4QDyytgmE4f7AnvW-ZaUOIi9i79qX4JwjRAiXBZCU65wOfBu-3Nb5I7b_Rmg3KCOcZM_C3y5pg7EBU5XGrcLTduQEhGV0aDKQ9aX9QgAAAAD__________4JpZIJ2NIJpcIQ2_DUbiXNlY3AyNTZrMaEDKnz_-ps3UUOfHWVYaskI5kWYO_vtYMGYCQRAR3gHDouDdGNwgiMog3VkcIIjKA",
    40  		// Prylab team's bootnodes
    41  		"enr:-Ku4QImhMc1z8yCiNJ1TyUxdcfNucje3BGwEHzodEZUan8PherEo4sF7pPHPSIB1NNuSg5fZy7qFsjmUKs2ea1Whi0EBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpD1pf1CAAAAAP__________gmlkgnY0gmlwhBLf22SJc2VjcDI1NmsxoQOVphkDqal4QzPMksc5wnpuC3gvSC8AfbFOnZY_On34wIN1ZHCCIyg",
    42  		"enr:-Ku4QP2xDnEtUXIjzJ_DhlCRN9SN99RYQPJL92TMlSv7U5C1YnYLjwOQHgZIUXw6c-BvRg2Yc2QsZxxoS_pPRVe0yK8Bh2F0dG5ldHOIAAAAAAAAAACEZXRoMpD1pf1CAAAAAP__________gmlkgnY0gmlwhBLf22SJc2VjcDI1NmsxoQMeFF5GrS7UZpAH2Ly84aLK-TyvH-dRo0JM1i8yygH50YN1ZHCCJxA",
    43  		"enr:-Ku4QPp9z1W4tAO8Ber_NQierYaOStqhDqQdOPY3bB3jDgkjcbk6YrEnVYIiCBbTxuar3CzS528d2iE7TdJsrL-dEKoBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpD1pf1CAAAAAP__________gmlkgnY0gmlwhBLf22SJc2VjcDI1NmsxoQMw5fqqkw2hHC4F5HZZDPsNmPdB1Gi8JPQK7pRc9XHh-oN1ZHCCKvg",
    44  		// Lighthouse team's bootnodes
    45  		"enr:-IS4QLkKqDMy_ExrpOEWa59NiClemOnor-krjp4qoeZwIw2QduPC-q7Kz4u1IOWf3DDbdxqQIgC4fejavBOuUPy-HE4BgmlkgnY0gmlwhCLzAHqJc2VjcDI1NmsxoQLQSJfEAHZApkm5edTCZ_4qps_1k_ub2CxHFxi-gr2JMIN1ZHCCIyg",
    46  		"enr:-IS4QDAyibHCzYZmIYZCjXwU9BqpotWmv2BsFlIq1V31BwDDMJPFEbox1ijT5c2Ou3kvieOKejxuaCqIcjxBjJ_3j_cBgmlkgnY0gmlwhAMaHiCJc2VjcDI1NmsxoQJIdpj_foZ02MXz4It8xKD7yUHTBx7lVFn3oeRP21KRV4N1ZHCCIyg",
    47  		// EF bootnodes
    48  		"enr:-Ku4QHqVeJ8PPICcWk1vSn_XcSkjOkNiTg6Fmii5j6vUQgvzMc9L1goFnLKgXqBJspJjIsB91LTOleFmyWWrFVATGngBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpC1MD8qAAAAAP__________gmlkgnY0gmlwhAMRHkWJc2VjcDI1NmsxoQKLVXFOhp2uX6jeT0DvvDpPcU8FWMjQdR4wMuORMhpX24N1ZHCCIyg",
    49  		"enr:-Ku4QG-2_Md3sZIAUebGYT6g0SMskIml77l6yR-M_JXc-UdNHCmHQeOiMLbylPejyJsdAPsTHJyjJB2sYGDLe0dn8uYBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpC1MD8qAAAAAP__________gmlkgnY0gmlwhBLY-NyJc2VjcDI1NmsxoQORcM6e19T1T9gi7jxEZjk_sjVLGFscUNqAY9obgZaxbIN1ZHCCIyg",
    50  		"enr:-Ku4QPn5eVhcoF1opaFEvg1b6JNFD2rqVkHQ8HApOKK61OIcIXD127bKWgAtbwI7pnxx6cDyk_nI88TrZKQaGMZj0q0Bh2F0dG5ldHOIAAAAAAAAAACEZXRoMpC1MD8qAAAAAP__________gmlkgnY0gmlwhDayLMaJc2VjcDI1NmsxoQK2sBOLGcUb4AwuYzFuAVCaNHA-dy24UuEKkeFNgCVCsIN1ZHCCIyg",
    51  		"enr:-Ku4QEWzdnVtXc2Q0ZVigfCGggOVB2Vc1ZCPEc6j21NIFLODSJbvNaef1g4PxhPwl_3kax86YPheFUSLXPRs98vvYsoBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpC1MD8qAAAAAP__________gmlkgnY0gmlwhDZBrP2Jc2VjcDI1NmsxoQM6jr8Rb1ktLEsVcKAPa08wCsKUmvoQ8khiOl_SLozf9IN1ZHCCIyg",
    52  	},
    53  }
    54  
    55  var mainnetBeaconConfig = &BeaconChainConfig{
    56  	// Constants (Non-configurable)
    57  	FarFutureEpoch:           1<<64 - 1,
    58  	FarFutureSlot:            1<<64 - 1,
    59  	BaseRewardsPerEpoch:      4,
    60  	DepositContractTreeDepth: 32,
    61  	GenesisDelay:             604800, // 1 week.
    62  
    63  	// Misc constant.
    64  	TargetCommitteeSize:            128,
    65  	MaxValidatorsPerCommittee:      2048,
    66  	MaxCommitteesPerSlot:           64,
    67  	MinPerEpochChurnLimit:          4,
    68  	ChurnLimitQuotient:             1 << 16,
    69  	ShuffleRoundCount:              90,
    70  	MinGenesisActiveValidatorCount: 16384,
    71  	MinGenesisTime:                 1606824000, // Dec 1, 2020, 12pm UTC.
    72  	TargetAggregatorsPerCommittee:  16,
    73  	HysteresisQuotient:             4,
    74  	HysteresisDownwardMultiplier:   1,
    75  	HysteresisUpwardMultiplier:     5,
    76  
    77  	// Gwei value constants.
    78  	MinDepositAmount:          1 * 1e9,
    79  	MaxEffectiveBalance:       32 * 1e9,
    80  	EjectionBalance:           16 * 1e9,
    81  	EffectiveBalanceIncrement: 1 * 1e9,
    82  
    83  	// Initial value constants.
    84  	BLSWithdrawalPrefixByte: byte(0),
    85  	ZeroHash:                [32]byte{},
    86  
    87  	// Time parameter constants.
    88  	MinAttestationInclusionDelay:     1,
    89  	SecondsPerSlot:                   12,
    90  	SlotsPerEpoch:                    32,
    91  	MinSeedLookahead:                 1,
    92  	MaxSeedLookahead:                 4,
    93  	EpochsPerEth1VotingPeriod:        64,
    94  	SlotsPerHistoricalRoot:           8192,
    95  	MinValidatorWithdrawabilityDelay: 256,
    96  	ShardCommitteePeriod:             256,
    97  	MinEpochsToInactivityPenalty:     4,
    98  	Eth1FollowDistance:               2048,
    99  	SafeSlotsToUpdateJustified:       8,
   100  
   101  	// Ethereum PoW parameters.
   102  	DepositChainID:         1, // Chain ID of eth1 mainnet.
   103  	DepositNetworkID:       1, // Network ID of eth1 mainnet.
   104  	DepositContractAddress: "0x00000000219ab540356cBB839Cbe05303d7705Fa",
   105  
   106  	// Validator params.
   107  	RandomSubnetsPerValidator:         1 << 0,
   108  	EpochsPerRandomSubnetSubscription: 1 << 8,
   109  
   110  	// While eth1 mainnet block times are closer to 13s, we must conform with other clients in
   111  	// order to vote on the correct eth1 blocks.
   112  	//
   113  	// Additional context: https://github.com/ethereum/eth2.0-specs/issues/2132
   114  	// Bug prompting this change: https://github.com/prysmaticlabs/prysm/issues/7856
   115  	// Future optimization: https://github.com/prysmaticlabs/prysm/issues/7739
   116  	SecondsPerETH1Block: 14,
   117  
   118  	// State list length constants.
   119  	EpochsPerHistoricalVector: 65536,
   120  	EpochsPerSlashingsVector:  8192,
   121  	HistoricalRootsLimit:      16777216,
   122  	ValidatorRegistryLimit:    1099511627776,
   123  
   124  	// Reward and penalty quotients constants.
   125  	BaseRewardFactor:               64,
   126  	WhistleBlowerRewardQuotient:    512,
   127  	ProposerRewardQuotient:         8,
   128  	InactivityPenaltyQuotient:      67108864,
   129  	MinSlashingPenaltyQuotient:     128,
   130  	ProportionalSlashingMultiplier: 1,
   131  
   132  	// Max operations per block constants.
   133  	MaxProposerSlashings: 16,
   134  	MaxAttesterSlashings: 2,
   135  	MaxAttestations:      128,
   136  	MaxDeposits:          16,
   137  	MaxVoluntaryExits:    16,
   138  
   139  	// BLS domain values.
   140  	DomainBeaconProposer:    bytesutil.ToBytes4(bytesutil.Bytes4(0)),
   141  	DomainBeaconAttester:    bytesutil.ToBytes4(bytesutil.Bytes4(1)),
   142  	DomainRandao:            bytesutil.ToBytes4(bytesutil.Bytes4(2)),
   143  	DomainDeposit:           bytesutil.ToBytes4(bytesutil.Bytes4(3)),
   144  	DomainVoluntaryExit:     bytesutil.ToBytes4(bytesutil.Bytes4(4)),
   145  	DomainSelectionProof:    bytesutil.ToBytes4(bytesutil.Bytes4(5)),
   146  	DomainAggregateAndProof: bytesutil.ToBytes4(bytesutil.Bytes4(6)),
   147  
   148  	// Prysm constants.
   149  	GweiPerEth:                1000000000,
   150  	BLSSecretKeyLength:        32,
   151  	BLSPubkeyLength:           48,
   152  	BLSSignatureLength:        96,
   153  	DefaultBufferSize:         10000,
   154  	WithdrawalPrivkeyFileName: "/shardwithdrawalkey",
   155  	ValidatorPrivkeyFileName:  "/validatorprivatekey",
   156  	RPCSyncCheck:              1,
   157  	EmptySignature:            [96]byte{},
   158  	DefaultPageSize:           250,
   159  	MaxPeersToSync:            15,
   160  	SlotsPerArchivedPoint:     2048,
   161  	GenesisCountdownInterval:  time.Minute,
   162  	ConfigName:                ConfigNames[Mainnet],
   163  	BeaconStateFieldCount:     21,
   164  
   165  	// Slasher related values.
   166  	WeakSubjectivityPeriod:          54000,
   167  	PruneSlasherStoragePeriod:       10,
   168  	SlashingProtectionPruningEpochs: 512,
   169  
   170  	// Weak subjectivity values.
   171  	SafetyDecay: 10,
   172  
   173  	// Fork related values.
   174  	GenesisForkVersion:  []byte{0, 0, 0, 0},
   175  	NextForkVersion:     []byte{0, 0, 0, 0}, // Set to GenesisForkVersion unless there is a scheduled fork
   176  	NextForkEpoch:       1<<64 - 1,          // Set to FarFutureEpoch unless there is a scheduled fork.
   177  	ForkVersionSchedule: map[types.Epoch][]byte{
   178  		// Any further forks must be specified here by their epoch number.
   179  	},
   180  }