Skip to content

Commit

Permalink
fix: Mock builder updates (#193)
Browse files Browse the repository at this point in the history
Required changes for the latest version of the mock builder.

cc @parithosh
  • Loading branch information
marioevz committed Sep 13, 2023
1 parent 7606cff commit 6cc3697
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion main.star
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def run(plan, args = {}):
el_uri = "{0}:{1}".format(all_el_client_contexts[0].ip_addr, all_el_client_contexts[0].engine_rpc_port_num)
beacon_uri = "{0}:{1}".format(all_cl_client_contexts[0].ip_addr, all_cl_client_contexts[0].http_port_num)
jwt_secret = all_el_client_contexts[0].jwt_secret
endpoint = mock_mev_launcher_module.launch_mock_mev(plan, el_uri, beacon_uri, jwt_secret)
endpoint = mock_mev_launcher_module.launch_mock_mev(plan, el_uri, beacon_uri, jwt_secret, args_with_right_defaults.global_client_log_level)
mev_endpoints.append(endpoint)
elif args_with_right_defaults.mev_type and args_with_right_defaults.mev_type == FULL_MEV_TYPE:
el_uri = "http://{0}:{1}".format(all_el_client_contexts[0].ip_addr, all_el_client_contexts[0].rpc_port_num)
Expand Down
10 changes: 6 additions & 4 deletions src/mock_mev/mock_mev_launcher.star
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
MOCK_MEV_IMAGE = "ethpandaops/mock-builder:latest"
MOCK_MEV_SERVICE_NAME = "mock-mev"
MOCK_MEV_BUILDER_PORT = 18550
DUMMY_PUB_KEY_THAT_ISNT_VERIFIED = "0xae1c2ca7bbd6f415a5aa5bb4079caf0a5c273104be5fb5e40e2b5a2f080b2f5bd945336f2a9e8ba346299cb65b0f84c8"
DEFAULT_MOCK_MEV_PUB_KEY = "0x95fde78acd5f6886ddaf5d0056610167c513d09c1c0efabbc7cdcc69beea113779c4a81e2d24daafc5387dbf6ac5fe48"

def launch_mock_mev(plan, el_uri, beacon_uri, jwt_secret):
def launch_mock_mev(plan, el_uri, beacon_uri, jwt_secret, global_client_log_level):
mock_builder = plan.add_service(
name = MOCK_MEV_SERVICE_NAME,
config = ServiceConfig(
Expand All @@ -14,8 +14,10 @@ def launch_mock_mev(plan, el_uri, beacon_uri, jwt_secret):
cmd = [
"--jwt-secret={0}".format(jwt_secret),
"--el={0}".format(el_uri),
"--cl={0}".format(beacon_uri)
"--cl={0}".format(beacon_uri),
"--bid-multiplier=5", # TODO: This could be customizable
"--log-level={0}".format(global_client_log_level)
]
)
)
return "http://{0}@{1}:{2}".format(DUMMY_PUB_KEY_THAT_ISNT_VERIFIED, mock_builder.ip_address, MOCK_MEV_BUILDER_PORT)
return "http://{0}@{1}:{2}".format(DEFAULT_MOCK_MEV_PUB_KEY, mock_builder.ip_address, MOCK_MEV_BUILDER_PORT)
3 changes: 0 additions & 3 deletions src/package_io/parse_input.star
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,6 @@ def parse_input(plan, input_args):


if result.get("mev_type") in ("mock", "full"):
if result["network_params"]["capella_fork_epoch"] == 0:
plan.print("MEV components require a non zero value for the network_params.capella_fork_epoch; setting it to 1 as its 0")
result["network_params"]["capella_fork_epoch"] = 1
result = enrich_mev_extra_params(result, MEV_BOOST_SERVICE_NAME_PREFIX, FLASHBOTS_MEV_BOOST_PORT, result.get("mev_type"))

return struct(
Expand Down

0 comments on commit 6cc3697

Please sign in to comment.