Skip to content

Commit

Permalink
adding config options for mock_mev
Browse files Browse the repository at this point in the history
  • Loading branch information
parithosh committed Dec 23, 2024
1 parent d8b424f commit 4d82560
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions main.star
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ def run(plan, args={}):
jwt_file,
args_with_right_defaults.global_log_level,
global_node_selectors,
args_with_right_defaults.mev_params,
)
mev_endpoints.append(endpoint)
mev_endpoint_names.append(constants.MOCK_MEV_TYPE)
Expand Down
8 changes: 5 additions & 3 deletions src/mev/flashbots/mock_mev/mock_mev_launcher.star
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
constants = import_module("../../../package_io/constants.star")

MOCK_MEV_IMAGE = "parithoshj/rustic-builder:v1"
# Default image if none specified in mev_params

MOCK_MEV_SERVICE_NAME = "mock-mev"
MOCK_MEV_BUILDER_PORT = 8560

Expand All @@ -18,11 +19,12 @@ def launch_mock_mev(
jwt_file,
global_log_level,
global_node_selectors,
):
mev_params,
):
mock_builder = plan.add_service(
name=MOCK_MEV_SERVICE_NAME,
config=ServiceConfig(
image=MOCK_MEV_IMAGE,
image=mev_params.mock_mev_image,
ports={
"rest": PortSpec(
number=MOCK_MEV_BUILDER_PORT, transport_protocol="TCP"
Expand Down
1 change: 1 addition & 0 deletions src/package_io/constants.star
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ DEFAULT_FLASHBOTS_MEV_BOOST_IMAGE = "flashbots/mev-boost"
DEFAULT_MEV_RS_IMAGE = "ethpandaops/mev-rs:main"
DEFAULT_MEV_RS_IMAGE_MINIMAL = "ethpandaops/mev-rs:main-minimal"
DEFAULT_COMMIT_BOOST_MEV_BOOST_IMAGE = "ghcr.io/commit-boost/pbs:latest"
DEFAULT_MOCK_MEV_IMAGE = "ethpandaops/rustic-builder:main"
DEFAULT_MEV_PUBKEY = "0xa55c1285d84ba83a5ad26420cd5ad3091e49c55a813eee651cd467db38a8c8e63192f47955e9376f6b42f6d190571cb5"
DEFAULT_MEV_SECRET_KEY = (
"0x607a11b45a7219cc61a3d9c5fd08c7eebd602a6a19a977f8d3771d5711a550f2"
Expand Down
10 changes: 10 additions & 0 deletions src/package_io/input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ def input_parser(plan, input_args):
mev_flood_seconds_per_bundle=result["mev_params"][
"mev_flood_seconds_per_bundle"
],
mock_mev_image=result["mev_params"]["mock_mev_image"],
)
if result["mev_params"]
else None,
Expand Down Expand Up @@ -1109,9 +1110,16 @@ def get_default_mev_params(mev_type, preset):
"0x436F6D6D69742D426F6F737420F09F93BB" # Commit-Boost 📻
)

if mev_type == constants.MOCK_MEV_TYPE:

mev_builder_image = constants.DEFAULT_MOCK_MEV_IMAGE
mev_boost_image = constants.DEFAULT_FLASHBOTS_MEV_BOOST_IMAGE


return {
"mev_relay_image": mev_relay_image,
"mev_builder_image": mev_builder_image,
"mock_mev_image": mev_builder_image if mev_type == constants.MOCK_MEV_TYPE else None,
"mev_builder_cl_image": mev_builder_cl_image,
"mev_builder_extra_data": mev_builder_extra_data,
"mev_builder_extra_args": mev_builder_extra_args,
Expand Down Expand Up @@ -1364,6 +1372,8 @@ def enrich_mev_extra_params(parsed_arguments_dict, mev_prefix, mev_port, mev_typ
}
)
parsed_arguments_dict["participants"].append(mev_participant)
if mev_type == constants.MOCK_MEV_TYPE:
parsed_arguments_dict["mev_params"]["mock_mev_image"] = parsed_arguments_dict["mev_params"]["mock_mev_image"]
return parsed_arguments_dict


Expand Down
1 change: 1 addition & 0 deletions src/package_io/sanity_check.star
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ SUBCATEGORY_PARAMS = {
"mev_flood_extra_args",
"mev_flood_seconds_per_bundle",
"custom_flood_params",
"mock_mev_image",
],
"xatu_sentry_params": [
"xatu_sentry_image",
Expand Down

0 comments on commit 4d82560

Please sign in to comment.