diff --git a/config/features/config.go b/config/features/config.go index 7b4f4db1a..c6b98c2bc 100644 --- a/config/features/config.go +++ b/config/features/config.go @@ -123,13 +123,15 @@ func configureTestnet(ctx *cli.Context) error { if err := params.SetActive(params.RopstenConfig().Copy()); err != nil { return err } - if err := ctx.Set(enableVecHTR.Names()[0], "true"); err != nil { - log.WithError(err).Debug("error enabling vectorized HTR flag") - } - if err := ctx.Set(enableForkChoiceDoublyLinkedTree.Names()[0], "true"); err != nil { - log.WithError(err).Debug("error enabling doubly linked tree forkchoice flag") - } + applyRopstenFeatureFlags(ctx) params.UseRopstenNetworkConfig() + } else if ctx.Bool(SepoliaTestnet.Name) { + log.Warn("Running on the Sepolia Beacon Chain Testnet") + if err := params.SetActive(params.SepoliaConfig().Copy()); err != nil { + return err + } + applySepoliaFeatureFlags(ctx) + params.UseSepoliaNetworkConfig() } else { if ctx.IsSet(cmd.ChainConfigFileFlag.Name) { log.Warn("Running on custom Ethereum network specified in a chain configuration yaml file") @@ -143,6 +145,26 @@ func configureTestnet(ctx *cli.Context) error { return nil } +// Insert feature flags within the function to be enabled for Ropsten testnet. +func applyRopstenFeatureFlags(ctx *cli.Context) { + if err := ctx.Set(enableVecHTR.Names()[0], "true"); err != nil { + log.WithError(err).Debug("error enabling vectorized HTR flag") + } + if err := ctx.Set(enableForkChoiceDoublyLinkedTree.Names()[0], "true"); err != nil { + log.WithError(err).Debug("error enabling doubly linked tree forkchoice flag") + } +} + +// Insert feature flags within the function to be enabled for Sepolia testnet. +func applySepoliaFeatureFlags(ctx *cli.Context) { + if err := ctx.Set(enableVecHTR.Names()[0], "true"); err != nil { + log.WithError(err).Debug("error enabling vectorized HTR flag") + } + if err := ctx.Set(enableForkChoiceDoublyLinkedTree.Names()[0], "true"); err != nil { + log.WithError(err).Debug("error enabling doubly linked tree forkchoice flag") + } +} + // ConfigureBeaconChain sets the global config based // on what flags are enabled for the beacon-chain client. func ConfigureBeaconChain(ctx *cli.Context) error { diff --git a/config/features/flags.go b/config/features/flags.go index f788e6f3f..7067a99d9 100644 --- a/config/features/flags.go +++ b/config/features/flags.go @@ -17,6 +17,11 @@ var ( Name: "ropsten", Usage: "Run Prysm configured for the Ropsten beacon chain test network", } + // SepoliaTestnet flag for the multiclient Ethereum consensus testnet. + SepoliaTestnet = &cli.BoolFlag{ + Name: "sepolia", + Usage: "Run Prysm configured for the Sepolia beacon chain test network", + } // Mainnet flag for easier tooling, no-op Mainnet = &cli.BoolFlag{ Value: true, diff --git a/config/params/BUILD.bazel b/config/params/BUILD.bazel index 9c5f3f876..db127866f 100644 --- a/config/params/BUILD.bazel +++ b/config/params/BUILD.bazel @@ -17,6 +17,7 @@ go_library( "testnet_e2e_config.go", "testnet_prater_config.go", "testnet_ropsten_config.go", + "testnet_sepolia_config.go", "testutils.go", "values.go", ], diff --git a/config/params/testnet_sepolia_config.go b/config/params/testnet_sepolia_config.go new file mode 100644 index 000000000..ec2df418b --- /dev/null +++ b/config/params/testnet_sepolia_config.go @@ -0,0 +1,37 @@ +package params + +import ( + eth1Params "github.com/ethereum/go-ethereum/params" +) + +// UseSepoliaNetworkConfig uses the Sepolia beacon chain specific network config. +func UseSepoliaNetworkConfig() { + cfg := BeaconNetworkConfig().Copy() + cfg.ContractDeploymentBlock = 1273020 + cfg.BootstrapNodes = []string{ + // EF boot node + "enr:-Iq4QMCTfIMXnow27baRUb35Q8iiFHSIDBJh6hQM5Axohhf4b6Kr_cOCu0htQ5WvVqKvFgY28893DHAg8gnBAXsAVqmGAX53x8JggmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk", + } + OverrideBeaconNetworkConfig(cfg) +} + +// SepoliaConfig defines the config for the Sepolia beacon chain testnet. +func SepoliaConfig() *BeaconChainConfig { + cfg := MainnetConfig().Copy() + cfg.MinGenesisTime = 1655647200 + cfg.GenesisDelay = 86400 + cfg.MinGenesisActiveValidatorCount = 1300 + cfg.ConfigName = SepoliaName + cfg.GenesisForkVersion = []byte{0x90, 0x00, 0x00, 0x69} + cfg.SecondsPerETH1Block = 14 + cfg.DepositChainID = eth1Params.SepoliaChainConfig.ChainID.Uint64() + cfg.DepositNetworkID = eth1Params.SepoliaChainConfig.ChainID.Uint64() + cfg.AltairForkEpoch = 50 + cfg.AltairForkVersion = []byte{0x90, 0x00, 0x00, 0x70} + cfg.BellatrixForkEpoch = 100 + cfg.BellatrixForkVersion = []byte{0x90, 0x00, 0x00, 0x71} + cfg.TerminalTotalDifficulty = "100000000000000000000000" + cfg.DepositContractAddress = "0x7f02C3E3c98b133055B8B348B2Ac625669Ed295D" + cfg.InitializeForkSchedule() + return cfg +} diff --git a/config/params/values.go b/config/params/values.go index e2570def9..04939a769 100644 --- a/config/params/values.go +++ b/config/params/values.go @@ -10,4 +10,5 @@ const ( MinimalName = "minimal" PraterName = "prater" RopstenName = "ropsten" + SepoliaName = "sepolia" )