Skip to content

Commit

Permalink
fix: ports in bolt sidecar and bolt boost
Browse files Browse the repository at this point in the history
  • Loading branch information
thedevbirb committed Oct 3, 2024
1 parent b42e1f8 commit 269168c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion main.star
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
17 changes: 9 additions & 8 deletions src/mev/bolt_boost/bolt_boost_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ 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"
)
}

Expand All @@ -26,7 +27,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,
Expand All @@ -40,10 +41,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
)


Expand Down Expand Up @@ -98,7 +99,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"],
Expand All @@ -112,6 +113,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,
}
}
14 changes: 7 additions & 7 deletions src/mev/bolt_sidecar/bolt_sidecar_launcher.star
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -27,7 +27,7 @@ def launch_bolt_sidecar(
}

api = plan.add_service(
name="bolt-sidecar",
name=SERVICE_NAME,
config=ServiceConfig(
image=image,
cmd=[
Expand All @@ -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",
Expand All @@ -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"
Expand Down
5 changes: 3 additions & 2 deletions src/package_io/input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"),
)

Expand Down Expand Up @@ -809,7 +810,7 @@ def enrich_mev_extra_params(parsed_arguments_dict, mev_prefix, mev_port, mev_typ
# )

# connection: beacon node -> mev-boost
mev_url = "{0}:{1}".format(bolt_sidecar.BOLT_SIDECAR_BASE_URL, mev_port)
mev_url = "{0}:{1}".format(bolt_boost.BOLT_BOOST_BASE_URL, mev_port)

if participant["cl_type"] == "lighthouse":
participant["vc_extra_params"].append("--builder-proposals")
Expand Down

0 comments on commit 269168c

Please sign in to comment.