From a7074204575ab5ac8d8bb19eb8024f88c1354761 Mon Sep 17 00:00:00 2001 From: thedevbirb Date: Thu, 3 Oct 2024 18:50:12 +0200 Subject: [PATCH] fix: ports in bolt sidecar and bolt boost --- main.star | 2 +- src/mev/bolt_boost/bolt_boost_launcher.star | 18 +++++++++--------- .../bolt_sidecar/bolt_sidecar_launcher.star | 14 +++++++------- src/package_io/input_parser.star | 3 ++- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/main.star b/main.star index 3d689f849..61e9f279f 100644 --- a/main.star +++ b/main.star @@ -307,7 +307,7 @@ def run(plan, args={}): }] bolt_sidecar_config = { "constraints_api_url": "{0}:{1}".format( - bolt_sidecar.BOLT_SIDECAR_BASE_URL, bolt_sidecar.BOLT_SIDECAR_COMMITMENTS_API_PORT + bolt_boost.BOLT_BOOST_BASE_URL, bolt_boost.BOLT_BOOST_PORT ), "beacon_api_url": all_cl_contexts[0].beacon_http_url, "execution_api_url": "http://{0}:{1}".format( diff --git a/src/mev/bolt_boost/bolt_boost_launcher.star b/src/mev/bolt_boost/bolt_boost_launcher.star index b7d1da774..8a71754b6 100644 --- a/src/mev/bolt_boost/bolt_boost_launcher.star +++ b/src/mev/bolt_boost/bolt_boost_launcher.star @@ -1,18 +1,18 @@ shared_utils = import_module("../../shared_utils/shared_utils.star") mev_boost_context_module = import_module("../mev_boost/mev_boost_context.star") -input_parser = import_module("../../package_io/input_parser.star") static_files = import_module("../../static_files/static_files.star") FLASHBOTS_MEV_BOOST_PROTOCOL = "TCP" -SERVICE_NAME="bolt-boost" +SERVICE_NAME = "bolt-boost" +BOLT_BOOST_BASE_URL = "http://{0}".format(SERVICE_NAME) +BOLT_BOOST_PORT = 9062 BOLT_BOOST_CONFIG_FILENAME="cb-bolt-config.toml" BOLT_BOOST_CONFIG_MOUNT_DIRPATH_ON_SERVICE="/config" -BOLT_BOOST_BUILDER_PROXY_PORT=18551 USED_PORTS = { "api": shared_utils.new_port_spec( - input_parser.FLASHBOTS_MEV_BOOST_PORT, FLASHBOTS_MEV_BOOST_PROTOCOL, wait="5s" + BOLT_BOOST_PORT, "TCP", wait="5s" ) } @@ -26,7 +26,7 @@ MAX_MEMORY = 256 def launch( plan, bolt_boost_image, - service_name, + service_name, # unused as of now relays_config, bolt_sidecar_config, network_params, @@ -40,10 +40,10 @@ def launch( global_node_selectors, ) - mev_boost_service = plan.add_service(service_name, config) + bolt_boost_service = plan.add_service(SERVICE_NAME, config) return mev_boost_context_module.new_mev_boost_context( - mev_boost_service.ip_address, input_parser.FLASHBOTS_MEV_BOOST_PORT + bolt_boost_service.ip_address, bolt_boost_service.ports["api"].number ) @@ -98,7 +98,7 @@ def new_bolt_boost_config_template_data(image, relays_config, bolt_sidecar_confi return { "chain": "Holesky", "image": image, - "port": input_parser.FLASHBOTS_MEV_BOOST_PORT, + "port": BOLT_BOOST_PORT, "relays_config": [ { "id": relay_config["id"], @@ -112,6 +112,6 @@ def new_bolt_boost_config_template_data(image, relays_config, bolt_sidecar_confi "engine_api_url": bolt_sidecar_config["engine_api_url"], "jwt_hex": bolt_sidecar_config["jwt_hex"], "metrics_port": bolt_sidecar_config["metrics_port"], - "builder_proxy_port": BOLT_BOOST_BUILDER_PROXY_PORT, + "builder_proxy_port": BOLT_BOOST_PORT, } } diff --git a/src/mev/bolt_sidecar/bolt_sidecar_launcher.star b/src/mev/bolt_sidecar/bolt_sidecar_launcher.star index c2c6df1c6..aecbf4f4c 100644 --- a/src/mev/bolt_sidecar/bolt_sidecar_launcher.star +++ b/src/mev/bolt_sidecar/bolt_sidecar_launcher.star @@ -1,12 +1,12 @@ redis_module = import_module("github.com/kurtosis-tech/redis-package/main.star") postgres_module = import_module("github.com/kurtosis-tech/postgres-package/main.star") constants = import_module("../../package_io/constants.star") +bolt_boost = import_module("../bolt_boost/bolt_boost_launcher.star") mev_boost_context_util = import_module("../mev_boost/mev_boost_context.star") -BOLT_SIDECAR_BASE_URL = "http://bolt-sidecar" - +SERVICE_NAME = "bolt-sidecar" +BOLT_SIDECAR_BASE_URL = "http://{}".format(SERVICE_NAME) BOLT_SIDECAR_COMMITMENTS_API_PORT = 9061 -BOLT_SIDECAR_BOOST_PROXY_PORT = 9062 BOLT_SIDECAR_METRICS_PORT = 9063 # The min/max CPU/memory that bolt-sidecar can use @@ -27,7 +27,7 @@ def launch_bolt_sidecar( } api = plan.add_service( - name="bolt-sidecar", + name=SERVICE_NAME, config=ServiceConfig( image=image, cmd=[ @@ -39,7 +39,7 @@ def launch_bolt_sidecar( "--constraints-url", sidecar_config["constraints_api_url"], "--constraints-proxy-port", - str(BOLT_SIDECAR_BOOST_PROXY_PORT), + str(bolt_boost.BOLT_BOOST_PORT), "--beacon-api-url", sidecar_config["beacon_api_url"], "--execution-api-url", @@ -66,8 +66,8 @@ def launch_bolt_sidecar( "api": PortSpec( number=BOLT_SIDECAR_COMMITMENTS_API_PORT, transport_protocol="TCP" ), - "mevboost-proxy": PortSpec( - number=BOLT_SIDECAR_BOOST_PROXY_PORT, transport_protocol="TCP" + "bolt-boost": PortSpec( + number=bolt_boost.BOLT_BOOST_PORT, transport_protocol="TCP" ), "metrics": PortSpec( number=BOLT_SIDECAR_METRICS_PORT, transport_protocol="TCP" diff --git a/src/package_io/input_parser.star b/src/package_io/input_parser.star index 5a56d7429..e395c6947 100644 --- a/src/package_io/input_parser.star +++ b/src/package_io/input_parser.star @@ -4,6 +4,7 @@ genesis_constants = import_module( "../prelaunch_data_generator/genesis_constants/genesis_constants.star" ) bolt_sidecar = import_module("../mev/bolt_sidecar/bolt_sidecar_launcher.star") +bolt_boost = import_module("../mev/bolt_boost/bolt_boost_launcher.star") DEFAULT_EL_IMAGES = { "geth": "ethereum/client-go:latest", @@ -145,7 +146,7 @@ def input_parser(plan, input_args): result = enrich_mev_extra_params( result, MEV_BOOST_SERVICE_NAME_PREFIX, - bolt_sidecar.BOLT_SIDECAR_BOOST_PROXY_PORT, + bolt_boost.BOLT_BOOST_PORT, result.get("mev_type"), )