Skip to content

Commit e83e440

Browse files
Add mekong testnet config
1 parent 4aa5410 commit e83e440

8 files changed

+231
-0
lines changed

WORKSPACE

+16
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,22 @@ filegroup(
358358
url = "https://github.com/eth-clients/sepolia/archive/f2c219a93c4491cee3d90c18f2f8e82aed850eab.tar.gz", # 2024-09-19
359359
)
360360

361+
http_archive(
362+
name = "mekong_testnet",
363+
build_file_content = """
364+
filegroup(
365+
name = "configs",
366+
srcs = [
367+
"network-configs/devnet-0/metadata/config.yaml",
368+
],
369+
visibility = ["//visibility:public"],
370+
)
371+
""",
372+
integrity = "sha256-y8id4VtAmk+geH52V77+UjR4NCTmGzXdtGpAUMkwvPM=",
373+
strip_prefix = "mekong-devnets-c144c729c3cb898e1d6bb299d42eeb595809252c",
374+
url = "https://github.com/ethpandaops/mekong-devnets/archive/c144c729c3cb898e1d6bb299d42eeb595809252c.tar.gz", # 2024-11-07
375+
)
376+
361377
http_archive(
362378
name = "com_google_protobuf",
363379
sha256 = "9bd87b8280ef720d3240514f884e56a712f2218f0d693b48050c836028940a42",

config/features/config.go

+6
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ func configureTestnet(ctx *cli.Context) error {
141141
}
142142
applyHoleskyFeatureFlags(ctx)
143143
params.UseHoleskyNetworkConfig()
144+
} else if ctx.Bool(MekongTestnet.Name) {
145+
log.Info("Running on the Mekong Beacon Chain Testnet")
146+
if err := params.SetActive(params.MekongConfig().Copy()); err != nil {
147+
return err
148+
}
149+
params.UseMekongNetworkConfig()
144150
} else {
145151
if ctx.IsSet(cmd.ChainConfigFileFlag.Name) {
146152
log.Warn("Running on custom Ethereum network specified in a chain configuration yaml file")

config/features/flags.go

+8
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ var (
1818
Name: "holesky",
1919
Usage: "Runs Prysm configured for the Holesky test network.",
2020
}
21+
// MekongTestnet flag for the multiclient Ethereum consensus testnet.
22+
MekongTestnet = &cli.BoolFlag{
23+
Name: "mekong",
24+
Usage: "Runs Prysm configured for the Mekong test network.",
25+
}
2126
// Mainnet flag for easier tooling, no-op
2227
Mainnet = &cli.BoolFlag{
2328
Value: true,
@@ -187,6 +192,7 @@ var ValidatorFlags = append(deprecatedFlags, []cli.Flag{
187192
writeWalletPasswordOnWebOnboarding,
188193
HoleskyTestnet,
189194
SepoliaTestnet,
195+
MekongTestnet,
190196
Mainnet,
191197
dynamicKeyReloadDebounceInterval,
192198
attestTimely,
@@ -211,6 +217,7 @@ var BeaconChainFlags = append(deprecatedBeaconFlags, append(deprecatedFlags, []c
211217
disableGRPCConnectionLogging,
212218
HoleskyTestnet,
213219
SepoliaTestnet,
220+
MekongTestnet,
214221
Mainnet,
215222
disablePeerScorer,
216223
disableBroadcastSlashingFlag,
@@ -244,4 +251,5 @@ var NetworkFlags = []cli.Flag{
244251
Mainnet,
245252
SepoliaTestnet,
246253
HoleskyTestnet,
254+
MekongTestnet,
247255
}

config/params/BUILD.bazel

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ go_library(
1616
"network_config.go",
1717
"testnet_e2e_config.go",
1818
"testnet_holesky_config.go",
19+
"testnet_mekong_config.go",
1920
"testnet_sepolia_config.go",
2021
"testutils.go",
2122
"testutils_develop.go", # keep
@@ -30,6 +31,7 @@ go_library(
3031
"//math:go_default_library",
3132
"//runtime/version:go_default_library",
3233
"@com_github_ethereum_go_ethereum//common:go_default_library",
34+
"@com_github_ethereum_go_ethereum//common/hexutil:go_default_library",
3335
"@com_github_ethereum_go_ethereum//params:go_default_library",
3436
"@com_github_mohae_deepcopy//:go_default_library",
3537
"@com_github_pkg_errors//:go_default_library",
@@ -49,6 +51,7 @@ go_test(
4951
"mainnet_config_test.go",
5052
"testnet_config_test.go",
5153
"testnet_holesky_config_test.go",
54+
"testnet_mekong_config_test.go",
5255
"testnet_sepolia_config_test.go",
5356
],
5457
data = glob(["*.yaml"]) + [
@@ -58,6 +61,7 @@ go_test(
5861
"@consensus_spec_tests_minimal//:test_data",
5962
"@eth2_networks//:configs",
6063
"@holesky_testnet//:configs",
64+
"@mekong_testnet//:configs",
6165
"@sepolia_testnet//:configs",
6266
],
6367
embed = [":go_default_library"],

config/params/loader_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ var placeholderFields = []string{
3636
"EIP7732_FORK_VERSION",
3737
"FIELD_ELEMENTS_PER_BLOB", // Compile time constant.
3838
"KZG_COMMITMENT_INCLUSION_PROOF_DEPTH", // Compile time constant on BlobSidecar.commitment_inclusion_proof.
39+
"FULU_FORK_EPOCH",
40+
"FULU_FORK_VERSION",
3941
"MAX_BLOBS_PER_BLOCK",
4042
"MAX_BLOB_COMMITMENTS_PER_BLOCK", // Compile time constant on BeaconBlockBodyDeneb.blob_kzg_commitments.
4143
"MAX_BYTES_PER_TRANSACTION", // Used for ssz of EL transactions. Unused in Prysm.

config/params/testnet_mekong_config.go

+166
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package params_test
2+
3+
import (
4+
"path"
5+
"testing"
6+
7+
"github.com/bazelbuild/rules_go/go/tools/bazel"
8+
"github.com/prysmaticlabs/prysm/v5/config/params"
9+
"github.com/prysmaticlabs/prysm/v5/testing/require"
10+
)
11+
12+
func TestMekongConfigMatchesUpstreamYaml(t *testing.T) {
13+
presetFPs := presetsFilePath(t, "mainnet")
14+
mn, err := params.ByName(params.MainnetName)
15+
require.NoError(t, err)
16+
cfg := mn.Copy()
17+
for _, fp := range presetFPs {
18+
cfg, err = params.UnmarshalConfigFile(fp, cfg)
19+
require.NoError(t, err)
20+
}
21+
fPath, err := bazel.Runfile("external/mekong_testnet")
22+
require.NoError(t, err)
23+
configFP := path.Join(fPath, "network-configs/devnet-0/metadata", "config.yaml")
24+
pcfg, err := params.UnmarshalConfigFile(configFP, nil)
25+
require.NoError(t, err)
26+
fields := fieldsFromYamls(t, append(presetFPs, configFP))
27+
assertYamlFieldsMatch(t, "mekong", fields, pcfg, params.MekongConfig())
28+
}

config/params/values.go

+1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ const (
1010
MinimalName = "minimal"
1111
SepoliaName = "sepolia"
1212
HoleskyName = "holesky"
13+
MekongName = "mekong"
1314
)

0 commit comments

Comments
 (0)