Commit 46d67fc5 authored by Gyanendra Mishra's avatar Gyanendra Mishra Committed by GitHub

fix: dont spin up extra el/cl client for mock-mev (#158)

parent 0165ef1a
...@@ -117,7 +117,7 @@ def parse_input(input_args): ...@@ -117,7 +117,7 @@ def parse_input(input_args):
if result.get("mev_type") in ("mock", "full"): if result.get("mev_type") in ("mock", "full"):
result = enrich_mev_extra_params(result, MEV_BOOST_SERVICE_NAME_PREFIX, FLASHBOTS_MEV_BOOST_PORT) result = enrich_mev_extra_params(result, MEV_BOOST_SERVICE_NAME_PREFIX, FLASHBOTS_MEV_BOOST_PORT, result.get("mev_type"))
return struct( return struct(
participants=[struct( participants=[struct(
...@@ -230,7 +230,7 @@ def get_default_mev_params(): ...@@ -230,7 +230,7 @@ def get_default_mev_params():
# TODO perhaps clean this up into a map # TODO perhaps clean this up into a map
def enrich_mev_extra_params(parsed_arguments_dict, mev_prefix, mev_port): def enrich_mev_extra_params(parsed_arguments_dict, mev_prefix, mev_port, mev_type):
for index, participant in enumerate(parsed_arguments_dict["participants"]): for index, participant in enumerate(parsed_arguments_dict["participants"]):
mev_url = "http://{0}{1}:{2}".format(mev_prefix, index, mev_port) mev_url = "http://{0}{1}:{2}".format(mev_prefix, index, mev_port)
...@@ -253,24 +253,40 @@ def enrich_mev_extra_params(parsed_arguments_dict, mev_prefix, mev_port): ...@@ -253,24 +253,40 @@ def enrich_mev_extra_params(parsed_arguments_dict, mev_prefix, mev_port):
num_participants = len(parsed_arguments_dict["participants"]) num_participants = len(parsed_arguments_dict["participants"])
mev_url = "http://{0}{1}:{2}".format(mev_prefix, num_participants, mev_port) if mev_type == "full":
mev_participant = { mev_url = "http://{0}{1}:{2}".format(mev_prefix, num_participants, mev_port)
"el_client_type": "geth",
# TODO replace with actual when flashbots/builder is published mev_participant = {
"el_client_image": "h4ck3rk3y/builder", "el_client_type": "geth",
"el_client_log_level": "", # TODO replace with actual when flashbots/builder is published
"cl_client_type": "lighthouse", "el_client_image": "h4ck3rk3y/builder",
# THIS overrides the beacon image "el_client_log_level": "",
"cl_client_image": "sigp/lighthouse", "cl_client_type": "lighthouse",
"cl_client_log_level": "", # THIS overrides the beacon image
"beacon_extra_params": ["--builder={0}".format(mev_url), "--always-prepare-payload", "--prepare-payload-lookahead", "12000"], "cl_client_image": "sigp/lighthouse",
# TODO(maybe) make parts of this more passable like the mev-relay-endpoint & forks "cl_client_log_level": "",
"el_extra_params": ["--builder", "--builder.remote_relay_endpoint=http://mev-relay-api:9062", "--builder.beacon_endpoints=http://cl-{0}-lighthouse-geth:4000".format(num_participants+1), "--builder.bellatrix_fork_version=0x30000038", "--builder.genesis_fork_version=0x10000038", "--builder.genesis_validators_root={0}".format(package_io.GENESIS_VALIDATORS_ROOT_PLACEHOLDER), "--miner.extradata=\"Illuminate Dmocratize Dstribute\"", "--miner.algotype=greedy"] + parsed_arguments_dict["mev_params"]["mev_builder_extra_args"], "beacon_extra_params": [
"validator_extra_params": ["--builder-proposals"], "--builder={0}".format(mev_url),
"builder_network_params": None "--always-prepare-payload",
} "--prepare-payload-lookahead",
"12000"
parsed_arguments_dict["participants"].append(mev_participant) ],
# TODO(maybe) make parts of this more passable like the mev-relay-endpoint & forks
"el_extra_params": [
"--builder",
"--builder.remote_relay_endpoint=http://mev-relay-api:9062",
"--builder.beacon_endpoints=http://cl-{0}-lighthouse-geth:4000".format(num_participants+1),
"--builder.bellatrix_fork_version=0x30000038",
"--builder.genesis_fork_version=0x10000038",
"--builder.genesis_validators_root={0}".format(package_io.GENESIS_VALIDATORS_ROOT_PLACEHOLDER),
"--miner.extradata=\"Illuminate Dmocratize Dstribute\"",
"--miner.algotype=greedy"
] + parsed_arguments_dict["mev_params"]["mev_builder_extra_args"],
"validator_extra_params": ["--builder-proposals"],
"builder_network_params": None
}
parsed_arguments_dict["participants"].append(mev_participant)
return parsed_arguments_dict return parsed_arguments_dict
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment