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

feat: add preregistered_validator_count network param field #426

Merged
merged 3 commits into from
Jan 2, 2024
Merged
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ network_params:
# This mnemonic will a) be used to create keystores for all the types of validators that we have and b) be used to generate a CL genesis.ssz that has the children
# validator keys already preregistered as validators
preregistered_validator_keys_mnemonic: "giant issue aisle success illegal bike spike question tent bar rely arctic volcano long crawl hungry vocal artwork sniff fantasy very lucky have athlete"
# The number of pre-registered validators for genesis. If 0 or not specified then the value will be calculated from the participants
preregistered_validator_count: 0
# How long you want the network to wait before starting up
genesis_delay: 120

Expand Down
1 change: 1 addition & 0 deletions network_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ network_params:
"giant issue aisle success illegal bike spike
question tent bar rely arctic volcano long crawl hungry vocal artwork sniff fantasy
very lucky have athlete"
preregistered_validator_count: 0
genesis_delay: 120
max_churn: 8
ejection_balance: 16000000000
Expand Down
4 changes: 4 additions & 0 deletions src/package_io/input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ def input_parser(plan, input_args):
preregistered_validator_keys_mnemonic=result["network_params"][
"preregistered_validator_keys_mnemonic"
],
preregistered_validator_count=result["network_params"][
"preregistered_validator_count"
],
num_validator_keys_per_node=result["network_params"][
"num_validator_keys_per_node"
],
Expand Down Expand Up @@ -407,6 +410,7 @@ def default_network_params():
# this is temporary till we get params working
return {
"preregistered_validator_keys_mnemonic": "giant issue aisle success illegal bike spike question tent bar rely arctic volcano long crawl hungry vocal artwork sniff fantasy very lucky have athlete",
"preregistered_validator_count": 0,
"num_validator_keys_per_node": 64,
"network_id": "3151908",
"deposit_contract_address": "0x4242424242424242424242424242424242424242",
Expand Down
9 changes: 6 additions & 3 deletions src/participant_network.star
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,12 @@ def launch_participant_network(
plan, CL_GENESIS_DATA_GENERATION_TIME + num_participants * CL_NODE_STARTUP_TIME
)

total_number_of_validator_keys = 0
for participant in participants:
total_number_of_validator_keys += participant.validator_count
# if preregistered validator count is 0 (default) then calculate the total number of validators from the participants
total_number_of_validator_keys = network_params.preregistered_validator_count

if network_params.preregistered_validator_count == 0:
for participant in participants:
total_number_of_validator_keys += participant.validator_count

plan.print("Generating EL CL data")
# we are running bellatrix genesis (deprecated) - will be removed in the future
Expand Down