Skip to content

Commit f6e1b13

Browse files
authored
feat: enable preset to be set, mainnet/minimal (#524)
1 parent 969012c commit f6e1b13

File tree

9 files changed

+121
-10
lines changed

9 files changed

+121
-10
lines changed

.github/tests/minimal.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
participants:
2+
- el_type: geth
3+
cl_type: teku
4+
- el_type: geth
5+
cl_type: prysm
6+
cl_extra_params: [--minimal-config=true]
7+
cl_image: ethpandaops/prysm-beacon-chain:develop-minimal
8+
- el_type: erigon
9+
cl_type: nimbus
10+
cl_image: ethpandaops/nimbus-eth2:unstable-minimal
11+
- el_type: besu
12+
cl_type: lighthouse
13+
cl_image: ethpandaops/lighthouse:unstable-minimal
14+
- el_type: reth
15+
cl_type: lodestar
16+
cl_extra_env_vars: { LODESTAR_PRESET: minimal }
17+
vc_extra_env_vars: { LODESTAR_PRESET: minimal }
18+
- el_type: geth
19+
cl_type: grandine
20+
cl_image: ethpandaops/grandine:develop-minimal
21+
network_params:
22+
preset: minimal
23+
seconds_per_slot: 6
24+
additional_services: []
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
participants:
2+
- el_type: geth
3+
cl_type: teku
4+
- el_type: geth
5+
cl_type: prysm
6+
cl_extra_params: [--minimal-config=true]
7+
cl_image: ethpandaops/prysm-beacon-chain:develop-minimal
8+
- el_type: erigon
9+
cl_type: nimbus
10+
cl_image: ethpandaops/nimbus-eth2:unstable-minimal
11+
- el_type: besu
12+
cl_type: lighthouse
13+
cl_image: ethpandaops/lighthouse:unstable-minimal
14+
- el_type: reth
15+
cl_type: lodestar
16+
cl_extra_env_vars: { LODESTAR_PRESET: minimal }
17+
vc_extra_env_vars: { LODESTAR_PRESET: minimal }
18+
- el_type: geth
19+
cl_type: grandine
20+
cl_image: ethpandaops/grandine:develop-minimal
21+
network_params:
22+
preset: minimal
23+
seconds_per_slot: 6
24+
additional_services:
25+
- tx_spammer
26+
- blob_spammer
27+
- el_forkmon
28+
- beacon_metrics_gazer
29+
- dora
30+
- prometheus_grafana
31+
- goomy_blob
32+
- custom_flood
33+
- blobscan
34+
- blockscout
35+
ethereum_metrics_exporter_enabled: true
36+
snooper_enabled: true
37+
keymanager_enabled: true

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,16 @@ network_params:
508508
# The snapshots are taken with https://github.com/ethpandaops/snapshotter
509509
network_sync_base_url: https://ethpandaops-ethereum-node-snapshots.ams3.digitaloceanspaces.com/
510510

511+
# Preset for the network
512+
# Default: "mainnet"
513+
# Options: "mainnet", "minimal"
514+
# "minimal" preset will spin up a network with minimal preset. This is useful for rapid testing and development.
515+
# 192 seconds to get to finalized epoch vs 1536 seconds with mainnet defaults
516+
# Please note that minimal preset requires alternative client images.
517+
# For an example of minimal preset, please refer to [minimal.yaml](.github/tests/minimal.yaml)
518+
preset: "mainnet"
519+
520+
511521
# Global parameters for the network
512522

513523
# By default includes

src/package_io/constants.star

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ DENEB_FORK_VERSION = "0x50000038"
7474
ELECTRA_FORK_VERSION = "0x60000038"
7575

7676
ETHEREUM_GENESIS_GENERATOR = struct(
77-
capella_genesis="ethpandaops/ethereum-genesis-generator:2.0.12", # Deprecated
78-
deneb_genesis="ethpandaops/ethereum-genesis-generator:3.0.0", # Default
77+
capella_genesis="ethpandaops/ethereum-genesis-generator:2.0.12", # Deprecated (no support for minimal config)
78+
deneb_genesis="ethpandaops/ethereum-genesis-generator:3.0.2", # Default
7979
verkle_support_genesis="ethpandaops/ethereum-genesis-generator:3.0.0-rc.19", # soon to be deneb genesis, waiting for rebase
8080
verkle_genesis="ethpandaops/ethereum-genesis-generator:verkle-gen-v1.0.0",
8181
)

src/package_io/input_parser.star

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ MEV_BOOST_RELAY_DEFAULT_IMAGE = "flashbots/mev-boost-relay:0.27"
3636

3737
MEV_BOOST_RELAY_IMAGE_NON_ZERO_CAPELLA = "flashbots/mev-boost-relay:0.26"
3838

39-
NETHERMIND_NODE_NAME = "nethermind"
40-
NIMBUS_NODE_NAME = "nimbus"
41-
4239
# Placeholder value for the deneb fork epoch if electra is being run
4340
# TODO: This is a hack, and should be removed once we electra is rebased on deneb
4441
HIGH_DENEB_VALUE_FORK_VERKLE = 2000000000
@@ -236,6 +233,7 @@ def input_parser(plan, input_args):
236233
],
237234
shard_committee_period=result["network_params"]["shard_committee_period"],
238235
network_sync_base_url=result["network_params"]["network_sync_base_url"],
236+
preset=result["network_params"]["preset"],
239237
),
240238
mev_params=struct(
241239
mev_relay_image=result["mev_params"]["mev_relay_image"],
@@ -339,10 +337,27 @@ def parse_network_params(input_args):
339337
cl_type = participant["cl_type"]
340338
vc_type = participant["vc_type"]
341339

342-
if cl_type in (NIMBUS_NODE_NAME) and (
343-
result["network_params"]["seconds_per_slot"] < 12
340+
if (
341+
cl_type in (constants.CL_TYPE.nimbus)
342+
and (result["network_params"]["seconds_per_slot"] < 12)
343+
and result["network_params"]["preset"] == "mainnet"
344344
):
345-
fail("nimbus can't be run with slot times below 12 seconds")
345+
fail(
346+
"nimbus can't be run with slot times below 12 seconds with "
347+
+ result["network_params"]["preset"]
348+
+ " preset"
349+
)
350+
351+
if (
352+
cl_type in (constants.CL_TYPE.nimbus)
353+
and (result["network_params"]["seconds_per_slot"] != 6)
354+
and result["network_params"]["preset"] == "minimal"
355+
):
356+
fail(
357+
"nimbus can't be run with slot times different than 6 seconds with "
358+
+ result["network_params"]["preset"]
359+
+ " preset"
360+
)
346361

347362
el_image = participant["el_image"]
348363
if el_image == "":
@@ -508,6 +523,17 @@ def parse_network_params(input_args):
508523
for participant in result["participants"]:
509524
participant["validator_count"] = 0
510525

526+
if result["network_params"]["preset"] not in ["mainnet", "minimal"]:
527+
fail(
528+
"preset "
529+
+ result["network_params"]["preset"]
530+
+ " is not supported, it can only be mainnet or minimal"
531+
)
532+
533+
if result["network_params"]["preset"] == "minimal":
534+
if result["network_params"]["deneb_fork_epoch"] > 0:
535+
fail("minimal preset only supports deneb genesis fork epoch")
536+
511537
return result
512538

513539

@@ -613,6 +639,7 @@ def default_network_params():
613639
"deneb_fork_epoch": 0,
614640
"electra_fork_epoch": 500,
615641
"network_sync_base_url": "https://ethpandaops-ethereum-node-snapshots.ams3.digitaloceanspaces.com/",
642+
"preset": "mainnet",
616643
}
617644

618645

src/participant_network.star

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ def launch_participant_network(
104104
latest_block.files_artifacts[0] if latest_block != "" else "",
105105
network_params.min_validator_withdrawability_delay,
106106
network_params.shard_committee_period,
107+
network_params.preset,
107108
)
108109
elif network_params.network in constants.PUBLIC_NETWORKS:
109110
# We are running a public network

src/prelaunch_data_generator/el_cl_genesis/el_cl_genesis_generator.star

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def generate_el_cl_genesis_data(
2828
latest_block,
2929
min_validator_withdrawability_delay,
3030
shard_committee_period,
31+
preset,
3132
):
3233
files = {}
3334
shadowfork_file = ""
@@ -51,6 +52,7 @@ def generate_el_cl_genesis_data(
5152
shadowfork_file,
5253
min_validator_withdrawability_delay,
5354
shard_committee_period,
55+
preset,
5456
)
5557
genesis_generation_template = shared_utils.new_template_and_data(
5658
genesis_generation_config_yml_template, template_data
@@ -126,6 +128,7 @@ def new_env_file_for_el_cl_genesis_data(
126128
shadowfork_file,
127129
min_validator_withdrawability_delay,
128130
shard_committee_period,
131+
preset,
129132
):
130133
return {
131134
"UnixTimestamp": genesis_unix_timestamp,
@@ -148,4 +151,5 @@ def new_env_file_for_el_cl_genesis_data(
148151
"ShadowForkFile": shadowfork_file,
149152
"MinValidatorWithdrawabilityDelay": min_validator_withdrawability_delay,
150153
"ShardCommitteePeriod": shard_committee_period,
154+
"Preset": preset,
151155
}

src/vc/prysm.star

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ def get_config(
5656
"--monitoring-port={0}".format(vc_shared.VALIDATOR_CLIENT_METRICS_PORT_NUM),
5757
# ^^^^^^^^^^^^^^^^^^^ METRICS CONFIG ^^^^^^^^^^^^^^^^^^^^^
5858
"--graffiti=" + full_name,
59-
"--enable-beacon-rest-api",
6059
]
6160

6261
keymanager_api_cmd = [
@@ -65,6 +64,15 @@ def get_config(
6564
"--rpc-host=0.0.0.0",
6665
]
6766

67+
keymanager_api_cmd = [
68+
"--rpc",
69+
"--rpc-port={0}".format(vc_shared.VALIDATOR_HTTP_PORT_NUM),
70+
"--rpc-host=0.0.0.0",
71+
]
72+
73+
if cl_context.client_name != constants.CL_TYPE.prysm:
74+
cmd.append("--enable-beacon-rest-api")
75+
6876
if len(extra_params) > 0:
6977
# this is a repeated<proto type>, we convert it into Starlark
7078
cmd.extend([param for param in extra_params])

static_files/genesis-generation-config/el-cl/values.env.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
export PRESET_BASE="{{ .Preset }}"
12
export CHAIN_ID="{{ .NetworkId }}"
23
export DEPOSIT_CONTRACT_ADDRESS="{{ .DepositContractAddress }}"
34
export EL_AND_CL_MNEMONIC="{{ .PreregisteredValidatorKeysMnemonic }}"
@@ -9,7 +10,6 @@ export GENESIS_FORK_VERSION="{{ .GenesisForkVersion }}"
910
export ALTAIR_FORK_VERSION="0x20000038"
1011
export BELLATRIX_FORK_VERSION="{{ .BellatrixForkVersion }}"
1112
export CAPELLA_FORK_VERSION="{{ .CapellaForkVersion }}"
12-
export CAPELLA_FORK_EPOCH="{{ .CapellaForkEpoch }}"
1313
export DENEB_FORK_VERSION="{{ .DenebForkVersion }}"
1414
export DENEB_FORK_EPOCH="{{ .DenebForkEpoch }}"
1515
export ELECTRA_FORK_VERSION="{{ .ElectraForkVersion }}"

0 commit comments

Comments
 (0)