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

fix: vc_count bad index #794

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft
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
3 changes: 3 additions & 0 deletions .github/tests/mix-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 4 additions & 5 deletions src/cl/cl_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ def launch(
"launch_method": grandine.launch,
},
}

all_snooper_engine_contexts = []
all_cl_contexts = []
preregistered_validator_keys_for_nodes = (
Expand Down Expand Up @@ -122,10 +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:
new_cl_node_validator_keystores = preregistered_validator_keys_for_nodes[
index
]
if participant.validator_count > 0 and participant.use_separate_vc == False:
new_cl_node_validator_keystores = (
preregistered_validator_keys_for_nodes.locator[index][0]
)

el_context = all_el_contexts[index]

Expand Down
12 changes: 12 additions & 0 deletions src/package_io/input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,18 @@ def parse_network_params(plan, input_args):
+ participant["cl_type"],
)
)
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"],
participant["use_separate_vc"],
str(index + 1)
+ "-"
+ participant["el_type"]
+ "-"
+ participant["cl_type"],
)
)

snooper_enabled = participant["snooper_enabled"]
if snooper_enabled == None:
Expand Down
16 changes: 4 additions & 12 deletions src/participant_network.star
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,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
Expand Down Expand Up @@ -294,14 +293,8 @@ 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
]

if participant.validator_count > 0:
vc_keystores = preregistered_validator_keys_for_nodes.locator
vc_context = None
remote_signer_context = None
snooper_beacon_context = None
Expand Down Expand Up @@ -358,7 +351,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=vc_keystores,
)

all_remote_signer_contexts.append(remote_signer_context)
Expand Down Expand Up @@ -391,13 +384,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 = []

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
)
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
Expand Down
Loading