Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: parameterize mev_boost and mev_builder images #171

Merged
merged 5 commits into from
Sep 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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