Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/tests/mev-helix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
participants:
- el_type: geth
el_image: ethpandaops/geth:master
cl_type: lighthouse
cl_image: ethpandaops/lighthouse:unstable
vc_image: ethpandaops/lighthouse:unstable
supernode: true
count: 2
- el_type: nethermind
el_image: ethpandaops/nethermind:master
cl_type: prysm
cl_image: ethpandaops/prysm-beacon-chain:develop
supernode: true

additional_services:
- dora
- spamoor

mev_type: helix
mev_params:
mev_relay_image: ghcr.io/gattaca-com/helix-relay:main
mev_builder_image: ethpandaops/reth-rbuilder:develop
mev_boost_image: ethpandaops/mev-boost:develop
mev_builder_cl_image: ethpandaops/lighthouse:unstable
mev_builder_subsidy: 1

spamoor_params:
spammers:
- name: "Blob Spammer (Kurtosis Package)"
description: "3 type-4 blob transactions per slot with 1-2 sidecars each, gas/blobgas limit 20 gwei"
scenario: "blobs"
config:
throughput: 10
- name: "ERC txs"
description: "ERC txs"
scenario: "erctx"
config:
throughput: 50
max_pending: 400

network_params:
min_validator_withdrawability_delay: 1
shard_committee_period: 1
churn_limit_quotient: 16
prefunded_accounts: '{"0xb9e79d19f651a941757b35830232e7efc77e1c79": {"balance": "100000ETH"}}'
54 changes: 52 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ Specifically, this [package][package-reference] will:
Optional features (enabled via flags or parameter files at runtime):

