Add network config for Testnet-V4

This commit is contained in:
Shane Bammel 2023-04-19 13:36:39 -05:00
parent 0ec879e672
commit 0dcb2ec61b
10 changed files with 71 additions and 64 deletions

View File

@ -28,7 +28,7 @@ var Commands = &cli.Command{
features.Mainnet, features.Mainnet,
features.PulseChain, features.PulseChain,
features.PraterTestnet, features.PraterTestnet,
features.PulseChainTestnetV3, features.PulseChainTestnetV4,
features.SepoliaTestnet, features.SepoliaTestnet,
features.HoleskyTestnet, features.HoleskyTestnet,
}), }),
@ -62,7 +62,7 @@ var Commands = &cli.Command{
features.Mainnet, features.Mainnet,
features.PulseChain, features.PulseChain,
features.PraterTestnet, features.PraterTestnet,
features.PulseChainTestnetV3, features.PulseChainTestnetV4,
features.SepoliaTestnet, features.SepoliaTestnet,
features.HoleskyTestnet, features.HoleskyTestnet,
}), }),
@ -94,7 +94,7 @@ var Commands = &cli.Command{
features.Mainnet, features.Mainnet,
features.PulseChain, features.PulseChain,
features.PraterTestnet, features.PraterTestnet,
features.PulseChainTestnetV3, features.PulseChainTestnetV4,
features.SepoliaTestnet, features.SepoliaTestnet,
features.HoleskyTestnet, features.HoleskyTestnet,
}), }),
@ -123,7 +123,7 @@ var Commands = &cli.Command{
features.Mainnet, features.Mainnet,
features.PulseChain, features.PulseChain,
features.PraterTestnet, features.PraterTestnet,
features.PulseChainTestnetV3, features.PulseChainTestnetV4,
features.SepoliaTestnet, features.SepoliaTestnet,
features.HoleskyTestnet, features.HoleskyTestnet,
}), }),
@ -164,7 +164,7 @@ var Commands = &cli.Command{
features.Mainnet, features.Mainnet,
features.PulseChain, features.PulseChain,
features.PraterTestnet, features.PraterTestnet,
features.PulseChainTestnetV3, features.PulseChainTestnetV4,
features.SepoliaTestnet, features.SepoliaTestnet,
features.HoleskyTestnet, features.HoleskyTestnet,
}), }),

View File

@ -23,7 +23,7 @@ var Commands = &cli.Command{
features.Mainnet, features.Mainnet,
features.PulseChain, features.PulseChain,
features.PraterTestnet, features.PraterTestnet,
features.PulseChainTestnetV3, features.PulseChainTestnetV4,
features.SepoliaTestnet, features.SepoliaTestnet,
features.HoleskyTestnet, features.HoleskyTestnet,
features.EnableMinimalSlashingProtection, features.EnableMinimalSlashingProtection,
@ -51,7 +51,7 @@ var Commands = &cli.Command{
features.Mainnet, features.Mainnet,
features.PulseChain, features.PulseChain,
features.PraterTestnet, features.PraterTestnet,
features.PulseChainTestnetV3, features.PulseChainTestnetV4,
features.SepoliaTestnet, features.SepoliaTestnet,
features.HoleskyTestnet, features.HoleskyTestnet,
features.EnableMinimalSlashingProtection, features.EnableMinimalSlashingProtection,

View File

@ -32,7 +32,7 @@ var Commands = &cli.Command{
features.Mainnet, features.Mainnet,
features.PulseChain, features.PulseChain,
features.PraterTestnet, features.PraterTestnet,
features.PulseChainTestnetV3, features.PulseChainTestnetV4,
features.SepoliaTestnet, features.SepoliaTestnet,
features.HoleskyTestnet, features.HoleskyTestnet,
}), }),
@ -62,7 +62,7 @@ var Commands = &cli.Command{
features.Mainnet, features.Mainnet,
features.PulseChain, features.PulseChain,
features.PraterTestnet, features.PraterTestnet,
features.PulseChainTestnetV3, features.PulseChainTestnetV4,
features.SepoliaTestnet, features.SepoliaTestnet,
features.HoleskyTestnet, features.HoleskyTestnet,
}), }),

View File

