Skip to content

Commit

Permalink
Add mekong testnet config
Browse files Browse the repository at this point in the history
  • Loading branch information
prestonvanloon committed Nov 7, 2024
1 parent 4aa5410 commit e83e440
Show file tree
Hide file tree
Showing 8 changed files with 231 additions and 0 deletions.
16 changes: 16 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,22 @@ filegroup(
url = "https://github.com/eth-clients/sepolia/archive/f2c219a93c4491cee3d90c18f2f8e82aed850eab.tar.gz", # 2024-09-19
)

http_archive(
name = "mekong_testnet",
build_file_content = """
filegroup(
name = "configs",
srcs = [
"network-configs/devnet-0/metadata/config.yaml",
],
visibility = ["//visibility:public"],
)
""",
integrity = "sha256-y8id4VtAmk+geH52V77+UjR4NCTmGzXdtGpAUMkwvPM=",
strip_prefix = "mekong-devnets-c144c729c3cb898e1d6bb299d42eeb595809252c",
url = "https://github.com/ethpandaops/mekong-devnets/archive/c144c729c3cb898e1d6bb299d42eeb595809252c.tar.gz", # 2024-11-07
)

http_archive(
name = "com_google_protobuf",
sha256 = "9bd87b8280ef720d3240514f884e56a712f2218f0d693b48050c836028940a42",
Expand Down
6 changes: 6 additions & 0 deletions config/features/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ func configureTestnet(ctx *cli.Context) error {
}
applyHoleskyFeatureFlags(ctx)
params.UseHoleskyNetworkConfig()
} else if ctx.Bool(MekongTestnet.Name) {
log.Info("Running on the Mekong Beacon Chain Testnet")
if err := params.SetActive(params.MekongConfig().Copy()); err != nil {
return err
}
params.UseMekongNetworkConfig()
} else {
if ctx.IsSet(cmd.ChainConfigFileFlag.Name) {
log.Warn("Running on custom Ethereum network specified in a chain configuration yaml file")
Expand Down
8 changes: 8 additions & 0 deletions config/features/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ var (
Name: "holesky",
Usage: "Runs Prysm configured for the Holesky test network.",
}
// MekongTestnet flag for the multiclient Ethereum consensus testnet.
MekongTestnet = &cli.BoolFlag{
Name: "mekong",
Usage: "Runs Prysm configured for the Mekong test network.",
}
// Mainnet flag for easier tooling, no-op
Mainnet = &cli.BoolFlag{
Value: true,
Expand Down Expand Up @@ -187,6 +192,7 @@ var ValidatorFlags = append(deprecatedFlags, []cli.Flag{
writeWalletPasswordOnWebOnboarding,
HoleskyTestnet,
SepoliaTestnet,
MekongTestnet,
Mainnet,
dynamicKeyReloadDebounceInterval,
attestTimely,
Expand All @@ -211,6 +217,7 @@ var BeaconChainFlags = append(deprecatedBeaconFlags, append(deprecatedFlags, []c
disableGRPCConnectionLogging,
HoleskyTestnet,
SepoliaTestnet,
MekongTestnet,
Mainnet,
disablePeerScorer,
disableBroadcastSlashingFlag,
Expand Down Expand Up @@ -244,4 +251,5 @@ var NetworkFlags = []cli.Flag{
Mainnet,
SepoliaTestnet,
HoleskyTestnet,
MekongTestnet,
}
4 changes: 4 additions & 0 deletions config/params/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ go_library(
"network_config.go",
"testnet_e2e_config.go",
"testnet_holesky_config.go",
"testnet_mekong_config.go",
"testnet_sepolia_config.go",
"testutils.go",
"testutils_develop.go", # keep
Expand All @@ -30,6 +31,7 @@ go_library(
"//math:go_default_library",
"//runtime/version:go_default_library",
"@com_github_ethereum_go_ethereum//common:go_default_library",
"@com_github_ethereum_go_ethereum//common/hexutil:go_default_library",
"@com_github_ethereum_go_ethereum//params:go_default_library",
"@com_github_mohae_deepcopy//:go_default_library",
"@com_github_pkg_errors//:go_default_library",
Expand All @@ -49,6 +51,7 @@ go_test(
"mainnet_config_test.go",
"testnet_config_test.go",
"testnet_holesky_config_test.go",
"testnet_mekong_config_test.go",
"testnet_sepolia_config_test.go",
],
data = glob(["*.yaml"]) + [
Expand All @@ -58,6 +61,7 @@ go_test(
"@consensus_spec_tests_minimal//:test_data",
"@eth2_networks//:configs",
"@holesky_testnet//:configs",
"@mekong_testnet//:configs",
"@sepolia_testnet//:configs",
],
embed = [":go_default_library"],
Expand Down
2 changes: 2 additions & 0 deletions config/params/loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ var placeholderFields = []string{
"EIP7732_FORK_VERSION",
"FIELD_ELEMENTS_PER_BLOB", // Compile time constant.
"KZG_COMMITMENT_INCLUSION_PROOF_DEPTH", // Compile time constant on BlobSidecar.commitment_inclusion_proof.
"FULU_FORK_EPOCH",
"FULU_FORK_VERSION",
"MAX_BLOBS_PER_BLOCK",
"MAX_BLOB_COMMITMENTS_PER_BLOCK", // Compile time constant on BeaconBlockBodyDeneb.blob_kzg_commitments.
"MAX_BYTES_PER_TRANSACTION", // Used for ssz of EL transactions. Unused in Prysm.
Expand Down
166 changes: 166 additions & 0 deletions config/params/testnet_mekong_config.go

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions config/params/testnet_mekong_config_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package params_test

import (
"path"
"testing"

"github.com/bazelbuild/rules_go/go/tools/bazel"
"github.com/prysmaticlabs/prysm/v5/config/params"
"github.com/prysmaticlabs/prysm/v5/testing/require"
)

func TestMekongConfigMatchesUpstreamYaml(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/mekong_testnet")
require.NoError(t, err)
configFP := path.Join(fPath, "network-configs/devnet-0/metadata", "config.yaml")
pcfg, err := params.UnmarshalConfigFile(configFP, nil)
require.NoError(t, err)
fields := fieldsFromYamls(t, append(presetFPs, configFP))
assertYamlFieldsMatch(t, "mekong", fields, pcfg, params.MekongConfig())
}
1 change: 1 addition & 0 deletions config/params/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ const (
MinimalName = "minimal"
SepoliaName = "sepolia"
HoleskyName = "holesky"
MekongName = "mekong"
)

0 comments on commit e83e440

Please sign in to comment.