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 snooper urls to assertoor config #571

Merged
merged 8 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 66 additions & 21 deletions src/assertoor/assertoor_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ def launch_assertoor(
global_node_selectors,
):
all_client_info = []
vc_info = []
clients_with_validators = []
clients_with_el_snooper = []
clients_with_cl_snooper = []

for index, participant in enumerate(participant_contexts):
(
Expand All @@ -50,27 +52,32 @@ def launch_assertoor(
) = shared_utils.get_client_names(
participant, index, participant_contexts, participant_configs
)
all_client_info.append(
new_client_info(
cl_client.beacon_http_url,
el_client.ip_addr,
el_client.rpc_port_num,
full_name,
)

client_info = new_client_info(
cl_client.beacon_http_url,
el_client.ip_addr,
el_client.rpc_port_num,
participant.snooper_engine_context,
participant.snooper_beacon_context,
full_name,
)

all_client_info.append(client_info)

if participant_config.validator_count != 0:
vc_info.append(
new_client_info(
cl_client.beacon_http_url,
el_client.ip_addr,
el_client.rpc_port_num,
full_name,
)
)
clients_with_validators.append(client_info)
if participant.snooper_engine_context != None:
clients_with_el_snooper.append(client_info)
if participant.snooper_beacon_context != None:
clients_with_cl_snooper.append(client_info)

template_data = new_config_template_data(
HTTP_PORT_NUMBER, all_client_info, vc_info, assertoor_params
HTTP_PORT_NUMBER,
all_client_info,
clients_with_validators,
clients_with_el_snooper,
clients_with_cl_snooper,
assertoor_params,
)

template_and_data = shared_utils.new_template_and_data(
Expand Down Expand Up @@ -136,7 +143,14 @@ def get_config(
)


def new_config_template_data(listen_port_num, client_info, vc_info, assertoor_params):
def new_config_template_data(
listen_port_num,
all_client_info,
clients_with_validators,
clients_with_el_snooper,
clients_with_cl_snooper,
assertoor_params,
):
additional_tests = []
for index, testcfg in enumerate(assertoor_params.tests):
if type(testcfg) == "dict":
Expand All @@ -152,8 +166,10 @@ def new_config_template_data(listen_port_num, client_info, vc_info, assertoor_pa

return {
"ListenPortNum": listen_port_num,
"ClientInfo": client_info,
"ValidatorClientInfo": vc_info,
"ClientInfo": all_client_info,
"ValidatorClientInfo": clients_with_validators,
"ElSnooperClientInfo": clients_with_el_snooper,
"ClSnooperClientInfo": clients_with_cl_snooper,
"RunStabilityCheck": assertoor_params.run_stability_check,
"RunBlockProposalCheck": assertoor_params.run_block_proposal_check,
"RunLifecycleTest": assertoor_params.run_lifecycle_test,
Expand All @@ -164,10 +180,39 @@ def new_config_template_data(listen_port_num, client_info, vc_info, assertoor_pa
}


def new_client_info(beacon_http_url, el_ip_addr, el_port_num, full_name):
def new_client_info(
beacon_http_url,
el_ip_addr,
el_port_num,
el_snooper_context,
cl_snooper_context,
full_name,
):
el_snooper_enabled = False
el_snooper_url = ""
cl_snooper_enabled = False
cl_snooper_url = ""

if el_snooper_context != None:
el_snooper_enabled = True
el_snooper_url = "http://{0}:{1}".format(
el_snooper_context.ip_addr,
el_snooper_context.engine_rpc_port_num,
)
if cl_snooper_context != None:
cl_snooper_enabled = True
cl_snooper_url = "http://{0}:{1}".format(
cl_snooper_context.ip_addr,
cl_snooper_context.beacon_rpc_port_num,
)

return {
"CL_HTTP_URL": beacon_http_url,
"ELIPAddr": el_ip_addr,
"ELPortNum": el_port_num,
"ELSnooperEnabled": el_snooper_enabled,
"ELSnooperUrl": el_snooper_url,
"CLSnooperEnabled": cl_snooper_enabled,
"CLSnooperUrl": cl_snooper_url,
"Name": full_name,
}
2 changes: 2 additions & 0 deletions src/participant.star
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ def new_participant(
cl_context,
vc_context,
snooper_engine_context,
snooper_beacon_context,
ethereum_metrics_exporter_context,
xatu_sentry_context,
):
Expand All @@ -17,6 +18,7 @@ def new_participant(
cl_context=cl_context,
vc_context=vc_context,
snooper_engine_context=snooper_engine_context,
snooper_beacon_context=snooper_beacon_context,
ethereum_metrics_exporter_context=ethereum_metrics_exporter_context,
xatu_sentry_context=xatu_sentry_context,
)
5 changes: 5 additions & 0 deletions src/participant_network.star
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,15 @@ def launch_participant_network(
# This should only be the case for the MEV participant,
# the regular participants default to False/True
all_vc_contexts.append(None)
all_snooper_beacon_contexts.append(None)
continue

if cl_type in _cls_that_need_separate_vc and not participant.use_separate_vc:
fail("{0} needs a separate validator client!".format(cl_type))

if not participant.use_separate_vc:
all_vc_contexts.append(None)
all_snooper_beacon_contexts.append(None)
continue

plan.print(
Expand Down Expand Up @@ -347,13 +349,15 @@ def launch_participant_network(
cl_type = participant.cl_type
vc_type = participant.vc_type
snooper_engine_context = None
snooper_beacon_context = None

el_context = all_el_contexts[index]
cl_context = all_cl_contexts[index]
vc_context = all_vc_contexts[index]

if participant.snooper_enabled:
snooper_engine_context = all_snooper_engine_contexts[index]
snooper_beacon_context = all_snooper_beacon_contexts[index]

ethereum_metrics_exporter_context = None

Expand All @@ -374,6 +378,7 @@ def launch_participant_network(
cl_context,
vc_context,
snooper_engine_context,
snooper_beacon_context,
ethereum_metrics_exporter_context,
xatu_sentry_context,
)
Expand Down
46 changes: 30 additions & 16 deletions static_files/assertoor-config/config.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ endpoints:
- name: "{{ $client.Name }}"
consensusUrl: "{{ $client.CL_HTTP_URL }}"
executionUrl: "http://{{ $client.ELIPAddr }}:{{ $client.ELPortNum }}"
{{- if .ELSnooperEnabled }}
executionSnooperUrl: "{{ $client.ELSnooperUrl }}"
{{- end }}
{{- if .CLSnooperEnabled }}
consensusSnooperUrl: "{{ $client.CLSnooperUrl }}"
{{- end }}
{{- end }}

web:
Expand All @@ -23,33 +29,41 @@ validatorNames:
globalVars:
walletPrivkey: "850643a0224065ecce3882673c21f56bcf6eef86274cc21cadff15930b59fc8c"
clientPairNames:
{{ range $client := .ClientInfo }}
{{- range $client := .ClientInfo }}
- "{{ $client.Name }}"
{{- end }}
validatorPairNames: {{ if eq (len .ValidatorClientInfo) 0 }}[]{{ end }}
{{- range $client := .ValidatorClientInfo }}
- "{{ $client.Name }}"
{{- end }}
validatorPairNames:
{{ range $client := .ValidatorClientInfo }}
elSnooperClientPairNames: {{ if eq (len .ElSnooperClientInfo) 0 }}[]{{ end }}
{{- range $client := .ElSnooperClientInfo }}
- "{{ $client.Name }}"
{{- end }}
clSnooperClientPairNames: {{ if eq (len .ClSnooperClientInfo) 0 }}[]{{ end }}
{{- range $client := .ClSnooperClientInfo }}
- "{{ $client.Name }}"
{{- end }}

externalTests:
{{ if .RunStabilityCheck }}
{{- if .RunStabilityCheck }}
- file: /tests/stability-check.yaml
{{ end }}
{{ if .RunBlockProposalCheck }}
{{- end }}
{{- if .RunBlockProposalCheck }}
- file: /tests/block-proposal-check.yaml
{{ end }}
{{ if .RunTransactionTest }}
{{- end }}
{{- if .RunTransactionTest }}
- file: /tests/eoa-transactions-test.yaml
{{ end }}
{{ if .RunBlobTransactionTest }}
{{- end }}
{{- if .RunBlobTransactionTest }}
- file: /tests/blob-transactions-test.yaml
{{ end }}
{{ if .RunOpcodesTransactionTest }}
{{- end }}
{{- if .RunOpcodesTransactionTest }}
- file: /tests/all-opcodes-transaction-test.yaml
{{ end }}
{{ if .RunLifecycleTest }}
{{- end }}
{{- if .RunLifecycleTest }}
- file: /tests/validator-lifecycle-test.yaml
{{ end }}
{{ range $test := .AdditionalTests }}
{{- end }}
{{- range $test := .AdditionalTests }}
- {{ $test }}
{{- end }}