2020-06-27 00:20:24 +00:00
|
|
|
package params
|
|
|
|
|
2022-02-15 21:06:14 +00:00
|
|
|
const (
|
|
|
|
altairE2EForkEpoch = 6
|
|
|
|
bellatrixE2EForkEpoch = 8 //nolint:deadcode
|
|
|
|
)
|
2021-08-13 05:11:11 +00:00
|
|
|
|
2020-06-27 00:20:24 +00:00
|
|
|
// UseE2EConfig for beacon chain services.
|
|
|
|
func UseE2EConfig() {
|
|
|
|
beaconConfig = E2ETestConfig()
|
2020-07-27 04:48:36 +00:00
|
|
|
|
|
|
|
cfg := BeaconNetworkConfig().Copy()
|
|
|
|
OverrideBeaconNetworkConfig(cfg)
|
2020-06-27 00:20:24 +00:00
|
|
|
}
|
|
|
|
|
2022-02-02 19:13:52 +00:00
|
|
|
// UseE2EMainnetConfig for beacon chain services.
|
|
|
|
func UseE2EMainnetConfig() {
|
|
|
|
beaconConfig = E2EMainnetTestConfig()
|
|
|
|
|
|
|
|
cfg := BeaconNetworkConfig().Copy()
|
|
|
|
OverrideBeaconNetworkConfig(cfg)
|
|
|
|
}
|
|
|
|
|
2020-06-27 00:20:24 +00:00
|
|
|
// E2ETestConfig retrieves the configurations made specifically for E2E testing.
|
|
|
|
// Warning: This config is only for testing, it is not meant for use outside of E2E.
|
|
|
|
func E2ETestConfig() *BeaconChainConfig {
|
|
|
|
e2eConfig := MinimalSpecConfig()
|
|
|
|
|
|
|
|
// Misc.
|
|
|
|
e2eConfig.MinGenesisActiveValidatorCount = 256
|
2020-08-02 21:30:59 +00:00
|
|
|
e2eConfig.GenesisDelay = 10 // 10 seconds so E2E has enough time to process deposits and get started.
|
2021-09-15 22:04:13 +00:00
|
|
|
e2eConfig.ChurnLimitQuotient = 65536
|
2020-06-27 00:20:24 +00:00
|
|
|
|
|
|
|
// Time parameters.
|
2020-08-01 17:22:53 +00:00
|
|
|
e2eConfig.SecondsPerSlot = 10
|
|
|
|
e2eConfig.SlotsPerEpoch = 6
|
2021-08-09 16:35:46 +00:00
|
|
|
e2eConfig.SqrRootSlotsPerEpoch = 2
|
2020-06-27 00:20:24 +00:00
|
|
|
e2eConfig.SecondsPerETH1Block = 2
|
2022-04-19 07:53:02 +00:00
|
|
|
e2eConfig.Eth1FollowDistance = 8
|
2020-08-01 17:22:53 +00:00
|
|
|
e2eConfig.EpochsPerEth1VotingPeriod = 2
|
2020-06-27 00:20:24 +00:00
|
|
|
e2eConfig.ShardCommitteePeriod = 4
|
2020-08-01 17:22:53 +00:00
|
|
|
e2eConfig.MaxSeedLookahead = 1
|
|
|
|
|
2020-12-18 22:22:48 +00:00
|
|
|
// PoW parameters.
|
|
|
|
e2eConfig.DepositChainID = 1337 // Chain ID of eth1 dev net.
|
|
|
|
e2eConfig.DepositNetworkID = 1337 // Network ID of eth1 dev net.
|
|
|
|
|
2022-04-11 13:45:22 +00:00
|
|
|
// Fork Parameters.
|
2021-09-28 19:07:32 +00:00
|
|
|
e2eConfig.AltairForkEpoch = altairE2EForkEpoch
|
2022-04-05 14:02:46 +00:00
|
|
|
e2eConfig.BellatrixForkEpoch = bellatrixE2EForkEpoch
|
|
|
|
|
|
|
|
// Terminal Total Difficulty.
|
2022-04-19 07:53:02 +00:00
|
|
|
e2eConfig.TerminalTotalDifficulty = "616"
|
2021-08-13 05:11:11 +00:00
|
|
|
|
2020-08-30 16:39:53 +00:00
|
|
|
// Prysm constants.
|
2022-05-06 21:42:27 +00:00
|
|
|
e2eConfig.ConfigName = EndToEndName
|
2022-03-21 19:43:41 +00:00
|
|
|
e2eConfig.GenesisForkVersion = []byte{0, 0, 0, 253}
|
|
|
|
e2eConfig.AltairForkVersion = []byte{1, 0, 0, 253}
|
|
|
|
e2eConfig.BellatrixForkVersion = []byte{2, 0, 0, 253}
|
|
|
|
e2eConfig.ShardingForkVersion = []byte{3, 0, 0, 253}
|
2020-08-30 16:39:53 +00:00
|
|
|
|
2022-03-21 19:43:41 +00:00
|
|
|
e2eConfig.InitializeForkSchedule()
|
2020-06-27 00:20:24 +00:00
|
|
|
return e2eConfig
|
|
|
|
}
|
2022-02-02 19:13:52 +00:00
|
|
|
|
|
|
|
func E2EMainnetTestConfig() *BeaconChainConfig {
|
|
|
|
e2eConfig := MainnetConfig().Copy()
|
|
|
|
|
|
|
|
// Misc.
|
|
|
|
e2eConfig.MinGenesisActiveValidatorCount = 256
|
|
|
|
e2eConfig.GenesisDelay = 25 // 25 seconds so E2E has enough time to process deposits and get started.
|
|
|
|
e2eConfig.ChurnLimitQuotient = 65536
|
|
|
|
|
|
|
|
// Time parameters.
|
2022-02-03 13:14:26 +00:00
|
|
|
e2eConfig.SecondsPerSlot = 6
|
2022-02-02 19:13:52 +00:00
|
|
|
e2eConfig.SqrRootSlotsPerEpoch = 5
|
|
|
|
e2eConfig.SecondsPerETH1Block = 2
|
2022-04-19 07:53:02 +00:00
|
|
|
e2eConfig.Eth1FollowDistance = 8
|
2022-02-02 19:13:52 +00:00
|
|
|
e2eConfig.ShardCommitteePeriod = 4
|
|
|
|
|
|
|
|
// PoW parameters.
|
|
|
|
e2eConfig.DepositChainID = 1337 // Chain ID of eth1 dev net.
|
|
|
|
e2eConfig.DepositNetworkID = 1337 // Network ID of eth1 dev net.
|
|
|
|
|
|
|
|
// Altair Fork Parameters.
|
|
|
|
e2eConfig.AltairForkEpoch = altairE2EForkEpoch
|
2022-04-05 14:02:46 +00:00
|
|
|
e2eConfig.BellatrixForkEpoch = bellatrixE2EForkEpoch
|
|
|
|
|
|
|
|
// Terminal Total Difficulty.
|
2022-04-19 07:53:02 +00:00
|
|
|
e2eConfig.TerminalTotalDifficulty = "616"
|
2022-02-02 19:13:52 +00:00
|
|
|
|
|
|
|
// Prysm constants.
|
2022-05-06 21:42:27 +00:00
|
|
|
e2eConfig.ConfigName = EndToEndName
|
2022-03-21 19:43:41 +00:00
|
|
|
e2eConfig.GenesisForkVersion = []byte{0, 0, 0, 254}
|
|
|
|
e2eConfig.AltairForkVersion = []byte{1, 0, 0, 254}
|
|
|
|
e2eConfig.BellatrixForkVersion = []byte{2, 0, 0, 254}
|
|
|
|
e2eConfig.ShardingForkVersion = []byte{3, 0, 0, 254}
|
2022-02-02 19:13:52 +00:00
|
|
|
|
2022-03-21 19:43:41 +00:00
|
|
|
e2eConfig.InitializeForkSchedule()
|
2022-02-02 19:13:52 +00:00
|
|
|
return e2eConfig
|
|
|
|
}
|
|
|
|
|
|
|
|
// E2EMainnetConfigYaml returns the e2e config in yaml format.
|
|
|
|
func E2EMainnetConfigYaml() []byte {
|
2022-02-03 04:53:09 +00:00
|
|
|
return ConfigToYaml(E2EMainnetTestConfig())
|
2022-02-02 19:13:52 +00:00
|
|
|
}
|
2022-04-23 08:41:24 +00:00
|
|
|
|
|
|
|
// E2ETestConfigYaml returns the e2e config in yaml format.
|
|
|
|
func E2ETestConfigYaml() []byte {
|
|
|
|
return ConfigToYaml(E2ETestConfig())
|
|
|
|
}
|