Skip to content

Commit

Permalink
feat: parameterize mev_boost and mev_builder images (#171)
Browse files Browse the repository at this point in the history
Fixes: #169
  • Loading branch information
bharath-123 authored Sep 3, 2023
1 parent 6b8d9d3 commit 28adec1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion main.star
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def run(plan, args):
for index, participant in enumerate(args_with_right_defaults.participants):
mev_boost_launcher = mev_boost_launcher_module.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)
mev_boost_context = mev_boost_launcher_module.launch(plan, mev_boost_launcher, mev_boost_service_name, network_params.network_id)
mev_boost_context = mev_boost_launcher_module.launch(plan, mev_boost_launcher, mev_boost_service_name, network_params.network_id, mev_params.mev_boost_image)
all_mevboost_contexts.append(mev_boost_context)

if not args_with_right_defaults.launch_additional_services:
Expand Down
9 changes: 4 additions & 5 deletions src/mev_boost/mev_boost_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ shared_utils = import_module("github.com/kurtosis-tech/eth2-package/src/shared_u
mev_boost_context_module = import_module("github.com/kurtosis-tech/eth2-package/src/mev_boost/mev_boost_context.star")
parse_input = import_module("github.com/kurtosis-tech/eth2-package/src/package_io/parse_input.star")

FLASHBOTS_MEV_BOOST_IMAGE = "flashbots/mev-boost"
FLASHBOTS_MEV_BOOST_PROTOCOL = "TCP"

USED_PORTS = {
Expand All @@ -15,22 +14,22 @@ NETWORK_ID_TO_NAME = {
"3": "ropsten",
}

def launch(plan, mev_boost_launcher, service_name, network_id):
config = get_config(mev_boost_launcher, network_id)
def launch(plan, mev_boost_launcher, service_name, network_id, mev_boost_image):
config = get_config(mev_boost_launcher, 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)


def get_config(mev_boost_launcher, network_id):
def get_config(mev_boost_launcher, network_id, mev_boost_image):
command = ["mev-boost"]

if mev_boost_launcher.should_check_relay:
command.append("-relay-check")

return ServiceConfig(
image = FLASHBOTS_MEV_BOOST_IMAGE,
image = mev_boost_image,
ports = USED_PORTS,
cmd = command,
env_vars = {
Expand Down
7 changes: 6 additions & 1 deletion src/package_io/parse_input.star
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ def parse_input(plan, input_args):
),
mev_params = struct(
mev_relay_image = result["mev_params"]["mev_relay_image"],
mev_builder_image = result["mev_params"]["mev_builder_image"],
mev_boost_image = result["mev_params"]["mev_boost_image"],
mev_relay_api_extra_args = result["mev_params"]["mev_relay_api_extra_args"],
mev_relay_housekeeper_extra_args = result["mev_params"]["mev_relay_housekeeper_extra_args"],
mev_relay_website_extra_args = result["mev_params"]["mev_relay_website_extra_args"],
Expand Down Expand Up @@ -219,6 +221,9 @@ def default_participant():
def get_default_mev_params():
return {
"mev_relay_image": "flashbots/mev-boost-relay",
# TODO replace with flashbots/builder when they publish an arm64 image as mentioned in flashbots/builder#105
"mev_builder_image": "ethpandaops/flashbots-builder:main",
"mev_boost_image": "flashbots/mev-boost",
"mev_relay_api_extra_args": [],
"mev_relay_housekeeper_extra_args": [],
"mev_relay_website_extra_args": [],
Expand Down Expand Up @@ -260,7 +265,7 @@ def enrich_mev_extra_params(parsed_arguments_dict, mev_prefix, mev_port, mev_typ
mev_participant = {
"el_client_type": "geth",
# TODO replace with actual when flashbots/builder is published
"el_client_image": "ethpandaops/flashbots-builder:main",
"el_client_image": parsed_arguments_dict["mev_params"]["mev_builder_image"],
"el_client_log_level": "",
"cl_client_type": "lighthouse",
# THIS overrides the beacon image
Expand Down

0 comments on commit 28adec1

Please sign in to comment.