Add bopsten config and cli flag (#10700)

* Add bopsten config and cli flag

* Rename : )

* Update genesis time

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
terencechain
2022-05-18 12:29:24 -07:00
committed by GitHub
parent 03d44d7bfe
commit 0d2696ed4e
8 changed files with 67 additions and 0 deletions

View File

@@ -29,6 +29,7 @@ var Commands = &cli.Command{
flags.DeletePublicKeysFlag,
features.Mainnet,
features.PraterTestnet,
features.RopstenTestnet,
cmd.AcceptTosFlag,
}),
Before: func(cliCtx *cli.Context) error {
@@ -65,6 +66,7 @@ var Commands = &cli.Command{
flags.GrpcRetryDelayFlag,
features.Mainnet,
features.PraterTestnet,
features.RopstenTestnet,
cmd.AcceptTosFlag,
}),
Before: func(cliCtx *cli.Context) error {
@@ -98,6 +100,7 @@ var Commands = &cli.Command{
flags.BackupPasswordFile,
features.Mainnet,
features.PraterTestnet,
features.RopstenTestnet,
cmd.AcceptTosFlag,
}),
Before: func(cliCtx *cli.Context) error {
@@ -125,6 +128,7 @@ var Commands = &cli.Command{
flags.ImportPrivateKeyFileFlag,
features.Mainnet,
features.PraterTestnet,
features.RopstenTestnet,
cmd.AcceptTosFlag,
}),
Before: func(cliCtx *cli.Context) error {
@@ -158,6 +162,7 @@ var Commands = &cli.Command{
flags.ExitAllFlag,
features.Mainnet,
features.PraterTestnet,
features.RopstenTestnet,
cmd.AcceptTosFlag,
}),
Before: func(cliCtx *cli.Context) error {

View File

@@ -23,6 +23,7 @@ var Commands = &cli.Command{
flags.SlashingProtectionExportDirFlag,
features.Mainnet,
features.PraterTestnet,
features.RopstenTestnet,
cmd.AcceptTosFlag,
}),
Before: func(cliCtx *cli.Context) error {
@@ -47,6 +48,7 @@ var Commands = &cli.Command{
flags.SlashingProtectionJSONFileFlag,
features.Mainnet,
features.PraterTestnet,
features.RopstenTestnet,
cmd.AcceptTosFlag,
}),
Before: func(cliCtx *cli.Context) error {

View File

@@ -35,6 +35,7 @@ var Commands = &cli.Command{
flags.SkipMnemonic25thWordCheckFlag,
features.Mainnet,
features.PraterTestnet,
features.RopstenTestnet,
cmd.AcceptTosFlag,
}),
Before: func(cliCtx *cli.Context) error {
@@ -64,6 +65,7 @@ var Commands = &cli.Command{
flags.RemoteSignerCACertPathFlag,
features.Mainnet,
features.PraterTestnet,
features.RopstenTestnet,
cmd.AcceptTosFlag,
}),
Before: func(cliCtx *cli.Context) error {
@@ -92,6 +94,7 @@ var Commands = &cli.Command{
flags.SkipMnemonic25thWordCheckFlag,
features.Mainnet,
features.PraterTestnet,
features.RopstenTestnet,
cmd.AcceptTosFlag,
}),
Before: func(cliCtx *cli.Context) error {

View File

@@ -115,6 +115,10 @@ func configureTestnet(ctx *cli.Context) {
log.Warn("Running on the Prater Testnet")
params.UsePraterConfig()
params.UsePraterNetworkConfig()
} else if ctx.Bool(RopstenTestnet.Name) {
log.Warn("Running on the Ropsten Beacon Chain Testnet")
params.UseRopstenConfig()
params.UseRopstenNetworkConfig()
} else {
log.Warn("Running on Ethereum Consensus Mainnet")
params.UseMainnetConfig()

View File

@@ -12,6 +12,11 @@ var (
Name: "prater",
Usage: "Run Prysm configured for the Prater test network",
}
// RopstenTestnet flag for the multiclient Ethereum consensus testnet.
RopstenTestnet = &cli.BoolFlag{
Name: "ropsten",
Usage: "Run Prysm configured for the Ropsten beacon chain test network",
}
// Mainnet flag for easier tooling, no-op
Mainnet = &cli.BoolFlag{
Value: true,
@@ -128,6 +133,7 @@ var ValidatorFlags = append(deprecatedFlags, []cli.Flag{
enableExternalSlasherProtectionFlag,
disableAttestingHistoryDBCache,
PraterTestnet,
RopstenTestnet,
Mainnet,
dynamicKeyReloadDebounceInterval,
attestTimely,
@@ -146,6 +152,7 @@ var BeaconChainFlags = append(deprecatedFlags, []cli.Flag{
writeSSZStateTransitionsFlag,
disableGRPCConnectionLogging,
PraterTestnet,
RopstenTestnet,
Mainnet,
enablePeerScorer,
enableLargerGossipHistory,

View File

@@ -14,6 +14,7 @@ go_library(
"registry.go",
"testnet_e2e_config.go",
"testnet_prater_config.go",
"testnet_ropsten_config.go",
"testutils.go",
"values.go",
],

View File

@@ -0,0 +1,44 @@
package params
import (
eth1Params "github.com/ethereum/go-ethereum/params"
)
// UseRopstenNetworkConfig uses the Ropsten beacon chain specific network config.
func UseRopstenNetworkConfig() {
cfg := BeaconNetworkConfig().Copy()
cfg.ContractDeploymentBlock = 12269949
cfg.BootstrapNodes = []string{
// EF boot node
"enr:-Iq4QMCTfIMXnow27baRUb35Q8iiFHSIDBJh6hQM5Axohhf4b6Kr_cOCu0htQ5WvVqKvFgY28893DHAg8gnBAXsAVqmGAX53x8JggmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk",
// Teku boot node
"enr:-KG4QMJSJ7DHk6v2p-W8zQ3Xv7FfssZ_1E3p2eY6kN13staMObUonAurqyWhODoeY6edXtV8e9eL9RnhgZ9va2SMDRQMhGV0aDKQS-iVMYAAAHD0AQAAAAAAAIJpZIJ2NIJpcIQDhAAhiXNlY3AyNTZrMaEDXBVUZhhmdy1MYor1eGdRJ4vHYghFKDgjyHgt6sJ-IlCDdGNwgiMog3VkcIIjKA",
}
OverrideBeaconNetworkConfig(cfg)
}
// UseRopstenConfig sets the main beacon chain config for Ropsten beacon chain.
func UseRopstenConfig() {
beaconConfig = RopstenConfig()
}
// RopstenConfig defines the config for the Ropsten beacon chain testnet.
func RopstenConfig() *BeaconChainConfig {
cfg := MainnetConfig().Copy()
cfg.MinGenesisTime = 1653318000
cfg.GenesisDelay = 604800
cfg.MinGenesisActiveValidatorCount = 100000
cfg.ConfigName = RopstenName
cfg.GenesisForkVersion = []byte{0x80, 0x00, 0x00, 0x69}
cfg.SecondsPerETH1Block = 14
cfg.DepositChainID = eth1Params.RopstenChainConfig.ChainID.Uint64()
cfg.DepositNetworkID = eth1Params.RopstenChainConfig.ChainID.Uint64()
cfg.AltairForkEpoch = 500
cfg.AltairForkVersion = []byte{0x80, 0x00, 0x00, 0x70}
cfg.BellatrixForkEpoch = 750
cfg.BellatrixForkVersion = []byte{0x80, 0x00, 0x00, 0x71}
cfg.TerminalTotalDifficulty = "43531756765713534"
cfg.DepositContractAddress = "0x6f22fFbC56eFF051aECF839396DD1eD9aD6BBA9D"
cfg.InitializeForkSchedule()
return cfg
}

View File

@@ -14,6 +14,7 @@ const (
MainnetName = "mainnet"
MinimalName = "minimal"
PraterName = "prater"
RopstenName = "ropsten"
)
// KnownConfigs provides an index of all known BeaconChainConfig values.