/
mainnet_config.go
351 lines (312 loc) · 15.6 KB
/
mainnet_config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
package params
import (
"math"
"time"
fieldparams "github.com/prysmaticlabs/prysm/v5/config/fieldparams"
"github.com/prysmaticlabs/prysm/v5/encoding/bytesutil"
)
// MainnetConfig returns the configuration to be used in the main network.
func MainnetConfig() *BeaconChainConfig {
if mainnetBeaconConfig.ForkVersionSchedule == nil {
mainnetBeaconConfig.InitializeForkSchedule()
}
return mainnetBeaconConfig
}
const (
// Genesis Fork Epoch for the mainnet config.
genesisForkEpoch = 0
// Altair Fork Epoch for mainnet config.
mainnetAltairForkEpoch = 74240 // Oct 27, 2021, 10:56:23am UTC
// Bellatrix Fork Epoch for mainnet config.
mainnetBellatrixForkEpoch = 144896 // Sept 6, 2022, 11:34:47am UTC
// Capella Fork Epoch for mainnet config.
mainnetCapellaForkEpoch = 194048 // April 12, 2023, 22:27:35 UTC
// Deneb Fork Epoch for mainnet config.
mainnetDenebForkEpoch = 269568 // March 13, 2024, 13:55:35 UTC
// Electra Fork Epoch for mainnet config
mainnetElectraForkEpoch = math.MaxUint64 // Far future / to be defined
)
var mainnetNetworkConfig = &NetworkConfig{
ETH2Key: "eth2",
AttSubnetKey: "attnets",
SyncCommsSubnetKey: "syncnets",
MinimumPeersInSubnetSearch: 20,
ContractDeploymentBlock: 11184524, // Note: contract was deployed in block 11052984 but no transactions were sent until 11184524.
BootstrapNodes: []string{
// Teku team's bootnode
"enr:-KG4QNTx85fjxABbSq_Rta9wy56nQ1fHK0PewJbGjLm1M4bMGx5-3Qq4ZX2-iFJ0pys_O90sVXNNOxp2E7afBsGsBrgDhGV0aDKQu6TalgMAAAD__________4JpZIJ2NIJpcIQEnfA2iXNlY3AyNTZrMaECGXWQ-rQ2KZKRH1aOW4IlPDBkY4XDphxg9pxKytFCkayDdGNwgiMog3VkcIIjKA",
"enr:-KG4QF4B5WrlFcRhUU6dZETwY5ZzAXnA0vGC__L1Kdw602nDZwXSTs5RFXFIFUnbQJmhNGVU6OIX7KVrCSTODsz1tK4DhGV0aDKQu6TalgMAAAD__________4JpZIJ2NIJpcIQExNYEiXNlY3AyNTZrMaECQmM9vp7KhaXhI-nqL_R0ovULLCFSFTa9CPPSdb1zPX6DdGNwgiMog3VkcIIjKA",
// Prylab team's bootnodes
"enr:-Ku4QImhMc1z8yCiNJ1TyUxdcfNucje3BGwEHzodEZUan8PherEo4sF7pPHPSIB1NNuSg5fZy7qFsjmUKs2ea1Whi0EBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpD1pf1CAAAAAP__________gmlkgnY0gmlwhBLf22SJc2VjcDI1NmsxoQOVphkDqal4QzPMksc5wn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4QKWrXTpV9T78hNG6s8AM6IO4XH9kFT91uZtFg1GcsJ6dKovDOr1jtAAFPnS2lvNltkOGA9k29BUN7lFh_sjuc9QBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpC1MD8qAAAAAP__________gmlkgnY0gmlwhANAdd-Jc2VjcDI1NmsxoQLQa6ai7y9PMN5hpLe5HmiJSlYzMuzP7ZhwRiwHvqNXdoN0Y3CCI4yDdWRwgiOM",
},
}
var mainnetBeaconConfig = &BeaconChainConfig{
// Constants (Non-configurable)
FarFutureEpoch: math.MaxUint64,
FarFutureSlot: math.MaxUint64,
BaseRewardsPerEpoch: 4,
DepositContractTreeDepth: 32,
GenesisDelay: 604800, // 1 week.
// Misc constant.
TargetCommitteeSize: 128,
MaxValidatorsPerCommittee: 2048,
MaxCommitteesPerSlot: 64,
MinPerEpochChurnLimit: 4,
ChurnLimitQuotient: 1 << 16,
ShuffleRoundCount: 90,
MinGenesisActiveValidatorCount: 16384,
MinGenesisTime: 1606824000, // Dec 1, 2020, 12pm UTC.
TargetAggregatorsPerCommittee: 16,
HysteresisQuotient: 4,
HysteresisDownwardMultiplier: 1,
HysteresisUpwardMultiplier: 5,
// Gwei value constants.
MinDepositAmount: 1 * 1e9,
MaxEffectiveBalance: 32 * 1e9,
EjectionBalance: 16 * 1e9,
EffectiveBalanceIncrement: 1 * 1e9,
// Initial value constants.
BLSWithdrawalPrefixByte: byte(0),
ETH1AddressWithdrawalPrefixByte: byte(1),
CompoundingWithdrawalPrefixByte: byte(2),
ZeroHash: [32]byte{},
// Time parameter constants.
MinAttestationInclusionDelay: 1,
SecondsPerSlot: 12,
SlotsPerEpoch: 32,
SqrRootSlotsPerEpoch: 5,
MinSeedLookahead: 1,
MaxSeedLookahead: 4,
EpochsPerEth1VotingPeriod: 64,
SlotsPerHistoricalRoot: 8192,
MinValidatorWithdrawabilityDelay: 256,
ShardCommitteePeriod: 256,
MinEpochsToInactivityPenalty: 4,
Eth1FollowDistance: 2048,
// Fork choice algorithm constants.
ProposerScoreBoost: 40,
ReorgWeightThreshold: 20,
ReorgParentWeightThreshold: 160,
ReorgMaxEpochsSinceFinalization: 2,
IntervalsPerSlot: 3,
// Ethereum PoW parameters.
DepositChainID: 1, // Chain ID of eth1 mainnet.
DepositNetworkID: 1, // Network ID of eth1 mainnet.
DepositContractAddress: "0x00000000219ab540356cBB839Cbe05303d7705Fa",
// Validator params.
RandomSubnetsPerValidator: 1 << 0,
EpochsPerRandomSubnetSubscription: 1 << 8,
// While eth1 mainnet block times are closer to 13s, we must conform with other clients in
// order to vote on the correct eth1 blocks.
//
// Additional context: https://github.com/ethereum/consensus-specs/issues/2132
// Bug prompting this change: https://github.com/prysmaticlabs/prysm/issues/7856
// Future optimization: https://github.com/prysmaticlabs/prysm/issues/7739
SecondsPerETH1Block: 14,
// State list length constants.
EpochsPerHistoricalVector: 65536,
EpochsPerSlashingsVector: 8192,
HistoricalRootsLimit: 16777216,
ValidatorRegistryLimit: 1099511627776,
// Reward and penalty quotients constants.
BaseRewardFactor: 64,
WhistleBlowerRewardQuotient: 512,
ProposerRewardQuotient: 8,
InactivityPenaltyQuotient: 67108864,
MinSlashingPenaltyQuotient: 128,
ProportionalSlashingMultiplier: 1,
// Max operations per block constants.
MaxProposerSlashings: 16,
MaxAttesterSlashings: 2,
MaxAttesterSlashingsElectra: 1,
MaxAttestations: 128,
MaxAttestationsElectra: 8,
MaxDeposits: 16,
MaxVoluntaryExits: 16,
MaxWithdrawalsPerPayload: 16,
MaxBlsToExecutionChanges: 16,
MaxValidatorsPerWithdrawalsSweep: 16384,
// BLS domain values.
DomainBeaconProposer: bytesutil.Uint32ToBytes4(0x00000000),
DomainBeaconAttester: bytesutil.Uint32ToBytes4(0x01000000),
DomainRandao: bytesutil.Uint32ToBytes4(0x02000000),
DomainDeposit: bytesutil.Uint32ToBytes4(0x03000000),
DomainVoluntaryExit: bytesutil.Uint32ToBytes4(0x04000000),
DomainSelectionProof: bytesutil.Uint32ToBytes4(0x05000000),
DomainAggregateAndProof: bytesutil.Uint32ToBytes4(0x06000000),
DomainSyncCommittee: bytesutil.Uint32ToBytes4(0x07000000),
DomainSyncCommitteeSelectionProof: bytesutil.Uint32ToBytes4(0x08000000),
DomainContributionAndProof: bytesutil.Uint32ToBytes4(0x09000000),
DomainApplicationMask: bytesutil.Uint32ToBytes4(0x00000001),
DomainApplicationBuilder: bytesutil.Uint32ToBytes4(0x00000001),
DomainBLSToExecutionChange: bytesutil.Uint32ToBytes4(0x0A000000),
DomainConsolidation: bytesutil.Uint32ToBytes4(0x0B000000),
// Prysm constants.
GweiPerEth: 1000000000,
BLSSecretKeyLength: 32,
BLSPubkeyLength: 48,
DefaultBufferSize: 10000,
WithdrawalPrivkeyFileName: "/shardwithdrawalkey",
ValidatorPrivkeyFileName: "/validatorprivatekey",
RPCSyncCheck: 1,
EmptySignature: [96]byte{},
DefaultPageSize: 250,
MaxPeersToSync: 15,
SlotsPerArchivedPoint: 2048,
GenesisCountdownInterval: time.Minute,
ConfigName: MainnetName,
PresetBase: "mainnet",
BeaconStateFieldCount: 21,
BeaconStateAltairFieldCount: 24,
BeaconStateBellatrixFieldCount: 25,
BeaconStateCapellaFieldCount: 28,
BeaconStateDenebFieldCount: 28,
BeaconStateElectraFieldCount: 37,
// Slasher related values.
WeakSubjectivityPeriod: 54000,
PruneSlasherStoragePeriod: 10,
SlashingProtectionPruningEpochs: 512,
// Weak subjectivity values.
SafetyDecay: 10,
// Fork related values.
GenesisEpoch: genesisForkEpoch,
GenesisForkVersion: []byte{0, 0, 0, 0},
AltairForkVersion: []byte{1, 0, 0, 0},
AltairForkEpoch: mainnetAltairForkEpoch,
BellatrixForkVersion: []byte{2, 0, 0, 0},
BellatrixForkEpoch: mainnetBellatrixForkEpoch,
CapellaForkVersion: []byte{3, 0, 0, 0},
CapellaForkEpoch: mainnetCapellaForkEpoch,
DenebForkVersion: []byte{4, 0, 0, 0},
DenebForkEpoch: mainnetDenebForkEpoch,
ElectraForkVersion: []byte{5, 0, 0, 0},
ElectraForkEpoch: mainnetElectraForkEpoch,
// New values introduced in Altair hard fork 1.
// Participation flag indices.
TimelySourceFlagIndex: 0,
TimelyTargetFlagIndex: 1,
TimelyHeadFlagIndex: 2,
// Incentivization weight values.
TimelySourceWeight: 14,
TimelyTargetWeight: 26,
TimelyHeadWeight: 14,
SyncRewardWeight: 2,
ProposerWeight: 8,
WeightDenominator: 64,
// Validator related values.
TargetAggregatorsPerSyncSubcommittee: 16,
SyncCommitteeSubnetCount: 4,
// Misc values.
SyncCommitteeSize: 512,
InactivityScoreBias: 4,
InactivityScoreRecoveryRate: 16,
EpochsPerSyncCommitteePeriod: 256,
// Updated penalty values.
InactivityPenaltyQuotientAltair: 3 * 1 << 24, //50331648
MinSlashingPenaltyQuotientAltair: 64,
ProportionalSlashingMultiplierAltair: 2,
MinSlashingPenaltyQuotientBellatrix: 32,
ProportionalSlashingMultiplierBellatrix: 3,
InactivityPenaltyQuotientBellatrix: 1 << 24,
// Light client
MinSyncCommitteeParticipants: 1,
MaxRequestLightClientUpdates: 128,
// Bellatrix
TerminalBlockHashActivationEpoch: 18446744073709551615,
TerminalBlockHash: [32]byte{},
TerminalTotalDifficulty: "58750000000000000000000", // Estimated: Sept 15, 2022
EthBurnAddressHex: "0x0000000000000000000000000000000000000000",
DefaultBuilderGasLimit: uint64(30000000),
// Mevboost circuit breaker
MaxBuilderConsecutiveMissedSlots: 3,
MaxBuilderEpochMissedSlots: 5,
// Execution engine timeout value
ExecutionEngineTimeoutValue: 8, // 8 seconds default based on: https://github.com/ethereum/execution-apis/blob/main/src/engine/specification.md#core
// Subnet value
BlobsidecarSubnetCount: 6,
MaxPerEpochActivationChurnLimit: 8,
MinEpochsForBlobsSidecarsRequest: 4096,
MaxRequestBlobSidecars: 768,
MaxRequestBlocksDeneb: 128,
// Values related to electra
MaxRequestDataColumnSidecars: 16384,
DataColumnSidecarSubnetCount: 32,
MinPerEpochChurnLimitElectra: 128_000_000_000,
MaxPerEpochActivationExitChurnLimit: 256_000_000_000,
MaxEffectiveBalanceElectra: 2048_000_000_000,
MinSlashingPenaltyQuotientElectra: 4096,
WhistleBlowerRewardQuotientElectra: 4096,
PendingBalanceDepositLimit: 134_217_728,
PendingPartialWithdrawalsLimit: 134_217_728,
PendingConsolidationsLimit: 262_144,
MinActivationBalance: 32_000_000_000,
MaxConsolidations: 1,
MaxPendingPartialsPerWithdrawalsSweep: 8,
FullExitRequestAmount: 0,
MaxWithdrawalRequestsPerPayload: 16,
UnsetDepositReceiptsStartIndex: math.MaxUint64,
// Values related to networking parameters.
GossipMaxSize: 10 * 1 << 20, // 10 MiB
MaxChunkSize: 10 * 1 << 20, // 10 MiB
AttestationSubnetCount: 64,
AttestationPropagationSlotRange: 32,
MaxRequestBlocks: 1 << 10, // 1024
TtfbTimeout: 5,
RespTimeout: 10,
MaximumGossipClockDisparity: 500,
MessageDomainInvalidSnappy: [4]byte{00, 00, 00, 00},
MessageDomainValidSnappy: [4]byte{01, 00, 00, 00},
MinEpochsForBlockRequests: 33024, // MIN_VALIDATOR_WITHDRAWABILITY_DELAY + CHURN_LIMIT_QUOTIENT / 2 (= 33024, ~5 months)
EpochsPerSubnetSubscription: 256,
AttestationSubnetExtraBits: 0,
AttestationSubnetPrefixBits: 6,
SubnetsPerNode: 2,
NodeIdBits: 256,
// PeerDAS
NumberOfColumns: 128,
MaxCellsInExtendedMatrix: 768,
}
// MainnetTestConfig provides a version of the mainnet config that has a different name
// and a different fork choice schedule. This can be used in cases where we want to use config values
// that are consistent with mainnet, but won't conflict or cause the hard-coded genesis to be loaded.
func MainnetTestConfig() *BeaconChainConfig {
mn := MainnetConfig().Copy()
mn.ConfigName = MainnetTestName
FillTestVersions(mn, 128)
return mn
}
// FillTestVersions replaces the fork schedule in the given BeaconChainConfig with test values, using the given
// byte argument as the high byte (common across forks).
func FillTestVersions(c *BeaconChainConfig, b byte) {
c.GenesisForkVersion = make([]byte, fieldparams.VersionLength)
c.AltairForkVersion = make([]byte, fieldparams.VersionLength)
c.BellatrixForkVersion = make([]byte, fieldparams.VersionLength)
c.CapellaForkVersion = make([]byte, fieldparams.VersionLength)
c.DenebForkVersion = make([]byte, fieldparams.VersionLength)
c.ElectraForkVersion = make([]byte, fieldparams.VersionLength)
c.GenesisForkVersion[fieldparams.VersionLength-1] = b
c.AltairForkVersion[fieldparams.VersionLength-1] = b
c.BellatrixForkVersion[fieldparams.VersionLength-1] = b
c.CapellaForkVersion[fieldparams.VersionLength-1] = b
c.DenebForkVersion[fieldparams.VersionLength-1] = b
c.ElectraForkVersion[fieldparams.VersionLength-1] = b
c.GenesisForkVersion[0] = 0
c.AltairForkVersion[0] = 1
c.BellatrixForkVersion[0] = 2
c.CapellaForkVersion[0] = 3
c.DenebForkVersion[0] = 4
c.ElectraForkVersion[0] = 5
}