Add Zinken config (#7391)

This commit is contained in:
terence tsao
2020-09-30 11:19:05 -07:00
committed by GitHub
parent db92d90309
commit e07b71b81d
6 changed files with 72 additions and 4 deletions

View File

@@ -33,9 +33,10 @@ type Flags struct {
// State locks
NewBeaconStateLocks bool // NewStateLocks for updated beacon state locking.
// Testnet Flags.
AltonaTestnet bool // AltonaTestnet defines the flag through which we can enable the node to run on the altona testnet.
OnyxTestnet bool // OnyxTestnet defines the flag through which we can enable the node to run on the onyx testnet.
SpadinaTestnet bool // Spadina defines the flag through which we can enable the node to run on the spadina testnet.
AltonaTestnet bool // AltonaTestnet defines the flag through which we can enable the node to run on the Altona testnet.
OnyxTestnet bool // OnyxTestnet defines the flag through which we can enable the node to run on the Onyx testnet.
SpadinaTestnet bool // SpadinaTestnet defines the flag through which we can enable the node to run on the Spadina testnet.
ZinkenTestnet bool // ZinkenTestnet defines the flag through which we can enable the node to run on the Zinken testnet.
// Feature related flags.
WriteSSZStateTransitions bool // WriteSSZStateTransitions to tmp directory.
@@ -142,6 +143,12 @@ func ConfigureBeaconChain(ctx *cli.Context) {
params.UseSpadinaNetworkConfig()
cfg.SpadinaTestnet = true
}
if ctx.Bool(ZinkenTestnet.Name) {
log.Warn("Running Node on Zinken Testnet")
params.UseZinkenConfig()
params.UseZinkenNetworkConfig()
cfg.ZinkenTestnet = true
}
if ctx.Bool(writeSSZStateTransitionsFlag.Name) {
log.Warn("Writing SSZ states and blocks after state transitions")
cfg.WriteSSZStateTransitions = true
@@ -299,6 +306,12 @@ func ConfigureSlasher(ctx *cli.Context) {
params.UseSpadinaNetworkConfig()
cfg.SpadinaTestnet = true
}
if ctx.Bool(ZinkenTestnet.Name) {
log.Warn("Running Node on Zinken Testnet")
params.UseZinkenConfig()
params.UseZinkenNetworkConfig()
cfg.ZinkenTestnet = true
}
if ctx.Bool(disableLookbackFlag.Name) {
log.Warn("Disabling slasher lookback")
cfg.DisableLookback = true
@@ -332,6 +345,12 @@ func ConfigureValidator(ctx *cli.Context) {
params.UseSpadinaNetworkConfig()
cfg.SpadinaTestnet = true
}
if ctx.Bool(ZinkenTestnet.Name) {
log.Warn("Running Node on Zinken Testnet")
params.UseZinkenConfig()
params.UseZinkenNetworkConfig()
cfg.ZinkenTestnet = true
}
if ctx.Bool(enableLocalProtectionFlag.Name) {
cfg.LocalProtection = true
} else {

View File

@@ -15,11 +15,16 @@ var (
Name: "onyx",
Usage: "This defines the flag through which we can run on the Onyx Prysm Testnet",
}
// SpadinaTestnet flag for the multiclient eth2 devnet.
// SpadinaTestnet flag for the multiclient eth2 testnet.
SpadinaTestnet = &cli.BoolFlag{
Name: "spadina",
Usage: "This defines the flag through which we can run on the Spadina Multiclient Testnet",
}
// ZinkenTestnet flag for the multiclient eth2 testnet.
ZinkenTestnet = &cli.BoolFlag{
Name: "zinken",
Usage: "This defines the flag through which we can run on the Zinken Multiclient Testnet",
}
devModeFlag = &cli.BoolFlag{
Name: "dev",
Usage: "Enable experimental features still in development. These features may not be stable.",
@@ -653,6 +658,7 @@ var ValidatorFlags = append(deprecatedFlags, []cli.Flag{
AltonaTestnet,
OnyxTestnet,
SpadinaTestnet,
ZinkenTestnet,
disableAccountsV2,
enableBlst,
}...)
@@ -697,6 +703,7 @@ var BeaconChainFlags = append(deprecatedFlags, []cli.Flag{
AltonaTestnet,
OnyxTestnet,
SpadinaTestnet,
ZinkenTestnet,
disableBatchBlockVerify,
initSyncVerbose,
disableFinalizedDepositsCache,

View File

@@ -15,6 +15,7 @@ go_library(
"testnet_medalla_config.go",
"testnet_onyx_config.go",
"testnet_spadina_config.go",
"testnet_zinken_config.go",
"testutils.go",
],
importpath = "github.com/prysmaticlabs/prysm/shared/params",

View File

@@ -0,0 +1,32 @@
package params
// UseZinkenNetworkConfig uses the Zinken specific
// network config.
func UseZinkenNetworkConfig() {
cfg := BeaconNetworkConfig().Copy()
cfg.ContractDeploymentBlock = 3384340
cfg.ChainID = 5
cfg.NetworkID = 5
cfg.DepositContractAddress = "0x99F0Ec06548b086E46Cb0019C78D0b9b9F36cD53"
// TODO(7390): Add Zinken bootnodes.
cfg.BootstrapNodes = []string{}
OverrideBeaconNetworkConfig(cfg)
}
// UseZinkenConfig sets the main beacon chain
// config for Zinken.
func UseZinkenConfig() {
beaconConfig = ZinkenConfig()
}
// ZinkenConfig defines the config for the
// Zinken testnet.
func ZinkenConfig() *BeaconChainConfig {
cfg := MainnetConfig().Copy()
cfg.MinGenesisTime = 1601899200
cfg.GenesisDelay = 345600
cfg.GenesisForkVersion = []byte{0x00, 0x00, 0x00, 0x03}
cfg.NetworkName = "zinken"
cfg.MinGenesisActiveValidatorCount = 1024
return cfg
}

View File

@@ -30,6 +30,7 @@ this command outputs a deposit data string which is required to become a validat
featureconfig.AltonaTestnet,
featureconfig.OnyxTestnet,
featureconfig.SpadinaTestnet,
featureconfig.ZinkenTestnet,
},
Action: func(cliCtx *cli.Context) error {
featureconfig.ConfigureValidator(cliCtx)
@@ -50,6 +51,7 @@ this command outputs a deposit data string which is required to become a validat
featureconfig.AltonaTestnet,
featureconfig.OnyxTestnet,
featureconfig.SpadinaTestnet,
featureconfig.ZinkenTestnet,
},
Action: func(cliCtx *cli.Context) error {
featureconfig.ConfigureValidator(cliCtx)
@@ -69,6 +71,7 @@ this command outputs a deposit data string which is required to become a validat
featureconfig.AltonaTestnet,
featureconfig.OnyxTestnet,
featureconfig.SpadinaTestnet,
featureconfig.ZinkenTestnet,
flags.DeprecatedPasswordsDirFlag,
},
Action: func(cliCtx *cli.Context) error {
@@ -94,6 +97,7 @@ this command outputs a deposit data string which is required to become a validat
featureconfig.AltonaTestnet,
featureconfig.OnyxTestnet,
featureconfig.SpadinaTestnet,
featureconfig.ZinkenTestnet,
},
Action: func(cliCtx *cli.Context) error {
featureconfig.ConfigureValidator(cliCtx)
@@ -115,6 +119,7 @@ this command outputs a deposit data string which is required to become a validat
featureconfig.AltonaTestnet,
featureconfig.OnyxTestnet,
featureconfig.SpadinaTestnet,
featureconfig.ZinkenTestnet,
flags.DeprecatedPasswordsDirFlag,
},
Action: func(cliCtx *cli.Context) error {
@@ -142,6 +147,7 @@ this command outputs a deposit data string which is required to become a validat
featureconfig.AltonaTestnet,
featureconfig.OnyxTestnet,
featureconfig.SpadinaTestnet,
featureconfig.ZinkenTestnet,
},
Action: func(cliCtx *cli.Context) error {
featureconfig.ConfigureValidator(cliCtx)

View File

@@ -27,6 +27,7 @@ var WalletCommands = &cli.Command{
featureconfig.AltonaTestnet,
featureconfig.OnyxTestnet,
featureconfig.SpadinaTestnet,
featureconfig.ZinkenTestnet,
flags.DeprecatedPasswordsDirFlag,
},
Action: func(cliCtx *cli.Context) error {
@@ -49,6 +50,7 @@ var WalletCommands = &cli.Command{
featureconfig.AltonaTestnet,
featureconfig.OnyxTestnet,
featureconfig.SpadinaTestnet,
featureconfig.ZinkenTestnet,
flags.DeprecatedPasswordsDirFlag,
},
Action: func(cliCtx *cli.Context) error {
@@ -70,6 +72,7 @@ var WalletCommands = &cli.Command{
featureconfig.AltonaTestnet,
featureconfig.OnyxTestnet,
featureconfig.SpadinaTestnet,
featureconfig.ZinkenTestnet,
flags.DeprecatedPasswordsDirFlag,
},
Action: func(cliCtx *cli.Context) error {