Commit 18b141ed authored by Gyanendra Mishra's avatar Gyanendra Mishra Committed by GitHub

fix: zero count validators and parallel keystore generation (#302)

Co-authored-by: default avatarBarnabas Busa <busa.barnabas@gmail.com>
parent 49596fd4
...@@ -251,6 +251,25 @@ jobs: ...@@ -251,6 +251,25 @@ jobs:
- checkout - checkout
- run: kurtosis run ${PWD} "$(cat ./.circleci/tests/mix-with-tools.json)" - 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: workflows:
check_latest_version: check_latest_version:
when: << pipeline.parameters.should-enable-check-latest-version-workflow >> when: << pipeline.parameters.should-enable-check-latest-version-workflow >>
...@@ -301,12 +320,12 @@ workflows: ...@@ -301,12 +320,12 @@ workflows:
filters: filters:
branches: branches:
ignore: ignore:
- main - main
- lint: - lint:
filters: filters:
branches: branches:
ignore: ignore:
- main - main
- mev: - mev:
filters: filters:
branches: branches:
...@@ -325,3 +344,19 @@ workflows: ...@@ -325,3 +344,19 @@ workflows:
branches: branches:
ignore: ignore:
- main - 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
{
"participants": [
{
"el_client_type": "geth",
"cl_client_type": "teku"
},
{
"el_client_type": "geth",
"cl_client_type": "teku",
"validator_count": 0
}
],
"parallel_keystore_generation": true
}
{
"participants": [
{
"el_client_type": "geth",
"cl_client_type": "teku",
"validator_count": 0
},
{
"el_client_type": "geth",
"cl_client_type": "teku"
}
],
"parallel_keystore_generation": true
}
{
"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
}
...@@ -163,7 +163,9 @@ def generate_cl_valdiator_keystores_in_parallel(plan, mnemonic, participants): ...@@ -163,7 +163,9 @@ def generate_cl_valdiator_keystores_in_parallel(plan, mnemonic, participants):
for idx, participant in enumerate(participants): for idx, participant in enumerate(participants):
output_dirpath = NODE_KEYSTORES_OUTPUT_DIRPATH_FORMAT_STR.format(idx) output_dirpath = NODE_KEYSTORES_OUTPUT_DIRPATH_FORMAT_STR.format(idx)
if participant.validator_count == 0: 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 continue
start_index = idx * participant.validator_count start_index = idx * participant.validator_count
stop_index = (idx + 1) * participant.validator_count stop_index = (idx + 1) * participant.validator_count
...@@ -188,6 +190,9 @@ def generate_cl_valdiator_keystores_in_parallel(plan, mnemonic, participants): ...@@ -188,6 +190,9 @@ def generate_cl_valdiator_keystores_in_parallel(plan, mnemonic, participants):
for idx in range(0, len(participants)): for idx in range(0, len(participants)):
service_name = service_names[idx] service_name = service_names[idx]
generation_command = all_generation_commands[idx] generation_command = all_generation_commands[idx]
if generation_command == None:
# no generation command as validator count is 0
continue
plan.exec( plan.exec(
recipe=ExecRecipe( recipe=ExecRecipe(
command=["sh", "-c", generation_command + " >/dev/null 2>&1 &"] command=["sh", "-c", generation_command + " >/dev/null 2>&1 &"]
...@@ -199,6 +204,9 @@ def generate_cl_valdiator_keystores_in_parallel(plan, mnemonic, participants): ...@@ -199,6 +204,9 @@ def generate_cl_valdiator_keystores_in_parallel(plan, mnemonic, participants):
for idx in range(0, len(participants)): for idx in range(0, len(participants)):
service_name = service_names[idx] service_name = service_names[idx]
output_dirpath = all_output_dirpaths[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] generation_finished_filepath = finished_files_to_verify[idx]
verificaiton_command = ["ls", generation_finished_filepath] verificaiton_command = ["ls", generation_finished_filepath]
plan.wait( plan.wait(
...@@ -221,7 +229,6 @@ def generate_cl_valdiator_keystores_in_parallel(plan, mnemonic, participants): ...@@ -221,7 +229,6 @@ def generate_cl_valdiator_keystores_in_parallel(plan, mnemonic, participants):
service_name = service_names[idx] service_name = service_names[idx]
output_dirpath = all_output_dirpaths[idx] output_dirpath = all_output_dirpaths[idx]
running_total_validator_count += participant.validator_count
padded_idx = zfill_custom(idx + 1, len(str(len(participants)))) padded_idx = zfill_custom(idx + 1, len(str(len(participants))))
keystore_start_index = running_total_validator_count keystore_start_index = running_total_validator_count
running_total_validator_count += participant.validator_count running_total_validator_count += participant.validator_count
......
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