Add medalla testnet configuration. (#6700)

This commit is contained in:
Jim McDonald 2020-07-23 20:56:39 +01:00 committed by GitHub
parent 2c11fcb242
commit 415cb9ff8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 48 additions and 1 deletions

View File

@ -33,7 +33,8 @@ 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.
AltonaTestnet bool // AltonaTestnet defines the flag through which we can enable the node to run on the altona testnet.
MedallaTestnet bool // MedallaTestnet defines the flag through which we can enable the node to run on the medalla testnet.
// Feature related flags.
WriteSSZStateTransitions bool // WriteSSZStateTransitions to tmp directory.
InitSyncNoVerify bool // InitSyncNoVerify when initial syncing w/o verifying block's contents.
@ -120,6 +121,12 @@ func ConfigureBeaconChain(ctx *cli.Context) {
params.UseAltonaNetworkConfig()
cfg.AltonaTestnet = true
}
if ctx.Bool(medallaTestnet.Name) {
log.Warn("Running Node on Medalla Testnet")
params.UseMedallaConfig()
params.UseMedallaNetworkConfig()
cfg.MedallaTestnet = true
}
if ctx.Bool(writeSSZStateTransitionsFlag.Name) {
log.Warn("Writing SSZ states and blocks after state transitions")
cfg.WriteSSZStateTransitions = true
@ -263,6 +270,12 @@ func ConfigureValidator(ctx *cli.Context) {
params.UseAltonaNetworkConfig()
cfg.AltonaTestnet = true
}
if ctx.Bool(medallaTestnet.Name) {
log.Warn("Running Validator on Medalla Testnet")
params.UseMedallaConfig()
params.UseMedallaNetworkConfig()
cfg.MedallaTestnet = true
}
if ctx.Bool(enableLocalProtectionFlag.Name) {
cfg.LocalProtection = true
} else {

View File

@ -140,6 +140,10 @@ var (
Name: "altona",
Usage: "This defines the flag through which we can run on the Altona Multiclient Testnet",
}
medallaTestnet = &cli.BoolFlag{
Name: "medalla",
Usage: "This defines the flag through which we can run on the Medalla Multiclient Testnet",
}
enableAccountsV2 = &cli.BoolFlag{
Name: "enable-accounts-v2",
Usage: "Enables usage of v2 for Prysm validator accounts",
@ -566,6 +570,7 @@ var ValidatorFlags = append(deprecatedFlags, []cli.Flag{
disableDomainDataCacheFlag,
waitForSyncedFlag,
altonaTestnet,
medallaTestnet,
enableAccountsV2,
}...)
@ -608,6 +613,7 @@ var BeaconChainFlags = append(deprecatedFlags, []cli.Flag{
newBeaconStateLocks,
forceMaxCoverAttestationAggregation,
altonaTestnet,
medallaTestnet,
batchBlockVerify,
initSyncVerbose,
enableFinalizedDepositsCache,

View File

@ -12,6 +12,7 @@ go_library(
"network_config.go",
"testnet_altona_config.go",
"testnet_e2e_config.go",
"testnet_medalla_config.go",
"testnet_onyx_config.go",
"testutils.go",
],

View File

@ -0,0 +1,27 @@
package params
// UseMedallaNetworkConfig uses the Medalla specific
// network config.
func UseMedallaNetworkConfig() {
cfg := BeaconNetworkConfig().Copy()
cfg.ContractDeploymentBlock = 3085928
cfg.DepositContractAddress = "0x07b39F4fDE4A38bACe212b546dAc87C58DfE3fDC"
cfg.BootstrapNodes = []string{}
OverrideBeaconNetworkConfig(cfg)
}
// UseMedallaConfig sets the main beacon chain
// config for medalla.
func UseMedallaConfig() {
beaconConfig = MedallaConfig()
}
// MedallaConfig defines the config for the
// medalla testnet.
func MedallaConfig() *BeaconChainConfig {
cfg := MainnetConfig().Copy()
cfg.MinGenesisTime = 1596546000
cfg.GenesisForkVersion = []byte{0x00, 0x00, 0x00, 0x01}
return cfg
}