diff --git a/.circleci/config.yml b/.circleci/config.yml index 847e849b8..aa326c606 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -251,6 +251,25 @@ jobs: - checkout - run: kurtosis run ${PWD} "$(cat ./.circleci/tests/mix-with-tools.json)" + parallel_key_store_generation_1: + executor: ubuntu_vm + steps: + - <<: *setup_kurtosis + - checkout + - run: kurtosis run ${PWD} "$(cat ./.circleci/tests/parallel-keystores-1.json)" + parallel_key_store_generation_2: + executor: ubuntu_vm + steps: + - <<: *setup_kurtosis + - checkout + - run: kurtosis run ${PWD} "$(cat ./.circleci/tests/parallel-keystores-2.json)" + parallel_key_store_generation_3: + executor: ubuntu_vm + steps: + - <<: *setup_kurtosis + - checkout + - run: kurtosis run ${PWD} "$(cat ./.circleci/tests/parallel-keystores-3.json)" + workflows: check_latest_version: when: << pipeline.parameters.should-enable-check-latest-version-workflow >> @@ -301,12 +320,12 @@ workflows: filters: branches: ignore: - - main + - main - lint: filters: branches: ignore: - - main + - main - mev: filters: branches: @@ -325,3 +344,19 @@ workflows: branches: ignore: - main + + - parallel_key_store_generation_1: + filters: + branches: + ignore: + - main + - parallel_key_store_generation_2: + filters: + branches: + ignore: + - main + - parallel_key_store_generation_3: + filters: + branches: + ignore: + - main diff --git a/.circleci/tests/parallel-keystores-1.json b/.circleci/tests/parallel-keystores-1.json new file mode 100644 index 000000000..22b4e47d9 --- /dev/null +++ b/.circleci/tests/parallel-keystores-1.json @@ -0,0 +1,14 @@ +{ + "participants": [ + { + "el_client_type": "geth", + "cl_client_type": "teku" + }, + { + "el_client_type": "geth", + "cl_client_type": "teku", + "validator_count": 0 + } + ], + "parallel_keystore_generation": true + } diff --git a/.circleci/tests/parallel-keystores-2.json b/.circleci/tests/parallel-keystores-2.json new file mode 100644 index 000000000..aa849a1e4 --- /dev/null +++ b/.circleci/tests/parallel-keystores-2.json @@ -0,0 +1,14 @@ +{ + "participants": [ + { + "el_client_type": "geth", + "cl_client_type": "teku", + "validator_count": 0 + }, + { + "el_client_type": "geth", + "cl_client_type": "teku" + } + ], + "parallel_keystore_generation": true + } diff --git a/.circleci/tests/parallel-keystores-3.json b/.circleci/tests/parallel-keystores-3.json new file mode 100644 index 000000000..2c32df889 --- /dev/null +++ b/.circleci/tests/parallel-keystores-3.json @@ -0,0 +1,18 @@ +{ + "participants": [ + { + "el_client_type": "geth", + "cl_client_type": "teku" + }, + { + "el_client_type": "geth", + "cl_client_type": "teku", + "validator_count": 0 + }, + { + "el_client_type": "geth", + "cl_client_type": "teku" + } + ], + "parallel_keystore_generation": true + } diff --git a/src/prelaunch_data_generator/cl_validator_keystores/cl_validator_keystore_generator.star b/src/prelaunch_data_generator/cl_validator_keystores/cl_validator_keystore_generator.star index 754ba96d4..ec3b995bb 100644 --- a/src/prelaunch_data_generator/cl_validator_keystores/cl_validator_keystore_generator.star +++ b/src/prelaunch_data_generator/cl_validator_keystores/cl_validator_keystore_generator.star @@ -163,7 +163,9 @@ def generate_cl_valdiator_keystores_in_parallel(plan, mnemonic, participants): for idx, participant in enumerate(participants): output_dirpath = NODE_KEYSTORES_OUTPUT_DIRPATH_FORMAT_STR.format(idx) if participant.validator_count == 0: - all_output_dirpaths.append(output_dirpath) + all_generation_commands.append(None) + all_output_dirpaths.append(None) + finished_files_to_verify.append(None) continue start_index = idx * participant.validator_count stop_index = (idx + 1) * participant.validator_count @@ -188,6 +190,9 @@ def generate_cl_valdiator_keystores_in_parallel(plan, mnemonic, participants): for idx in range(0, len(participants)): service_name = service_names[idx] generation_command = all_generation_commands[idx] + if generation_command == None: + # no generation command as validator count is 0 + continue plan.exec( recipe=ExecRecipe( command=["sh", "-c", generation_command + " >/dev/null 2>&1 &"] @@ -199,6 +204,9 @@ def generate_cl_valdiator_keystores_in_parallel(plan, mnemonic, participants): for idx in range(0, len(participants)): service_name = service_names[idx] output_dirpath = all_output_dirpaths[idx] + if output_dirpath == None: + # no output dir path as validator count is 0 + continue generation_finished_filepath = finished_files_to_verify[idx] verificaiton_command = ["ls", generation_finished_filepath] plan.wait( @@ -221,7 +229,6 @@ def generate_cl_valdiator_keystores_in_parallel(plan, mnemonic, participants): service_name = service_names[idx] output_dirpath = all_output_dirpaths[idx] - running_total_validator_count += participant.validator_count padded_idx = zfill_custom(idx + 1, len(str(len(participants)))) keystore_start_index = running_total_validator_count running_total_validator_count += participant.validator_count