From 1b6547de6a863f51d66760c66b1993ce6d7b114c Mon Sep 17 00:00:00 2001 From: terence Date: Tue, 2 Jan 2024 07:31:57 -0800 Subject: [PATCH] Add Goerli Deneb Fork Epoch (#13390) * Add deneb fork epoch * Fix test --- WORKSPACE | 16 ++++++++++++++++ config/params/BUILD.bazel | 2 ++ config/params/testnet_config_test.go | 8 -------- config/params/testnet_prater_config.go | 4 +--- config/params/testnet_prater_config_test.go | 6 +++++- 5 files changed, 24 insertions(+), 12 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index fb00908df..31379b236 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -322,6 +322,22 @@ filegroup( url = "https://github.com/eth-clients/eth2-networks/archive/7b4897888cebef23801540236f73123e21774954.tar.gz", ) +http_archive( + name = "goerli_testnet", + build_file_content = """ +filegroup( + name = "configs", + srcs = [ + "prater/config.yaml", + ], + visibility = ["//visibility:public"], +) + """, + sha256 = "43fc0f55ddff7b511713e2de07aa22846a67432df997296fb4fc09cd8ed1dcdb", + strip_prefix = "goerli-6522ac6684693740cd4ddcc2a0662e03702aa4a1", + url = "https://github.com/eth-clients/goerli/archive/6522ac6684693740cd4ddcc2a0662e03702aa4a1.tar.gz", +) + http_archive( name = "holesky_testnet", build_file_content = """ diff --git a/config/params/BUILD.bazel b/config/params/BUILD.bazel index 08103085a..4eb396cc8 100644 --- a/config/params/BUILD.bazel +++ b/config/params/BUILD.bazel @@ -58,12 +58,14 @@ go_test( "@consensus_spec_tests_mainnet//:test_data", "@consensus_spec_tests_minimal//:test_data", "@eth2_networks//:configs", + "@goerli_testnet//:configs", "@holesky_testnet//:configs", ], embed = [":go_default_library"], gotags = ["develop"], tags = ["CI_race_detection"], deps = [ + "//build/bazel:go_default_library", "//consensus-types/primitives:go_default_library", "//encoding/bytesutil:go_default_library", "//io/file:go_default_library", diff --git a/config/params/testnet_config_test.go b/config/params/testnet_config_test.go index b98d70193..c585eb0dd 100644 --- a/config/params/testnet_config_test.go +++ b/config/params/testnet_config_test.go @@ -1,7 +1,6 @@ package params_test import ( - "path" "path/filepath" "testing" @@ -12,13 +11,6 @@ import ( "github.com/prysmaticlabs/prysm/v4/testing/require" ) -func testnetConfigFilePath(t *testing.T, network string) string { - fPath, err := bazel.Runfile("external/eth2_networks") - require.NoError(t, err) - configFilePath := path.Join(fPath, "shared", network, "config.yaml") - return configFilePath -} - func TestE2EConfigParity(t *testing.T) { params.SetupTestConfigCleanup(t) testDir := bazel.TestTmpDir() diff --git a/config/params/testnet_prater_config.go b/config/params/testnet_prater_config.go index 58a15c668..f1caffb45 100644 --- a/config/params/testnet_prater_config.go +++ b/config/params/testnet_prater_config.go @@ -1,8 +1,6 @@ package params import ( - "math" - eth1Params "github.com/ethereum/go-ethereum/params" ) @@ -42,7 +40,7 @@ func PraterConfig() *BeaconChainConfig { cfg.BellatrixForkVersion = []byte{0x2, 0x0, 0x10, 0x20} cfg.CapellaForkEpoch = 162304 cfg.CapellaForkVersion = []byte{0x3, 0x0, 0x10, 0x20} - cfg.DenebForkEpoch = math.MaxUint64 + cfg.DenebForkEpoch = 231680 // 2024-01-17 06:32:00 (UTC) cfg.DenebForkVersion = []byte{0x4, 0x0, 0x10, 0x20} cfg.TerminalTotalDifficulty = "10790000" cfg.DepositContractAddress = "0xff50ed3d0ec03aC01D4C79aAd74928BFF48a7b2b" diff --git a/config/params/testnet_prater_config_test.go b/config/params/testnet_prater_config_test.go index ab2842726..1b0e3f3e7 100644 --- a/config/params/testnet_prater_config_test.go +++ b/config/params/testnet_prater_config_test.go @@ -1,8 +1,10 @@ package params_test import ( + "path" "testing" + "github.com/prysmaticlabs/prysm/v4/build/bazel" "github.com/prysmaticlabs/prysm/v4/config/params" "github.com/prysmaticlabs/prysm/v4/testing/require" ) @@ -16,7 +18,9 @@ func TestPraterConfigMatchesUpstreamYaml(t *testing.T) { cfg, err = params.UnmarshalConfigFile(fp, cfg) require.NoError(t, err) } - configFP := testnetConfigFilePath(t, "prater") + fPath, err := bazel.Runfile("external/goerli_testnet") + require.NoError(t, err) + configFP := path.Join(fPath, "prater", "config.yaml") pcfg, err := params.UnmarshalConfigFile(configFP, nil) require.NoError(t, err) fields := fieldsFromYamls(t, append(presetFPs, configFP))