Add spadina config (#7235)

This commit is contained in:
terence tsao
2020-09-14 21:21:46 -07:00
committed by GitHub
parent f31f49582b
commit 36c921c601
4 changed files with 53 additions and 2 deletions

View File

@@ -33,8 +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.
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.
// Feature related flags.
WriteSSZStateTransitions bool // WriteSSZStateTransitions to tmp directory.
InitSyncNoVerify bool // InitSyncNoVerify when initial syncing w/o verifying block's contents.
@@ -134,6 +136,12 @@ func ConfigureBeaconChain(ctx *cli.Context) {
params.UseOnyxNetworkConfig()
cfg.OnyxTestnet = true
}
if ctx.Bool(spadinaTestnet.Name) {
log.Warn("Running Node on Spadina Testnet")
params.UseSpadinaConfig()
params.UseSpadinaNetworkConfig()
cfg.SpadinaTestnet = true
}
if ctx.Bool(writeSSZStateTransitionsFlag.Name) {
log.Warn("Writing SSZ states and blocks after state transitions")
cfg.WriteSSZStateTransitions = true
@@ -299,6 +307,12 @@ func ConfigureValidator(ctx *cli.Context) {
params.UseOnyxNetworkConfig()
cfg.OnyxTestnet = true
}
if ctx.Bool(spadinaTestnet.Name) {
log.Warn("Running Node on Spadina Testnet")
params.UseSpadinaConfig()
params.UseSpadinaNetworkConfig()
cfg.SpadinaTestnet = true
}
if ctx.Bool(enableLocalProtectionFlag.Name) {
cfg.LocalProtection = true
} else {

View File

@@ -15,6 +15,10 @@ var (
Name: "onyx",
Usage: "This defines the flag through which we can run on the Onyx Prysm Testnet",
}
spadinaTestnet = &cli.BoolFlag{
Name: "spadina",
Usage: "This defines the flag through which we can run on the Spadina Multiclient Testnet",
}
devModeFlag = &cli.BoolFlag{
Name: "dev",
Usage: "Enable experimental features still in development. These features may not be stable.",
@@ -636,6 +640,7 @@ var ValidatorFlags = append(deprecatedFlags, []cli.Flag{
waitForSyncedFlag,
AltonaTestnet,
OnyxTestnet,
spadinaTestnet,
disableAccountsV2,
}...)
@@ -675,6 +680,7 @@ var BeaconChainFlags = append(deprecatedFlags, []cli.Flag{
disableNewBeaconStateLocks,
AltonaTestnet,
OnyxTestnet,
spadinaTestnet,
batchBlockVerify,
initSyncVerbose,
disableFinalizedDepositsCache,

View File

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

View File

@@ -0,0 +1,30 @@
package params
// UseSpadinaNetworkConfig uses the Spadina specific
// network config.
func UseSpadinaNetworkConfig() {
cfg := BeaconNetworkConfig().Copy()
cfg.ContractDeploymentBlock = 3384340
cfg.ChainID = 5
cfg.NetworkID = 5
cfg.DepositContractAddress = "0x48B597F4b53C21B48AD95c7256B49D1779Bd5890"
cfg.BootstrapNodes = []string{}
OverrideBeaconNetworkConfig(cfg)
}
// UseSpadinaConfig sets the main beacon chain
// config for Spadina.
func UseSpadinaConfig() {
beaconConfig = SpadinaConfig()
}
// SpadinaConfig defines the config for the
// Spadina testnet.
func SpadinaConfig() *BeaconChainConfig {
cfg := MainnetConfig().Copy()
cfg.MinGenesisTime = 1601380800
cfg.GenesisForkVersion = []byte{0x00, 0x00, 0x00, 0x00}
cfg.MinGenesisActiveValidatorCount = 1024
return cfg
}