Skip to content

Commit 293001a

Browse files
authored
feat: add mev relays to dora config (#679)
1 parent cb203ff commit 293001a

File tree

3 files changed

+39
-5
lines changed

3 files changed

+39
-5
lines changed

main.star

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,16 @@ def run(plan, args={}):
191191
)
192192

193193
mev_endpoints = []
194+
mev_endpoint_names = []
194195
# passed external relays get priority
195196
# perhaps add mev_type External or remove this
196197
if (
197198
hasattr(participant, "builder_network_params")
198199
and participant.builder_network_params != None
199200
):
200201
mev_endpoints = participant.builder_network_params.relay_end_points
202+
for idx, mev_endpoint in enumerate(mev_endpoints):
203+
mev_endpoint_names.append("relay-{0}".format(idx + 1))
201204
# otherwise dummy relays spinup if chosen
202205
elif (
203206
args_with_right_defaults.mev_type
@@ -219,6 +222,7 @@ def run(plan, args={}):
219222
global_node_selectors,
220223
)
221224
mev_endpoints.append(endpoint)
225+
mev_endpoint_names.append(constants.MOCK_MEV_TYPE)
222226
elif args_with_right_defaults.mev_type and (
223227
args_with_right_defaults.mev_type == constants.FLASHBOTS_MEV_TYPE
224228
or args_with_right_defaults.mev_type == constants.MEV_RS_MEV_TYPE
@@ -288,6 +292,7 @@ def run(plan, args={}):
288292
normal_user.private_key,
289293
)
290294
mev_endpoints.append(endpoint)
295+
mev_endpoint_names.append(args_with_right_defaults.mev_type)
291296

292297
# spin up the mev boost contexts if some endpoints for relays have been passed
293298
all_mevboost_contexts = []
@@ -451,6 +456,8 @@ def run(plan, args={}):
451456
network_params,
452457
dora_params,
453458
global_node_selectors,
459+
mev_endpoints,
460+
mev_endpoint_names,
454461
)
455462
plan.print("Successfully launched dora")
456463
elif additional_service == "dugtrio":

src/dora/dora_launcher.star

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ def launch_dora(
3636
network_params,
3737
dora_params,
3838
global_node_selectors,
39+
mev_endpoints,
40+
mev_endpoint_names,
3941
):
4042
all_cl_client_info = []
4143
all_el_client_info = []
@@ -59,8 +61,22 @@ def launch_dora(
5961
)
6062
)
6163

64+
mev_endpoint_info = []
65+
for index, endpoint in enumerate(mev_endpoints):
66+
mev_endpoint_info.append(
67+
{
68+
"Index": index,
69+
"Name": mev_endpoint_names[index],
70+
"Url": endpoint,
71+
}
72+
)
73+
6274
template_data = new_config_template_data(
63-
network_params.network, HTTP_PORT_NUMBER, all_cl_client_info, all_el_client_info
75+
network_params.network,
76+
HTTP_PORT_NUMBER,
77+
all_cl_client_info,
78+
all_el_client_info,
79+
mev_endpoint_info,
6480
)
6581

6682
template_and_data = shared_utils.new_template_and_data(
@@ -103,9 +119,7 @@ def get_config(
103119
elif network_params.electra_fork_epoch < 100000000:
104120
IMAGE_NAME = "ethpandaops/dora:electra-support"
105121
else:
106-
IMAGE_NAME = (
107-
"ethpandaops/dora:master" # TODO: revert to latest after next dora release
108-
)
122+
IMAGE_NAME = "ethpandaops/dora:latest"
109123

110124
return ServiceConfig(
111125
image=IMAGE_NAME,
@@ -125,12 +139,15 @@ def get_config(
125139
)
126140

127141

128-
def new_config_template_data(network, listen_port_num, cl_client_info, el_client_info):
142+
def new_config_template_data(
143+
network, listen_port_num, cl_client_info, el_client_info, mev_endpoint_info
144+
):
129145
return {
130146
"Network": network,
131147
"ListenPortNum": listen_port_num,
132148
"CLClientInfo": cl_client_info,
133149
"ELClientInfo": el_client_info,
150+
"MEVRelayInfo": mev_endpoint_info,
134151
"PublicNetwork": True if network in constants.PUBLIC_NETWORKS else False,
135152
}
136153

static_files/dora-config/config.yaml.tmpl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,16 @@ indexer:
6868
# number of seconds to wait between each epoch (don't overload CL client)
6969
syncEpochCooldown: 1
7070

71+
mevIndexer:
72+
# list of mev relays to crawl mev blocks from
73+
relays: {{ if not .MEVRelayInfo }}[]{{ end }}
74+
{{ range $relay := .MEVRelayInfo }}
75+
- index: {{ $relay.Index }}
76+
name: "{{ $relay.Name }}"
77+
url: "{{ $relay.Url }}"
78+
{{- end }}
79+
refreshInterval: 5m
80+
7181
database:
7282
engine: "sqlite"
7383
sqlite:

0 commit comments

Comments
 (0)