Skip to content

Commit

Permalink
parameterize mev-boost args
Browse files Browse the repository at this point in the history
  • Loading branch information
bharath-123 committed Dec 10, 2023
1 parent 3c06194 commit 0bc7893
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
5 changes: 2 additions & 3 deletions main.star
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,7 @@ 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.new_mev_boost_launcher(
MEV_BOOST_SHOULD_CHECK_RELAY, mev_endpoints
)
mev_boost_launcher = mev_boost.new_mev_boost_launcher(mev_endpoints)
mev_boost_service_name = "{0}{1}".format(
input_parser.MEV_BOOST_SERVICE_NAME_PREFIX, index
)
Expand All @@ -253,6 +251,7 @@ def run(plan, args={}):
mev_boost_service_name,
network_params.network_id,
mev_params.mev_boost_image,
mev_params.mev_boost_extra_args,
)
all_mevboost_contexts.append(mev_boost_context)

Expand Down
2 changes: 2 additions & 0 deletions network_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,6 @@ mev_params:
mev_flood_image: flashbots/mev-flood
mev_flood_extra_args: []
mev_flood_seconds_per_bundle: 15
mev_boost_image: flashbots/mev-boost
mev_boost_extra_args: ["mev-boost", "--relay-check"]
grafana_additional_dashboards: []
19 changes: 8 additions & 11 deletions src/mev_boost/mev_boost_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ NETWORK_ID_TO_NAME = {
}


def launch(plan, mev_boost_launcher, service_name, network_id, mev_boost_image):
config = get_config(mev_boost_launcher, network_id, mev_boost_image)
def launch(
plan, mev_boost_launcher, service_name, network_id, mev_boost_image, mev_boost_args
):
config = get_config(mev_boost_launcher, network_id, mev_boost_image, mev_boost_args)

mev_boost_service = plan.add_service(service_name, config)

Expand All @@ -27,11 +29,8 @@ def launch(plan, mev_boost_launcher, service_name, network_id, mev_boost_image):
)


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")
def get_config(mev_boost_launcher, network_id, mev_boost_image, mev_boost_args):
command = mev_boost_args

return ServiceConfig(
image=mev_boost_image,
Expand All @@ -53,7 +52,5 @@ def get_config(mev_boost_launcher, network_id, mev_boost_image):
)


def new_mev_boost_launcher(should_check_relay, relay_end_points):
return struct(
should_check_relay=should_check_relay, relay_end_points=relay_end_points
)
def new_mev_boost_launcher(relay_end_points):
return struct(relay_end_points=relay_end_points)
2 changes: 2 additions & 0 deletions src/package_io/input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ def input_parser(plan, input_args):
mev_builder_image=result["mev_params"]["mev_builder_image"],
mev_builder_cl_image=result["mev_params"]["mev_builder_cl_image"],
mev_boost_image=result["mev_params"]["mev_boost_image"],
mev_boost_extra_args=result["mev_params"]["mev_boost_extra_args"],
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"
Expand Down Expand Up @@ -442,6 +443,7 @@ def get_default_mev_params():
"mev_builder_image": "flashbots/builder:latest",
"mev_builder_cl_image": "sigp/lighthouse:latest",
"mev_boost_image": "flashbots/mev-boost",
"mev_boost_extra_args": ["mev-boost", "--relay-check"],
"mev_relay_api_extra_args": [],
"mev_relay_housekeeper_extra_args": [],
"mev_relay_website_extra_args": [],
Expand Down

0 comments on commit 0bc7893

Please sign in to comment.