diff --git a/.github/tests/custom-mnemonics.yaml b/.github/tests/custom-mnemonics.yaml new file mode 100644 index 000000000..696db6edb --- /dev/null +++ b/.github/tests/custom-mnemonics.yaml @@ -0,0 +1,23 @@ +participants: + - el_type: geth + cl_type: teku + - el_type: nethermind + cl_type: prysm + - el_type: erigon + cl_type: nimbus + - el_type: besu + cl_type: lighthouse + - el_type: reth + cl_type: lodestar + - el_type: ethrex + cl_type: teku +network_params: + network: kurtosis + num_validator_keys_per_node: 128 + additional_mnemonics: + - mnemonic: "estate dog switch misery manage room million bleak wrap distance always insane usage busy chicken limit already duck feature unhappy dial emotion expire please" + count: 10 + status: 1 # exited + - mnemonic: "bachelor goose intact globe grab observe youth kit castle purchase ranch safe wire planet portion artist soon captain before cute dinner arrange cat churn" + count: 10 + status: 2 # slashed & exited diff --git a/README.md b/README.md index 8f337faf0..91fad32ff 100644 --- a/README.md +++ b/README.md @@ -612,6 +612,35 @@ network_params: # 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 + # Additional mnemonics to generate validators from + # These validators will be included in genesis but won't have keystores generated + # Useful for pre-registering validators with custom withdrawal credentials or states + # Default: [] + additional_mnemonics: + - # The mnemonic to derive validator keys from + mnemonic: "estate dog switch misery manage room million bleak wrap distance always insane usage busy chicken limit already duck feature unhappy dial emotion expire please" + # The validator index to start deriving keys from + # Defaults to 0 + start: 0 + # The number of validators to generate from this mnemonic + count: 10 + # The withdrawal address for these validators + # Only used when wd_prefix is 0x01 or 0x02 (execution layer withdrawal credentials) + wd_address: 0x000000000000000000000000000000000000dEaD + # The withdrawal credentials prefix + # 0x00: BLS withdrawal credentials (default) + # 0x01: Execution layer withdrawal credentials (uses wd_address) + # 0x02: Compounding withdrawal credentials (uses wd_address) + wd_prefix: 0x01 + # The validator balance in gwei + # Defaults to 32000000000 (32 ETH) + balance: 32000000000 + # The initial validator status + # 0: active (default) + # 1: slashed + # 2: exited + status: 1 + # How long you want the network to wait before starting up genesis_delay: 20 @@ -1265,7 +1294,7 @@ spamoor_params: # Ethereum genesis generator params ethereum_genesis_generator_params: # The image to use for ethereum genesis generator - image: ethpandaops/ethereum-genesis-generator:5.2.0 + image: ethpandaops/ethereum-genesis-generator:5.2.2 # Pass custom environment variables to the genesis generator (e.g. MY_VAR: my_value) extra_env: {} diff --git a/network_params.yaml b/network_params.yaml index 32f959f23..33544bbbc 100644 --- a/network_params.yaml +++ b/network_params.yaml @@ -81,6 +81,7 @@ network_params: question tent bar rely arctic volcano long crawl hungry vocal artwork sniff fantasy very lucky have athlete" preregistered_validator_count: 0 + additional_mnemonics: [] genesis_delay: 20 genesis_time: 0 genesis_gaslimit: 60000000 @@ -236,7 +237,7 @@ keymanager_enabled: false checkpoint_sync_enabled: false checkpoint_sync_url: "" ethereum_genesis_generator_params: - image: ethpandaops/ethereum-genesis-generator:5.2.0 + image: ethpandaops/ethereum-genesis-generator:5.2.2 extra_env: {} port_publisher: nat_exit_ip: KURTOSIS_IP_ADDR_PLACEHOLDER diff --git a/src/package_io/constants.star b/src/package_io/constants.star index 0671c7f0d..64f929480 100644 --- a/src/package_io/constants.star +++ b/src/package_io/constants.star @@ -100,7 +100,7 @@ DEFAULT_ASSERTOOR_IMAGE = "ethpandaops/assertoor:latest" DEFAULT_SNOOPER_IMAGE = "ethpandaops/rpc-snooper:latest" DEFAULT_BOOTNODOOR_IMAGE = "ethpandaops/bootnodoor:latest" DEFAULT_ETHEREUM_GENESIS_GENERATOR_IMAGE = ( - "ethpandaops/ethereum-genesis-generator:5.2.0" + "ethpandaops/ethereum-genesis-generator:5.2.2" ) DEFAULT_YQ_IMAGE = "linuxserver/yq" DEFAULT_FLASHBOTS_RELAY_IMAGE = "ethpandaops/mev-boost-relay:main" diff --git a/src/package_io/input_parser.star b/src/package_io/input_parser.star index ab904d456..78d450880 100644 --- a/src/package_io/input_parser.star +++ b/src/package_io/input_parser.star @@ -638,6 +638,7 @@ def input_parser(plan, input_args): additional_preloaded_contracts=result["network_params"][ "additional_preloaded_contracts" ], + additional_mnemonics=result["network_params"]["additional_mnemonics"], devnet_repo=result["network_params"]["devnet_repo"], prefunded_accounts=result["network_params"]["prefunded_accounts"], max_payload_size=result["network_params"]["max_payload_size"], @@ -1326,6 +1327,7 @@ def default_network_params(): "base_fee_update_fraction_electra": 5007716, "preset": "mainnet", "additional_preloaded_contracts": {}, + "additional_mnemonics": [], "devnet_repo": "ethpandaops", "prefunded_accounts": {}, "max_payload_size": 10485760, @@ -1408,6 +1410,7 @@ def default_minimal_network_params(): "base_fee_update_fraction_electra": 5007716, "preset": "minimal", "additional_preloaded_contracts": {}, + "additional_mnemonics": [], "devnet_repo": "ethpandaops", "prefunded_accounts": {}, "max_payload_size": 10485760, diff --git a/src/package_io/sanity_check.star b/src/package_io/sanity_check.star index 6ef60e909..360f9b7d4 100644 --- a/src/package_io/sanity_check.star +++ b/src/package_io/sanity_check.star @@ -241,6 +241,7 @@ SUBCATEGORY_PARAMS = { "base_fee_update_fraction_electra", "preset", "additional_preloaded_contracts", + "additional_mnemonics", "devnet_repo", "prefunded_accounts", "max_payload_size", diff --git a/src/prelaunch_data_generator/el_cl_genesis/el_cl_genesis_generator.star b/src/prelaunch_data_generator/el_cl_genesis/el_cl_genesis_generator.star index b13a97291..6d97aef5f 100644 --- a/src/prelaunch_data_generator/el_cl_genesis/el_cl_genesis_generator.star +++ b/src/prelaunch_data_generator/el_cl_genesis/el_cl_genesis_generator.star @@ -174,6 +174,7 @@ def new_env_file_for_el_cl_genesis_data( "Eip7805ForkVersion": constants.EIP7805_FORK_VERSION, "Eip7441ForkVersion": constants.EIP7441_FORK_VERSION, "ShadowForkFile": shadowfork_file, + "AdditionalValidatorMnemonics": get_additional_mnemonics_json(network_params), "MinValidatorWithdrawabilityDelay": network_params.min_validator_withdrawability_delay, "ShardCommitteePeriod": network_params.shard_committee_period, "AttestationDueBpsGloas": network_params.attestation_due_bps_gloas, @@ -237,3 +238,16 @@ def new_additionsl_contracts_file_for_el_cl_genesis_data( return { "AdditionalPreloadedContracts": additional_contracts_json, } + + +def get_additional_mnemonics_json( + network_params, +): + additional_mnemonics_json = network_params.additional_mnemonics + if type(additional_mnemonics_json) == "string": + # re-encode json to trim whitespaces and newlines + additional_mnemonics_json = json.decode(additional_mnemonics_json) + + additional_mnemonics_json = json.encode(json.encode(additional_mnemonics_json)) + + return additional_mnemonics_json diff --git a/static_files/genesis-generation-config/el-cl/values.env.tmpl b/static_files/genesis-generation-config/el-cl/values.env.tmpl index 59cd3f447..733d88bd1 100644 --- a/static_files/genesis-generation-config/el-cl/values.env.tmpl +++ b/static_files/genesis-generation-config/el-cl/values.env.tmpl @@ -56,6 +56,7 @@ export MAX_REQUEST_BLOCKS_DENEB={{ .MaxRequestBlocksDeneb }} export MAX_REQUEST_BLOB_SIDECARS_ELECTRA={{ .MaxRequestBlobSidecarsElectra }} export BASEFEE_UPDATE_FRACTION_ELECTRA={{ .BaseFeeUpdateFractionElectra }} export ADDITIONAL_PRELOADED_CONTRACTS={{ .AdditionalPreloadedContractsFile }} +export ADDITIONAL_VALIDATOR_MNEMONICS={{ .AdditionalValidatorMnemonics }} export EL_PREMINE_ADDRS={{ .PrefundedAccounts }} export MAX_PAYLOAD_SIZE={{ .MaxPayloadSize }} export BPO_1_EPOCH="{{ .Bpo1Epoch }}"