Commit 87f383fb authored by pk910's avatar pk910 Committed by GitHub

feat: add snooper urls to assertoor config (#571)

Add URL to RPC snoopers to assertoor config when snoopers are enabled.
This will allow assertoor to use the special snooper control api for
further tests
parent 02b9c504
...@@ -39,7 +39,9 @@ def launch_assertoor( ...@@ -39,7 +39,9 @@ def launch_assertoor(
global_node_selectors, global_node_selectors,
): ):
all_client_info = [] all_client_info = []
vc_info = [] clients_with_validators = []
clients_with_el_snooper = []
clients_with_cl_snooper = []
for index, participant in enumerate(participant_contexts): for index, participant in enumerate(participant_contexts):
( (
...@@ -50,27 +52,32 @@ def launch_assertoor( ...@@ -50,27 +52,32 @@ def launch_assertoor(
) = shared_utils.get_client_names( ) = shared_utils.get_client_names(
participant, index, participant_contexts, participant_configs participant, index, participant_contexts, participant_configs
) )
all_client_info.append(
new_client_info( client_info = new_client_info(
cl_client.beacon_http_url, cl_client.beacon_http_url,
el_client.ip_addr, el_client.ip_addr,
el_client.rpc_port_num, el_client.rpc_port_num,
full_name, participant.snooper_engine_context,
) participant.snooper_beacon_context,
full_name,
) )
all_client_info.append(client_info)
if participant_config.validator_count != 0: if participant_config.validator_count != 0:
vc_info.append( clients_with_validators.append(client_info)
new_client_info( if participant.snooper_engine_context != None:
cl_client.beacon_http_url, clients_with_el_snooper.append(client_info)
el_client.ip_addr, if participant.snooper_beacon_context != None:
el_client.rpc_port_num, clients_with_cl_snooper.append(client_info)
full_name,
)
)
template_data = new_config_template_data( 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( template_and_data = shared_utils.new_template_and_data(
...@@ -136,7 +143,14 @@ def get_config( ...@@ -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 = [] additional_tests = []
for index, testcfg in enumerate(assertoor_params.tests): for index, testcfg in enumerate(assertoor_params.tests):
if type(testcfg) == "dict": if type(testcfg) == "dict":
...@@ -152,8 +166,10 @@ def new_config_template_data(listen_port_num, client_info, vc_info, assertoor_pa ...@@ -152,8 +166,10 @@ def new_config_template_data(listen_port_num, client_info, vc_info, assertoor_pa
return { return {
"ListenPortNum": listen_port_num, "ListenPortNum": listen_port_num,
"ClientInfo": client_info, "ClientInfo": all_client_info,
"ValidatorClientInfo": vc_info, "ValidatorClientInfo": clients_with_validators,
"ElSnooperClientInfo": clients_with_el_snooper,
"ClSnooperClientInfo": clients_with_cl_snooper,
"RunStabilityCheck": assertoor_params.run_stability_check, "RunStabilityCheck": assertoor_params.run_stability_check,
"RunBlockProposalCheck": assertoor_params.run_block_proposal_check, "RunBlockProposalCheck": assertoor_params.run_block_proposal_check,
"RunLifecycleTest": assertoor_params.run_lifecycle_test, "RunLifecycleTest": assertoor_params.run_lifecycle_test,
...@@ -164,10 +180,39 @@ def new_config_template_data(listen_port_num, client_info, vc_info, assertoor_pa ...@@ -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 { return {
"CL_HTTP_URL": beacon_http_url, "CL_HTTP_URL": beacon_http_url,
"ELIPAddr": el_ip_addr, "ELIPAddr": el_ip_addr,
"ELPortNum": el_port_num, "ELPortNum": el_port_num,
"ELSnooperEnabled": el_snooper_enabled,
"ELSnooperUrl": el_snooper_url,
"CLSnooperEnabled": cl_snooper_enabled,
"CLSnooperUrl": cl_snooper_url,
"Name": full_name, "Name": full_name,
} }
...@@ -6,6 +6,7 @@ def new_participant( ...@@ -6,6 +6,7 @@ def new_participant(
cl_context, cl_context,
vc_context, vc_context,
snooper_engine_context, snooper_engine_context,
snooper_beacon_context,
ethereum_metrics_exporter_context, ethereum_metrics_exporter_context,
xatu_sentry_context, xatu_sentry_context,
): ):
...@@ -17,6 +18,7 @@ def new_participant( ...@@ -17,6 +18,7 @@ def new_participant(
cl_context=cl_context, cl_context=cl_context,
vc_context=vc_context, vc_context=vc_context,
snooper_engine_context=snooper_engine_context, snooper_engine_context=snooper_engine_context,
snooper_beacon_context=snooper_beacon_context,
ethereum_metrics_exporter_context=ethereum_metrics_exporter_context, ethereum_metrics_exporter_context=ethereum_metrics_exporter_context,
xatu_sentry_context=xatu_sentry_context, xatu_sentry_context=xatu_sentry_context,
) )
...@@ -261,6 +261,7 @@ def launch_participant_network( ...@@ -261,6 +261,7 @@ def launch_participant_network(
# This should only be the case for the MEV participant, # This should only be the case for the MEV participant,
# the regular participants default to False/True # the regular participants default to False/True
all_vc_contexts.append(None) all_vc_contexts.append(None)
all_snooper_beacon_contexts.append(None)
continue continue
if cl_type in _cls_that_need_separate_vc and not participant.use_separate_vc: if cl_type in _cls_that_need_separate_vc and not participant.use_separate_vc:
...@@ -268,6 +269,7 @@ def launch_participant_network( ...@@ -268,6 +269,7 @@ def launch_participant_network(
if not participant.use_separate_vc: if not participant.use_separate_vc:
all_vc_contexts.append(None) all_vc_contexts.append(None)
all_snooper_beacon_contexts.append(None)
continue continue
plan.print( plan.print(
...@@ -347,6 +349,7 @@ def launch_participant_network( ...@@ -347,6 +349,7 @@ def launch_participant_network(
cl_type = participant.cl_type cl_type = participant.cl_type
vc_type = participant.vc_type vc_type = participant.vc_type
snooper_engine_context = None snooper_engine_context = None
snooper_beacon_context = None
el_context = all_el_contexts[index] el_context = all_el_contexts[index]
cl_context = all_cl_contexts[index] cl_context = all_cl_contexts[index]
...@@ -354,6 +357,7 @@ def launch_participant_network( ...@@ -354,6 +357,7 @@ def launch_participant_network(
if participant.snooper_enabled: if participant.snooper_enabled:
snooper_engine_context = all_snooper_engine_contexts[index] snooper_engine_context = all_snooper_engine_contexts[index]
snooper_beacon_context = all_snooper_beacon_contexts[index]
ethereum_metrics_exporter_context = None ethereum_metrics_exporter_context = None
...@@ -374,6 +378,7 @@ def launch_participant_network( ...@@ -374,6 +378,7 @@ def launch_participant_network(
cl_context, cl_context,
vc_context, vc_context,
snooper_engine_context, snooper_engine_context,
snooper_beacon_context,
ethereum_metrics_exporter_context, ethereum_metrics_exporter_context,
xatu_sentry_context, xatu_sentry_context,
) )
......
...@@ -4,6 +4,12 @@ endpoints: ...@@ -4,6 +4,12 @@ endpoints:
- name: "{{ $client.Name }}" - name: "{{ $client.Name }}"
consensusUrl: "{{ $client.CL_HTTP_URL }}" consensusUrl: "{{ $client.CL_HTTP_URL }}"
executionUrl: "http://{{ $client.ELIPAddr }}:{{ $client.ELPortNum }}" executionUrl: "http://{{ $client.ELIPAddr }}:{{ $client.ELPortNum }}"
{{- if .ELSnooperEnabled }}
executionSnooperUrl: "{{ $client.ELSnooperUrl }}"
{{- end }}
{{- if .CLSnooperEnabled }}
consensusSnooperUrl: "{{ $client.CLSnooperUrl }}"
{{- end }}
{{- end }} {{- end }}
web: web:
...@@ -23,33 +29,41 @@ validatorNames: ...@@ -23,33 +29,41 @@ validatorNames:
globalVars: globalVars:
walletPrivkey: "850643a0224065ecce3882673c21f56bcf6eef86274cc21cadff15930b59fc8c" walletPrivkey: "850643a0224065ecce3882673c21f56bcf6eef86274cc21cadff15930b59fc8c"
clientPairNames: clientPairNames:
{{ range $client := .ClientInfo }} {{- range $client := .ClientInfo }}
- "{{ $client.Name }}"
{{- end }}
validatorPairNames: {{ if eq (len .ValidatorClientInfo) 0 }}[]{{ end }}
{{- range $client := .ValidatorClientInfo }}
- "{{ $client.Name }}" - "{{ $client.Name }}"
{{- end }} {{- end }}
validatorPairNames: elSnooperClientPairNames: {{ if eq (len .ElSnooperClientInfo) 0 }}[]{{ end }}
{{ range $client := .ValidatorClientInfo }} {{- range $client := .ElSnooperClientInfo }}
- "{{ $client.Name }}"
{{- end }}
clSnooperClientPairNames: {{ if eq (len .ClSnooperClientInfo) 0 }}[]{{ end }}
{{- range $client := .ClSnooperClientInfo }}
- "{{ $client.Name }}" - "{{ $client.Name }}"
{{- end }} {{- end }}
externalTests: externalTests:
{{ if .RunStabilityCheck }} {{- if .RunStabilityCheck }}
- file: /tests/stability-check.yaml - file: /tests/stability-check.yaml
{{ end }} {{- end }}
{{ if .RunBlockProposalCheck }} {{- if .RunBlockProposalCheck }}
- file: /tests/block-proposal-check.yaml - file: /tests/block-proposal-check.yaml
{{ end }} {{- end }}
{{ if .RunTransactionTest }} {{- if .RunTransactionTest }}
- file: /tests/eoa-transactions-test.yaml - file: /tests/eoa-transactions-test.yaml
{{ end }} {{- end }}
{{ if .RunBlobTransactionTest }} {{- if .RunBlobTransactionTest }}
- file: /tests/blob-transactions-test.yaml - file: /tests/blob-transactions-test.yaml
{{ end }} {{- end }}
{{ if .RunOpcodesTransactionTest }} {{- if .RunOpcodesTransactionTest }}
- file: /tests/all-opcodes-transaction-test.yaml - file: /tests/all-opcodes-transaction-test.yaml
{{ end }} {{- end }}
{{ if .RunLifecycleTest }} {{- if .RunLifecycleTest }}
- file: /tests/validator-lifecycle-test.yaml - file: /tests/validator-lifecycle-test.yaml
{{ end }} {{- end }}
{{ range $test := .AdditionalTests }} {{- range $test := .AdditionalTests }}
- {{ $test }} - {{ $test }}
{{- end }} {{- end }}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment