Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add option to disable CL #373

Closed
wants to merge 15 commits into from
35 changes: 35 additions & 0 deletions examples/aura.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
participants:
gr8h marked this conversation as resolved.
Show resolved Hide resolved
- el_client_type: nethermind
el_client_image: nethermind/nethermind:latest
el_extra_params:
- --config=/nethermind/configs/validator.cfg
- --Init.ChainSpecPath=/nethermind/chainspec/chainspec.json
beacon_extra_params: []
validator_extra_params: []
builder_network_params: null
validator_count: null
gr8h marked this conversation as resolved.
Show resolved Hide resolved
snooper_enabled: false
ethereum_metrics_exporter_enabled: false
count: 1
- el_client_type: nethermind
el_client_image: nethermind/nethermind:latest
el_extra_params:
- --config=/nethermind/configs/node.cfg
- --Init.ChainSpecPath=/nethermind/chainspec/chainspec.json
beacon_extra_params: []
validator_extra_params: []
builder_network_params: null
validator_count: 0
snooper_enabled: false
ethereum_metrics_exporter_enabled: false
count: 2
network_params:
deneb_fork_epoch: 4
additional_services:
- tx_spammer
- prometheus_grafana
wait_for_finalization: false
global_client_log_level: info
snooper_enabled: false
ethereum_metrics_exporter_enabled: false
parallel_keystore_generation: false
15 changes: 14 additions & 1 deletion main.star
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ def run(plan, args={}):
all_ethereum_metrics_exporter_contexts = []
for participant in all_participants:
all_el_client_contexts.append(participant.el_client_context)
all_cl_client_contexts.append(participant.cl_client_context)
if participant.cl_client_context:
all_cl_client_contexts.append(participant.cl_client_context)
all_ethereum_metrics_exporter_contexts.append(
participant.ethereum_metrics_exporter_context
)
Expand Down Expand Up @@ -279,6 +280,9 @@ def run(plan, args={}):
)
plan.print("Successfully launched transaction spammer")
elif additional_service == "blob_spammer":
if not all_cl_client_contexts:
plan.print("Skip launching Blob spammer")
continue
plan.print("Launching Blob spammer")
blob_spammer.launch_blob_spammer(
plan,
Expand All @@ -291,6 +295,9 @@ def run(plan, args={}):
)
plan.print("Successfully launched blob spammer")
elif additional_service == "goomy_blob":
if not all_cl_client_contexts:
plan.print("Skip launching Goomy the blob spammer")
continue
plan.print("Launching Goomy the blob spammer")
goomy_blob_params = args_with_right_defaults.goomy_blob_params
goomy_blob.launch_goomy_blob(
Expand All @@ -314,6 +321,9 @@ def run(plan, args={}):
)
plan.print("Successfully launched execution layer forkmon")
elif additional_service == "beacon_metrics_gazer":
if not all_cl_client_contexts:
plan.print("Skip launching beacon metrics gazer")
continue
plan.print("Launching beacon metrics gazer")
beacon_metrics_gazer_prometheus_metrics_job = (
beacon_metrics_gazer.launch_beacon_metrics_gazer(
Expand All @@ -328,6 +338,9 @@ def run(plan, args={}):
)
plan.print("Successfully launched beacon metrics gazer")
elif additional_service == "dora":
if not all_cl_client_contexts:
plan.print("Skip launching dora")
continue
plan.print("Launching dora")
dora_config_template = read_file(static_files.DORA_CONFIG_TEMPLATE_FILEPATH)
dora.launch_dora(
Expand Down
6 changes: 5 additions & 1 deletion src/el/nethermind/nethermind_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ def launch(
el_min_mem = el_min_mem if int(el_min_mem) > 0 else EXECUTION_MIN_MEMORY
el_max_mem = el_max_mem if int(el_max_mem) > 0 else EXECUTION_MAX_MEMORY

cl_client_name = service_name.split("-")[3]
split_service_name = service_name.split("-")
if len(split_service_name) < 4:
cl_client_name = "na"
else:
cl_client_name = split_service_name[3]

config = get_config(
launcher.el_cl_genesis_data,
Expand Down
8 changes: 5 additions & 3 deletions src/package_io/input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,10 @@ def parse_network_params(input_args):
el_client_type = participant["el_client_type"]
cl_client_type = participant["cl_client_type"]

if cl_client_type in (NIMBUS_NODE_NAME) and (
result["network_params"]["seconds_per_slot"] < 12
if (
cl_client_type
and cl_client_type in (NIMBUS_NODE_NAME)
and (result["network_params"]["seconds_per_slot"] < 12)
):
fail("nimbus can't be run with slot times below 12 seconds")
el_image = participant["el_client_image"]
Expand All @@ -262,7 +264,7 @@ def parse_network_params(input_args):
participant["el_client_image"] = default_image

cl_image = participant["cl_client_image"]
if cl_image == "":
if cl_client_type and cl_image == "":
default_image = DEFAULT_CL_IMAGES.get(cl_client_type, "")
if default_image == "":
fail(
Expand Down
14 changes: 11 additions & 3 deletions src/participant_network.star
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,10 @@ def launch_participant_network(
# Zero-pad the index using the calculated zfill value
index_str = shared_utils.zfill_custom(index + 1, len(str(len(participants))))

el_service_name = "el-{0}-{1}-{2}".format(
index_str, el_client_type, cl_client_type
el_service_name = "el-{0}-{1}{2}".format(
index_str,
el_client_type,
"-{0}".format(cl_client_type) if cl_client_type else "",
)

el_client_context = launch_method(
Expand Down Expand Up @@ -270,6 +272,9 @@ def launch_participant_network(
cl_client_type = participant.cl_client_type
el_client_type = participant.el_client_type

if not participant.cl_client_type:
continue

if cl_client_type not in cl_launchers:
fail(
"Unsupported launcher '{0}', need one of '{1}'".format(
Expand Down Expand Up @@ -408,8 +413,11 @@ def launch_participant_network(
cl_client_type = participant.cl_client_type

el_client_context = all_el_client_contexts[index]
cl_client_context = all_cl_client_contexts[index]
cl_client_context = None
if participant.cl_client_type:
cl_client_context = all_cl_client_contexts[index]

snooper_engine_context = None
if participant.snooper_enabled:
snooper_engine_context = all_snooper_engine_contexts[index]

Expand Down