From 0bfb6d63f010e27c0a7cecba5390af30b6f071fb Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Mon, 7 Oct 2024 14:26:33 +0200 Subject: [PATCH 1/8] fix: vc_count bad index --- src/package_io/input_parser.star | 12 ++++++++++++ src/participant_network.star | 12 ++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/package_io/input_parser.star b/src/package_io/input_parser.star index 7c4b7418e..970e567af 100644 --- a/src/package_io/input_parser.star +++ b/src/package_io/input_parser.star @@ -590,6 +590,18 @@ def parse_network_params(plan, input_args): + participant["cl_type"], ) ) + if participant["vc_count"] > 0 and participant["use_separate_vc"] != True: + fail( + "vc_count is set to {0} but use_separate_vc is set to {1} for participant: {2}. You have to use use_separate_vc = True for teku/nimbus if you want to set vc_count.".format( + participant["vc_count"], + participant["use_separate_vc"], + str(index + 1) + + "-" + + participant["el_type"] + + "-" + + participant["cl_type"], + ) + ) snooper_enabled = participant["snooper_enabled"] if snooper_enabled == None: diff --git a/src/participant_network.star b/src/participant_network.star index b519dc8d8..d4898efa4 100644 --- a/src/participant_network.star +++ b/src/participant_network.star @@ -290,12 +290,12 @@ def launch_participant_network( vc_keystores = None if participant.validator_count != 0: - if participant.vc_count == 1: - vc_keystores = preregistered_validator_keys_for_nodes[index] - else: - vc_keystores = preregistered_validator_keys_for_nodes[ - index + sub_index - ] + vc_keystores = preregistered_validator_keys_for_nodes[current_vc_index] + plan.print( + "index: {0}, subindex: {1}, vc_keystores: {2}, current_vc_index: {3}".format( + index, sub_index, vc_keystores, current_vc_index + ) + ) vc_context = None snooper_beacon_context = None From a14ab014dbd7a18e5e28a2dea88a6e0f7030fe8b Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Mon, 7 Oct 2024 14:27:42 +0200 Subject: [PATCH 2/8] remove print --- src/participant_network.star | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/participant_network.star b/src/participant_network.star index d4898efa4..eebf32d77 100644 --- a/src/participant_network.star +++ b/src/participant_network.star @@ -291,11 +291,6 @@ def launch_participant_network( vc_keystores = None if participant.validator_count != 0: vc_keystores = preregistered_validator_keys_for_nodes[current_vc_index] - plan.print( - "index: {0}, subindex: {1}, vc_keystores: {2}, current_vc_index: {3}".format( - index, sub_index, vc_keystores, current_vc_index - ) - ) vc_context = None snooper_beacon_context = None From 0e823625513bdbd6d38799546b5e8100c11e1f7e Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Mon, 7 Oct 2024 14:31:56 +0200 Subject: [PATCH 3/8] fix vc count more than one --- src/package_io/input_parser.star | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/package_io/input_parser.star b/src/package_io/input_parser.star index 970e567af..e9da3e1da 100644 --- a/src/package_io/input_parser.star +++ b/src/package_io/input_parser.star @@ -590,7 +590,7 @@ def parse_network_params(plan, input_args): + participant["cl_type"], ) ) - if participant["vc_count"] > 0 and participant["use_separate_vc"] != True: + if participant["vc_count"] > 1 and participant["use_separate_vc"] != True: fail( "vc_count is set to {0} but use_separate_vc is set to {1} for participant: {2}. You have to use use_separate_vc = True for teku/nimbus if you want to set vc_count.".format( participant["vc_count"], From 08194ce1b3c1aa609fd3971dc967680edbbc25bd Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Mon, 7 Oct 2024 15:16:41 +0200 Subject: [PATCH 4/8] fix cl launch vc count --- src/cl/cl_launcher.star | 10 ++++++++-- src/participant_network.star | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/cl/cl_launcher.star b/src/cl/cl_launcher.star index ea1dbf5c3..4c0893c28 100644 --- a/src/cl/cl_launcher.star +++ b/src/cl/cl_launcher.star @@ -84,7 +84,7 @@ def launch( "launch_method": grandine.launch, }, } - + current_vc_index = 0 all_snooper_engine_contexts = [] all_cl_contexts = [] preregistered_validator_keys_for_nodes = ( @@ -122,10 +122,15 @@ def launch( cl_service_name = "cl-{0}-{1}-{2}".format(index_str, cl_type, el_type) new_cl_node_validator_keystores = None - if participant.validator_count != 0 and participant.vc_count != 0: + if ( + participant.validator_count != 0 + and participant.vc_count != 0 + and participant.use_separate_vc == False + ): new_cl_node_validator_keystores = preregistered_validator_keys_for_nodes[ index ] + current_vc_index += 1 el_context = all_el_contexts[index] @@ -200,4 +205,5 @@ def launch( all_cl_contexts, all_snooper_engine_contexts, preregistered_validator_keys_for_nodes, + current_vc_index, ) diff --git a/src/participant_network.star b/src/participant_network.star index eebf32d77..5b8cefc2a 100644 --- a/src/participant_network.star +++ b/src/participant_network.star @@ -161,6 +161,7 @@ def launch_participant_network( all_cl_contexts, all_snooper_engine_contexts, preregistered_validator_keys_for_nodes, + current_vc_index, ) = cl_client_launcher.launch( plan, network_params, @@ -195,7 +196,6 @@ def launch_participant_network( constants.CL_TYPE.lighthouse, ] - current_vc_index = 0 for index, participant in enumerate(participants): el_type = participant.el_type cl_type = participant.cl_type From 1fdbc3c0d621a3ad1d64e58f354df6545a3ce0ae Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Mon, 7 Oct 2024 17:11:47 +0200 Subject: [PATCH 5/8] fix cl launch vc count --- src/cl/cl_launcher.star | 9 +-------- src/participant_network.star | 8 +++----- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/cl/cl_launcher.star b/src/cl/cl_launcher.star index 4c0893c28..8ed65f067 100644 --- a/src/cl/cl_launcher.star +++ b/src/cl/cl_launcher.star @@ -84,7 +84,6 @@ def launch( "launch_method": grandine.launch, }, } - current_vc_index = 0 all_snooper_engine_contexts = [] all_cl_contexts = [] preregistered_validator_keys_for_nodes = ( @@ -122,15 +121,10 @@ def launch( cl_service_name = "cl-{0}-{1}-{2}".format(index_str, cl_type, el_type) new_cl_node_validator_keystores = None - if ( - participant.validator_count != 0 - and participant.vc_count != 0 - and participant.use_separate_vc == False - ): + if participant.validator_count > 0 and participant.use_separate_vc == False: new_cl_node_validator_keystores = preregistered_validator_keys_for_nodes[ index ] - current_vc_index += 1 el_context = all_el_contexts[index] @@ -205,5 +199,4 @@ def launch( all_cl_contexts, all_snooper_engine_contexts, preregistered_validator_keys_for_nodes, - current_vc_index, ) diff --git a/src/participant_network.star b/src/participant_network.star index 5b8cefc2a..21147f54e 100644 --- a/src/participant_network.star +++ b/src/participant_network.star @@ -161,7 +161,6 @@ def launch_participant_network( all_cl_contexts, all_snooper_engine_contexts, preregistered_validator_keys_for_nodes, - current_vc_index, ) = cl_client_launcher.launch( plan, network_params, @@ -289,8 +288,8 @@ def launch_participant_network( ) vc_keystores = None - if participant.validator_count != 0: - vc_keystores = preregistered_validator_keys_for_nodes[current_vc_index] + if participant.validator_count > 0: + vc_keystores = preregistered_validator_keys_for_nodes[index + sub_index] vc_context = None snooper_beacon_context = None @@ -354,13 +353,12 @@ def launch_participant_network( network=network_params.network, electra_fork_epoch=network_params.electra_fork_epoch, port_publisher=port_publisher, - vc_index=current_vc_index, + vc_index=vc_keystores, ) all_vc_contexts.append(vc_context) if vc_context and vc_context.metrics_info: vc_context.metrics_info["config"] = participant.prometheus_config - current_vc_index += 1 all_participants = [] From b206bec8cb3a6f6a790ee5a2c8cff8deba9a6fe7 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Mon, 7 Oct 2024 17:19:17 +0200 Subject: [PATCH 6/8] fix index --- src/participant_network.star | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/participant_network.star b/src/participant_network.star index 061ddfc2d..999484c55 100644 --- a/src/participant_network.star +++ b/src/participant_network.star @@ -352,7 +352,7 @@ def launch_participant_network( global_tolerations=global_tolerations, node_selectors=node_selectors, port_publisher=port_publisher, - remote_signer_index=current_vc_index, + remote_signer_index=index + sub_index, ) all_remote_signer_contexts.append(remote_signer_context) @@ -385,7 +385,7 @@ def launch_participant_network( network=network_params.network, electra_fork_epoch=network_params.electra_fork_epoch, port_publisher=port_publisher, - vc_index=vc_keystores, + vc_index=index + sub_index, ) all_vc_contexts.append(vc_context) From ef00961c4832601548fb98ef221902ed928b032d Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Mon, 7 Oct 2024 17:25:11 +0200 Subject: [PATCH 7/8] fix assert test to run minimal --- .github/tests/mix-assert.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/tests/mix-assert.yaml b/.github/tests/mix-assert.yaml index 9d8cb6820..d71bf444c 100644 --- a/.github/tests/mix-assert.yaml +++ b/.github/tests/mix-assert.yaml @@ -13,6 +13,9 @@ participants: cl_type: grandine additional_services: - assertoor + - dora assertoor_params: run_stability_check: false run_block_proposal_check: true +network_params: + preset: minimal From 4cfbb88a48f5a4ede4d442c3b194ff0128f2b987 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Wed, 9 Oct 2024 12:09:42 +0200 Subject: [PATCH 8/8] dont even know whats up --- src/cl/cl_launcher.star | 6 +++--- src/participant_network.star | 7 +++---- .../validator_keystores/keystore_files.star | 2 ++ .../validator_keystores/validator_keystore_generator.star | 3 ++- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/cl/cl_launcher.star b/src/cl/cl_launcher.star index 8ed65f067..fa8b98c8f 100644 --- a/src/cl/cl_launcher.star +++ b/src/cl/cl_launcher.star @@ -122,9 +122,9 @@ def launch( cl_service_name = "cl-{0}-{1}-{2}".format(index_str, cl_type, el_type) new_cl_node_validator_keystores = None if participant.validator_count > 0 and participant.use_separate_vc == False: - new_cl_node_validator_keystores = preregistered_validator_keys_for_nodes[ - index - ] + new_cl_node_validator_keystores = ( + preregistered_validator_keys_for_nodes.locator[index][0] + ) el_context = all_el_contexts[index] diff --git a/src/participant_network.star b/src/participant_network.star index 999484c55..ed9d3609f 100644 --- a/src/participant_network.star +++ b/src/participant_network.star @@ -294,8 +294,7 @@ def launch_participant_network( vc_keystores = None if participant.validator_count > 0: - vc_keystores = preregistered_validator_keys_for_nodes[index + sub_index] - + vc_keystores = preregistered_validator_keys_for_nodes.locator vc_context = None remote_signer_context = None snooper_beacon_context = None @@ -352,7 +351,7 @@ def launch_participant_network( global_tolerations=global_tolerations, node_selectors=node_selectors, port_publisher=port_publisher, - remote_signer_index=index + sub_index, + remote_signer_index=vc_keystores, ) all_remote_signer_contexts.append(remote_signer_context) @@ -385,7 +384,7 @@ def launch_participant_network( network=network_params.network, electra_fork_epoch=network_params.electra_fork_epoch, port_publisher=port_publisher, - vc_index=index + sub_index, + vc_index=vc_keystores, ) all_vc_contexts.append(vc_context) diff --git a/src/prelaunch_data_generator/validator_keystores/keystore_files.star b/src/prelaunch_data_generator/validator_keystores/keystore_files.star index d10f359b4..58e609512 100644 --- a/src/prelaunch_data_generator/validator_keystores/keystore_files.star +++ b/src/prelaunch_data_generator/validator_keystores/keystore_files.star @@ -8,6 +8,7 @@ def new_keystore_files( prysm_relative_dirpath, teku_keys_relative_dirpath, teku_secrets_relative_dirpath, + locator, ): return struct( files_artifact_uuid=files_artifact_uuid, @@ -19,4 +20,5 @@ def new_keystore_files( prysm_relative_dirpath=prysm_relative_dirpath, teku_keys_relative_dirpath=teku_keys_relative_dirpath, teku_secrets_relative_dirpath=teku_secrets_relative_dirpath, + locator=locator, ) diff --git a/src/prelaunch_data_generator/validator_keystores/validator_keystore_generator.star b/src/prelaunch_data_generator/validator_keystores/validator_keystore_generator.star index 603cfdb2d..0b06dcdba 100644 --- a/src/prelaunch_data_generator/validator_keystores/validator_keystore_generator.star +++ b/src/prelaunch_data_generator/validator_keystores/validator_keystore_generator.star @@ -178,7 +178,7 @@ def generate_validator_keystores(plan, mnemonic, participants): artifact_name = plan.store_service_files( service_name, output_dirpath, name=artifact_name ) - + locator = {str(idx): i} base_dirname_in_artifact = shared_utils.path_base(output_dirpath) to_add = keystore_files_module.new_keystore_files( artifact_name, @@ -189,6 +189,7 @@ def generate_validator_keystores(plan, mnemonic, participants): shared_utils.path_join(base_dirname_in_artifact, PRYSM_DIRNAME), shared_utils.path_join(base_dirname_in_artifact, TEKU_KEYS_DIRNAME), shared_utils.path_join(base_dirname_in_artifact, TEKU_SECRETS_DIRNAME), + locator, ) keystore_files.append(to_add)