Skip to content

Commit 08a65c3

Browse files
authored
feat: allow setting custom dora image & env variables (ethereum#623)
Allow using a custom dora image and specifying custom env variables. This is especially useful for early testnets that might need disabling some features via ENV vars (eg. `KILLSWITCH_DISABLE_SSZ_REQUESTS=true`, `KILLSWITCH_DISABLE_SSZ_ENCODING=true`)
1 parent 085b6e1 commit 08a65c3

File tree

5 files changed

+37
-1
lines changed

5 files changed

+37
-1
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,15 @@ additional_services:
588588
- blutgang
589589
- apache
590590

591+
# Configuration place for dora the explorer - https:#github.com/ethpandaops/dora
592+
dora_params:
593+
# Dora docker image to use
594+
# Leave blank to use the default image according to your network params
595+
image: ""
596+
597+
# A list of optional extra env_vars the dora container should spin up with
598+
env: {}
599+
591600
# Configuration place for transaction spammer - https:#github.com/MariusVanDerWijden/tx-fuzz
592601
tx_spammer_params:
593602
# A list of optional extra params that will be passed to the TX Spammer container for modifying its behaviour

main.star

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,13 +439,15 @@ def run(plan, args={}):
439439
elif additional_service == "dora":
440440
plan.print("Launching dora")
441441
dora_config_template = read_file(static_files.DORA_CONFIG_TEMPLATE_FILEPATH)
442+
dora_params = args_with_right_defaults.dora_params
442443
dora.launch_dora(
443444
plan,
444445
dora_config_template,
445446
all_participants,
446447
args_with_right_defaults.participants,
447448
el_cl_data_files_artifact_uuid,
448449
network_params,
450+
dora_params,
449451
global_node_selectors,
450452
)
451453
plan.print("Successfully launched dora")

network_params.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ additional_services:
8787
- beacon_metrics_gazer
8888
- dora
8989
- prometheus_grafana
90+
dora_params:
91+
image: ""
9092
tx_spammer_params:
9193
tx_spammer_extra_args: []
9294
goomy_blob_params:

src/dora/dora_launcher.star

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def launch_dora(
3434
participant_configs,
3535
el_cl_data_files_artifact_uuid,
3636
network_params,
37+
dora_params,
3738
global_node_selectors,
3839
):
3940
all_cl_client_info = []
@@ -76,6 +77,7 @@ def launch_dora(
7677
config_files_artifact_name,
7778
el_cl_data_files_artifact_uuid,
7879
network_params,
80+
dora_params,
7981
global_node_selectors,
8082
)
8183

@@ -86,14 +88,17 @@ def get_config(
8688
config_files_artifact_name,
8789
el_cl_data_files_artifact_uuid,
8890
network_params,
91+
dora_params,
8992
node_selectors,
9093
):
9194
config_file_path = shared_utils.path_join(
9295
DORA_CONFIG_MOUNT_DIRPATH_ON_SERVICE,
9396
DORA_CONFIG_FILENAME,
9497
)
9598

96-
if network_params.eip7594_fork_epoch < 100000000:
99+
if dora_params.image != "":
100+
IMAGE_NAME = dora_params.image
101+
elif network_params.eip7594_fork_epoch < 100000000:
97102
IMAGE_NAME = "ethpandaops/dora:peer-das"
98103
elif network_params.electra_fork_epoch < 100000000:
99104
IMAGE_NAME = "ethpandaops/dora:electra-support"
@@ -111,6 +116,7 @@ def get_config(
111116
constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_data_files_artifact_uuid,
112117
},
113118
cmd=["-config", config_file_path],
119+
env_vars=dora_params.env,
114120
min_cpu=MIN_CPU,
115121
max_cpu=MAX_CPU,
116122
min_memory=MIN_MEMORY,

src/package_io/input_parser.star

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ ATTR_TO_BE_SKIPPED_AT_ROOT = (
7474
"network_params",
7575
"participants",
7676
"mev_params",
77+
"dora_params",
7778
"assertoor_params",
7879
"goomy_blob_params",
7980
"tx_spammer_params",
@@ -87,6 +88,7 @@ def input_parser(plan, input_args):
8788
result = parse_network_params(plan, input_args)
8889

8990
# add default eth2 input params
91+
result["dora_params"] = get_default_dora_params()
9092
result["mev_params"] = get_default_mev_params(
9193
result.get("mev_type"), result["network_params"]["preset"]
9294
)
@@ -127,6 +129,10 @@ def input_parser(plan, input_args):
127129
if attr not in ATTR_TO_BE_SKIPPED_AT_ROOT and attr in input_args:
128130
result[attr] = value
129131
# custom eth2 attributes config
132+
elif attr == "dora_params":
133+
for sub_attr in input_args["dora_params"]:
134+
sub_value = input_args["dora_params"][sub_attr]
135+
result["dora_params"][sub_attr] = sub_value
130136
elif attr == "mev_params":
131137
for sub_attr in input_args["mev_params"]:
132138
sub_value = input_args["mev_params"][sub_attr]
@@ -309,6 +315,10 @@ def input_parser(plan, input_args):
309315
)
310316
if result["mev_params"]
311317
else None,
318+
dora_params=struct(
319+
image=result["dora_params"]["image"],
320+
env=result["dora_params"]["env"],
321+
),
312322
tx_spammer_params=struct(
313323
tx_spammer_extra_args=result["tx_spammer_params"]["tx_spammer_extra_args"],
314324
),
@@ -840,6 +850,13 @@ def default_participant():
840850
}
841851

842852

853+
def get_default_dora_params():
854+
return {
855+
"image": "",
856+
"env": {},
857+
}
858+
859+
843860
def get_default_mev_params(mev_type, preset):
844861
mev_relay_image = constants.DEFAULT_FLASHBOTS_RELAY_IMAGE
845862
mev_builder_image = constants.DEFAULT_FLASHBOTS_BUILDER_IMAGE

0 commit comments

Comments
 (0)