Skip to content

Commit

Permalink
fix: mev workflow (#434)
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabasbusa authored Jan 3, 2024
1 parent a40f7dc commit 91794e9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 17 deletions.
15 changes: 6 additions & 9 deletions examples/capella-mev.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
mev_type: full
participants:
- el_client_type: geth
el_client_image: ethereum/client-go:latest
el_client_log_level: ''
cl_client_type: lighthouse
cl_client_log_level: ''
cl_client_image: sigp/lighthouse
el_extra_params: []
cl_client_image: ethpandaops/lighthouse:unstable-c55608b
beacon_extra_params:
- "--always-prefer-builder-payload"
- "--disable-peer-scoring"
network_params:
capella_fork_epoch: 0
seconds_per_slot: 12
network_config:
deneb_fork_epoch: 1
mev_params:
mev_flood_seconds_per_bundle: 12
mev_flood_extra_args:
- "--txsPerBundle=300"
mev_flood_image: flashbots/mev-flood:0.0.9
mev_relay_image: flashbots/mev-boost-relay:0.27.0
mev_relay_image: flashbots/mev-boost-relay:0.28.0a7
mev_boost_image: flashbots/mev-boost:1.6.4844.dev5
mev_builder_image: flashbots/builder:1.13.2.4844.dev7-4d161de
7 changes: 5 additions & 2 deletions main.star
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
input_parser = import_module("./src/package_io/input_parser.star")
constants = import_module("./src/package_io/constants.star")
participant_network = import_module("./src/participant_network.star")

shared_utils = import_module("./src/shared_utils/shared_utils.star")
static_files = import_module("./src/static_files/static_files.star")
genesis_constants = import_module(
"./src/prelaunch_data_generator/genesis_constants/genesis_constants.star"
Expand Down Expand Up @@ -239,13 +239,16 @@ def run(plan, args={}):
all_mevboost_contexts = []
if mev_endpoints:
for index, participant in enumerate(all_participants):
index_str = shared_utils.zfill_custom(
index + 1, len(str(len(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_service_name = "{0}-{1}-{2}-{3}".format(
input_parser.MEV_BOOST_SERVICE_NAME_PREFIX,
index,
index_str,
participant.cl_client_type,
participant.el_client_type,
)
Expand Down
2 changes: 2 additions & 0 deletions src/mev/mev_relay/mev_relay_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ def launch_mev_relay(
"DENEB_FORK_VERSION": constants.DENEB_FORK_VERSION,
"GENESIS_VALIDATORS_ROOT": validator_root,
"SEC_PER_SLOT": str(seconds_per_slot),
"LOG_LEVEL": "debug",
"DB_TABLE_PREFIX": "custom",
}

redis_url = "{}:{}".format(redis.hostname, redis.port_number)
Expand Down
18 changes: 12 additions & 6 deletions src/package_io/input_parser.star
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
constants = import_module("../package_io/constants.star")

constants = import_module("./constants.star")
shared_utils = import_module("../shared_utils/shared_utils.star")
genesis_constants = import_module(
"../prelaunch_data_generator/genesis_constants/genesis_constants.star"
)
Expand Down Expand Up @@ -517,9 +517,12 @@ def enrich_disable_peer_scoring(parsed_arguments_dict):
# TODO perhaps clean this up into a map
def enrich_mev_extra_params(parsed_arguments_dict, mev_prefix, mev_port, mev_type):
for index, participant in enumerate(parsed_arguments_dict["participants"]):
index_str = shared_utils.zfill_custom(
index + 1, len(str(len(parsed_arguments_dict["participants"])))
)
mev_url = "http://{0}-{1}-{2}-{3}:{4}".format(
MEV_BOOST_SERVICE_NAME_PREFIX,
index,
index_str,
participant["cl_client_type"],
participant["el_client_type"],
mev_port,
Expand All @@ -529,6 +532,7 @@ def enrich_mev_extra_params(parsed_arguments_dict, mev_prefix, mev_port, mev_typ
participant["validator_extra_params"].append("--builder-proposals")
participant["beacon_extra_params"].append("--builder={0}".format(mev_url))
if participant["cl_client_type"] == "lodestar":
participant["validator_extra_params"].append("--builder")
participant["beacon_extra_params"].append("--builder")
participant["beacon_extra_params"].append(
"--builder.urls={0}".format(mev_url)
Expand All @@ -553,7 +557,9 @@ def enrich_mev_extra_params(parsed_arguments_dict, mev_prefix, mev_port, mev_typ
)

num_participants = len(parsed_arguments_dict["participants"])

index_str = shared_utils.zfill_custom(
num_participants + 1, len(str(num_participants + 1))
)
if mev_type == "full":
mev_participant = default_participant()
mev_participant["el_client_type"] = (
Expand All @@ -577,8 +583,8 @@ def enrich_mev_extra_params(parsed_arguments_dict, mev_prefix, mev_port, mev_typ
"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.beacon_endpoints=http://cl-{0}-lighthouse-geth-builder:4000".format(
index_str
),
"--builder.bellatrix_fork_version={0}".format(
constants.BELLATRIX_FORK_VERSION
Expand Down

0 comments on commit 91794e9

Please sign in to comment.