@ -137,13 +137,13 @@ func configureTestnet(ctx *cli.Context) error {
} }
applyPulseChainFeatureFlags(ctx) applyPulseChainFeatureFlags(ctx)
params.UsePulseChainNetworkConfig() params.UsePulseChainNetworkConfig()
} else if ctx.Bool(PulseChainTestnetV3.Name) { } else if ctx.Bool(PulseChainTestnetV4.Name) {
log.Warn("Running on PulseChain Testnet V3") log.Warn("Running on PulseChain Testnet V4")
if err := params.SetActive(params.PulseChainTestnetV3Config().Copy()); err != nil { if err := params.SetActive(params.PulseChainTestnetV4Config().Copy()); err != nil {
return err return err
} }
applyPulseChainTestnetV3FeatureFlags(ctx) applyPulseChainTestnetV4FeatureFlags(ctx)
params.UsePulseChainTestnetV3NetworkConfig() params.UsePulseChainTestnetV4NetworkConfig()
} else if ctx.Bool(SepoliaTestnet.Name) { } else if ctx.Bool(SepoliaTestnet.Name) {
log.Info("Running on the Sepolia Beacon Chain Testnet") log.Info("Running on the Sepolia Beacon Chain Testnet")
if err := params.SetActive(params.SepoliaConfig().Copy()); err != nil { if err := params.SetActive(params.SepoliaConfig().Copy()); err != nil {
@ -179,8 +179,8 @@ func applyPraterFeatureFlags(ctx *cli.Context) {
func applyPulseChainFeatureFlags(ctx *cli.Context) { func applyPulseChainFeatureFlags(ctx *cli.Context) {
} }
// Insert feature flags within the function to be enabled for PulseChain Testnet V3. // Insert feature flags within the function to be enabled for PulseChain Testnet V4.
func applyPulseChainTestnetV3FeatureFlags(ctx *cli.Context) { func applyPulseChainTestnetV4FeatureFlags(ctx *cli.Context) {
} }
// Insert feature flags within the function to be enabled for Sepolia testnet. // Insert feature flags within the function to be enabled for Sepolia testnet.

View File

@ -14,10 +14,10 @@ var (
Usage: "Runs Prysm configured for the Prater / Goerli test network.", Usage: "Runs Prysm configured for the Prater / Goerli test network.",
Aliases: []string{"goerli"}, Aliases: []string{"goerli"},
} }
// PulseChainTestnetV3 flag for the multiclient Ethereum consensus testnet. // PulseChainTestnetV4 flag for the multiclient Ethereum consensus testnet.
PulseChainTestnetV3 = &cli.BoolFlag{ PulseChainTestnetV4 = &cli.BoolFlag{
Name: "pulsechain-testnet-v3", Name: "pulsechain-testnet-v4",
Usage: "Run Prysm configured for the PulseChain Testnet V3 beacon chain", Usage: "Run Prysm configured for the PulseChain Testnet V4 beacon chain",
} }
// SepoliaTestnet flag for the multiclient Ethereum consensus testnet. // SepoliaTestnet flag for the multiclient Ethereum consensus testnet.
SepoliaTestnet = &cli.BoolFlag{ SepoliaTestnet = &cli.BoolFlag{
@ -194,7 +194,7 @@ var ValidatorFlags = append(deprecatedFlags, []cli.Flag{
writeWalletPasswordOnWebOnboarding, writeWalletPasswordOnWebOnboarding,
HoleskyTestnet, HoleskyTestnet,
PraterTestnet, PraterTestnet,
PulseChainTestnetV3, PulseChainTestnetV4,
SepoliaTestnet, SepoliaTestnet,
Mainnet, Mainnet,
PulseChain, PulseChain,
@ -221,7 +221,7 @@ var BeaconChainFlags = append(deprecatedBeaconFlags, append(deprecatedFlags, []c
disableGRPCConnectionLogging, disableGRPCConnectionLogging,
HoleskyTestnet, HoleskyTestnet,
PraterTestnet, PraterTestnet,
PulseChainTestnetV3, PulseChainTestnetV4,
SepoliaTestnet, SepoliaTestnet,
Mainnet, Mainnet,
PulseChain, PulseChain,
@ -255,7 +255,7 @@ var NetworkFlags = []cli.Flag{
Mainnet, Mainnet,
PulseChain, PulseChain,
PraterTestnet, PraterTestnet,
PulseChainTestnetV3, PulseChainTestnetV4,
SepoliaTestnet, SepoliaTestnet,
HoleskyTestnet, HoleskyTestnet,
} }

View File

@ -18,7 +18,7 @@ go_library(
"testnet_e2e_config.go", "testnet_e2e_config.go",
"testnet_holesky_config.go", "testnet_holesky_config.go",
"testnet_prater_config.go", "testnet_prater_config.go",
"testnet_pulsechain_v3_config.go", "testnet_pulsechain_v4_config.go",
"testnet_sepolia_config.go", "testnet_sepolia_config.go",
"testutils.go", "testutils.go",
"testutils_develop.go", # keep "testutils_develop.go", # keep

View File

@ -3,11 +3,11 @@ package params
// UsePulseChainNetworkConfig uses the PulseChain beacon chain mainnet network config. // UsePulseChainNetworkConfig uses the PulseChain beacon chain mainnet network config.
func UsePulseChainNetworkConfig() { func UsePulseChainNetworkConfig() {
// TODO // TODO
UsePulseChainTestnetV3NetworkConfig() UsePulseChainTestnetV4NetworkConfig()
} }
// PulseChainConfig defines the config for the PulseChain beacon chain mainnet. // PulseChainConfig defines the config for the PulseChain beacon chain mainnet.
func PulseChainConfig() *BeaconChainConfig { func PulseChainConfig() *BeaconChainConfig {
// TODO // TODO
return PulseChainTestnetV3Config() return PulseChainTestnetV4Config()
} }

View File

@ -1,37 +0,0 @@
package params
// UsePulseChainTestnetV3NetworkConfig uses the PulseChain beacon chain testnet network config.
func UsePulseChainTestnetV3NetworkConfig() {
cfg := BeaconNetworkConfig().Copy()
cfg.ContractDeploymentBlock = 16492700
cfg.BootstrapNodes = []string{
"enr:-MK4QC37TFAfc973oOezRlVoOCygtjT-rlOoKbbuZNmrJ5dhXS-IfrsH3yhjNP0dfy3-UpyFZy2hy6lOE__ykFfj3lKGAYa95Co5h2F0dG5ldHOIAAAAAAAAAACEZXRoMpBbnJIGAAAJRP__________gmlkgnY0gmlwhAPsylWJc2VjcDI1NmsxoQOpEhsSXVShFW4yvaww_SI0A-H0pix0aJlOdYJgyIgbjYhzeW5jbmV0cwCDdGNwgjLIg3VkcIIu4A", // bootnode-aws-us-east-1-001
"enr:-MK4QM1JpOXnj-zpjfPvG1GkCEvjYMg8dEk6t7VLtpFuionhBz59n2ZIwixpO2exzoNLMV4_v7jCHGQqi0zYtc-Gp3OGAYa94lhqh2F0dG5ldHOIAAAAAAAAAACEZXRoMpBbnJIGAAAJRP__________gmlkgnY0gmlwhCzKVYOJc2VjcDI1NmsxoQK24rqFwR7W3HJgLVVGDSMy8PiMculxF6VOJgAlG4wmXohzeW5jbmV0cwCDdGNwgjLIg3VkcIIu4A", // bootnode-aws-us-east-1-002
"enr:-MK4QBAlroGpM1xtk7WzWP8lbKnI2UjVpoQNsKJeNRS-kVvFCswNyVRBZHwMOvfW2G3j0qaaDsUpMxXY-t9LdGAZgQGGAYa94IQmh2F0dG5ldHOIAAAAAAAAAACEZXRoMpBbnJIGAAAJRP__________gmlkgnY0gmlwhK6BYN-Jc2VjcDI1NmsxoQJNoBFGkhcAMKIbrDPHoI7dYVAY99Z832TimlqhpoYo7YhzeW5jbmV0cwCDdGNwgjLIg3VkcIIu4A", // bootnode-aws-us-east-1-003
}
OverrideBeaconNetworkConfig(cfg)
}
// PulseChainTestnetV3Config defines the config for the PulseChain beacon chain testnet.
func PulseChainTestnetV3Config() *BeaconChainConfig {
cfg := MainnetConfig().Copy()
cfg.ConfigName = PulseChainTestnetV3Name
cfg.PresetBase = "pulsechain"
cfg.TerminalTotalDifficulty = "58750003716598352947541"
cfg.MinGenesisActiveValidatorCount = 4096
cfg.MinGenesisTime = 1674864000
cfg.GenesisForkVersion = []byte{0x00, 0x00, 0x09, 0x42}
cfg.GenesisDelay = 300
cfg.AltairForkVersion = []byte{0x00, 0x00, 0x09, 0x43}
cfg.AltairForkEpoch = 1
cfg.BellatrixForkVersion = []byte{0x00, 0x00, 0x09, 0x44}
cfg.BellatrixForkEpoch = 2
cfg.SecondsPerSlot = 10
cfg.MaxEffectiveBalance = 32 * 1e15
cfg.EjectionBalance = 16 * 1e15
cfg.DepositChainID = 942
cfg.DepositNetworkID = 942
cfg.DepositContractAddress = "0x3693693693693693693693693693693693693693"
cfg.InitializeForkSchedule()
return cfg
}

View File

@ -0,0 +1,44 @@
package params
// UsePulseChainTestnetV4NetworkConfig uses the PulseChain beacon chain testnet network config.
func UsePulseChainTestnetV4NetworkConfig() {
cfg := BeaconNetworkConfig().Copy()
cfg.ContractDeploymentBlock = 16492700
cfg.BootstrapNodes = []string{
"enr:-MK4QPzTScyPIPS7UWhaz0v4cVYKTfN2-0leb-iFKGl_xFBjDOSJenQ91BwaZ7sUXApiCPihr_Mw4L5oZJ4W5vNqffuGAYd4QZA7h2F0dG5ldHOIAAAAAAAAAACEZXRoMpB3mwAIAAAJRAEAAAAAAAAAgmlkgnY0gmlwhAOOpsuJc2VjcDI1NmsxoQNJljCY9olY73J9aYbW-9Ix72ZNzKv1AeIt6BHSqtniV4hzeW5jbmV0cwCDdGNwgjLIg3VkcIIu4A", // bootnode-aws-us-east-2-001
"enr:-MK4QF0dJA9H3BlxJE7HEjucJD47JYdlQyJ0wbQVNrbfgM_0A-OZEb8J1jjtmiaw3ytpl-FdmofS7QPW31j1n2WImTiGAYd4QUGRh2F0dG5ldHOIAAAAAAAAAACEZXRoMpB3mwAIAAAJRAEAAAAAAAAAgmlkgnY0gmlwhBJ2vKWJc2VjcDI1NmsxoQJsvKcVWN9inS4QTW8QsPSd053XZl6MZ5zmvBXLycbONYhzeW5jbmV0cwCDdGNwgjLIg3VkcIIu4A", // bootnode-aws-us-east-2-002
"enr:-MK4QMqHY3x4vzN1yHXY7ZCAH8ylE8dSYT3ZWSNsUBd0MJ4dIYjz94vrEUvMZGsDfJXW1aHZlpszxScBLJEQovnha6WGAYd4QUMUh2F0dG5ldHOIAAAAAAAAAACEZXRoMpB3mwAIAAAJRAEAAAAAAAAAgmlkgnY0gmlwhAOKa5CJc2VjcDI1NmsxoQIt-VoTVWzXdUTO78hhF_25-AhXgOk0k-YG3gW_dzX6YIhzeW5jbmV0cwCDdGNwgjLIg3VkcIIu4A", // bootnode-aws-us-east-2-003
}
OverrideBeaconNetworkConfig(cfg)
}
// PulseChainTestnetV4Config defines the config for the PulseChain beacon chain testnet.
func PulseChainTestnetV4Config() *BeaconChainConfig {
cfg := MainnetConfig().Copy()
cfg.ConfigName = PulseChainTestnetV4Name
cfg.PresetBase = "pulsechain"
// preset overrides
cfg.BaseRewardFactor = 64000
cfg.EffectiveBalanceIncrement = 1 * 1e15
cfg.MaxEffectiveBalance = 32 * 1e15
// config overrides
cfg.TerminalTotalDifficulty = "58750003716598352947541"
cfg.MinGenesisActiveValidatorCount = 4096
cfg.MinGenesisTime = 1674864000
cfg.GenesisForkVersion = []byte{0x00, 0x00, 0x09, 0x43}
cfg.GenesisDelay = 300
cfg.AltairForkVersion = []byte{0x00, 0x00, 0x09, 0x44}
cfg.AltairForkEpoch = 1
cfg.BellatrixForkVersion = []byte{0x00, 0x00, 0x09, 0x45}
cfg.BellatrixForkEpoch = 2
cfg.SecondsPerSlot = 10
cfg.EjectionBalance = 16 * 1e15
cfg.DepositChainID = 943
cfg.DepositNetworkID = 943
cfg.DepositContractAddress = "0x3693693693693693693693693693693693693693"
cfg.InitializeForkSchedule()
return cfg
}

View File

@ -13,5 +13,5 @@ const (
GoerliName = "goerli" GoerliName = "goerli"
SepoliaName = "sepolia" SepoliaName = "sepolia"
HoleskyName = "holesky" HoleskyName = "holesky"
PulseChainTestnetV3Name = "pulsechain-testnet-v3" PulseChainTestnetV4Name = "pulsechain-testnet-v4"
) )