mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 21:38:05 -05:00
Holesky support (#12821)
* Add holesky config Copy config/params from deneb-integration * Add --holesky flag * Handle no genesis block error and suggest to user a workaround
This commit is contained in:
@@ -133,6 +133,13 @@ func configureTestnet(ctx *cli.Context) error {
|
||||
}
|
||||
applySepoliaFeatureFlags(ctx)
|
||||
params.UseSepoliaNetworkConfig()
|
||||
} else if ctx.Bool(HoleskyTestnet.Name) {
|
||||
log.Warn("Running on the Holesky Beacon Chain Testnet")
|
||||
if err := params.SetActive(params.HoleskyConfig().Copy()); err != nil {
|
||||
return err
|
||||
}
|
||||
applyHoleskyFeatureFlags(ctx)
|
||||
params.UseHoleskyNetworkConfig()
|
||||
} else {
|
||||
if ctx.IsSet(cmd.ChainConfigFileFlag.Name) {
|
||||
log.Warn("Running on custom Ethereum network specified in a chain configuration yaml file")
|
||||
@@ -154,6 +161,10 @@ func applyPraterFeatureFlags(ctx *cli.Context) {
|
||||
func applySepoliaFeatureFlags(ctx *cli.Context) {
|
||||
}
|
||||
|
||||
// Insert feature flags within the function to be enabled for Holesky testnet.
|
||||
func applyHoleskyFeatureFlags(ctx *cli.Context) {
|
||||
}
|
||||
|
||||
// ConfigureBeaconChain sets the global config based
|
||||
// on what flags are enabled for the beacon-chain client.
|
||||
func ConfigureBeaconChain(ctx *cli.Context) error {
|
||||
|
||||
@@ -18,6 +18,11 @@ var (
|
||||
Name: "sepolia",
|
||||
Usage: "Run Prysm configured for the Sepolia beacon chain test network",
|
||||
}
|
||||
// HoleskyTestnet flag for the multiclient Ethereum consensus testnet.
|
||||
HoleskyTestnet = &cli.BoolFlag{
|
||||
Name: "holesky",
|
||||
Usage: "Run Prysm configured for the Holesky beacon chain test network",
|
||||
}
|
||||
// Mainnet flag for easier tooling, no-op
|
||||
Mainnet = &cli.BoolFlag{
|
||||
Value: true,
|
||||
@@ -171,6 +176,7 @@ var devModeFlags = []cli.Flag{
|
||||
var ValidatorFlags = append(deprecatedFlags, []cli.Flag{
|
||||
writeWalletPasswordOnWebOnboarding,
|
||||
enableExternalSlasherProtectionFlag,
|
||||
HoleskyTestnet,
|
||||
PraterTestnet,
|
||||
SepoliaTestnet,
|
||||
Mainnet,
|
||||
@@ -191,6 +197,7 @@ var BeaconChainFlags = append(deprecatedBeaconFlags, append(deprecatedFlags, []c
|
||||
devModeFlag,
|
||||
writeSSZStateTransitionsFlag,
|
||||
disableGRPCConnectionLogging,
|
||||
HoleskyTestnet,
|
||||
PraterTestnet,
|
||||
SepoliaTestnet,
|
||||
Mainnet,
|
||||
@@ -225,4 +232,5 @@ var NetworkFlags = []cli.Flag{
|
||||
Mainnet,
|
||||
PraterTestnet,
|
||||
SepoliaTestnet,
|
||||
HoleskyTestnet,
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ go_library(
|
||||
"minimal_config.go",
|
||||
"network_config.go",
|
||||
"testnet_e2e_config.go",
|
||||
"testnet_holesky_config.go",
|
||||
"testnet_prater_config.go",
|
||||
"testnet_sepolia_config.go",
|
||||
"testutils.go",
|
||||
@@ -47,6 +48,7 @@ go_test(
|
||||
"configset_test.go",
|
||||
"loader_test.go",
|
||||
"testnet_config_test.go",
|
||||
"testnet_holesky_config_test.go",
|
||||
"testnet_prater_config_test.go",
|
||||
],
|
||||
data = glob(["*.yaml"]) + [
|
||||
@@ -55,6 +57,7 @@ go_test(
|
||||
"@consensus_spec_tests_mainnet//:test_data",
|
||||
"@consensus_spec_tests_minimal//:test_data",
|
||||
"@eth2_networks//:configs",
|
||||
"@holesky_testnet//:configs",
|
||||
],
|
||||
embed = [":go_default_library"],
|
||||
gotags = ["develop"],
|
||||
|
||||
43
config/params/testnet_holesky_config.go
Normal file
43
config/params/testnet_holesky_config.go
Normal file
@@ -0,0 +1,43 @@
|
||||
package params
|
||||
|
||||
import "math"
|
||||
|
||||
// UseHoleskyNetworkConfig uses the Holesky beacon chain specific network config.
|
||||
func UseHoleskyNetworkConfig() {
|
||||
cfg := BeaconNetworkConfig().Copy()
|
||||
cfg.ContractDeploymentBlock = 0
|
||||
cfg.BootstrapNodes = []string{
|
||||
// EF
|
||||
"enr:-Iq4QJk4WqRkjsX5c2CXtOra6HnxN-BMXnWhmhEQO9Bn9iABTJGdjUOurM7Btj1ouKaFkvTRoju5vz2GPmVON2dffQKGAX53x8JigmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk",
|
||||
"enr:-KG4QMH842KsJOZAHxI98VJcf8oPr1U8Ylyp2Tb-sNAPniWSCaxIS4F9gc3lGOnROEok7g5qrOm8WgJTl2WXx8MhMmIMhGV0aDKQqX6DZjABcAAKAAAAAAAAAIJpZIJ2NIJpcISygIjpiXNlY3AyNTZrMaECvQMvoDF46BfJgvAbbv1hwpNu9VQBXRIpHS_B8zmkZmmDdGNwgiMog3VkcIIjKA",
|
||||
"enr:-Ly4QDU8tZeygxz1gEeAD4EKe4H_8gg-IanpTY6h8A1YGPv5BPNvCMD77zjHUk_iF1pfG_8DC6jYWbIOD1k5kF-LaG4Bh2F0dG5ldHOIAAAAAAAAAACEZXRoMpCpfoNmMAFwAAoAAAAAAAAAgmlkgnY0gmlwhJK-DYCJc2VjcDI1NmsxoQN4bUae9DwIcq_56DNztksQYXeddTDKRonI5qI3YhN4SohzeW5jbmV0cwCDdGNwgiMog3VkcIIjKA",
|
||||
// Teku
|
||||
"enr:-LK4QMlzEff6d-M0A1pSFG5lJ2c56i_I-ZftdojZbW3ehkGNM4pkQuHQqzVvF1BG9aDjIakjnmO23mCBFFZ2w5zOsugEh2F0dG5ldHOIAAAAAAYAAACEZXRoMpCpfoNmMAFwAAABAAAAAAAAgmlkgnY0gmlwhKyuI_mJc2VjcDI1NmsxoQIH1kQRCZW-4AIVyAeXj5o49m_IqNFKRHp6tSpfXMUrSYN0Y3CCIyiDdWRwgiMo",
|
||||
}
|
||||
OverrideBeaconNetworkConfig(cfg)
|
||||
}
|
||||
|
||||
// HoleskyConfig defines the config for the Holesky beacon chain testnet.
|
||||
func HoleskyConfig() *BeaconChainConfig {
|
||||
cfg := MainnetConfig().Copy()
|
||||
cfg.MinGenesisTime = 1694786100
|
||||
cfg.GenesisDelay = 300
|
||||
cfg.ConfigName = HoleskyName
|
||||
cfg.GenesisForkVersion = []byte{0x00, 0x01, 0x70, 0x00}
|
||||
cfg.SecondsPerETH1Block = 14
|
||||
cfg.DepositChainID = 17000
|
||||
cfg.DepositNetworkID = 17000
|
||||
cfg.AltairForkEpoch = 0
|
||||
cfg.AltairForkVersion = []byte{0x10, 0x1, 0x70, 0x0}
|
||||
cfg.BellatrixForkEpoch = 0
|
||||
cfg.BellatrixForkVersion = []byte{0x20, 0x1, 0x70, 0x0}
|
||||
cfg.CapellaForkEpoch = 256
|
||||
cfg.CapellaForkVersion = []byte{0x30, 0x1, 0x70, 0x0}
|
||||
cfg.DenebForkEpoch = math.MaxUint64
|
||||
cfg.DenebForkVersion = []byte{0x40, 0x1, 0x70, 0x0}
|
||||
cfg.TerminalTotalDifficulty = "0"
|
||||
cfg.DepositContractAddress = "0x4242424242424242424242424242424242424242"
|
||||
cfg.EjectionBalance = 28000000000
|
||||
cfg.InitializeForkSchedule()
|
||||
return cfg
|
||||
}
|
||||
28
config/params/testnet_holesky_config_test.go
Normal file
28
config/params/testnet_holesky_config_test.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package params_test
|
||||
|
||||
import (
|
||||
"path"
|
||||
"testing"
|
||||
|
||||
"github.com/bazelbuild/rules_go/go/tools/bazel"
|
||||
"github.com/prysmaticlabs/prysm/v4/config/params"
|
||||
"github.com/prysmaticlabs/prysm/v4/testing/require"
|
||||
)
|
||||
|
||||
func TestHoleskyConfigMatchesUpstreamYaml(t *testing.T) {
|
||||
presetFPs := presetsFilePath(t, "mainnet")
|
||||
mn, err := params.ByName(params.MainnetName)
|
||||
require.NoError(t, err)
|
||||
cfg := mn.Copy()
|
||||
for _, fp := range presetFPs {
|
||||
cfg, err = params.UnmarshalConfigFile(fp, cfg)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
fPath, err := bazel.Runfile("external/holesky_testnet")
|
||||
require.NoError(t, err)
|
||||
configFP := path.Join(fPath, "custom_config_data", "config.yaml")
|
||||
pcfg, err := params.UnmarshalConfigFile(configFP, nil)
|
||||
require.NoError(t, err)
|
||||
fields := fieldsFromYamls(t, append(presetFPs, configFP))
|
||||
assertYamlFieldsMatch(t, "holesky", fields, pcfg, params.HoleskyConfig())
|
||||
}
|
||||
@@ -11,4 +11,5 @@ const (
|
||||
PraterName = "prater"
|
||||
GoerliName = "goerli"
|
||||
SepoliaName = "sepolia"
|
||||
HoleskyName = "holesky"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user