- Block until the Beacon nodes finalize an epoch (i.e. finalized_epoch > 0)
- Spin up & configure parameters for the infrastructure behind Flashbot's implementation of PBS using `mev-boost`, in either `full` or `mock` mode. [More details on PBS implementation](./README.md#proposer-builder-separation-pbs-implementation-via-flashbots-mev-boost-protocol).
- Spin up & configure parameters for the infrastructure behind PBS (Proposer-Builder Separation) using `mev-boost`, with support for multiple relay implementations:
- `flashbots` - Full Flashbots MEV infrastructure
- `helix` - High-performance [Helix relay](https://github.com/gattaca-com/helix) with TimescaleDB backend
- `mev-rs` - Alternative relay implementation
- `commit-boost` - Commit-boost based infrastructure
- `mock` - Mock builder for testing
- [More details on PBS implementation](./README.md#proposer-builder-separation-pbs-emulation).
- Spin up & connect the network to a [beacon metrics gazer service](https://github.com/dapplion/beacon-metrics-gazer) to collect network-wide participation metrics.
- Spin up and connect a [JSON RPC Snooper](https://github.com/ethDreamer/json_rpc_snoop) to the network log responses & requests between the EL engine API and the CL client.
- Specify extra parameters to be passed in for any of the: CL client Beacon, and CL client validator, and/or EL client containers
Expand Down Expand Up @@ -1098,12 +1104,14 @@ mempool_bridge_params:
# Default: "30s"
retry_interval: "30s"

# Supports four values
# Supports six values
# Default: "null" - no mev boost, mev builder, mev flood or relays are spun up
# "mock" - mock-builder & mev-boost are spun up
# "flashbots" - mev-boost, relays, flooder and builder are all spun up, powered by [flashbots](https://github.com/flashbots)
# "mev-rs" - mev-boost, relays and builder are all spun up, powered by [mev-rs](https://github.com/ralexstokes/mev-rs/)
# "commit-boost" - mev-boost, relays and builder are all spun up, powered by [commit-boost](https://github.com/Commit-Boost/commit-boost-client)
# "helix" - helix relay, flashbots builder and mev-boost are spun up, powered by [helix](https://github.com/gattaca-com/helix)
# Note: Helix uses TimescaleDB (PostgreSQL with time-series extension) for data storage
# We have seen instances of multibuilder instances failing to start mev-relay-api with non zero epochs
mev_type: null

Expand Down Expand Up @@ -1478,6 +1486,40 @@ network_params:

</details>

<details>
<summary>A 3-node Ethereum network with Helix relay for MEV-boost infrastructure</summary>

```yaml
participants:
- el_type: geth
el_image: ethpandaops/geth:master
cl_type: lighthouse
cl_image: ethpandaops/lighthouse:unstable
count: 2
- el_type: nethermind
el_image: ethpandaops/nethermind:master
cl_type: prysm
cl_image: ethpandaops/prysm-beacon-chain:develop

mev_type: helix
mev_params:
mev_relay_image: ghcr.io/gattaca-com/helix-relay:main
mev_builder_image: ethpandaops/reth-rbuilder:develop
mev_boost_image: ethpandaops/mev-boost:develop
mev_builder_cl_image: ethpandaops/lighthouse:unstable
mev_builder_subsidy: 1

additional_services:
- dora
- spamoor

network_params:
min_validator_withdrawability_delay: 1
shard_committee_period: 1
```

</details>

<details>
<summary>A 2-node geth/lighthouse network with optional services (Grafana, Prometheus, tx_fuzz, EngineAPI snooper)</summary>

Expand Down Expand Up @@ -1605,6 +1647,14 @@ Starting your network up with `"mev_type": "flashbots"` will instantiate and con
4. `mev-relay-housekeeper` - Updates known validators, proposer duties, and more in the background. Only a single instance of this should run.
5. `mev-boost` - open-source middleware instantiated for each EL/Cl pair in the network, including the builder

The package also supports other MEV implementations:

- `"mev_type": "helix"` - Uses the high-performance [Helix relay](https://github.com/gattaca-com/helix) with TimescaleDB backend for data storage
- `"mev_type": "mev-rs"` - Alternative relay implementation powered by [mev-rs](https://github.com/ralexstokes/mev-rs/)
- `"mev_type": "commit-boost"` - Infrastructure powered by [commit-boost](https://github.com/Commit-Boost/commit-boost-client)

Each implementation provides different features and performance characteristics suitable for various testing and development scenarios.

<details>
<summary>Caveats when using "mev_type": "flashbots"</summary>

Expand Down
22 changes: 21 additions & 1 deletion main.star
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ flashbots_mev_boost = import_module(
flashbots_mev_relay = import_module(
"./src/mev/flashbots/mev_relay/mev_relay_launcher.star"
)
helix_relay = import_module("./src/mev/helix/helix_relay_launcher.star")
mock_mev = import_module("./src/mev/flashbots/mock_mev/mock_mev_launcher.star")
mev_custom_flood = import_module(
"./src/mev/flashbots/mev_custom_flood/mev_custom_flood_launcher.star"
Expand Down Expand Up @@ -212,11 +213,12 @@ def run(plan, args={}):
elif (
args_with_right_defaults.mev_type == constants.FLASHBOTS_MEV_TYPE
or args_with_right_defaults.mev_type == constants.COMMIT_BOOST_MEV_TYPE
or args_with_right_defaults.mev_type == constants.HELIX_MEV_TYPE
):
plan.print("Generating flashbots builder config file")
flashbots_builder_config_file = flashbots_mev_rbuilder.new_builder_config(
plan,
constants.FLASHBOTS_MEV_TYPE,
args_with_right_defaults.mev_type,
network_params,
constants.VALIDATING_REWARDS_ACCOUNT,
network_params.preregistered_validator_keys_mnemonic,
Expand Down Expand Up @@ -347,6 +349,7 @@ def run(plan, args={}):
args_with_right_defaults.mev_type == constants.FLASHBOTS_MEV_TYPE
or args_with_right_defaults.mev_type == constants.MEV_RS_MEV_TYPE
or args_with_right_defaults.mev_type == constants.COMMIT_BOOST_MEV_TYPE
or args_with_right_defaults.mev_type == constants.HELIX_MEV_TYPE
):
blocksim_uri = "http://{0}:{1}".format(
all_el_contexts[-1].ip_addr, all_el_contexts[-1].rpc_port_num
Expand Down Expand Up @@ -385,6 +388,22 @@ def run(plan, args={}):
global_node_selectors,
global_tolerations,
)
elif args_with_right_defaults.mev_type == constants.HELIX_MEV_TYPE:
endpoint = helix_relay.launch_helix_relay(
plan,
network_params,
mev_params,
beacon_uri,
genesis_validators_root,
final_genesis_timestamp,
blocksim_uri,
persistent,
args_with_right_defaults.port_publisher,
num_participants,
global_node_selectors,
global_tolerations,
el_cl_data_files_artifact_uuid,
)
else:
fail("Invalid MEV type")

Expand All @@ -407,6 +426,7 @@ def run(plan, args={}):
if (
args_with_right_defaults.mev_type == constants.FLASHBOTS_MEV_TYPE
or args_with_right_defaults.mev_type == constants.MOCK_MEV_TYPE
or args_with_right_defaults.mev_type == constants.HELIX_MEV_TYPE
):
mev_boost_launcher = flashbots_mev_boost.new_mev_boost_launcher(
MEV_BOOST_SHOULD_CHECK_RELAY,
Expand Down
1 change: 1 addition & 0 deletions network_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ ethereum_metrics_exporter_enabled: false
parallel_keystore_generation: false
disable_peer_scoring: false
persistent: false
# Supports: null, mock, flashbots, mev-rs, commit-boost, helix
mev_type: null
mev_params:
mev_relay_image: ethpandaops/mev-boost-relay:main
Expand Down
4 changes: 4 additions & 0 deletions src/el/reth/reth_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def get_config(
if (
launcher.builder_type == constants.FLASHBOTS_MEV_TYPE
or launcher.builder_type == constants.COMMIT_BOOST_MEV_TYPE
or launcher.builder_type == constants.HELIX_MEV_TYPE
):
additional_public_port_assignments[
constants.RBUILDER_PORT_ID
Expand Down Expand Up @@ -152,6 +153,7 @@ def get_config(
if (
launcher.builder_type == constants.FLASHBOTS_MEV_TYPE
or launcher.builder_type == constants.COMMIT_BOOST_MEV_TYPE
or launcher.builder_type == constants.HELIX_MEV_TYPE
):
used_port_assignments[constants.RBUILDER_PORT_ID] = RBUILDER_PORT_NUM
used_port_assignments[
Expand Down Expand Up @@ -183,6 +185,7 @@ def get_config(
",flashbots"
if launcher.builder_type == constants.FLASHBOTS_MEV_TYPE
or launcher.builder_type == constants.COMMIT_BOOST_MEV_TYPE
or launcher.builder_type == constants.HELIX_MEV_TYPE
else ""
),
"--ws",
Expand Down Expand Up @@ -273,6 +276,7 @@ def get_config(
elif (
launcher.builder_type == constants.FLASHBOTS_MEV_TYPE
or launcher.builder_type == constants.COMMIT_BOOST_MEV_TYPE
or launcher.builder_type == constants.HELIX_MEV_TYPE
):
image = launcher.mev_params.mev_builder_image
cl_client_name = service_name.split("-")[4]
Expand Down
20 changes: 17 additions & 3 deletions src/mev/flashbots/mev_builder/mev_builder_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ input_parser = import_module("../../../package_io/input_parser.star")
static_files = import_module("../../../static_files/static_files.star")
constants = import_module("../../../package_io/constants.star")
flashbots_relay = import_module("../mev_relay/mev_relay_launcher.star")
helix_relay = import_module("../../helix/helix_relay_launcher.star")
lighthouse = import_module("../../../cl/lighthouse/lighthouse_launcher.star")
# MEV Builder flags

Expand All @@ -16,7 +17,7 @@ MEV_FILE_PATH_ON_CONTAINER = (

def new_builder_config(
plan,
service_name,
mev_type,
network_params,
fee_recipient,
mnemonic,
Expand All @@ -36,6 +37,7 @@ def new_builder_config(
mev_params.mev_builder_extra_data,
num_of_participants,
mev_params.mev_builder_subsidy,
mev_type,
)
flashbots_builder_config_template = read_file(
static_files.FLASHBOTS_RBUILDER_CONFIG_FILEPATH
Expand Down Expand Up @@ -70,7 +72,18 @@ def new_builder_config_template_data(
extra_data,
num_of_participants,
subsidy,
mev_type,
):
# Determine relay service name and port based on MEV type
if mev_type == constants.HELIX_MEV_TYPE:
relay_service = "helix-relay"
relay_port = helix_relay.HELIX_RELAY_ENDPOINT_PORT
relay_name = "helix"
else:
relay_service = "mev-relay-api"
relay_port = flashbots_relay.MEV_RELAY_ENDPOINT_PORT
relay_name = "flashbots"

return {
"Network": network_params.network
if network_params.network in constants.PUBLIC_NETWORKS
Expand All @@ -83,8 +96,9 @@ def new_builder_config_template_data(
lighthouse.BEACON_HTTP_PORT_NUM,
),
"GenesisForkVersion": constants.GENESIS_FORK_VERSION,
"Relay": "mev-relay-api",
"RelayPort": flashbots_relay.MEV_RELAY_ENDPOINT_PORT,
"Relay": relay_service,
"RelayPort": relay_port,
"RelayName": relay_name,
"PublicKey": pubkey,
"SecretKey": secret,
"Mnemonic": mnemonic,
Expand Down
Loading