From 2a20d5ad7d2bf8f9a9eb2b619681b438810176d2 Mon Sep 17 00:00:00 2001 From: pk910 Date: Mon, 6 May 2024 09:33:31 +0200 Subject: [PATCH] feat: add execution client urls to dora config (#588) upcoming version of dora uses execution layer clients to crawl the deposit contract log. This PR adds the execution client urls to the dora config. --- src/dora/dora_launcher.star | 24 ++++++++++++++++++++--- static_files/dora-config/config.yaml.tmpl | 9 +++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/dora/dora_launcher.star b/src/dora/dora_launcher.star index 4b39f9cdd..74cd55453 100644 --- a/src/dora/dora_launcher.star +++ b/src/dora/dora_launcher.star @@ -37,8 +37,9 @@ def launch_dora( global_node_selectors, ): all_cl_client_info = [] + all_el_client_info = [] for index, participant in enumerate(participant_contexts): - full_name, cl_client, _, _ = shared_utils.get_client_names( + full_name, cl_client, el_client, _ = shared_utils.get_client_names( participant, index, participant_contexts, participant_configs ) all_cl_client_info.append( @@ -47,9 +48,18 @@ def launch_dora( full_name, ) ) + all_el_client_info.append( + new_el_client_info( + "http://{0}:{1}".format( + el_client.ip_addr, + el_client.rpc_port_num, + ), + full_name, + ) + ) template_data = new_config_template_data( - network_params.network, HTTP_PORT_NUMBER, all_cl_client_info + network_params.network, HTTP_PORT_NUMBER, all_cl_client_info, all_el_client_info ) template_and_data = shared_utils.new_template_and_data( @@ -105,11 +115,12 @@ def get_config( ) -def new_config_template_data(network, listen_port_num, cl_client_info): +def new_config_template_data(network, listen_port_num, cl_client_info, el_client_info): return { "Network": network, "ListenPortNum": listen_port_num, "CLClientInfo": cl_client_info, + "ELClientInfo": el_client_info, "PublicNetwork": True if network in constants.PUBLIC_NETWORKS else False, } @@ -119,3 +130,10 @@ def new_cl_client_info(beacon_http_url, full_name): "Beacon_HTTP_URL": beacon_http_url, "FullName": full_name, } + + +def new_el_client_info(execution_http_url, full_name): + return { + "Execution_HTTP_URL": execution_http_url, + "FullName": full_name, + } diff --git a/static_files/dora-config/config.yaml.tmpl b/static_files/dora-config/config.yaml.tmpl index 41205331b..e511fd468 100644 --- a/static_files/dora-config/config.yaml.tmpl +++ b/static_files/dora-config/config.yaml.tmpl @@ -45,6 +45,15 @@ beaconapi: redisCacheAddr: "" redisCachePrefix: "" +executionapi: + endpoints: +{{ range $clClient := .ELClientInfo }} + - url: "{{ $clClient.Execution_HTTP_URL }}" + name: "{{ $clClient.FullName }}" + archive: true +{{- end }} + depositLogBatchSize: 1000 + # indexer keeps track of the latest epochs in memory. indexer: # max number of epochs to keep in memory