diff --git a/README.md b/README.md index eb203db..a45c948 100644 --- a/README.md +++ b/README.md @@ -157,17 +157,18 @@ For example, this `eth-network-params.json` adds a second node, running a differ ```json { - "//note": "each participant struct in particpants corresponds to a node in the network", + "//note": "each participant struct in participants corresponds to a node in the network", "participants": [ { "el_client_type": "geth", "el_client_image": "", "el_client_log_level": "", + "el_extra_params": [], + "el_extra_env_vars": {}, "cl_client_type": "lighthouse", "cl_client_image": "", "cl_client_log_level": "", "beacon_extra_params": [], - "el_extra_params": [], "validator_extra_params": [], "builder_network_params": null, "count": 1 @@ -176,11 +177,12 @@ For example, this `eth-network-params.json` adds a second node, running a differ "el_client_type": "nethermind", "el_client_image": "", "el_client_log_level": "", + "el_extra_params": [], + "el_extra_env_vars": {}, "cl_client_type": "teku", "cl_client_image": "", "cl_client_log_level": "", "beacon_extra_params": [], - "el_extra_params": [], "validator_extra_params": [], "builder_network_params": null, "count": 1 diff --git a/default-network-params.json b/default-network-params.json index a730844..2e5e816 100644 --- a/default-network-params.json +++ b/default-network-params.json @@ -4,11 +4,12 @@ "el_client_type": "geth", "el_client_image": "", "el_client_log_level": "", + "el_extra_params": [], + "el_extra_env_vars": {}, "cl_client_type": "lighthouse", "cl_client_image": "", "cl_client_log_level": "", "beacon_extra_params": [], - "el_extra_params": [], "validator_extra_params": [], "builder_network_params": null, "count": 1 diff --git a/package_io/input_parser.star b/package_io/input_parser.star index 6ef6691..996396d 100644 --- a/package_io/input_parser.star +++ b/package_io/input_parser.star @@ -36,6 +36,7 @@ def get_args_with_default_values(args): cl_client_log_level=participant["cl_client_log_level"], beacon_extra_params=participant["beacon_extra_params"], el_extra_params=participant["el_extra_params"], + el_extra_env_vars=participant["el_extra_env_vars"], validator_extra_params=participant["validator_extra_params"], builder_network_params=participant["builder_network_params"], el_min_cpu=participant["el_min_cpu"], @@ -223,6 +224,7 @@ def default_participant(): "cl_client_log_level": "", "beacon_extra_params": [], "el_extra_params": [], + "el_extra_env_vars": {}, "validator_extra_params": [], "builder_network_params": None, "el_min_cpu": 0, diff --git a/src/el/besu/besu_launcher.star b/src/el/besu/besu_launcher.star index 358a7ca..cd25ac6 100644 --- a/src/el/besu/besu_launcher.star +++ b/src/el/besu/besu_launcher.star @@ -60,7 +60,8 @@ def launch( el_max_cpu, el_min_mem, el_max_mem, - extra_params): + extra_params, + extra_env_vars): log_level = input_parser.get_client_log_level_or_default(participant_log_level, global_log_level, BESU_LOG_LEVELS) @@ -79,7 +80,8 @@ def launch( el_max_cpu, el_min_mem, el_max_mem, - extra_params + extra_params, + extra_env_vars ) service = plan.add_service(service_name, config) @@ -111,7 +113,8 @@ def get_config( el_max_cpu, el_min_mem, el_max_mem, - extra_params): + extra_params, + extra_env_vars): genesis_json_filepath_on_client = shared_utils.path_join(GENESIS_DATA_DIRPATH_ON_CLIENT_CONTAINER, genesis_data.besu_genesis_json_relative_filepath) jwt_secret_json_filepath_on_client = shared_utils.path_join(GENESIS_DATA_DIRPATH_ON_CLIENT_CONTAINER, genesis_data.jwt_secret_relative_filepath) @@ -165,7 +168,8 @@ def get_config( min_cpu = el_min_cpu, max_cpu = el_max_cpu, min_memory = el_min_mem, - max_memory = el_max_mem + max_memory = el_max_mem, + env_vars = extra_env_vars ), jwt_secret_json_filepath_on_client diff --git a/src/el/erigon/erigon_launcher.star b/src/el/erigon/erigon_launcher.star index d4ba03c..9aeaf3e 100644 --- a/src/el/erigon/erigon_launcher.star +++ b/src/el/erigon/erigon_launcher.star @@ -57,7 +57,8 @@ def launch( el_max_cpu, el_min_mem, el_max_mem, - extra_params): + extra_params, + extra_env_vars): log_level = input_parser.get_client_log_level_or_default(participant_log_level, global_log_level, ERIGON_LOG_LEVELS) @@ -76,7 +77,8 @@ def launch( el_max_cpu, el_min_mem, el_max_mem, - extra_params + extra_params, + extra_env_vars ) service = plan.add_service(service_name, config) @@ -108,7 +110,8 @@ def get_config( el_max_cpu, el_min_mem, el_max_mem, - extra_params): + extra_params, + extra_env_vars): network_id = network_id genesis_json_filepath_on_client = shared_utils.path_join(GENESIS_DATA_MOUNT_DIRPATH, genesis_data.erigon_genesis_json_relative_filepath) @@ -174,7 +177,8 @@ def get_config( min_cpu = el_min_cpu, max_cpu = el_max_cpu, min_memory = el_min_mem, - max_memory = el_max_mem + max_memory = el_max_mem, + env_vars = extra_env_vars ), jwt_secret_json_filepath_on_client diff --git a/src/el/ethereumjs/ethereumjs_launcher.star b/src/el/ethereumjs/ethereumjs_launcher.star index 3fa420e..f34bc41 100644 --- a/src/el/ethereumjs/ethereumjs_launcher.star +++ b/src/el/ethereumjs/ethereumjs_launcher.star @@ -71,7 +71,8 @@ def launch( el_max_cpu, el_min_mem, el_max_mem, - extra_params): + extra_params, + extra_env_vars): log_level = input_parser.get_client_log_level_or_default(participant_log_level, global_log_level, VERBOSITY_LEVELS) @@ -91,7 +92,8 @@ def launch( el_max_cpu, el_min_mem, el_max_mem, - extra_params + extra_params, + extra_env_vars ) service = plan.add_service(service_name, config) @@ -121,7 +123,8 @@ def get_config( el_max_cpu, el_min_mem, el_max_mem, - extra_params): + extra_params, + extra_env_vars): genesis_json_filepath_on_client = shared_utils.path_join(GENESIS_DATA_MOUNT_DIRPATH, genesis_data.geth_genesis_json_relative_filepath) jwt_secret_json_filepath_on_client = shared_utils.path_join(GENESIS_DATA_MOUNT_DIRPATH, genesis_data.jwt_secret_relative_filepath) @@ -169,7 +172,8 @@ def get_config( min_cpu = el_min_cpu, max_cpu = el_max_cpu, min_memory = el_min_mem, - max_memory = el_max_mem + max_memory = el_max_mem, + env_vars = extra_env_vars ), jwt_secret_json_filepath_on_client diff --git a/src/el/geth/geth_launcher.star b/src/el/geth/geth_launcher.star index fd82839..41c019a 100644 --- a/src/el/geth/geth_launcher.star +++ b/src/el/geth/geth_launcher.star @@ -75,7 +75,8 @@ def launch( el_max_cpu, el_min_mem, el_max_mem, - extra_params): + extra_params, + extra_env_vars): log_level = input_parser.get_client_log_level_or_default(participant_log_level, global_log_level, VERBOSITY_LEVELS) el_min_cpu = el_min_cpu if int(el_min_cpu) > 0 else EXECUTION_MIN_CPU @@ -97,6 +98,7 @@ def launch( el_min_mem, el_max_mem, extra_params, + extra_env_vars, launcher.electra_fork_epoch ) @@ -132,6 +134,7 @@ def get_config( el_min_mem, el_max_mem, extra_params, + extra_env_vars, electra_fork_epoch): genesis_json_filepath_on_client = shared_utils.path_join(GENESIS_DATA_MOUNT_DIRPATH, genesis_data.geth_genesis_json_relative_filepath) @@ -145,15 +148,6 @@ def get_config( if package_io.GENESIS_VALIDATORS_ROOT_PLACEHOLDER in extra_param: extra_params[index] = extra_param.replace(package_io.GENESIS_VALIDATORS_ROOT_PLACEHOLDER, genesis_validators_root) - env_vars = {} - - # the key here is the private key of the first genesis account - # note that the mev builder is the one that needs this and not other nodes - # TODO productize a way to send custom env variables - if BUILDER_IMAGE_STR in image: - env_vars = { - "BUILDER_TX_SIGNING_KEY": "0x" + genesis_constants.PRE_FUNDED_ACCOUNTS[0].private_key - } accounts_to_unlock_str = ",".join(account_addresses_to_unlock) @@ -241,7 +235,7 @@ def get_config( max_cpu = el_max_cpu, min_memory = el_min_mem, max_memory = el_max_mem, - env_vars = env_vars + env_vars = extra_env_vars ), jwt_secret_json_filepath_on_client diff --git a/src/el/nethermind/nethermind_launcher.star b/src/el/nethermind/nethermind_launcher.star index bfd6dfc..7510ab8 100644 --- a/src/el/nethermind/nethermind_launcher.star +++ b/src/el/nethermind/nethermind_launcher.star @@ -59,7 +59,8 @@ def launch( el_max_cpu, el_min_mem, el_max_mem, - extra_params): + extra_params, + extra_env_vars): log_level = input_parser.get_client_log_level_or_default(participant_log_level, global_log_level, NETHERMIND_LOG_LEVELS) @@ -77,7 +78,8 @@ def launch( el_max_cpu, el_min_mem, el_max_mem, - extra_params + extra_params, + extra_env_vars ) service = plan.add_service(service_name, config) @@ -109,7 +111,8 @@ def get_config( el_max_cpu, el_min_mem, el_max_mem, - extra_params): + extra_params, + extra_env_vars): genesis_json_filepath_on_client = shared_utils.path_join(GENESIS_DATA_MOUNT_DIRPATH, genesis_data.nethermind_genesis_json_relative_filepath) @@ -154,7 +157,8 @@ def get_config( min_cpu = el_min_cpu, max_cpu = el_max_cpu, min_memory = el_min_mem, - max_memory = el_max_mem + max_memory = el_max_mem, + env_vars = extra_env_vars ), jwt_secret_json_filepath_on_client diff --git a/src/el/reth/reth_launcher.star b/src/el/reth/reth_launcher.star index 2f0bf3e..87f0f48 100644 --- a/src/el/reth/reth_launcher.star +++ b/src/el/reth/reth_launcher.star @@ -68,7 +68,8 @@ def launch( el_max_cpu, el_min_mem, el_max_mem, - extra_params): + extra_params, + extra_env_vars): log_level = input_parser.get_client_log_level_or_default(participant_log_level, global_log_level, VERBOSITY_LEVELS) @@ -88,7 +89,8 @@ def launch( el_max_cpu, el_min_mem, el_max_mem, - extra_params + extra_params, + extra_env_vars ) service = plan.add_service(service_name, config) @@ -118,7 +120,8 @@ def get_config( el_max_cpu, el_min_mem, el_max_mem, - extra_params): + extra_params, + extra_env_vars): genesis_json_filepath_on_client = shared_utils.path_join(GENESIS_DATA_MOUNT_DIRPATH, genesis_data.geth_genesis_json_relative_filepath) jwt_secret_json_filepath_on_client = shared_utils.path_join(GENESIS_DATA_MOUNT_DIRPATH, genesis_data.jwt_secret_relative_filepath) @@ -181,7 +184,8 @@ def get_config( min_cpu = el_min_cpu, max_cpu = el_max_cpu, min_memory = el_min_mem, - max_memory = el_max_mem + max_memory = el_max_mem, + env_vars = extra_env_vars ), jwt_secret_json_filepath_on_client diff --git a/src/participant_network.star b/src/participant_network.star index eaa7dc8..3416287 100644 --- a/src/participant_network.star +++ b/src/participant_network.star @@ -154,7 +154,8 @@ def launch_participant_network(plan, participants, network_params, global_log_le participant.el_max_cpu, participant.el_min_mem, participant.el_max_mem, - participant.el_extra_params + participant.el_extra_params, + participant.el_extra_env_vars ) all_el_client_contexts.append(el_client_context)