Skip to content

Commit

Permalink
fix: blobber incorrect url (#528)
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabasbusa authored Mar 28, 2024
1 parent 47d0ea0 commit 6f84e3d
Show file tree
Hide file tree
Showing 21 changed files with 45 additions and 75 deletions.
11 changes: 4 additions & 7 deletions main.star
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ def run(plan, args={}):
all_el_contexts[0].ip_addr,
all_el_contexts[0].engine_rpc_port_num,
)
beacon_uri = "{0}:{1}".format(
all_cl_contexts[0].ip_addr, all_cl_contexts[0].http_port_num
)
beacon_uri = "{0}".format(all_cl_contexts[0].beacon_http_url)[
7:
] # remove http://
endpoint = mock_mev.launch_mock_mev(
plan,
el_uri,
Expand All @@ -199,10 +199,7 @@ def run(plan, args={}):
all_el_contexts[-1].ip_addr, all_el_contexts[-1].rpc_port_num
)
beacon_uris = ",".join(
[
"http://{0}:{1}".format(context.ip_addr, context.http_port_num)
for context in all_cl_contexts
]
["{0}".format(context.beacon_http_url) for context in all_cl_contexts]
)

first_cl_client = all_cl_contexts[0]
Expand Down
11 changes: 4 additions & 7 deletions src/assertoor/assertoor_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ def launch_assertoor(
)
all_client_info.append(
new_client_info(
cl_client.ip_addr,
cl_client.http_port_num,
cl_client.beacon_http_url,
el_client.ip_addr,
el_client.rpc_port_num,
full_name,
Expand All @@ -63,8 +62,7 @@ def launch_assertoor(
if participant_config.validator_count != 0:
vc_info.append(
new_client_info(
cl_client.ip_addr,
cl_client.http_port_num,
cl_client.beacon_http_url,
el_client.ip_addr,
el_client.rpc_port_num,
full_name,
Expand Down Expand Up @@ -164,10 +162,9 @@ def new_config_template_data(listen_port_num, client_info, vc_info, assertoor_pa
}


def new_client_info(cl_ip_addr, cl_port_num, el_ip_addr, el_port_num, full_name):
def new_client_info(beacon_http_url, el_ip_addr, el_port_num, full_name):
return {
"CLIPAddr": cl_ip_addr,
"CLPortNum": cl_port_num,
"CL_HTTP_URL": beacon_http_url,
"ELIPAddr": el_ip_addr,
"ELPortNum": el_port_num,
"Name": full_name,
Expand Down
7 changes: 3 additions & 4 deletions src/beacon_metrics_gazer/beacon_metrics_gazer_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ def launch_beacon_metrics_gazer(
global_node_selectors,
):
config = get_config(
cl_contexts[0].ip_addr,
cl_contexts[0].http_port_num,
cl_contexts[0].beacon_http_url,
global_node_selectors,
)

Expand All @@ -57,7 +56,7 @@ def launch_beacon_metrics_gazer(
)


def get_config(ip_addr, http_port_num, node_selectors):
def get_config(beacon_http_url, node_selectors):
config_file_path = shared_utils.path_join(
BEACON_METRICS_GAZER_CONFIG_MOUNT_DIRPATH_ON_SERVICE,
BEACON_METRICS_GAZER_CONFIG_FILENAME,
Expand All @@ -69,7 +68,7 @@ def get_config(ip_addr, http_port_num, node_selectors):
BEACON_METRICS_GAZER_CONFIG_MOUNT_DIRPATH_ON_SERVICE: VALIDATOR_RANGES_ARTIFACT_NAME,
},
cmd=[
"http://{0}:{1}".format(ip_addr, http_port_num),
"{0}".format(beacon_http_url),
"--ranges-file",
config_file_path,
"--port",
Expand Down
9 changes: 4 additions & 5 deletions src/blob_spammer/blob_spammer.star
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,12 @@ def get_config(
[
"apk update",
"apk add curl jq",
'current_epoch=$(curl -s http://{0}:{1}/eth/v2/beacon/blocks/head | jq -r ".version")'.format(
cl_context.ip_addr, cl_context.http_port_num
'current_epoch=$(curl -s {0}/eth/v2/beacon/blocks/head | jq -r ".version")'.format(
cl_context.beacon_http_url,
),
"echo $current_epoch",
'while [ $current_epoch != "deneb" ]; do echo "waiting for deneb, current epoch is $current_epoch"; current_epoch=$(curl -s http://{0}:{1}/eth/v2/beacon/blocks/head | jq -r ".version"); sleep {2}; done'.format(
cl_context.ip_addr,
cl_context.http_port_num,
'while [ $current_epoch != "deneb" ]; do echo "waiting for deneb, current epoch is $current_epoch"; current_epoch=$(curl -s {0}/eth/v2/beacon/blocks/head | jq -r ".version"); sleep {1}; done'.format(
cl_context.beacon_http_url,
seconds_per_slot,
),
'echo "sleep is over, starting to send blob transactions"',
Expand Down
4 changes: 1 addition & 3 deletions src/blobscan/blobscan_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ def launch_blobscan(
global_node_selectors,
):
node_selectors = global_node_selectors
beacon_node_rpc_uri = "http://{0}:{1}".format(
cl_contexts[0].ip_addr, cl_contexts[0].http_port_num
)
beacon_node_rpc_uri = "{0}".format(cl_contexts[0].beacon_http_url)
execution_node_rpc_uri = "http://{0}:{1}".format(
el_contexts[0].ip_addr, el_contexts[0].rpc_port_num
)
Expand Down
6 changes: 2 additions & 4 deletions src/cl/cl_context.star
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
def new_cl_context(
client_name,
enr,
ip_addr,
http_port_num,
beacon_http_url,
cl_nodes_metrics_info,
beacon_service_name,
multiaddr="",
Expand All @@ -14,8 +13,7 @@ def new_cl_context(
return struct(
client_name=client_name,
enr=enr,
ip_addr=ip_addr,
http_port_num=http_port_num,
beacon_http_url=beacon_http_url,
cl_nodes_metrics_info=cl_nodes_metrics_info,
beacon_service_name=beacon_service_name,
multiaddr=multiaddr,
Expand Down
4 changes: 1 addition & 3 deletions src/cl/grandine/grandine_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,10 @@ def launch(
service_name, BEACON_METRICS_PATH, beacon_metrics_url
)
nodes_metrics_info = [beacon_node_metrics_info]

return cl_context.new_cl_context(
"grandine",
beacon_node_enr,
beacon_service.ip_address,
BEACON_HTTP_PORT_NUM,
beacon_http_url,
nodes_metrics_info,
beacon_service_name,
multiaddr=beacon_multiaddr,
Expand Down
5 changes: 2 additions & 3 deletions src/cl/lighthouse/lighthouse_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,10 @@ def launch(
beacon_service_name, METRICS_PATH, beacon_metrics_url
)
nodes_metrics_info = [beacon_node_metrics_info]

return cl_context.new_cl_context(
"lighthouse",
beacon_node_enr,
beacon_service.ip_address,
BEACON_HTTP_PORT_NUM,
beacon_http_url,
nodes_metrics_info,
beacon_service_name,
beacon_multiaddr,
Expand Down Expand Up @@ -300,6 +298,7 @@ def get_beacon_config(
# ^^^^^^^^^^^^^^^^^^^ METRICS CONFIG ^^^^^^^^^^^^^^^^^^^^^
# Enable this flag once we have https://github.com/sigp/lighthouse/issues/5054 fixed
# "--allow-insecure-genesis-sync",
"--enable-private-discovery",
]

if network not in constants.PUBLIC_NETWORKS:
Expand Down
3 changes: 1 addition & 2 deletions src/cl/lodestar/lodestar_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,7 @@ def launch(
return cl_context.new_cl_context(
"lodestar",
beacon_node_enr,
beacon_service.ip_address,
HTTP_PORT_NUM,
beacon_http_url,
nodes_metrics_info,
beacon_service_name,
beacon_multiaddr,
Expand Down
3 changes: 1 addition & 2 deletions src/cl/nimbus/nimbus_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,7 @@ def launch(
return cl_context.new_cl_context(
"nimbus",
beacon_node_enr,
beacon_service.ip_address,
BEACON_HTTP_PORT_NUM,
beacon_http_url,
nodes_metrics_info,
beacon_service_name,
beacon_multiaddr,
Expand Down
5 changes: 2 additions & 3 deletions src/cl/prysm/prysm_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def launch(

beacon_http_endpoint = "{0}:{1}".format(beacon_service.ip_address, HTTP_PORT_NUM)
beacon_rpc_endpoint = "{0}:{1}".format(beacon_service.ip_address, RPC_PORT_NUM)

beacon_http_url = beacon_http_endpoint
# TODO(old) add validator availability using the validator API: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v1#/ValidatorRequiredApi | from eth2-merge-kurtosis-module
beacon_node_identity_recipe = GetHttpRequestRecipe(
endpoint="/eth/v1/node/identity",
Expand Down Expand Up @@ -180,8 +180,7 @@ def launch(
return cl_context.new_cl_context(
"prysm",
beacon_node_enr,
beacon_service.ip_address,
HTTP_PORT_NUM,
beacon_http_url,
nodes_metrics_info,
beacon_service_name,
beacon_multiaddr,
Expand Down
3 changes: 1 addition & 2 deletions src/cl/teku/teku_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ def launch(
return cl_context.new_cl_context(
"teku",
beacon_node_enr,
beacon_service.ip_address,
BEACON_HTTP_PORT_NUM,
beacon_http_url,
nodes_metrics_info,
beacon_service_name,
multiaddr=beacon_multiaddr,
Expand Down
8 changes: 3 additions & 5 deletions src/dora/dora_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ def launch_dora(
)
all_cl_client_info.append(
new_cl_client_info(
cl_client.ip_addr,
cl_client.http_port_num,
cl_client.beacon_http_url,
full_name,
)
)
Expand Down Expand Up @@ -115,9 +114,8 @@ def new_config_template_data(network, listen_port_num, cl_client_info):
}


def new_cl_client_info(ip_addr, port_num, full_name):
def new_cl_client_info(beacon_http_url, full_name):
return {
"IPAddr": ip_addr,
"PortNum": port_num,
"Beacon_HTTP_URL": beacon_http_url,
"FullName": full_name,
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ def launch(
"--metrics-port",
str(METRICS_PORT_NUMBER),
"--consensus-url",
"http://{}:{}".format(
cl_context.ip_addr,
cl_context.http_port_num,
"{0}".format(
cl_context.beacon_http_url,
),
"--execution-url",
"http://{}:{}".format(
Expand Down
9 changes: 4 additions & 5 deletions src/goomy_blob/goomy_blob.star
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,11 @@ def get_config(
[
"apt-get update",
"apt-get install -y curl jq",
'current_epoch=$(curl -s http://{0}:{1}/eth/v2/beacon/blocks/head | jq -r ".version")'.format(
cl_context.ip_addr, cl_context.http_port_num
'current_epoch=$(curl -s {0}/eth/v2/beacon/blocks/head | jq -r ".version")'.format(
cl_context.beacon_http_url,
),
'while [ $current_epoch != "deneb" ]; do echo "waiting for deneb, current epoch is $current_epoch"; current_epoch=$(curl -s http://{0}:{1}/eth/v2/beacon/blocks/head | jq -r ".version"); sleep {2}; done'.format(
cl_context.ip_addr,
cl_context.http_port_num,
'while [ $current_epoch != "deneb" ]; do echo "waiting for deneb, current epoch is $current_epoch"; current_epoch=$(curl -s {0}/eth/v2/beacon/blocks/head | jq -r ".version"); sleep {1}; done'.format(
cl_context.beacon_http_url,
seconds_per_slot,
),
'echo "sleep is over, starting to send blob transactions"',
Expand Down
5 changes: 2 additions & 3 deletions src/snooper/snooper_beacon_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ def launch(plan, service_name, cl_context, node_selectors):


def get_config(service_name, cl_context, node_selectors):
beacon_rpc_port_num = "http://{0}:{1}".format(
cl_context.ip_addr,
cl_context.http_port_num,
beacon_rpc_port_num = "{0}".format(
cl_context.beacon_http_url,
)
cmd = [
SNOOPER_BINARY_COMMAND,
Expand Down
5 changes: 2 additions & 3 deletions src/vc/prysm.star
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ def get_config(
+ constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER
+ "/config.yaml",
"--beacon-rpc-provider="
+ "{}:{}".format(
cl_context.ip_addr,
PRYSM_BEACON_RPC_PORT,
+ "{0}".format(
cl_context.beacon_http_url,
),
"--beacon-rest-api-provider=" + beacon_http_url,
"--wallet-dir=" + validator_keys_dirpath,
Expand Down
8 changes: 3 additions & 5 deletions src/vc/vc_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,14 @@ def launch(
)

if snooper_enabled:
beacon_http_url = "http://{}:{}".format(
beacon_http_url = "http://{0}:{1}".format(
snooper_beacon_context.ip_addr,
snooper_beacon_context.beacon_rpc_port_num,
)
else:
beacon_http_url = "http://{}:{}".format(
cl_context.ip_addr,
cl_context.http_port_num,
beacon_http_url = "{0}".format(
cl_context.beacon_http_url,
)

vc_min_cpu = int(vc_min_cpu) if int(vc_min_cpu) > 0 else MIN_CPU
vc_max_cpu = int(vc_max_cpu) if int(vc_max_cpu) > 0 else MAX_CPU
vc_min_mem = int(vc_min_mem) if int(vc_min_mem) > 0 else MIN_MEMORY
Expand Down
5 changes: 1 addition & 4 deletions src/xatu_sentry/xatu_sentry_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ def launch(
template_data = new_config_template_data(
str(METRICS_PORT_NUMBER),
pair_name,
"http://{}:{}".format(
cl_context.ip_addr,
cl_context.http_port_num,
),
"{0}".format(cl_context.beacon_http_url),
xatu_sentry_params.xatu_server_addr,
network_params.network,
xatu_sentry_params.beacon_subscriptions,
Expand Down
2 changes: 1 addition & 1 deletion static_files/assertoor-config/config.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
endpoints:
{{ range $client := .ClientInfo }}
- name: "{{ $client.Name }}"
consensusUrl: "http://{{ $client.CLIPAddr }}:{{ $client.CLPortNum }}"
consensusUrl: "{{ $client.CL_HTTP_URL }}"
executionUrl: "http://{{ $client.ELIPAddr }}:{{ $client.ELPortNum }}"
{{- end }}

Expand Down
2 changes: 1 addition & 1 deletion static_files/dora-config/config.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ beaconapi:
# CL Client RPC
endpoints:
{{ range $clClient := .CLClientInfo }}
- url: "http://{{ $clClient.IPAddr }}:{{ $clClient.PortNum }}"
- url: "{{ $clClient.Beacon_HTTP_URL }}"
name: "{{ $clClient.FullName }}"
archive: true
{{- end }}
Expand Down

0 comments on commit 6f84e3d

Please sign in to comment.