From 9bf997933f00e9e833af3bf66bb9eb40a21d9ada Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Thu, 19 Oct 2023 12:17:58 +0200 Subject: [PATCH] refactor: rename some module names (#313) --- main.star | 35 +++++++------- src/cl/lighthouse/lighthouse_launcher.star | 47 +++++++++---------- src/cl/lodestar/lodestar_launcher.star | 30 ++++++------ src/cl/nimbus/nimbus_launcher.star | 26 +++++----- src/cl/prysm/prysm_launcher.star | 34 +++++++------- src/cl/teku/teku_launcher.star | 30 ++++++------ src/dora/dora_launcher.star | 4 +- src/el/besu/besu_launcher.star | 24 +++++----- src/el/erigon/erigon_launcher.star | 24 +++++----- src/el/ethereumjs/ethereumjs_launcher.star | 22 ++++----- src/el/geth/geth_launcher.star | 22 ++++----- src/el/nethermind/nethermind_launcher.star | 24 +++++----- src/el/reth/reth_launcher.star | 26 +++++----- src/mev_boost/mev_boost_launcher.star | 8 ++-- .../{parse_input.star => input_parser.star} | 16 +++---- src/participant_network.star | 26 +++++----- src/snooper/snooper_engine_launcher.star | 3 +- 17 files changed, 196 insertions(+), 205 deletions(-) rename src/package_io/{parse_input.star => input_parser.star} (99%) diff --git a/main.star b/main.star index ffe66306b..4edcec6c9 100644 --- a/main.star +++ b/main.star @@ -1,6 +1,5 @@ -parse_input = import_module("./src/package_io/parse_input.star") +input_parser = import_module("./src/package_io/input_parser.star") constants = import_module("./src/package_io/constants.star") - participant_network = import_module("./src/participant_network.star") static_files = import_module("./src/static_files/static_files.star") @@ -27,14 +26,14 @@ full_beaconchain_explorer = import_module( ) prometheus = import_module("./src/prometheus/prometheus_launcher.star") grafana = import_module("./src/grafana/grafana_launcher.star") -mev_boost_launcher_module = import_module("./src/mev_boost/mev_boost_launcher.star") -mock_mev_launcher_module = import_module("./src/mock_mev/mock_mev_launcher.star") -mev_relay_launcher_module = import_module("./src/mev_relay/mev_relay_launcher.star") -mev_flood_module = import_module("./src/mev_flood/mev_flood_launcher.star") -mev_custom_flood_module = import_module( +mev_boost = import_module("./src/mev_boost/mev_boost_launcher.star") +mock_mev = import_module("./src/mock_mev/mock_mev_launcher.star") +mev_relay = import_module("./src/mev_relay/mev_relay_launcher.star") +mev_flood = import_module("./src/mev_flood/mev_flood_launcher.star") +mev_custom_flood = import_module( "./src/mev_custom_flood/mev_custom_flood_launcher.star" ) -eip4788_deployment_module = import_module( +eip4788_deployment = import_module( "./src/eip4788_deployment/eip4788_deployment_launcher.star" ) GRAFANA_USER = "admin" @@ -51,7 +50,7 @@ PATH_TO_PARSED_BEACON_STATE = "/genesis/output/parsedBeaconState.json" def run(plan, args={}): - args_with_right_defaults = parse_input.parse_input(plan, args) + args_with_right_defaults = input_parser.input_parser(plan, args) num_participants = len(args_with_right_defaults.participants) network_params = args_with_right_defaults.network_params @@ -118,7 +117,7 @@ def run(plan, args={}): el_uri = "http://{0}:{1}".format( all_el_client_contexts[0].ip_addr, all_el_client_contexts[0].rpc_port_num ) - eip4788_deployment_module.deploy_eip4788_contract_in_background( + eip4788_deployment.deploy_eip4788_contract_in_background( plan, genesis_constants.PRE_FUNDED_ACCOUNTS[5].private_key, el_uri, @@ -150,7 +149,7 @@ def run(plan, args={}): files={"/data": el_cl_data_files_artifact_uuid}, wait=None, ) - endpoint = mock_mev_launcher_module.launch_mock_mev( + endpoint = mock_mev.launch_mock_mev( plan, el_uri, beacon_uri, @@ -177,7 +176,7 @@ def run(plan, args={}): first_cl_client = all_cl_client_contexts[0] first_client_beacon_name = first_cl_client.beacon_service_name - mev_flood_module.launch_mev_flood( + mev_flood.launch_mev_flood( plan, mev_params.mev_flood_image, el_uri, @@ -196,7 +195,7 @@ def run(plan, args={}): timeout="20m", service_name=first_client_beacon_name, ) - endpoint = mev_relay_launcher_module.launch_mev_relay( + endpoint = mev_relay.launch_mev_relay( plan, mev_params, network_params.network_id, @@ -205,7 +204,7 @@ def run(plan, args={}): builder_uri, network_params.seconds_per_slot, ) - mev_flood_module.spam_in_background( + mev_flood.spam_in_background( plan, el_uri, mev_params.mev_flood_extra_args, @@ -219,13 +218,13 @@ def run(plan, args={}): if mev_endpoints: for index, participant in enumerate(all_participants): if args_with_right_defaults.participants[index].validator_count != 0: - mev_boost_launcher = mev_boost_launcher_module.new_mev_boost_launcher( + mev_boost_launcher = mev_boost.new_mev_boost_launcher( MEV_BOOST_SHOULD_CHECK_RELAY, mev_endpoints ) mev_boost_service_name = "{0}{1}".format( - parse_input.MEV_BOOST_SERVICE_NAME_PREFIX, index + input_parser.MEV_BOOST_SERVICE_NAME_PREFIX, index ) - mev_boost_context = mev_boost_launcher_module.launch( + mev_boost_context = mev_boost.launch( plan, mev_boost_launcher, mev_boost_service_name, @@ -330,7 +329,7 @@ def run(plan, args={}): # Allow prometheus to be launched last so is able to collect metrics from other services launch_prometheus_grafana = True elif additional_service == "custom_flood": - mev_custom_flood_module.spam_in_background( + mev_custom_flood.spam_in_background( plan, genesis_constants.PRE_FUNDED_ACCOUNTS[-1].private_key, genesis_constants.PRE_FUNDED_ACCOUNTS[0].address, diff --git a/src/cl/lighthouse/lighthouse_launcher.star b/src/cl/lighthouse/lighthouse_launcher.star index 08d08f580..3348c2e66 100644 --- a/src/cl/lighthouse/lighthouse_launcher.star +++ b/src/cl/lighthouse/lighthouse_launcher.star @@ -1,9 +1,10 @@ shared_utils = import_module("../../shared_utils/shared_utils.star") -input_parser = import_module("../../package_io/parse_input.star") +input_parser = import_module("../../package_io/input_parser.star") cl_client_context = import_module("../../cl/cl_client_context.star") node_metrics = import_module("../../node_metrics_info.star") +cl_node_ready_conditions = import_module("../../cl/cl_node_ready_conditions.star") -package_io = import_module("../../package_io/constants.star") +constants = import_module("../../package_io/constants.star") LIGHTHOUSE_BINARY_COMMAND = "lighthouse" @@ -84,11 +85,11 @@ VALIDATOR_USED_PORTS = { } LIGHTHOUSE_LOG_LEVELS = { - package_io.GLOBAL_CLIENT_LOG_LEVEL.error: "error", - package_io.GLOBAL_CLIENT_LOG_LEVEL.warn: "warn", - package_io.GLOBAL_CLIENT_LOG_LEVEL.info: "info", - package_io.GLOBAL_CLIENT_LOG_LEVEL.debug: "debug", - package_io.GLOBAL_CLIENT_LOG_LEVEL.trace: "trace", + constants.GLOBAL_CLIENT_LOG_LEVEL.error: "error", + constants.GLOBAL_CLIENT_LOG_LEVEL.warn: "warn", + constants.GLOBAL_CLIENT_LOG_LEVEL.info: "info", + constants.GLOBAL_CLIENT_LOG_LEVEL.debug: "debug", + constants.GLOBAL_CLIENT_LOG_LEVEL.trace: "trace", } @@ -266,7 +267,7 @@ def get_beacon_config( "beacon_node", "--debug-level=" + log_level, "--datadir=" + CONSENSUS_DATA_DIRPATH_ON_BEACON_SERVICE_CONTAINER, - "--testnet-dir=" + package_io.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER, + "--testnet-dir=" + constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER, # vvvvvvvvvvvvvvvvvvv REMOVE THESE WHEN CONNECTING TO EXTERNAL NET vvvvvvvvvvvvvvvvvvvvv "--disable-enr-auto-update", "--enr-address=" + PRIVATE_IP_ADDRESS_PLACEHOLDER, @@ -281,14 +282,14 @@ def get_beacon_config( "--http-address=0.0.0.0", "--http-port={0}".format(BEACON_HTTP_PORT_NUM), "--http-allow-sync-stalled", - "--slots-per-restore-point={0}".format(32 if package_io.ARCHIVE_MODE else 8192), + "--slots-per-restore-point={0}".format(32 if constants.ARCHIVE_MODE else 8192), # NOTE: This comes from: # https://github.com/sigp/lighthouse/blob/7c88f582d955537f7ffff9b2c879dcf5bf80ce13/scripts/local_testnet/beacon_node.sh # and the option says it's "useful for testing in smaller networks" (unclear what happens in larger networks) "--disable-packet-filter", "--execution-endpoints=" + EXECUTION_ENGINE_ENDPOINT, - "--jwt-secrets=" + package_io.JWT_AUTH_PATH, - "--suggested-fee-recipient=" + package_io.VALIDATING_REWARDS_ACCOUNT, + "--jwt-secrets=" + constants.JWT_AUTH_PATH, + "--suggested-fee-recipient=" + constants.VALIDATING_REWARDS_ACCOUNT, # Set per Paris' recommendation to reduce noise in the logs "--subscribe-all-subnets", # vvvvvvvvvvvvvvvvvvv METRICS CONFIG vvvvvvvvvvvvvvvvvvvvv @@ -303,7 +304,7 @@ def get_beacon_config( cmd.append( "--boot-nodes=" + ",".join( - [ctx.enr for ctx in boot_cl_client_ctxs[: package_io.MAX_ENR_ENTRIES]] + [ctx.enr for ctx in boot_cl_client_ctxs[: constants.MAX_ENR_ENTRIES]] ) ) cmd.append( @@ -311,7 +312,7 @@ def get_beacon_config( + ",".join( [ ctx.peer_id - for ctx in boot_cl_client_ctxs[: package_io.MAX_ENR_ENTRIES] + for ctx in boot_cl_client_ctxs[: constants.MAX_ENR_ENTRIES] ] ) ) @@ -324,24 +325,18 @@ def get_beacon_config( endpoint="/eth/v1/node/identity", port_id=BEACON_HTTP_PORT_ID ) - ready_conditions = ReadyCondition( - recipe=recipe, - field="code", - assertion="IN", - target_value=[200, 206], - timeout="15m", - ) - return ServiceConfig( image=image, ports=BEACON_USED_PORTS, cmd=cmd, files={ - package_io.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid + constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid }, env_vars={RUST_BACKTRACE_ENVVAR_NAME: RUST_FULL_BACKTRACE_KEYWORD}, private_ip_address_placeholder=PRIVATE_IP_ADDRESS_PLACEHOLDER, - ready_conditions=ready_conditions, + ready_conditions=cl_node_ready_conditions.get_ready_conditions( + BEACON_HTTP_PORT_ID + ), min_cpu=bn_min_cpu, max_cpu=bn_max_cpu, min_memory=bn_min_mem, @@ -374,7 +369,7 @@ def get_validator_config( "lighthouse", "validator_client", "--debug-level=" + log_level, - "--testnet-dir=" + package_io.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER, + "--testnet-dir=" + constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER, "--validators-dir=" + validator_keys_dirpath, # NOTE: When secrets-dir is specified, we can't add the --data-dir flag "--secrets-dir=" + validator_secrets_dirpath, @@ -387,7 +382,7 @@ def get_validator_config( "--beacon-nodes=" + beacon_client_http_url, # "--enable-doppelganger-protection", // Disabled to not have to wait 2 epochs before validator can start # burn address - If unset, the validator will scream in its logs - "--suggested-fee-recipient=" + package_io.VALIDATING_REWARDS_ACCOUNT, + "--suggested-fee-recipient=" + constants.VALIDATING_REWARDS_ACCOUNT, # vvvvvvvvvvvvvvvvvvv PROMETHEUS CONFIG vvvvvvvvvvvvvvvvvvvvv "--metrics", "--metrics-address=0.0.0.0", @@ -404,7 +399,7 @@ def get_validator_config( ports=VALIDATOR_USED_PORTS, cmd=cmd, files={ - package_io.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid, + constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid, VALIDATOR_KEYS_MOUNTPOINT_ON_CLIENTS: node_keystore_files.files_artifact_uuid, }, env_vars={RUST_BACKTRACE_ENVVAR_NAME: RUST_FULL_BACKTRACE_KEYWORD}, diff --git a/src/cl/lodestar/lodestar_launcher.star b/src/cl/lodestar/lodestar_launcher.star index eafb1eeee..ec2eee590 100644 --- a/src/cl/lodestar/lodestar_launcher.star +++ b/src/cl/lodestar/lodestar_launcher.star @@ -1,10 +1,10 @@ shared_utils = import_module("../../shared_utils/shared_utils.star") -input_parser = import_module("../../package_io/parse_input.star") +input_parser = import_module("../../package_io/input_parser.star") cl_client_context = import_module("../../cl/cl_client_context.star") node_metrics = import_module("../../node_metrics_info.star") cl_node_ready_conditions = import_module("../../cl/cl_node_ready_conditions.star") -package_io = import_module("../../package_io/constants.star") +constants = import_module("../../package_io/constants.star") # ---------------------------------- Beacon client ------------------------------------- CONSENSUS_DATA_DIRPATH_ON_SERVICE_CONTAINER = "/consensus-data" @@ -61,11 +61,11 @@ VALIDATOR_USED_PORTS = { LODESTAR_LOG_LEVELS = { - package_io.GLOBAL_CLIENT_LOG_LEVEL.error: "error", - package_io.GLOBAL_CLIENT_LOG_LEVEL.warn: "warn", - package_io.GLOBAL_CLIENT_LOG_LEVEL.info: "info", - package_io.GLOBAL_CLIENT_LOG_LEVEL.debug: "debug", - package_io.GLOBAL_CLIENT_LOG_LEVEL.trace: "trace", + constants.GLOBAL_CLIENT_LOG_LEVEL.error: "error", + constants.GLOBAL_CLIENT_LOG_LEVEL.warn: "warn", + constants.GLOBAL_CLIENT_LOG_LEVEL.info: "info", + constants.GLOBAL_CLIENT_LOG_LEVEL.debug: "debug", + constants.GLOBAL_CLIENT_LOG_LEVEL.trace: "trace", } @@ -232,10 +232,10 @@ def get_beacon_config( "--discoveryPort={0}".format(DISCOVERY_PORT_NUM), "--dataDir=" + CONSENSUS_DATA_DIRPATH_ON_SERVICE_CONTAINER, "--paramsFile=" - + package_io.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + + constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/config.yaml", "--genesisStateFile=" - + package_io.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + + constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/genesis.ssz", "--eth1.depositContractDeployBlock=0", "--network.connectToDiscv5Bootnodes=true", @@ -253,7 +253,7 @@ def get_beacon_config( "--enr.udp={0}".format(DISCOVERY_PORT_NUM), # Set per Pari's recommendation to reduce noise in the logs "--subscribeAllSubnets=true", - "--jwt-secret=" + package_io.JWT_AUTH_PATH, + "--jwt-secret=" + constants.JWT_AUTH_PATH, # vvvvvvvvvvvvvvvvvvv METRICS CONFIG vvvvvvvvvvvvvvvvvvvvv "--metrics", "--metrics.address=0.0.0.0", @@ -265,7 +265,7 @@ def get_beacon_config( cmd.append( "--bootnodes=" + ",".join( - [ctx.enr for ctx in bootnode_contexts[: package_io.MAX_ENR_ENTRIES]] + [ctx.enr for ctx in bootnode_contexts[: constants.MAX_ENR_ENTRIES]] ) ) @@ -278,7 +278,7 @@ def get_beacon_config( ports=BEACON_USED_PORTS, cmd=cmd, files={ - package_io.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid + constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid }, private_ip_address_placeholder=PRIVATE_IP_ADDRESS_PLACEHOLDER, ready_conditions=cl_node_ready_conditions.get_ready_conditions(HTTP_PORT_ID), @@ -321,12 +321,12 @@ def get_validator_config( "--logLevel=" + log_level, "--dataDir=" + root_dirpath, "--paramsFile=" - + package_io.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + + constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/config.yaml", "--beaconNodes=" + beacon_client_http_url, "--keystoresDir=" + validator_keys_dirpath, "--secretsDir=" + validator_secrets_dirpath, - "--suggestedFeeRecipient=" + package_io.VALIDATING_REWARDS_ACCOUNT, + "--suggestedFeeRecipient=" + constants.VALIDATING_REWARDS_ACCOUNT, # vvvvvvvvvvvvvvvvvvv PROMETHEUS CONFIG vvvvvvvvvvvvvvvvvvvvv "--metrics", "--metrics.address=0.0.0.0", @@ -343,7 +343,7 @@ def get_validator_config( ports=VALIDATOR_USED_PORTS, cmd=cmd, files={ - package_io.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid, + constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid, VALIDATOR_KEYS_MOUNT_DIRPATH_ON_SERVICE_CONTAINER: node_keystore_files.files_artifact_uuid, }, private_ip_address_placeholder=PRIVATE_IP_ADDRESS_PLACEHOLDER, diff --git a/src/cl/nimbus/nimbus_launcher.star b/src/cl/nimbus/nimbus_launcher.star index 55e11e578..2ac6b0a5e 100644 --- a/src/cl/nimbus/nimbus_launcher.star +++ b/src/cl/nimbus/nimbus_launcher.star @@ -1,10 +1,10 @@ shared_utils = import_module("../../shared_utils/shared_utils.star") -input_parser = import_module("../../package_io/parse_input.star") +input_parser = import_module("../../package_io/input_parser.star") cl_client_context = import_module("../../cl/cl_client_context.star") node_metrics = import_module("../../node_metrics_info.star") cl_node_ready_conditions = import_module("../../cl/cl_node_ready_conditions.star") -package_io = import_module("../../package_io/constants.star") +constants = import_module("../../package_io/constants.star") VALIDATOR_KEYS_MOUNTPOINT_ON_CLIENT = "/validator-keys" @@ -61,11 +61,11 @@ USED_PORTS = { } NIMBUS_LOG_LEVELS = { - package_io.GLOBAL_CLIENT_LOG_LEVEL.error: "ERROR", - package_io.GLOBAL_CLIENT_LOG_LEVEL.warn: "WARN", - package_io.GLOBAL_CLIENT_LOG_LEVEL.info: "INFO", - package_io.GLOBAL_CLIENT_LOG_LEVEL.debug: "DEBUG", - package_io.GLOBAL_CLIENT_LOG_LEVEL.trace: "TRACE", + constants.GLOBAL_CLIENT_LOG_LEVEL.error: "ERROR", + constants.GLOBAL_CLIENT_LOG_LEVEL.warn: "WARN", + constants.GLOBAL_CLIENT_LOG_LEVEL.info: "INFO", + constants.GLOBAL_CLIENT_LOG_LEVEL.debug: "DEBUG", + constants.GLOBAL_CLIENT_LOG_LEVEL.trace: "TRACE", } ENTRYPOINT_ARGS = ["sh", "-c"] @@ -239,7 +239,7 @@ def get_config( validator_flags = [ "--validators-dir=" + VALIDATOR_KEYS_DIRPATH_ON_SERVICE_CONTAINER, "--secrets-dir=" + VALIDATOR_SECRETS_DIRPATH_ON_SERVICE_CONTAINER, - "--suggested-fee-recipient=" + package_io.VALIDATING_REWARDS_ACCOUNT, + "--suggested-fee-recipient=" + constants.VALIDATING_REWARDS_ACCOUNT, ] beacon_start = [ @@ -248,12 +248,12 @@ def get_config( "--log-level=" + log_level, "--udp-port={0}".format(DISCOVERY_PORT_NUM), "--tcp-port={0}".format(DISCOVERY_PORT_NUM), - "--network=" + package_io.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER, + "--network=" + constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER, "--data-dir=" + CONSENSUS_DATA_DIRPATH_IN_SERVICE_CONTAINER, "--web3-url=" + EXECUTION_ENGINE_ENDPOINT, "--nat=extip:" + PRIVATE_IP_ADDRESS_PLACEHOLDER, "--enr-auto-update=false", - "--history={0}".format("archive" if package_io.ARCHIVE_MODE else "prune"), + "--history={0}".format("archive" if constants.ARCHIVE_MODE else "prune"), "--rest", "--rest-address=0.0.0.0", "--rest-allow-origin=*", @@ -266,7 +266,7 @@ def get_config( "--subscribe-all-subnets=true", # Nimbus can handle a max of 256 threads, if the host has more then nimbus crashes. Setting it to 4 so it doesn't crash on build servers "--num-threads=4", - "--jwt-secret=" + package_io.JWT_AUTH_PATH, + "--jwt-secret=" + constants.JWT_AUTH_PATH, # vvvvvvvvvvvvvvvvvvv METRICS CONFIG vvvvvvvvvvvvvvvvvvvvv "--metrics", "--metrics-address=0.0.0.0", @@ -288,7 +288,7 @@ def get_config( # See explanation there cmd.append("--subscribe-all-subnets") else: - for ctx in bootnode_contexts[: package_io.MAX_ENR_ENTRIES]: + for ctx in bootnode_contexts[: constants.MAX_ENR_ENTRIES]: cmd.append("--bootstrap-node=" + ctx.enr) cmd.append("--direct-peer=" + ctx.multiaddr) @@ -296,7 +296,7 @@ def get_config( cmd.extend([param for param in extra_params]) files = { - package_io.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid, + constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid, } if node_keystore_files: files[ diff --git a/src/cl/prysm/prysm_launcher.star b/src/cl/prysm/prysm_launcher.star index b08a9ada0..c5184ba32 100644 --- a/src/cl/prysm/prysm_launcher.star +++ b/src/cl/prysm/prysm_launcher.star @@ -1,9 +1,9 @@ shared_utils = import_module("../../shared_utils/shared_utils.star") -input_parser = import_module("../../package_io/parse_input.star") +input_parser = import_module("../../package_io/input_parser.star") cl_client_context = import_module("../../cl/cl_client_context.star") node_metrics = import_module("../../node_metrics_info.star") cl_node_ready_conditions = import_module("../../cl/cl_node_ready_conditions.star") -package_io = import_module("../../package_io/constants.star") +constants = import_module("../../package_io/constants.star") IMAGE_SEPARATOR_DELIMITER = "," EXPECTED_NUM_IMAGES = 2 @@ -74,11 +74,11 @@ VALIDATOR_NODE_USED_PORTS = { } PRYSM_LOG_LEVELS = { - package_io.GLOBAL_CLIENT_LOG_LEVEL.error: "error", - package_io.GLOBAL_CLIENT_LOG_LEVEL.warn: "warn", - package_io.GLOBAL_CLIENT_LOG_LEVEL.info: "info", - package_io.GLOBAL_CLIENT_LOG_LEVEL.debug: "debug", - package_io.GLOBAL_CLIENT_LOG_LEVEL.trace: "trace", + constants.GLOBAL_CLIENT_LOG_LEVEL.error: "error", + constants.GLOBAL_CLIENT_LOG_LEVEL.warn: "warn", + constants.GLOBAL_CLIENT_LOG_LEVEL.info: "info", + constants.GLOBAL_CLIENT_LOG_LEVEL.debug: "debug", + constants.GLOBAL_CLIENT_LOG_LEVEL.trace: "trace", } @@ -264,10 +264,10 @@ def get_beacon_config( "--accept-terms-of-use=true", # it's mandatory in order to run the node "--datadir=" + CONSENSUS_DATA_DIRPATH_ON_SERVICE_CONTAINER, "--chain-config-file=" - + package_io.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + + constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/config.yaml", "--genesis-state=" - + package_io.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + + constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/genesis.ssz", "--execution-endpoint=" + EXECUTION_ENGINE_ENDPOINT, "--rpc-host=0.0.0.0", @@ -280,11 +280,11 @@ def get_beacon_config( "--p2p-udp-port={0}".format(DISCOVERY_UDP_PORT_NUM), "--min-sync-peers={0}".format(MIN_PEERS), "--verbosity=" + log_level, - "--slots-per-archive-point={0}".format(32 if package_io.ARCHIVE_MODE else 8192), - "--suggested-fee-recipient=" + package_io.VALIDATING_REWARDS_ACCOUNT, + "--slots-per-archive-point={0}".format(32 if constants.ARCHIVE_MODE else 8192), + "--suggested-fee-recipient=" + constants.VALIDATING_REWARDS_ACCOUNT, # Set per Pari's recommendation to reduce noise "--subscribe-all-subnets=true", - "--jwt-secret=" + package_io.JWT_AUTH_PATH, + "--jwt-secret=" + constants.JWT_AUTH_PATH, # vvvvvvvvv METRICS CONFIG vvvvvvvvvvvvvvvvvvvvv "--disable-monitoring=false", "--monitoring-host=0.0.0.0", @@ -293,7 +293,7 @@ def get_beacon_config( ] if bootnode_contexts != None: - for ctx in bootnode_contexts[: package_io.MAX_ENR_ENTRIES]: + for ctx in bootnode_contexts[: constants.MAX_ENR_ENTRIES]: cmd.append("--peer=" + ctx.multiaddr) cmd.append("--bootstrap-node=" + ctx.enr) cmd.append("--p2p-static-id=true") @@ -307,7 +307,7 @@ def get_beacon_config( ports=BEACON_NODE_USED_PORTS, cmd=cmd, files={ - package_io.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid, + constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid, }, private_ip_address_placeholder=PRIVATE_IP_ADDRESS_PLACEHOLDER, ready_conditions=cl_node_ready_conditions.get_ready_conditions(HTTP_PORT_ID), @@ -346,7 +346,7 @@ def get_validator_config( cmd = [ "--accept-terms-of-use=true", # it's mandatory in order to run the node "--chain-config-file=" - + package_io.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + + constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/config.yaml", "--beacon-rpc-gateway-provider=" + beacon_http_endpoint, "--beacon-rpc-provider=" + beacon_rpc_endpoint, @@ -355,7 +355,7 @@ def get_validator_config( "--datadir=" + CONSENSUS_DATA_DIRPATH_ON_SERVICE_CONTAINER, "--monitoring-port={0}".format(VALIDATOR_MONITORING_PORT_NUM), "--verbosity=" + log_level, - "--suggested-fee-recipient=" + package_io.VALIDATING_REWARDS_ACCOUNT, + "--suggested-fee-recipient=" + constants.VALIDATING_REWARDS_ACCOUNT, # TODO(old) SOMETHING ABOUT JWT # vvvvvvvvvvvvvvvvvvv METRICS CONFIG vvvvvvvvvvvvvvvvvvvvv "--disable-monitoring=false", @@ -373,7 +373,7 @@ def get_validator_config( ports=VALIDATOR_NODE_USED_PORTS, cmd=cmd, files={ - package_io.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid, + constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid, VALIDATOR_KEYS_MOUNT_DIRPATH_ON_SERVICE_CONTAINER: node_keystore_files.files_artifact_uuid, PRYSM_PASSWORD_MOUNT_DIRPATH_ON_SERVICE_CONTAINER: prysm_password_artifact_uuid, }, diff --git a/src/cl/teku/teku_launcher.star b/src/cl/teku/teku_launcher.star index f44ebd82d..1452653b5 100644 --- a/src/cl/teku/teku_launcher.star +++ b/src/cl/teku/teku_launcher.star @@ -1,10 +1,10 @@ shared_utils = import_module("../../shared_utils/shared_utils.star") -input_parser = import_module("../../package_io/parse_input.star") +input_parser = import_module("../../package_io/input_parser.star") cl_client_context = import_module("../../cl/cl_client_context.star") node_metrics = import_module("../../node_metrics_info.star") cl_node_ready_conditions = import_module("../../cl/cl_node_ready_conditions.star") -package_io = import_module("../../package_io/constants.star") +constants = import_module("../../package_io/constants.star") TEKU_BINARY_FILEPATH_IN_IMAGE = "/opt/teku/bin/teku" @@ -65,11 +65,11 @@ ENTRYPOINT_ARGS = ["sh", "-c"] TEKU_LOG_LEVELS = { - package_io.GLOBAL_CLIENT_LOG_LEVEL.error: "ERROR", - package_io.GLOBAL_CLIENT_LOG_LEVEL.warn: "WARN", - package_io.GLOBAL_CLIENT_LOG_LEVEL.info: "INFO", - package_io.GLOBAL_CLIENT_LOG_LEVEL.debug: "DEBUG", - package_io.GLOBAL_CLIENT_LOG_LEVEL.trace: "TRACE", + constants.GLOBAL_CLIENT_LOG_LEVEL.error: "ERROR", + constants.GLOBAL_CLIENT_LOG_LEVEL.warn: "WARN", + constants.GLOBAL_CLIENT_LOG_LEVEL.info: "INFO", + constants.GLOBAL_CLIENT_LOG_LEVEL.debug: "DEBUG", + constants.GLOBAL_CLIENT_LOG_LEVEL.trace: "TRACE", } @@ -230,21 +230,21 @@ def get_config( DEST_VALIDATOR_SECRETS_DIRPATH_IN_SERVICE_CONTAINER, ), "--validators-proposer-default-fee-recipient=" - + package_io.VALIDATING_REWARDS_ACCOUNT, + + constants.VALIDATING_REWARDS_ACCOUNT, ] beacon_start = [ TEKU_BINARY_FILEPATH_IN_IMAGE, "--logging=" + log_level, "--log-destination=CONSOLE", "--network=" - + package_io.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + + constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/config.yaml", "--initial-state=" - + package_io.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + + constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/genesis.ssz", "--data-path=" + CONSENSUS_DATA_DIRPATH_ON_SERVICE_CONTAINER, "--data-storage-mode={0}".format( - "ARCHIVE" if package_io.ARCHIVE_MODE else "PRUNE" + "ARCHIVE" if constants.ARCHIVE_MODE else "PRUNE" ), "--p2p-enabled=true", # Set per Pari's recommendation, to reduce noise in the logs @@ -258,7 +258,7 @@ def get_config( "--rest-api-port={0}".format(HTTP_PORT_NUM), "--rest-api-host-allowlist=*", "--data-storage-non-canonical-blocks-enabled=true", - "--ee-jwt-secret-file=" + package_io.JWT_AUTH_PATH, + "--ee-jwt-secret-file=" + constants.JWT_AUTH_PATH, "--ee-endpoint=" + EXECUTION_ENGINE_ENDPOINT, # vvvvvvvvvvvvvvvvvvv METRICS CONFIG vvvvvvvvvvvvvvvvvvvvv "--metrics-enabled", @@ -282,7 +282,7 @@ def get_config( cmd.append( "--p2p-discovery-bootnodes=" + ",".join( - [ctx.enr for ctx in bootnode_contexts[: package_io.MAX_ENR_ENTRIES]] + [ctx.enr for ctx in bootnode_contexts[: constants.MAX_ENR_ENTRIES]] ) ) cmd.append( @@ -290,7 +290,7 @@ def get_config( + ",".join( [ ctx.multiaddr - for ctx in bootnode_contexts[: package_io.MAX_ENR_ENTRIES] + for ctx in bootnode_contexts[: constants.MAX_ENR_ENTRIES] ] ) ) @@ -300,7 +300,7 @@ def get_config( cmd.extend([param for param in extra_params]) files = { - package_io.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid, + constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid, } if node_keystore_files: files[ diff --git a/src/dora/dora_launcher.star b/src/dora/dora_launcher.star index b94449a07..5be2f7f6a 100644 --- a/src/dora/dora_launcher.star +++ b/src/dora/dora_launcher.star @@ -1,5 +1,5 @@ shared_utils = import_module("../shared_utils/shared_utils.star") -package_io = import_module("../package_io/constants.star") +constants = import_module("../package_io/constants.star") SERVICE_NAME = "dora" IMAGE_NAME = "ethpandaops/dora:master" @@ -65,7 +65,7 @@ def get_config(config_files_artifact_name, el_cl_data_files_artifact_uuid): files={ DORA_CONFIG_MOUNT_DIRPATH_ON_SERVICE: config_files_artifact_name, VALIDATOR_RANGES_MOUNT_DIRPATH_ON_SERVICE: VALIDATOR_RANGES_ARTIFACT_NAME, - package_io.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_data_files_artifact_uuid, + constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_data_files_artifact_uuid, }, cmd=["-config", config_file_path], ) diff --git a/src/el/besu/besu_launcher.star b/src/el/besu/besu_launcher.star index f109098d0..5130232e9 100644 --- a/src/el/besu/besu_launcher.star +++ b/src/el/besu/besu_launcher.star @@ -1,9 +1,9 @@ shared_utils = import_module("../../shared_utils/shared_utils.star") -input_parser = import_module("../../package_io/parse_input.star") +input_parser = import_module("../../package_io/input_parser.star") el_client_context = import_module("../../el/el_client_context.star") el_admin_node_info = import_module("../../el/el_admin_node_info.star") node_metrics = import_module("../../node_metrics_info.star") -package_io = import_module("../../package_io/constants.star") +constants = import_module("../../package_io/constants.star") # The dirpath of the execution data directory on the client container EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER = "/opt/besu/execution-data" @@ -52,11 +52,11 @@ USED_PORTS = { ENTRYPOINT_ARGS = ["sh", "-c"] BESU_LOG_LEVELS = { - package_io.GLOBAL_CLIENT_LOG_LEVEL.error: "ERROR", - package_io.GLOBAL_CLIENT_LOG_LEVEL.warn: "WARN", - package_io.GLOBAL_CLIENT_LOG_LEVEL.info: "INFO", - package_io.GLOBAL_CLIENT_LOG_LEVEL.debug: "DEBUG", - package_io.GLOBAL_CLIENT_LOG_LEVEL.trace: "TRACE", + constants.GLOBAL_CLIENT_LOG_LEVEL.error: "ERROR", + constants.GLOBAL_CLIENT_LOG_LEVEL.warn: "WARN", + constants.GLOBAL_CLIENT_LOG_LEVEL.info: "INFO", + constants.GLOBAL_CLIENT_LOG_LEVEL.debug: "DEBUG", + constants.GLOBAL_CLIENT_LOG_LEVEL.trace: "TRACE", } @@ -138,7 +138,7 @@ def get_config( "--logging=" + log_level, "--data-path=" + EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER, "--genesis-file=" - + package_io.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + + constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/besu.json", "--network-id=" + network_id, "--host-allowlist=*", @@ -155,12 +155,12 @@ def get_config( "--p2p-host=" + PRIVATE_IP_ADDRESS_PLACEHOLDER, "--p2p-port={0}".format(DISCOVERY_PORT_NUM), "--engine-rpc-enabled=true", - "--engine-jwt-secret=" + package_io.JWT_AUTH_PATH, + "--engine-jwt-secret=" + constants.JWT_AUTH_PATH, "--engine-host-allowlist=*", "--engine-rpc-port={0}".format(ENGINE_HTTP_RPC_PORT_NUM), "--sync-mode=FULL", "--data-storage-format=BONSAI", - "--kzg-trusted-setup=" + package_io.KZG_DATA_DIRPATH_ON_CLIENT_CONTAINER, + "--kzg-trusted-setup=" + constants.KZG_DATA_DIRPATH_ON_CLIENT_CONTAINER, "--metrics-enabled=true", "--metrics-host=0.0.0.0", "--metrics-port={0}".format(METRICS_PORT_NUM), @@ -172,7 +172,7 @@ def get_config( + ",".join( [ ctx.enode - for ctx in existing_el_clients[: package_io.MAX_ENODE_ENTRIES] + for ctx in existing_el_clients[: constants.MAX_ENODE_ENTRIES] ] ) ) @@ -188,7 +188,7 @@ def get_config( ports=USED_PORTS, cmd=[cmd_str], files={ - package_io.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid, + constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid, }, entrypoint=ENTRYPOINT_ARGS, private_ip_address_placeholder=PRIVATE_IP_ADDRESS_PLACEHOLDER, diff --git a/src/el/erigon/erigon_launcher.star b/src/el/erigon/erigon_launcher.star index 4ddce5dc1..420825f0e 100644 --- a/src/el/erigon/erigon_launcher.star +++ b/src/el/erigon/erigon_launcher.star @@ -1,10 +1,10 @@ shared_utils = import_module("../../shared_utils/shared_utils.star") -input_parser = import_module("../../package_io/parse_input.star") +input_parser = import_module("../../package_io/input_parser.star") el_admin_node_info = import_module("../../el/el_admin_node_info.star") el_client_context = import_module("../../el/el_client_context.star") node_metrics = import_module("../../node_metrics_info.star") -package_io = import_module("../../package_io/constants.star") +constants = import_module("../../package_io/constants.star") # The dirpath of the execution data directory on the client container EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER = "/home/erigon/execution-data" @@ -53,11 +53,11 @@ USED_PORTS = { ENTRYPOINT_ARGS = ["sh", "-c"] ERIGON_LOG_LEVELS = { - package_io.GLOBAL_CLIENT_LOG_LEVEL.error: "1", - package_io.GLOBAL_CLIENT_LOG_LEVEL.warn: "2", - package_io.GLOBAL_CLIENT_LOG_LEVEL.info: "3", - package_io.GLOBAL_CLIENT_LOG_LEVEL.debug: "4", - package_io.GLOBAL_CLIENT_LOG_LEVEL.trace: "5", + constants.GLOBAL_CLIENT_LOG_LEVEL.error: "1", + constants.GLOBAL_CLIENT_LOG_LEVEL.warn: "2", + constants.GLOBAL_CLIENT_LOG_LEVEL.info: "3", + constants.GLOBAL_CLIENT_LOG_LEVEL.debug: "4", + constants.GLOBAL_CLIENT_LOG_LEVEL.trace: "5", } @@ -140,7 +140,7 @@ def get_config( init_datadir_cmd_str = "erigon init --datadir={0} {1}".format( EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER, - package_io.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/genesis.json", + constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/genesis.json", ) cmd = [ @@ -158,7 +158,7 @@ def get_config( "--http.addr=0.0.0.0", "--http.corsdomain=*", "--http.port={0}".format(WS_RPC_PORT_NUM), - "--authrpc.jwtsecret=" + package_io.JWT_AUTH_PATH, + "--authrpc.jwtsecret=" + constants.JWT_AUTH_PATH, "--authrpc.addr=0.0.0.0", "--authrpc.port={0}".format(ENGINE_RPC_PORT_NUM), "--authrpc.vhosts=*", @@ -173,7 +173,7 @@ def get_config( + ",".join( [ ctx.enode - for ctx in existing_el_clients[: package_io.MAX_ENODE_ENTRIES] + for ctx in existing_el_clients[: constants.MAX_ENODE_ENTRIES] ] ) ) @@ -182,7 +182,7 @@ def get_config( + ",".join( [ ctx.enode - for ctx in existing_el_clients[: package_io.MAX_ENODE_ENTRIES] + for ctx in existing_el_clients[: constants.MAX_ENODE_ENTRIES] ] ) ) @@ -200,7 +200,7 @@ def get_config( ports=USED_PORTS, cmd=[command_arg_str], files={ - package_io.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid, + constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid, }, entrypoint=ENTRYPOINT_ARGS, private_ip_address_placeholder=PRIVATE_IP_ADDRESS_PLACEHOLDER, diff --git a/src/el/ethereumjs/ethereumjs_launcher.star b/src/el/ethereumjs/ethereumjs_launcher.star index adb4f09e9..e6c968be8 100644 --- a/src/el/ethereumjs/ethereumjs_launcher.star +++ b/src/el/ethereumjs/ethereumjs_launcher.star @@ -1,10 +1,10 @@ shared_utils = import_module("../../shared_utils/shared_utils.star") -input_parser = import_module("../..//package_io/parse_input.star") +input_parser = import_module("../..//package_io/input_parser.star") el_client_context = import_module("../../el/el_client_context.star") el_admin_node_info = import_module("../../el/el_admin_node_info.star") node_metrics = import_module("../../node_metrics_info.star") -package_io = import_module("../../package_io/constants.star") +constants = import_module("../../package_io/constants.star") RPC_PORT_NUM = 8545 @@ -56,11 +56,11 @@ USED_PORTS = { ENTRYPOINT_ARGS = [] VERBOSITY_LEVELS = { - package_io.GLOBAL_CLIENT_LOG_LEVEL.error: "error", - package_io.GLOBAL_CLIENT_LOG_LEVEL.warn: "warn", - package_io.GLOBAL_CLIENT_LOG_LEVEL.info: "info", - package_io.GLOBAL_CLIENT_LOG_LEVEL.debug: "debug", - package_io.GLOBAL_CLIENT_LOG_LEVEL.trace: "trace", + constants.GLOBAL_CLIENT_LOG_LEVEL.error: "error", + constants.GLOBAL_CLIENT_LOG_LEVEL.warn: "warn", + constants.GLOBAL_CLIENT_LOG_LEVEL.info: "info", + constants.GLOBAL_CLIENT_LOG_LEVEL.debug: "debug", + constants.GLOBAL_CLIENT_LOG_LEVEL.trace: "trace", } @@ -137,7 +137,7 @@ def get_config( ): cmd = [ "--gethGenesis=" - + package_io.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + + constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/genesis.json", "--dataDir=" + EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER, "--port={0}".format(DISCOVERY_PORT_NUM), @@ -153,7 +153,7 @@ def get_config( "--wsPort={0}".format(WS_PORT_NUM), "--wsEnginePort={0}".format(WS_PORT_ENGINE_NUM), "--wsEngineAddr=0.0.0.0", - "--jwt-secret=" + package_io.JWT_AUTH_PATH, + "--jwt-secret=" + constants.JWT_AUTH_PATH, "--extIP={0}".format(PRIVATE_IP_ADDRESS_PLACEHOLDER), "--sync=full", "--isSingleNode=true", @@ -166,7 +166,7 @@ def get_config( + ",".join( [ ctx.enode - for ctx in existing_el_clients[: package_io.MAX_ENODE_ENTRIES] + for ctx in existing_el_clients[: constants.MAX_ENODE_ENTRIES] ] ) ) @@ -180,7 +180,7 @@ def get_config( ports=USED_PORTS, cmd=cmd, files={ - package_io.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid, + constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid, }, entrypoint=ENTRYPOINT_ARGS, private_ip_address_placeholder=PRIVATE_IP_ADDRESS_PLACEHOLDER, diff --git a/src/el/geth/geth_launcher.star b/src/el/geth/geth_launcher.star index 5f674ec3d..47e815a0f 100644 --- a/src/el/geth/geth_launcher.star +++ b/src/el/geth/geth_launcher.star @@ -1,5 +1,5 @@ shared_utils = import_module("../../shared_utils/shared_utils.star") -input_parser = import_module("../../package_io/parse_input.star") +input_parser = import_module("../../package_io/input_parser.star") el_client_context = import_module("../../el/el_client_context.star") el_admin_node_info = import_module("../../el/el_admin_node_info.star") genesis_constants = import_module( @@ -7,7 +7,7 @@ genesis_constants = import_module( ) node_metrics = import_module("../../node_metrics_info.star") -package_io = import_module("../../package_io/constants.star") +constants = import_module("../../package_io/constants.star") RPC_PORT_NUM = 8545 WS_PORT_NUM = 8546 @@ -60,11 +60,11 @@ USED_PORTS = { ENTRYPOINT_ARGS = ["sh", "-c"] VERBOSITY_LEVELS = { - package_io.GLOBAL_CLIENT_LOG_LEVEL.error: "1", - package_io.GLOBAL_CLIENT_LOG_LEVEL.warn: "2", - package_io.GLOBAL_CLIENT_LOG_LEVEL.info: "3", - package_io.GLOBAL_CLIENT_LOG_LEVEL.debug: "4", - package_io.GLOBAL_CLIENT_LOG_LEVEL.trace: "5", + constants.GLOBAL_CLIENT_LOG_LEVEL.error: "1", + constants.GLOBAL_CLIENT_LOG_LEVEL.warn: "2", + constants.GLOBAL_CLIENT_LOG_LEVEL.info: "3", + constants.GLOBAL_CLIENT_LOG_LEVEL.debug: "4", + constants.GLOBAL_CLIENT_LOG_LEVEL.trace: "5", } BUILDER_IMAGE_STR = "builder" @@ -150,7 +150,7 @@ def get_config( init_datadir_cmd_str = "geth init {0} --state.scheme=path --datadir={1} {2}".format( "--cache.preimages" if electra_fork_epoch != None else "", EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER, - package_io.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/genesis.json", + constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/genesis.json", ) cmd = [ @@ -177,7 +177,7 @@ def get_config( "--authrpc.port={0}".format(ENGINE_RPC_PORT_NUM), "--authrpc.addr=0.0.0.0", "--authrpc.vhosts=*", - "--authrpc.jwtsecret=" + package_io.JWT_AUTH_PATH, + "--authrpc.jwtsecret=" + constants.JWT_AUTH_PATH, "--syncmode=full", "--rpc.allow-unprotected-txs", "--metrics", @@ -195,7 +195,7 @@ def get_config( + ",".join( [ ctx.enode - for ctx in existing_el_clients[: package_io.MAX_ENODE_ENTRIES] + for ctx in existing_el_clients[: constants.MAX_ENODE_ENTRIES] ] ) ) @@ -217,7 +217,7 @@ def get_config( ports=USED_PORTS, cmd=[command_str], files={ - package_io.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid + constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid }, entrypoint=ENTRYPOINT_ARGS, private_ip_address_placeholder=PRIVATE_IP_ADDRESS_PLACEHOLDER, diff --git a/src/el/nethermind/nethermind_launcher.star b/src/el/nethermind/nethermind_launcher.star index 21d3374c0..04ff6bcc7 100644 --- a/src/el/nethermind/nethermind_launcher.star +++ b/src/el/nethermind/nethermind_launcher.star @@ -1,10 +1,10 @@ shared_utils = import_module("../../shared_utils/shared_utils.star") -input_parser = import_module("../../package_io/parse_input.star") +input_parser = import_module("../../package_io/input_parser.star") el_client_context = import_module("../../el/el_client_context.star") el_admin_node_info = import_module("../../el/el_admin_node_info.star") node_metrics = import_module("../../node_metrics_info.star") -package_io = import_module("../../package_io/constants.star") +constants = import_module("../../package_io/constants.star") # The dirpath of the execution data directory on the client container EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER = "/execution-data" @@ -51,11 +51,11 @@ USED_PORTS = { } NETHERMIND_LOG_LEVELS = { - package_io.GLOBAL_CLIENT_LOG_LEVEL.error: "ERROR", - package_io.GLOBAL_CLIENT_LOG_LEVEL.warn: "WARN", - package_io.GLOBAL_CLIENT_LOG_LEVEL.info: "INFO", - package_io.GLOBAL_CLIENT_LOG_LEVEL.debug: "DEBUG", - package_io.GLOBAL_CLIENT_LOG_LEVEL.trace: "TRACE", + constants.GLOBAL_CLIENT_LOG_LEVEL.error: "ERROR", + constants.GLOBAL_CLIENT_LOG_LEVEL.warn: "WARN", + constants.GLOBAL_CLIENT_LOG_LEVEL.info: "INFO", + constants.GLOBAL_CLIENT_LOG_LEVEL.debug: "DEBUG", + constants.GLOBAL_CLIENT_LOG_LEVEL.trace: "TRACE", } @@ -135,10 +135,10 @@ def get_config( "--log=" + log_level, "--datadir=" + EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER, "--Init.ChainSpecPath=" - + package_io.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + + constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/chainspec.json", "--Init.WebSocketsEnabled=true", - "--Init.KzgSetupPath=" + package_io.KZG_DATA_DIRPATH_ON_CLIENT_CONTAINER, + "--Init.KzgSetupPath=" + constants.KZG_DATA_DIRPATH_ON_CLIENT_CONTAINER, "--config=none.cfg", "--JsonRpc.Enabled=true", "--JsonRpc.EnabledModules=net,eth,consensus,subscribe,web3,admin", @@ -150,7 +150,7 @@ def get_config( "--Network.ExternalIp={0}".format(PRIVATE_IP_ADDRESS_PLACEHOLDER), "--Network.DiscoveryPort={0}".format(DISCOVERY_PORT_NUM), "--Network.P2PPort={0}".format(DISCOVERY_PORT_NUM), - "--JsonRpc.JwtSecretFile=" + package_io.JWT_AUTH_PATH, + "--JsonRpc.JwtSecretFile=" + constants.JWT_AUTH_PATH, "--Network.OnlyStaticPeers=true", "--Metrics.Enabled=true", "--Metrics.ExposePort={0}".format(METRICS_PORT_NUM), @@ -162,7 +162,7 @@ def get_config( + ",".join( [ ctx.enode - for ctx in existing_el_clients[: package_io.MAX_ENODE_ENTRIES] + for ctx in existing_el_clients[: constants.MAX_ENODE_ENTRIES] ] ) ) @@ -176,7 +176,7 @@ def get_config( ports=USED_PORTS, cmd=cmd, files={ - package_io.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid, + constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid, }, private_ip_address_placeholder=PRIVATE_IP_ADDRESS_PLACEHOLDER, min_cpu=el_min_cpu, diff --git a/src/el/reth/reth_launcher.star b/src/el/reth/reth_launcher.star index 4a952f4f3..14fa06098 100644 --- a/src/el/reth/reth_launcher.star +++ b/src/el/reth/reth_launcher.star @@ -1,9 +1,9 @@ shared_utils = import_module("../../shared_utils/shared_utils.star") -input_parser = import_module("../../package_io/parse_input.star") +input_parser = import_module("../../package_io/input_parser.star") el_client_context = import_module("../../el/el_client_context.star") el_admin_node_info = import_module("../../el/el_admin_node_info.star") node_metrics = import_module("../../node_metrics_info.star") -package_io = import_module("../../package_io/constants.star") +constants = import_module("../../package_io/constants.star") RPC_PORT_NUM = 8545 @@ -54,11 +54,11 @@ USED_PORTS = { ENTRYPOINT_ARGS = ["sh", "-c"] VERBOSITY_LEVELS = { - package_io.GLOBAL_CLIENT_LOG_LEVEL.error: "v", - package_io.GLOBAL_CLIENT_LOG_LEVEL.warn: "vv", - package_io.GLOBAL_CLIENT_LOG_LEVEL.info: "vvv", - package_io.GLOBAL_CLIENT_LOG_LEVEL.debug: "vvvv", - package_io.GLOBAL_CLIENT_LOG_LEVEL.trace: "vvvvv", + constants.GLOBAL_CLIENT_LOG_LEVEL.error: "v", + constants.GLOBAL_CLIENT_LOG_LEVEL.warn: "vv", + constants.GLOBAL_CLIENT_LOG_LEVEL.info: "vvv", + constants.GLOBAL_CLIENT_LOG_LEVEL.debug: "vvvv", + constants.GLOBAL_CLIENT_LOG_LEVEL.trace: "vvvvv", } @@ -136,7 +136,7 @@ def get_config( ): init_datadir_cmd_str = "reth init --datadir={0} --chain={1}".format( EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER, - package_io.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/genesis.json", + constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/genesis.json", ) cmd = [ @@ -144,9 +144,7 @@ def get_config( "node", "-{0}".format(verbosity_level), "--datadir=" + EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER, - "--chain=" - + package_io.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER - + "/genesis.json", + "--chain=" + constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/genesis.json", "--http", "--http.port={0}".format(RPC_PORT_NUM), "--http.addr=0.0.0.0", @@ -161,7 +159,7 @@ def get_config( "--ws.origins=*", "--nat=extip:" + PRIVATE_IP_ADDRESS_PLACEHOLDER, "--authrpc.port={0}".format(ENGINE_RPC_PORT_NUM), - "--authrpc.jwtsecret=" + package_io.JWT_AUTH_PATH, + "--authrpc.jwtsecret=" + constants.JWT_AUTH_PATH, "--authrpc.addr=0.0.0.0", "--metrics=0.0.0.0:{0}".format(METRICS_PORT_NUM), ] @@ -172,7 +170,7 @@ def get_config( + ",".join( [ ctx.enode - for ctx in existing_el_clients[: package_io.MAX_ENODE_ENTRIES] + for ctx in existing_el_clients[: constants.MAX_ENODE_ENTRIES] ] ) ) @@ -194,7 +192,7 @@ def get_config( ports=USED_PORTS, cmd=[command_str], files={ - package_io.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid, + constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data.files_artifact_uuid, }, entrypoint=ENTRYPOINT_ARGS, private_ip_address_placeholder=PRIVATE_IP_ADDRESS_PLACEHOLDER, diff --git a/src/mev_boost/mev_boost_launcher.star b/src/mev_boost/mev_boost_launcher.star index e7585bb95..db5686c11 100644 --- a/src/mev_boost/mev_boost_launcher.star +++ b/src/mev_boost/mev_boost_launcher.star @@ -1,12 +1,12 @@ shared_utils = import_module("../shared_utils/shared_utils.star") mev_boost_context_module = import_module("../mev_boost/mev_boost_context.star") -parse_input = import_module("../package_io/parse_input.star") +input_parser = import_module("../package_io/input_parser.star") FLASHBOTS_MEV_BOOST_PROTOCOL = "TCP" USED_PORTS = { "api": shared_utils.new_port_spec( - parse_input.FLASHBOTS_MEV_BOOST_PORT, FLASHBOTS_MEV_BOOST_PROTOCOL, wait="5s" + input_parser.FLASHBOTS_MEV_BOOST_PORT, FLASHBOTS_MEV_BOOST_PROTOCOL, wait="5s" ) } @@ -23,7 +23,7 @@ def launch(plan, mev_boost_launcher, service_name, network_id, mev_boost_image): mev_boost_service = plan.add_service(service_name, config) return mev_boost_context_module.new_mev_boost_context( - mev_boost_service.ip_address, parse_input.FLASHBOTS_MEV_BOOST_PORT + mev_boost_service.ip_address, input_parser.FLASHBOTS_MEV_BOOST_PORT ) @@ -44,7 +44,7 @@ def get_config(mev_boost_launcher, network_id, mev_boost_image): # does this need genesis time to be set as well "GENESIS_FORK_VERSION": "0x10000038", "BOOST_LISTEN_ADDR": "0.0.0.0:{0}".format( - parse_input.FLASHBOTS_MEV_BOOST_PORT + input_parser.FLASHBOTS_MEV_BOOST_PORT ), # maybe this is breaking; this isn't verifyign the bid and not sending it to the validator "SKIP_RELAY_SIGNATURE_CHECK": "1", diff --git a/src/package_io/parse_input.star b/src/package_io/input_parser.star similarity index 99% rename from src/package_io/parse_input.star rename to src/package_io/input_parser.star index b7be9d17e..92327d61e 100644 --- a/src/package_io/parse_input.star +++ b/src/package_io/input_parser.star @@ -1,3 +1,9 @@ +constants = import_module("../package_io/constants.star") + +genesis_constants = import_module( + "../prelaunch_data_generator/genesis_constants/genesis_constants.star" +) + DEFAULT_EL_IMAGES = { "geth": "ethereum/client-go:latest", "erigon": "ethpandaops/erigon:devel", @@ -51,14 +57,8 @@ ATTR_TO_BE_SKIPPED_AT_ROOT = ( "custom_flood_params", ) -package_io_constants = import_module("../package_io/constants.star") - -genesis_constants = import_module( - "../prelaunch_data_generator/genesis_constants/genesis_constants.star" -) - -def parse_input(plan, input_args): +def input_parser(plan, input_args): result = parse_network_params(input_args) # add default eth2 input params @@ -513,7 +513,7 @@ def enrich_mev_extra_params(parsed_arguments_dict, mev_prefix, mev_port, mev_typ "--builder.bellatrix_fork_version=0x30000038", "--builder.genesis_fork_version=0x10000038", "--builder.genesis_validators_root={0}".format( - package_io_constants.GENESIS_VALIDATORS_ROOT_PLACEHOLDER + constants.GENESIS_VALIDATORS_ROOT_PLACEHOLDER ), '--miner.extradata="Illuminate Dmocratize Dstribute"', "--builder.algotype=greedy", diff --git a/src/participant_network.star b/src/participant_network.star index f6d52bbfd..532006ebe 100644 --- a/src/participant_network.star +++ b/src/participant_network.star @@ -29,7 +29,7 @@ genesis_constants = import_module( ) participant_module = import_module("./participant.star") -package_io = import_module("./package_io/constants.star") +constants = import_module("./package_io/constants.star") BOOT_PARTICIPANT_INDEX = 0 @@ -128,7 +128,7 @@ def launch_participant_network( ) el_launchers = { - package_io.EL_CLIENT_TYPE.geth: { + constants.EL_CLIENT_TYPE.geth: { "launcher": geth.new_geth_launcher( network_params.network_id, el_cl_data, @@ -136,25 +136,25 @@ def launch_participant_network( ), "launch_method": geth.launch, }, - package_io.EL_CLIENT_TYPE.besu: { + constants.EL_CLIENT_TYPE.besu: { "launcher": besu.new_besu_launcher(network_params.network_id, el_cl_data), "launch_method": besu.launch, }, - package_io.EL_CLIENT_TYPE.erigon: { + constants.EL_CLIENT_TYPE.erigon: { "launcher": erigon.new_erigon_launcher( network_params.network_id, el_cl_data ), "launch_method": erigon.launch, }, - package_io.EL_CLIENT_TYPE.nethermind: { + constants.EL_CLIENT_TYPE.nethermind: { "launcher": nethermind.new_nethermind_launcher(el_cl_data), "launch_method": nethermind.launch, }, - package_io.EL_CLIENT_TYPE.reth: { + constants.EL_CLIENT_TYPE.reth: { "launcher": reth.new_reth_launcher(el_cl_data), "launch_method": reth.launch, }, - package_io.EL_CLIENT_TYPE.ethereumjs: { + constants.EL_CLIENT_TYPE.ethereumjs: { "launcher": ethereumjs.new_ethereumjs_launcher(el_cl_data), "launch_method": ethereumjs.launch, }, @@ -208,19 +208,19 @@ def launch_participant_network( plan.print("Launching CL network") cl_launchers = { - package_io.CL_CLIENT_TYPE.lighthouse: { + constants.CL_CLIENT_TYPE.lighthouse: { "launcher": lighthouse.new_lighthouse_launcher(el_cl_data), "launch_method": lighthouse.launch, }, - package_io.CL_CLIENT_TYPE.lodestar: { + constants.CL_CLIENT_TYPE.lodestar: { "launcher": lodestar.new_lodestar_launcher(el_cl_data), "launch_method": lodestar.launch, }, - package_io.CL_CLIENT_TYPE.nimbus: { + constants.CL_CLIENT_TYPE.nimbus: { "launcher": nimbus.new_nimbus_launcher(el_cl_data), "launch_method": nimbus.launch, }, - package_io.CL_CLIENT_TYPE.prysm: { + constants.CL_CLIENT_TYPE.prysm: { "launcher": prysm.new_prysm_launcher( el_cl_data, validator_data.prysm_password_relative_filepath, @@ -228,7 +228,7 @@ def launch_participant_network( ), "launch_method": prysm.launch, }, - package_io.CL_CLIENT_TYPE.teku: { + constants.CL_CLIENT_TYPE.teku: { "launcher": teku.new_teku_launcher(el_cl_data), "launch_method": teku.launch, }, @@ -273,7 +273,7 @@ def launch_participant_network( snooper_service_name = "snooper-{0}-{1}-{2}".format( index_str, cl_client_type, el_client_type ) - snooper_image = package_io.DEFAULT_SNOOPER_IMAGE + snooper_image = constants.DEFAULT_SNOOPER_IMAGE snooper_engine_context = snooper.launch( plan, snooper_service_name, diff --git a/src/snooper/snooper_engine_launcher.star b/src/snooper/snooper_engine_launcher.star index c0985fcef..743d571c3 100644 --- a/src/snooper/snooper_engine_launcher.star +++ b/src/snooper/snooper_engine_launcher.star @@ -1,8 +1,7 @@ shared_utils = import_module("../shared_utils/shared_utils.star") -input_parser = import_module("../package_io/parse_input.star") +input_parser = import_module("../package_io/input_parser.star") el_client_context = import_module("../el/el_client_context.star") el_admin_node_info = import_module("../el/el_admin_node_info.star") -package_io = import_module("../package_io/constants.star") snooper_engine_context = import_module("../snooper/snooper_engine_context.star") SNOOPER_ENGINE_RPC_PORT_NUM = 8561