From c022339733a55f359479acfbf8f1f4515ac09d38 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Wed, 2 Oct 2024 22:06:02 +0200 Subject: [PATCH 01/17] feat: add rbuilder remove old geth builder - flashbots --- .github/tests/minimal-mev-rbuilder.yaml | 10 +++ main.star | 19 +++- src/el/el_launcher.star | 11 +-- src/el/reth/reth_launcher.star | 40 +++++++-- .../mev_builder/mev_builder_launcher.star | 88 +++++++++++++++++++ src/package_io/constants.star | 9 +- src/package_io/input_parser.star | 32 ++----- src/participant_network.star | 2 + src/static_files/static_files.star | 4 + .../flashbots/mev_builder/config.toml.tmpl | 56 ++++++++++++ 10 files changed, 220 insertions(+), 51 deletions(-) create mode 100644 .github/tests/minimal-mev-rbuilder.yaml create mode 100644 src/mev/flashbots/mev_builder/mev_builder_launcher.star create mode 100644 static_files/mev/flashbots/mev_builder/config.toml.tmpl diff --git a/.github/tests/minimal-mev-rbuilder.yaml b/.github/tests/minimal-mev-rbuilder.yaml new file mode 100644 index 000000000..08b28d40a --- /dev/null +++ b/.github/tests/minimal-mev-rbuilder.yaml @@ -0,0 +1,10 @@ +participants: + - el_type: geth + cl_type: teku +network_params: + preset: minimal +additional_services: + - dora + - tx_spammer +mev_type: flashbots + diff --git a/main.star b/main.star index 9dce197c9..0e6db50ad 100644 --- a/main.star +++ b/main.star @@ -38,6 +38,10 @@ mev_rs_mev_relay = import_module("./src/mev/mev-rs/mev_relay/mev_relay_launcher. mev_rs_mev_builder = import_module( "./src/mev/mev-rs/mev_builder/mev_builder_launcher.star" ) +flashbots_mev_rbuilder = import_module( + "./src/mev/flashbots/mev_builder/mev_builder_launcher.star" +) + flashbots_mev_boost = import_module( "./src/mev/flashbots/mev_boost/mev_boost_launcher.star" ) @@ -116,7 +120,7 @@ def run(plan, args={}): if args_with_right_defaults.mev_type == constants.MEV_RS_MEV_TYPE: plan.print("Generating mev-rs builder config file") - mev_rs__builder_config_file = mev_rs_mev_builder.new_builder_config( + mev_rs_builder_config_file = mev_rs_mev_builder.new_builder_config( plan, constants.MEV_RS_MEV_TYPE, network_params.network, @@ -125,6 +129,18 @@ def run(plan, args={}): args_with_right_defaults.mev_params.mev_builder_extra_data, global_node_selectors, ) + elif args_with_right_defaults.mev_type == constants.FLASHBOTS_MEV_TYPE: + plan.print("Generating flashbots builder config file") + flashbots_builder_config_file = flashbots_mev_rbuilder.new_builder_config( + plan, + constants.FLASHBOTS_MEV_TYPE, + network_params, + constants.VALIDATING_REWARDS_ACCOUNT, + network_params.preregistered_validator_keys_mnemonic, + args_with_right_defaults.mev_params.mev_builder_extra_data, + enumerate(args_with_right_defaults.participants), + global_node_selectors, + ) plan.print( "Launching participant network with {0} participants and the following network params {1}".format( @@ -153,6 +169,7 @@ def run(plan, args={}): args_with_right_defaults.checkpoint_sync_enabled, args_with_right_defaults.checkpoint_sync_url, args_with_right_defaults.port_publisher, + args_with_right_defaults.mev_type, ) plan.print( diff --git a/src/el/el_launcher.star b/src/el/el_launcher.star index c86f56995..65e9809a7 100644 --- a/src/el/el_launcher.star +++ b/src/el/el_launcher.star @@ -24,6 +24,7 @@ def launch( network_id, num_participants, port_publisher, + mev_builder_type, ): el_launchers = { constants.EL_TYPE.geth: { @@ -67,15 +68,7 @@ def launch( el_cl_data, jwt_file, network_params.network, - ), - "launch_method": reth.launch, - }, - constants.EL_TYPE.reth_builder: { - "launcher": reth.new_reth_launcher( - el_cl_data, - jwt_file, - network_params.network, - builder=True, + builder=mev_builder_type, ), "launch_method": reth.launch, }, diff --git a/src/el/reth/reth_launcher.star b/src/el/reth/reth_launcher.star index 0408a46d7..27ef42da5 100644 --- a/src/el/reth/reth_launcher.star +++ b/src/el/reth/reth_launcher.star @@ -6,6 +6,10 @@ el_shared = import_module("../el_shared.star") node_metrics = import_module("../../node_metrics_info.star") constants = import_module("../../package_io/constants.star") mev_rs_builder = import_module("../../mev/mev-rs/mev_builder/mev_builder_launcher.star") +lighthouse = import_module("../../cl/lighthouse/lighthouse_launcher.star") +flashbots_rbuilder = import_module( + "../../mev/flashbots/mev_builder/mev_builder_launcher.star" +) RPC_PORT_NUM = 8545 WS_PORT_NUM = 8546 @@ -135,7 +139,9 @@ def get_config( used_ports = shared_utils.get_port_specs(used_port_assignments) cmd = [ - "/usr/local/bin/mev build" if launcher.builder else "reth", + "{0}".format( + "/usr/local/bin/mev" if launcher.builder == "mev-rs" else "/app/reth" + ), "node", "-{0}".format(log_level), "--datadir=" + EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER, @@ -208,19 +214,41 @@ def get_config( ], ) - if launcher.builder: + env_vars = { + "RETH_CMD": cmd_str, + } + + env_vars = env_vars | participant.el_extra_env_vars + image = participant.el_image + rbuilder_cmd = [] + if launcher.builder == "mev-rs": files[ mev_rs_builder.MEV_BUILDER_MOUNT_DIRPATH_ON_SERVICE ] = mev_rs_builder.MEV_BUILDER_FILES_ARTIFACT_NAME + elif launcher.builder == "flashbots": + files[ + flashbots_rbuilder.MEV_BUILDER_MOUNT_DIRPATH_ON_SERVICE + ] = flashbots_rbuilder.MEV_BUILDER_FILES_ARTIFACT_NAME + env_vars.update( + { + "RBUILDER_CONFIG": flashbots_rbuilder.MEV_FILE_PATH_ON_CONTAINER, + "CL_ENDPOINT": "http://cl-{0}-{1}-{2}:{3}".format( + participant_index, + cl_client_name, + constants.EL_TYPE.reth, + lighthouse.BEACON_HTTP_PORT_NUM, + ), + } + ) + image = constants.DEFAULT_FLASHBOTS_BUILDER_IMAGE - env_vars = participant.el_extra_env_vars config_args = { - "image": participant.el_image, + "image": image, "ports": used_ports, "public_ports": public_ports, - "cmd": [cmd_str], + "cmd": ["./app/entrypoint.sh"], "files": files, - "entrypoint": ENTRYPOINT_ARGS, + # "entrypoint": ENTRYPOINT_ARGS, "private_ip_address_placeholder": constants.PRIVATE_IP_ADDRESS_PLACEHOLDER, "env_vars": env_vars, "labels": shared_utils.label_maker( diff --git a/src/mev/flashbots/mev_builder/mev_builder_launcher.star b/src/mev/flashbots/mev_builder/mev_builder_launcher.star new file mode 100644 index 000000000..f3ed8f2d3 --- /dev/null +++ b/src/mev/flashbots/mev_builder/mev_builder_launcher.star @@ -0,0 +1,88 @@ +shared_utils = import_module("../../../shared_utils/shared_utils.star") +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") +lighthouse = import_module("../../../cl/lighthouse/lighthouse_launcher.star") +# MEV Builder flags + +MEV_BUILDER_CONFIG_FILENAME = "config.toml" +MEV_BUILDER_MOUNT_DIRPATH_ON_SERVICE = "/config/" +MEV_BUILDER_FILES_ARTIFACT_NAME = "mev-rbuilder-config" +MEV_FILE_PATH_ON_CONTAINER = ( + MEV_BUILDER_MOUNT_DIRPATH_ON_SERVICE + MEV_BUILDER_CONFIG_FILENAME +) + + +def new_builder_config( + plan, + service_name, + network_params, + fee_recipient, + mnemonic, + extra_data, + participants, + global_node_selectors, +): + num_of_participants = shared_utils.zfill_custom( + len(participants), len(str(len(participants))) + ) + builder_template_data = new_builder_config_template_data( + network_params, + constants.DEFAULT_MEV_PUBKEY, + constants.DEFAULT_MEV_SECRET_KEY, + mnemonic, + fee_recipient, + extra_data, + num_of_participants, + ) + flashbots_builder_config_template = read_file( + static_files.FLASHBOTS_RBUILDER_CONFIG_FILEPATH + ) + + template_and_data = shared_utils.new_template_and_data( + flashbots_builder_config_template, builder_template_data + ) + + template_and_data_by_rel_dest_filepath = {} + template_and_data_by_rel_dest_filepath[ + MEV_BUILDER_CONFIG_FILENAME + ] = template_and_data + + config_files_artifact_name = plan.render_templates( + template_and_data_by_rel_dest_filepath, MEV_BUILDER_FILES_ARTIFACT_NAME + ) + + config_file_path = shared_utils.path_join( + MEV_BUILDER_MOUNT_DIRPATH_ON_SERVICE, MEV_BUILDER_CONFIG_FILENAME + ) + + return config_files_artifact_name + + +def new_builder_config_template_data( + network_params, + pubkey, + secret, + mnemonic, + fee_recipient, + extra_data, + num_of_participants, +): + return { + "Network": network_params.network + if network_params.network in constants.PUBLIC_NETWORKS + else "/network-configs/genesis.json", + "DataDir": "/data/reth/execution-data", + "CLEndpoint": "http://cl-{0}-lighthouse-reth:{1}".format( + num_of_participants, lighthouse.BEACON_HTTP_PORT_NUM + ), + "GenesisForkVersion": constants.GENESIS_FORK_VERSION, + "Relay": "mev-relay-api", + "RelayPort": flashbots_relay.MEV_RELAY_ENDPOINT_PORT, + "PublicKey": pubkey, + "SecretKey": secret, + "Mnemonic": mnemonic, + "FeeRecipient": fee_recipient, + "ExtraData": extra_data, + } diff --git a/src/package_io/constants.star b/src/package_io/constants.star index e35b52625..16989ca67 100644 --- a/src/package_io/constants.star +++ b/src/package_io/constants.star @@ -4,7 +4,6 @@ EL_TYPE = struct( nethermind="nethermind", besu="besu", reth="reth", - reth_builder="reth-builder", ethereumjs="ethereumjs", nimbus="nimbus", ) @@ -82,7 +81,7 @@ MEV_RS_MEV_TYPE = "mev-rs" DEFAULT_SNOOPER_IMAGE = "ethpandaops/rpc-snooper:latest" DEFAULT_FLASHBOTS_RELAY_IMAGE = "flashbots/mev-boost-relay:0.27" -DEFAULT_FLASHBOTS_BUILDER_IMAGE = "flashbots/builder:latest" +DEFAULT_FLASHBOTS_BUILDER_IMAGE = "bbusa/rbuilder:latest" 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" @@ -164,7 +163,6 @@ VOLUME_SIZE = { "nethermind_volume_size": 1000000, # 1TB "besu_volume_size": 1000000, # 1TB "reth_volume_size": 3000000, # 3TB - "reth-builder_volume_size": 3000000, # 3TB "ethereumjs_volume_size": 1000000, # 1TB "nimbus_eth1_volume_size": 1000000, # 1TB "prysm_volume_size": 500000, # 500GB @@ -180,7 +178,6 @@ VOLUME_SIZE = { "nethermind_volume_size": 300000, # 300GB "besu_volume_size": 300000, # 300GB "reth_volume_size": 500000, # 500GB - "reth-builder_volume_size": 500000, # 500GB "ethereumjs_volume_size": 300000, # 300GB "nimbus_eth1_volume_size": 300000, # 300GB "prysm_volume_size": 150000, # 150GB @@ -196,7 +193,6 @@ VOLUME_SIZE = { "nethermind_volume_size": 100000, # 100GB "besu_volume_size": 100000, # 100GB "reth_volume_size": 200000, # 200GB - "reth-builder_volume_size": 200000, # 200GB "ethereumjs_volume_size": 100000, # 100GB "nimbus_eth1_volume_size": 100000, # 100GB "prysm_volume_size": 100000, # 100GB @@ -212,7 +208,6 @@ VOLUME_SIZE = { "nethermind_volume_size": 100000, # 100GB "besu_volume_size": 100000, # 100GB "reth_volume_size": 200000, # 200GB - "reth-builder_volume_size": 200000, # 200GB "ethereumjs_volume_size": 100000, # 100GB "nimbus_eth1_volume_size": 100000, # 100GB "prysm_volume_size": 100000, # 100GB @@ -228,7 +223,6 @@ VOLUME_SIZE = { "nethermind_volume_size": 3000, # 3GB "besu_volume_size": 3000, # 3GB "reth_volume_size": 3000, # 3GB - "reth-builder_volume_size": 3000, # 3GB "ethereumjs_volume_size": 3000, # 3GB "nimbus_eth1_volume_size": 3000, # 3GB "prysm_volume_size": 1000, # 1GB @@ -244,7 +238,6 @@ VOLUME_SIZE = { "nethermind_volume_size": 3000, # 3GB "besu_volume_size": 3000, # 3GB "reth_volume_size": 3000, # 3GB - "reth-builder_volume_size": 3000, # 3GB "ethereumjs_volume_size": 3000, # 3GB "nimbus_eth1_volume_size": 3000, # 3GB "prysm_volume_size": 1000, # 1GB diff --git a/src/package_io/input_parser.star b/src/package_io/input_parser.star index 7c4b7418e..b22792213 100644 --- a/src/package_io/input_parser.star +++ b/src/package_io/input_parser.star @@ -1150,7 +1150,7 @@ def enrich_mev_extra_params(parsed_arguments_dict, mev_prefix, mev_port, mev_typ ) if mev_type == constants.FLASHBOTS_MEV_TYPE: mev_participant = default_participant() - mev_participant["el_type"] = "geth" + mev_participant["el_type"] = "reth" mev_participant.update( { "el_image": parsed_arguments_dict["mev_params"]["mev_builder_image"], @@ -1162,31 +1162,9 @@ def enrich_mev_extra_params(parsed_arguments_dict, mev_prefix, mev_port, mev_typ "12000", "--disable-peer-scoring", ], - # 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-builder:4000".format( - index_str - ), - "--builder.bellatrix_fork_version={0}".format( - constants.BELLATRIX_FORK_VERSION - ), - "--builder.genesis_fork_version={0}".format( - constants.GENESIS_FORK_VERSION - ), - "--builder.genesis_validators_root={0}".format( - constants.GENESIS_VALIDATORS_ROOT_PLACEHOLDER - ), - '--miner.extradata="Illuminate Dmocratize Dstribute"', - "--builder.algotype=greedy", - "--metrics.builder", - ] - + parsed_arguments_dict["mev_params"]["mev_builder_extra_args"], - "el_extra_env_vars": { - "BUILDER_TX_SIGNING_KEY": "0x" - + genesis_constants.PRE_FUNDED_ACCOUNTS[0].private_key - }, + "el_extra_params": parsed_arguments_dict["mev_params"][ + "mev_builder_extra_args" + ], "validator_count": 0, "prometheus_config": parsed_arguments_dict["mev_params"][ "mev_builder_prometheus_config" @@ -1198,7 +1176,7 @@ def enrich_mev_extra_params(parsed_arguments_dict, mev_prefix, mev_port, mev_typ if mev_type == constants.MEV_RS_MEV_TYPE: mev_participant = default_participant() - mev_participant["el_type"] = "reth-builder" + mev_participant["el_type"] = constants.EL_TYPE.reth mev_participant.update( { "el_image": parsed_arguments_dict["mev_params"]["mev_builder_image"], diff --git a/src/participant_network.star b/src/participant_network.star index b519dc8d8..55c74aee0 100644 --- a/src/participant_network.star +++ b/src/participant_network.star @@ -43,6 +43,7 @@ def launch_participant_network( checkpoint_sync_enabled, checkpoint_sync_url, port_publisher, + mev_builder_type, ): network_id = network_params.network_id latest_block = "" @@ -143,6 +144,7 @@ def launch_participant_network( network_id, num_participants, port_publisher, + mev_builder_type, ) # Launch all consensus layer clients diff --git a/src/static_files/static_files.star b/src/static_files/static_files.star index b05031d71..453cf0f1e 100644 --- a/src/static_files/static_files.star +++ b/src/static_files/static_files.star @@ -96,3 +96,7 @@ MEV_RS_MEV_RELAY_CONFIG_FILEPATH = ( MEV_RS_MEV_BUILDER_CONFIG_FILEPATH = ( STATIC_FILES_DIRPATH + "/mev/mev-rs/mev_builder/config.toml.tmpl" ) + +FLASHBOTS_RBUILDER_CONFIG_FILEPATH = ( + STATIC_FILES_DIRPATH + "/mev/flashbots/mev_builder/config.toml.tmpl" +) diff --git a/static_files/mev/flashbots/mev_builder/config.toml.tmpl b/static_files/mev/flashbots/mev_builder/config.toml.tmpl new file mode 100644 index 000000000..8242fc12c --- /dev/null +++ b/static_files/mev/flashbots/mev_builder/config.toml.tmpl @@ -0,0 +1,56 @@ +log_json = true +log_level = "info,rbuilder=debug" +redacted_telemetry_server_port = 6061 +redacted_telemetry_server_ip = "0.0.0.0" +full_telemetry_server_port = 6060 +full_telemetry_server_ip = "0.0.0.0" + +chain = "{{ .Network }}" +reth_datadir = "{{ .DataDir }}" + +coinbase_secret_key = "{{ .SecretKey }}" +relay_secret_key = "{{ .SecretKey }}" +optimistic_relay_secret_key = "{{ .SecretKey }}" + +# cl_node_url can be a single value, array of values, or passed by an environment variables with values separated with a comma +cl_node_url = "{{ .CLEndpoint }}" +jsonrpc_server_port = 8645 +jsonrpc_server_ip = "0.0.0.0" +el_node_ipc_path = "/tmp/reth.ipc" +extra_data = "🐼⚡🤖" +genesis_fork_version = "{{ .GenesisForkVersion }}" + +dry_run = false +dry_run_validation_url = "http://localhost:8545" + +ignore_cancellable_orders = true + +max_concurrent_seals = 4 + +sbundle_mergeabe_signers = [] +# slot_delta_to_start_submits_ms is usually negative since we start bidding BEFORE the slot start +# slot_delta_to_start_submits_ms = -5000 +live_builders = ["mp-ordering", "mgp-ordering"] +watchdog_timeout_sec = 99999 +[[relays]] +name = "flashbots" +url = "http://{{ .PublicKey }}@{{ .Relay }}:{{ .RelayPort }}" +priority = 0 +use_ssz_for_submit = false +use_gzip_for_submit = false + +[[builders]] +name = "mgp-ordering" +algo = "ordering-builder" +discard_txs = true +sorting = "mev-gas-price" +failed_order_retries = 1 +drop_failed_orders = true + +[[builders]] +name = "mp-ordering" +algo = "ordering-builder" +discard_txs = true +sorting = "max-profit" +failed_order_retries = 1 +drop_failed_orders = true From 82644ad547154770d1ee596113cecec760df4f26 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Thu, 3 Oct 2024 12:15:51 +0200 Subject: [PATCH 02/17] update rbuilder --- .github/tests/minimal-mev-rbuilder.yaml | 2 +- main.star | 8 ++++++-- src/el/el_launcher.star | 10 +++++++++- src/el/reth/reth_launcher.star | 25 +++++++++++++++---------- src/package_io/constants.star | 8 ++++++++ src/package_io/input_parser.star | 2 +- src/shared_utils/shared_utils.star | 1 + 7 files changed, 41 insertions(+), 15 deletions(-) diff --git a/.github/tests/minimal-mev-rbuilder.yaml b/.github/tests/minimal-mev-rbuilder.yaml index 08b28d40a..f17811898 100644 --- a/.github/tests/minimal-mev-rbuilder.yaml +++ b/.github/tests/minimal-mev-rbuilder.yaml @@ -1,5 +1,5 @@ participants: - - el_type: geth + - el_type: reth cl_type: teku network_params: preset: minimal diff --git a/main.star b/main.star index 0e6db50ad..d8b441a81 100644 --- a/main.star +++ b/main.star @@ -259,8 +259,12 @@ 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 ): - builder_uri = "http://{0}:{1}".format( - all_el_contexts[-1].ip_addr, all_el_contexts[-1].rpc_port_num + builder_uri = ( + "http://{0}:{1}".format( + all_el_contexts[-1].ip_addr, all_el_contexts[-1].rpc_port_num + ) + if args_with_right_defaults.mev_type == constants.MEV_RS_MEV_TYPE + else "http://{0}:{1}".format(all_el_contexts[-1].ip_addr, 8645) ) beacon_uri = all_cl_contexts[-1].beacon_http_url beacon_uris = ",".join( diff --git a/src/el/el_launcher.star b/src/el/el_launcher.star index 65e9809a7..def5f27fd 100644 --- a/src/el/el_launcher.star +++ b/src/el/el_launcher.star @@ -68,7 +68,15 @@ def launch( el_cl_data, jwt_file, network_params.network, - builder=mev_builder_type, + ), + "launch_method": reth.launch, + }, + constants.EL_TYPE.reth_builder: { + "launcher": reth.new_reth_launcher( + el_cl_data, + jwt_file, + network_params.network, + builder_type=mev_builder_type, ), "launch_method": reth.launch, }, diff --git a/src/el/reth/reth_launcher.star b/src/el/reth/reth_launcher.star index 27ef42da5..b56af5f32 100644 --- a/src/el/reth/reth_launcher.star +++ b/src/el/reth/reth_launcher.star @@ -16,14 +16,13 @@ WS_PORT_NUM = 8546 DISCOVERY_PORT_NUM = 30303 ENGINE_RPC_PORT_NUM = 8551 METRICS_PORT_NUM = 9001 - +RBUILDER_PORT_NUM = 8645 # Paths METRICS_PATH = "/metrics" # The dirpath of the execution data directory on the client container EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER = "/data/reth/execution-data" -ENTRYPOINT_ARGS = ["sh", "-c"] VERBOSITY_LEVELS = { constants.GLOBAL_LOG_LEVEL.error: "v", @@ -136,11 +135,15 @@ def get_config( constants.WS_PORT_ID: WS_PORT_NUM, constants.METRICS_PORT_ID: METRICS_PORT_NUM, } + + if launcher.builder_type == "flashbots": + used_port_assignments[constants.RBUILDER_PORT_ID] = RBUILDER_PORT_NUM + used_ports = shared_utils.get_port_specs(used_port_assignments) cmd = [ "{0}".format( - "/usr/local/bin/mev" if launcher.builder == "mev-rs" else "/app/reth" + "/usr/local/bin/mev" if launcher.builder_type == "mev-rs" else "reth" ), "node", "-{0}".format(log_level), @@ -217,15 +220,15 @@ def get_config( env_vars = { "RETH_CMD": cmd_str, } - + entrypoint_args = ["sh", "-c"] env_vars = env_vars | participant.el_extra_env_vars image = participant.el_image rbuilder_cmd = [] - if launcher.builder == "mev-rs": + if launcher.builder_type == "mev-rs": files[ mev_rs_builder.MEV_BUILDER_MOUNT_DIRPATH_ON_SERVICE ] = mev_rs_builder.MEV_BUILDER_FILES_ARTIFACT_NAME - elif launcher.builder == "flashbots": + elif launcher.builder_type == "flashbots": files[ flashbots_rbuilder.MEV_BUILDER_MOUNT_DIRPATH_ON_SERVICE ] = flashbots_rbuilder.MEV_BUILDER_FILES_ARTIFACT_NAME @@ -241,14 +244,16 @@ def get_config( } ) image = constants.DEFAULT_FLASHBOTS_BUILDER_IMAGE + cmd_str = "./app/entrypoint.sh" + entrypoint_args = [] config_args = { "image": image, "ports": used_ports, "public_ports": public_ports, - "cmd": ["./app/entrypoint.sh"], + "cmd": [cmd_str], "files": files, - # "entrypoint": ENTRYPOINT_ARGS, + "entrypoint": entrypoint_args, "private_ip_address_placeholder": constants.PRIVATE_IP_ADDRESS_PLACEHOLDER, "env_vars": env_vars, "labels": shared_utils.label_maker( @@ -273,10 +278,10 @@ def get_config( return ServiceConfig(**config_args) -def new_reth_launcher(el_cl_genesis_data, jwt_file, network, builder=False): +def new_reth_launcher(el_cl_genesis_data, jwt_file, network, builder_type=False): return struct( el_cl_genesis_data=el_cl_genesis_data, jwt_file=jwt_file, network=network, - builder=builder, + builder_type=builder_type, ) diff --git a/src/package_io/constants.star b/src/package_io/constants.star index 16989ca67..32f2bbd4f 100644 --- a/src/package_io/constants.star +++ b/src/package_io/constants.star @@ -4,6 +4,7 @@ EL_TYPE = struct( nethermind="nethermind", besu="besu", reth="reth", + reth_builder="reth-builder", ethereumjs="ethereumjs", nimbus="nimbus", ) @@ -51,6 +52,7 @@ METRICS_PORT_ID = "metrics" ENGINE_RPC_PORT_ID = "engine-rpc" ENGINE_WS_PORT_ID = "engine-ws" ADMIN_PORT_ID = "admin" +RBUILDER_PORT_ID = "rbuilder-rpc" LITTLE_BIGTABLE_PORT_ID = "littlebigtable" VALDIATOR_GRPC_PORT_ID = "grpc" @@ -163,6 +165,7 @@ VOLUME_SIZE = { "nethermind_volume_size": 1000000, # 1TB "besu_volume_size": 1000000, # 1TB "reth_volume_size": 3000000, # 3TB + "reth_builder_volume_size": 3000000, # 3TB "ethereumjs_volume_size": 1000000, # 1TB "nimbus_eth1_volume_size": 1000000, # 1TB "prysm_volume_size": 500000, # 500GB @@ -178,6 +181,7 @@ VOLUME_SIZE = { "nethermind_volume_size": 300000, # 300GB "besu_volume_size": 300000, # 300GB "reth_volume_size": 500000, # 500GB + "reth_builder_volume_size": 500000, # 500GB "ethereumjs_volume_size": 300000, # 300GB "nimbus_eth1_volume_size": 300000, # 300GB "prysm_volume_size": 150000, # 150GB @@ -193,6 +197,7 @@ VOLUME_SIZE = { "nethermind_volume_size": 100000, # 100GB "besu_volume_size": 100000, # 100GB "reth_volume_size": 200000, # 200GB + "reth_builder_volume_size": 200000, # 200GB "ethereumjs_volume_size": 100000, # 100GB "nimbus_eth1_volume_size": 100000, # 100GB "prysm_volume_size": 100000, # 100GB @@ -208,6 +213,7 @@ VOLUME_SIZE = { "nethermind_volume_size": 100000, # 100GB "besu_volume_size": 100000, # 100GB "reth_volume_size": 200000, # 200GB + "reth_builder_volume_size": 200000, # 200GB "ethereumjs_volume_size": 100000, # 100GB "nimbus_eth1_volume_size": 100000, # 100GB "prysm_volume_size": 100000, # 100GB @@ -223,6 +229,7 @@ VOLUME_SIZE = { "nethermind_volume_size": 3000, # 3GB "besu_volume_size": 3000, # 3GB "reth_volume_size": 3000, # 3GB + "reth_builder_volume_size": 3000, # 3GB "ethereumjs_volume_size": 3000, # 3GB "nimbus_eth1_volume_size": 3000, # 3GB "prysm_volume_size": 1000, # 1GB @@ -238,6 +245,7 @@ VOLUME_SIZE = { "nethermind_volume_size": 3000, # 3GB "besu_volume_size": 3000, # 3GB "reth_volume_size": 3000, # 3GB + "reth_builder_volume_size": 3000, # 3GB "ethereumjs_volume_size": 3000, # 3GB "nimbus_eth1_volume_size": 3000, # 3GB "prysm_volume_size": 1000, # 1GB diff --git a/src/package_io/input_parser.star b/src/package_io/input_parser.star index b22792213..833aaeea5 100644 --- a/src/package_io/input_parser.star +++ b/src/package_io/input_parser.star @@ -1150,7 +1150,7 @@ def enrich_mev_extra_params(parsed_arguments_dict, mev_prefix, mev_port, mev_typ ) if mev_type == constants.FLASHBOTS_MEV_TYPE: mev_participant = default_participant() - mev_participant["el_type"] = "reth" + mev_participant["el_type"] = "reth-builder" mev_participant.update( { "el_image": parsed_arguments_dict["mev_params"]["mev_builder_image"], diff --git a/src/shared_utils/shared_utils.star b/src/shared_utils/shared_utils.star index 7742d643d..6b9079c07 100644 --- a/src/shared_utils/shared_utils.star +++ b/src/shared_utils/shared_utils.star @@ -301,6 +301,7 @@ def get_port_specs(port_assignments): constants.VALIDATOR_HTTP_PORT_ID, constants.ADMIN_PORT_ID, constants.VALDIATOR_GRPC_PORT_ID, + constants.RBUILDER_PORT_ID, ]: ports.update( {port_id: new_port_spec(port, TCP_PROTOCOL, HTTP_APPLICATION_PROTOCOL)} From 386bedcbd7bb89dbae44985d6ca8a5afeb8c2ca0 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Thu, 3 Oct 2024 12:48:03 +0200 Subject: [PATCH 03/17] update rbuilder --- .github/tests/minimal-mev-rbuilder.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/tests/minimal-mev-rbuilder.yaml b/.github/tests/minimal-mev-rbuilder.yaml index f17811898..23576a8a4 100644 --- a/.github/tests/minimal-mev-rbuilder.yaml +++ b/.github/tests/minimal-mev-rbuilder.yaml @@ -8,3 +8,5 @@ additional_services: - tx_spammer mev_type: flashbots +mev_params: + mev_relay_image: flashbots/mev-boost-relay From 44d70cf2ba3c860c30fde25188ce452d44991308 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Wed, 16 Oct 2024 13:06:01 +0200 Subject: [PATCH 04/17] fix some cl names --- src/el/reth/reth_launcher.star | 5 +++-- src/mev/flashbots/mev_builder/mev_builder_launcher.star | 2 +- src/package_io/input_parser.star | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/el/reth/reth_launcher.star b/src/el/reth/reth_launcher.star index 65594baa4..5ced5499a 100644 --- a/src/el/reth/reth_launcher.star +++ b/src/el/reth/reth_launcher.star @@ -229,6 +229,7 @@ def get_config( mev_rs_builder.MEV_BUILDER_MOUNT_DIRPATH_ON_SERVICE ] = mev_rs_builder.MEV_BUILDER_FILES_ARTIFACT_NAME elif launcher.builder_type == "flashbots": + cl_client_name = service_name.split("-")[4] files[ flashbots_rbuilder.MEV_BUILDER_MOUNT_DIRPATH_ON_SERVICE ] = flashbots_rbuilder.MEV_BUILDER_FILES_ARTIFACT_NAME @@ -236,9 +237,9 @@ def get_config( { "RBUILDER_CONFIG": flashbots_rbuilder.MEV_FILE_PATH_ON_CONTAINER, "CL_ENDPOINT": "http://cl-{0}-{1}-{2}:{3}".format( - participant_index, + participant_index + 1, cl_client_name, - constants.EL_TYPE.reth, + constants.EL_TYPE.reth_builder, lighthouse.BEACON_HTTP_PORT_NUM, ), } diff --git a/src/mev/flashbots/mev_builder/mev_builder_launcher.star b/src/mev/flashbots/mev_builder/mev_builder_launcher.star index f3ed8f2d3..26b227b0d 100644 --- a/src/mev/flashbots/mev_builder/mev_builder_launcher.star +++ b/src/mev/flashbots/mev_builder/mev_builder_launcher.star @@ -74,7 +74,7 @@ def new_builder_config_template_data( if network_params.network in constants.PUBLIC_NETWORKS else "/network-configs/genesis.json", "DataDir": "/data/reth/execution-data", - "CLEndpoint": "http://cl-{0}-lighthouse-reth:{1}".format( + "CLEndpoint": "http://cl-{0}-lighthouse-reth-builder:{1}".format( num_of_participants, lighthouse.BEACON_HTTP_PORT_NUM ), "GenesisForkVersion": constants.GENESIS_FORK_VERSION, diff --git a/src/package_io/input_parser.star b/src/package_io/input_parser.star index c9e93ced8..c26aea35b 100644 --- a/src/package_io/input_parser.star +++ b/src/package_io/input_parser.star @@ -31,7 +31,7 @@ DEFAULT_CL_IMAGES_MINIMAL = { "nimbus": "ethpandaops/nimbus-eth2:stable-minimal", "prysm": "ethpandaops/prysm-beacon-chain:develop-minimal", "lodestar": "chainsafe/lodestar:latest", - "grandine": "ethpandaops/grandine:master-minimal", + "grandine": "ethpandaops/grandine:develop-minimal", } DEFAULT_VC_IMAGES = { @@ -49,7 +49,7 @@ DEFAULT_VC_IMAGES_MINIMAL = { "nimbus": "ethpandaops/nimbus-validator-client:stable-minimal", "prysm": "ethpandaops/prysm-validator:develop-minimal", "teku": "consensys/teku:latest", - "grandine": "ethpandaops/grandine:master-minimal", + "grandine": "ethpandaops/grandine:develop-minimal", } DEFAULT_REMOTE_SIGNER_IMAGES = { From 9a7120bba11d4614e4c813a66e65aa32cb4fbcf4 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Wed, 16 Oct 2024 14:43:55 +0200 Subject: [PATCH 05/17] bump relay version --- src/package_io/constants.star | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/package_io/constants.star b/src/package_io/constants.star index b9a2e5e39..5688b6160 100644 --- a/src/package_io/constants.star +++ b/src/package_io/constants.star @@ -85,7 +85,7 @@ FLASHBOTS_MEV_TYPE = "flashbots" MEV_RS_MEV_TYPE = "mev-rs" DEFAULT_SNOOPER_IMAGE = "ethpandaops/rpc-snooper:latest" -DEFAULT_FLASHBOTS_RELAY_IMAGE = "flashbots/mev-boost-relay:0.27" +DEFAULT_FLASHBOTS_RELAY_IMAGE = "flashbots/mev-boost-relay:0.29.2a3" DEFAULT_FLASHBOTS_BUILDER_IMAGE = "bbusa/rbuilder:latest" DEFAULT_FLASHBOTS_MEV_BOOST_IMAGE = "flashbots/mev-boost" DEFAULT_MEV_RS_IMAGE = "ethpandaops/mev-rs:main" From 4518ca0faba99e5f057eab1b7b0699a37b04ffc5 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Wed, 16 Oct 2024 17:11:09 +0200 Subject: [PATCH 06/17] drop 0x prefix, and add array for cl endpoints --- src/mev/flashbots/mev_builder/mev_builder_launcher.star | 6 +++--- static_files/mev/flashbots/mev_builder/config.toml.tmpl | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mev/flashbots/mev_builder/mev_builder_launcher.star b/src/mev/flashbots/mev_builder/mev_builder_launcher.star index 26b227b0d..b6ceb19bb 100644 --- a/src/mev/flashbots/mev_builder/mev_builder_launcher.star +++ b/src/mev/flashbots/mev_builder/mev_builder_launcher.star @@ -30,7 +30,7 @@ def new_builder_config( builder_template_data = new_builder_config_template_data( network_params, constants.DEFAULT_MEV_PUBKEY, - constants.DEFAULT_MEV_SECRET_KEY, + constants.DEFAULT_MEV_SECRET_KEY[2:], # drop the 0x prefix mnemonic, fee_recipient, extra_data, @@ -74,8 +74,8 @@ def new_builder_config_template_data( if network_params.network in constants.PUBLIC_NETWORKS else "/network-configs/genesis.json", "DataDir": "/data/reth/execution-data", - "CLEndpoint": "http://cl-{0}-lighthouse-reth-builder:{1}".format( - num_of_participants, lighthouse.BEACON_HTTP_PORT_NUM + "CLEndpoint": "http://cl-{0}-{1}-{2}:{3}".format( + num_of_participants, constants.CL_TYPE.lighthouse, constants.EL_TYPE.reth_builder, lighthouse.BEACON_HTTP_PORT_NUM ), "GenesisForkVersion": constants.GENESIS_FORK_VERSION, "Relay": "mev-relay-api", diff --git a/static_files/mev/flashbots/mev_builder/config.toml.tmpl b/static_files/mev/flashbots/mev_builder/config.toml.tmpl index 8242fc12c..41606a132 100644 --- a/static_files/mev/flashbots/mev_builder/config.toml.tmpl +++ b/static_files/mev/flashbots/mev_builder/config.toml.tmpl @@ -13,7 +13,7 @@ relay_secret_key = "{{ .SecretKey }}" optimistic_relay_secret_key = "{{ .SecretKey }}" # cl_node_url can be a single value, array of values, or passed by an environment variables with values separated with a comma -cl_node_url = "{{ .CLEndpoint }}" +cl_node_url = ["{{ .CLEndpoint }}"] jsonrpc_server_port = 8645 jsonrpc_server_ip = "0.0.0.0" el_node_ipc_path = "/tmp/reth.ipc" From b58c7da5dd289b19c1795f49b3732e4cf6b87aa6 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Wed, 16 Oct 2024 17:44:57 +0200 Subject: [PATCH 07/17] fix lint --- src/mev/flashbots/mev_builder/mev_builder_launcher.star | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mev/flashbots/mev_builder/mev_builder_launcher.star b/src/mev/flashbots/mev_builder/mev_builder_launcher.star index b6ceb19bb..86c91f196 100644 --- a/src/mev/flashbots/mev_builder/mev_builder_launcher.star +++ b/src/mev/flashbots/mev_builder/mev_builder_launcher.star @@ -30,7 +30,7 @@ def new_builder_config( builder_template_data = new_builder_config_template_data( network_params, constants.DEFAULT_MEV_PUBKEY, - constants.DEFAULT_MEV_SECRET_KEY[2:], # drop the 0x prefix + constants.DEFAULT_MEV_SECRET_KEY[2:], # drop the 0x prefix mnemonic, fee_recipient, extra_data, @@ -75,7 +75,10 @@ def new_builder_config_template_data( else "/network-configs/genesis.json", "DataDir": "/data/reth/execution-data", "CLEndpoint": "http://cl-{0}-{1}-{2}:{3}".format( - num_of_participants, constants.CL_TYPE.lighthouse, constants.EL_TYPE.reth_builder, lighthouse.BEACON_HTTP_PORT_NUM + num_of_participants, + constants.CL_TYPE.lighthouse, + constants.EL_TYPE.reth_builder, + lighthouse.BEACON_HTTP_PORT_NUM, ), "GenesisForkVersion": constants.GENESIS_FORK_VERSION, "Relay": "mev-relay-api", From 34471819bcd1af61633b5ea9fd9af095e397cf96 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Thu, 17 Oct 2024 11:28:03 +0200 Subject: [PATCH 08/17] fix lint --- src/static_files/static_files.star | 1 + 1 file changed, 1 insertion(+) diff --git a/src/static_files/static_files.star b/src/static_files/static_files.star index 945e7ebc2..78d686dcf 100644 --- a/src/static_files/static_files.star +++ b/src/static_files/static_files.star @@ -99,6 +99,7 @@ MEV_RS_MEV_BUILDER_CONFIG_FILEPATH = ( FLASHBOTS_RBUILDER_CONFIG_FILEPATH = ( STATIC_FILES_DIRPATH + "/mev/flashbots/mev_builder/config.toml.tmpl" +) COMMIT_BOOST_CONFIG_FILEPATH = ( STATIC_FILES_DIRPATH + "/mev/commit-boost/cb-config.toml.tmpl" From 5514b176e0b2c12485d97bb5336fff9f2b78b1f1 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Wed, 23 Oct 2024 00:54:10 +0200 Subject: [PATCH 09/17] fix: add extra cmd for reth if its builder --- .../tests/{minimal-mev-rbuilder.yaml => mev-rbuilder.yaml} | 2 -- src/el/reth/reth_launcher.star | 7 ++++--- 2 files changed, 4 insertions(+), 5 deletions(-) rename .github/tests/{minimal-mev-rbuilder.yaml => mev-rbuilder.yaml} (83%) diff --git a/.github/tests/minimal-mev-rbuilder.yaml b/.github/tests/mev-rbuilder.yaml similarity index 83% rename from .github/tests/minimal-mev-rbuilder.yaml rename to .github/tests/mev-rbuilder.yaml index 23576a8a4..3a19fafba 100644 --- a/.github/tests/minimal-mev-rbuilder.yaml +++ b/.github/tests/mev-rbuilder.yaml @@ -1,8 +1,6 @@ participants: - el_type: reth cl_type: teku -network_params: - preset: minimal additional_services: - dora - tx_spammer diff --git a/src/el/reth/reth_launcher.star b/src/el/reth/reth_launcher.star index 5ced5499a..7e64cbc20 100644 --- a/src/el/reth/reth_launcher.star +++ b/src/el/reth/reth_launcher.star @@ -200,8 +200,6 @@ def get_config( # this is a repeated, we convert it into Starlark cmd.extend([param for param in participant.el_extra_params]) - cmd_str = " ".join(cmd) - files = { constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: launcher.el_cl_genesis_data.files_artifact_uuid, constants.JWT_MOUNTPOINT_ON_CLIENTS: launcher.jwt_file, @@ -216,7 +214,7 @@ def get_config( constants.EL_TYPE.reth + "_volume_size" ], ) - + cmd_str = " ".join(cmd) env_vars = { "RETH_CMD": cmd_str, } @@ -230,9 +228,12 @@ def get_config( ] = mev_rs_builder.MEV_BUILDER_FILES_ARTIFACT_NAME elif launcher.builder_type == "flashbots": cl_client_name = service_name.split("-")[4] + cmd.append("--engine.legacy") + cmd_str = " ".join(cmd) files[ flashbots_rbuilder.MEV_BUILDER_MOUNT_DIRPATH_ON_SERVICE ] = flashbots_rbuilder.MEV_BUILDER_FILES_ARTIFACT_NAME + env_vars["RETH_CMD"] = cmd_str env_vars.update( { "RBUILDER_CONFIG": flashbots_rbuilder.MEV_FILE_PATH_ON_CONTAINER, From ce20c04aac14616db0e3d820adcf0d5cf9eeb5ab Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Fri, 25 Oct 2024 09:36:32 +0200 Subject: [PATCH 10/17] add flashbots --- src/el/reth/reth_launcher.star | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/el/reth/reth_launcher.star b/src/el/reth/reth_launcher.star index 7e64cbc20..39883a4aa 100644 --- a/src/el/reth/reth_launcher.star +++ b/src/el/reth/reth_launcher.star @@ -159,7 +159,7 @@ def get_config( "--http.corsdomain=*", # WARNING: The admin info endpoint is enabled so that we can easily get ENR/enode, which means # that users should NOT store private information in these Kurtosis nodes! - "--http.api=admin,net,eth,web3,debug,trace", + "--http.api=admin,net,eth,web3,debug,trace, flashbots", "--ws", "--ws.addr=0.0.0.0", "--ws.port={0}".format(WS_PORT_NUM), From 3878edf6cd43f61a8bb5eb1085d7af4e48a2e4d6 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Fri, 25 Oct 2024 09:37:58 +0200 Subject: [PATCH 11/17] add flashbots --- src/el/reth/reth_launcher.star | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/el/reth/reth_launcher.star b/src/el/reth/reth_launcher.star index 39883a4aa..b497c012e 100644 --- a/src/el/reth/reth_launcher.star +++ b/src/el/reth/reth_launcher.star @@ -159,7 +159,7 @@ def get_config( "--http.corsdomain=*", # WARNING: The admin info endpoint is enabled so that we can easily get ENR/enode, which means # that users should NOT store private information in these Kurtosis nodes! - "--http.api=admin,net,eth,web3,debug,trace, flashbots", + "--http.api=admin,net,eth,web3,debug,trace,flashbots", "--ws", "--ws.addr=0.0.0.0", "--ws.port={0}".format(WS_PORT_NUM), From 854c7fbd1aea03d57a2d86dafc03a80ea4cc3b5b Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Fri, 25 Oct 2024 13:29:07 +0200 Subject: [PATCH 12/17] add flashbots if builder is flashbots --- src/el/reth/reth_launcher.star | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/el/reth/reth_launcher.star b/src/el/reth/reth_launcher.star index b497c012e..48dc6dcf3 100644 --- a/src/el/reth/reth_launcher.star +++ b/src/el/reth/reth_launcher.star @@ -159,7 +159,7 @@ def get_config( "--http.corsdomain=*", # WARNING: The admin info endpoint is enabled so that we can easily get ENR/enode, which means # that users should NOT store private information in these Kurtosis nodes! - "--http.api=admin,net,eth,web3,debug,trace,flashbots", + "--http.api=admin,net,eth,web3,debug,trace{0}".format(",flashbots" if launcher.builder_type == "flashbots" else ""), "--ws", "--ws.addr=0.0.0.0", "--ws.port={0}".format(WS_PORT_NUM), From 6a779720ed35e76e72b8401a29a9519239aa19e9 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Mon, 28 Oct 2024 12:34:18 +0100 Subject: [PATCH 13/17] update rbuilder image --- main.star | 10 +++------- src/el/reth/reth_launcher.star | 4 +++- src/mev/flashbots/mev_relay/mev_relay_launcher.star | 4 ++-- src/package_io/constants.star | 2 +- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/main.star b/main.star index 675505a86..a9605f784 100644 --- a/main.star +++ b/main.star @@ -265,12 +265,8 @@ def run(plan, args={}): or args_with_right_defaults.mev_type == constants.MEV_RS_MEV_TYPE or args_with_right_defaults.mev_type == constants.COMMIT_BOOST_MEV_TYPE ): - builder_uri = ( - "http://{0}:{1}".format( - all_el_contexts[-1].ip_addr, all_el_contexts[-1].rpc_port_num - ) - if args_with_right_defaults.mev_type == constants.MEV_RS_MEV_TYPE - else "http://{0}:{1}".format(all_el_contexts[-1].ip_addr, 8645) + blocksim_uri = "http://{0}:{1}".format( + all_el_contexts[-1].ip_addr, all_el_contexts[-1].rpc_port_num ) beacon_uri = all_cl_contexts[-1].beacon_http_url beacon_uris = ",".join( @@ -311,7 +307,7 @@ def run(plan, args={}): network_id, beacon_uris, genesis_validators_root, - builder_uri, + blocksim_uri, network_params.seconds_per_slot, persistent, global_node_selectors, diff --git a/src/el/reth/reth_launcher.star b/src/el/reth/reth_launcher.star index 48dc6dcf3..2dab08770 100644 --- a/src/el/reth/reth_launcher.star +++ b/src/el/reth/reth_launcher.star @@ -159,7 +159,9 @@ def get_config( "--http.corsdomain=*", # WARNING: The admin info endpoint is enabled so that we can easily get ENR/enode, which means # that users should NOT store private information in these Kurtosis nodes! - "--http.api=admin,net,eth,web3,debug,trace{0}".format(",flashbots" if launcher.builder_type == "flashbots" else ""), + "--http.api=admin,net,eth,web3,debug,trace{0}".format( + ",flashbots" if launcher.builder_type == "flashbots" else "" + ), "--ws", "--ws.addr=0.0.0.0", "--ws.port={0}".format(WS_PORT_NUM), diff --git a/src/mev/flashbots/mev_relay/mev_relay_launcher.star b/src/mev/flashbots/mev_relay/mev_relay_launcher.star index e83d27959..5b2e6a32c 100644 --- a/src/mev/flashbots/mev_relay/mev_relay_launcher.star +++ b/src/mev/flashbots/mev_relay/mev_relay_launcher.star @@ -42,7 +42,7 @@ def launch_mev_relay( network_id, beacon_uris, validator_root, - builder_uri, + blocksim_uri, seconds_per_slot, persistent, global_node_selectors, @@ -134,7 +134,7 @@ def launch_mev_relay( "--beacon-uris", beacon_uris, "--blocksim", - builder_uri, + blocksim_uri, ] + mev_params.mev_relay_api_extra_args, ports={ diff --git a/src/package_io/constants.star b/src/package_io/constants.star index 85803df22..9f491689e 100644 --- a/src/package_io/constants.star +++ b/src/package_io/constants.star @@ -87,7 +87,7 @@ COMMIT_BOOST_MEV_TYPE = "commit-boost" DEFAULT_SNOOPER_IMAGE = "ethpandaops/rpc-snooper:latest" DEFAULT_FLASHBOTS_RELAY_IMAGE = "flashbots/mev-boost-relay:0.29.2a3" -DEFAULT_FLASHBOTS_BUILDER_IMAGE = "bbusa/rbuilder:latest" +DEFAULT_FLASHBOTS_BUILDER_IMAGE = "ethpandaops/rbuilder:develop" 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" From 73b996dd81f4e5911cb64d01e1234b1f06f0a480 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Mon, 28 Oct 2024 22:23:33 +0100 Subject: [PATCH 14/17] fix final-genesis-timestamp, and add it to mev-boost --- main.star | 2 +- .../flashbots/mev_boost/mev_boost_launcher.star | 15 ++++++--------- .../el_cl_genesis/el_cl_genesis_generator.star | 2 +- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/main.star b/main.star index a9605f784..839401613 100644 --- a/main.star +++ b/main.star @@ -366,7 +366,7 @@ def run(plan, args={}): plan, mev_boost_launcher, mev_boost_service_name, - network_id, + final_genesis_timestamp, mev_params.mev_boost_image, mev_params.mev_boost_args, global_node_selectors, diff --git a/src/mev/flashbots/mev_boost/mev_boost_launcher.star b/src/mev/flashbots/mev_boost/mev_boost_launcher.star index 41b6760b4..1d97b04a7 100644 --- a/src/mev/flashbots/mev_boost/mev_boost_launcher.star +++ b/src/mev/flashbots/mev_boost/mev_boost_launcher.star @@ -1,6 +1,7 @@ shared_utils = import_module("../../../shared_utils/shared_utils.star") mev_boost_context_module = import_module("../mev_boost/mev_boost_context.star") input_parser = import_module("../../../package_io/input_parser.star") +constants = import_module("../../../package_io/constants.star") FLASHBOTS_MEV_BOOST_PROTOCOL = "TCP" @@ -27,14 +28,14 @@ def launch( plan, mev_boost_launcher, service_name, - network_id, + genesis_timestamp, mev_boost_image, mev_boost_args, global_node_selectors, ): config = get_config( mev_boost_launcher, - network_id, + genesis_timestamp, mev_boost_image, mev_boost_args, global_node_selectors, @@ -49,7 +50,7 @@ def launch( def get_config( mev_boost_launcher, - network_id, + genesis_timestamp, mev_boost_image, mev_boost_args, node_selectors, @@ -61,13 +62,9 @@ def get_config( ports=USED_PORTS, cmd=command, env_vars={ - # TODO(maybe) remove the hardcoding - # This is set to match this file https://github.com/ethpandaops/ethereum-package/blob/main/static_files/genesis-generation-config/cl/config.yaml.tmpl#L11 - # latest-notes - # does this need genesis time to be set as well - "GENESIS_FORK_VERSION": "0x10000038", + "GENESIS_FORK_VERSION": constants.GENESIS_FORK_VERSION, + "GENESIS_TIMESTAMP": "{0}".format(genesis_timestamp), "BOOST_LISTEN_ADDR": "0.0.0.0:{0}".format(input_parser.MEV_BOOST_PORT), - # maybe this is breaking; this isn't verifyign the bid and not sending it to the validator "SKIP_RELAY_SIGNATURE_CHECK": "1", "RELAYS": mev_boost_launcher.relay_end_points[0], }, diff --git a/src/prelaunch_data_generator/el_cl_genesis/el_cl_genesis_generator.star b/src/prelaunch_data_generator/el_cl_genesis/el_cl_genesis_generator.star index 4216485f1..fbd6a479e 100644 --- a/src/prelaunch_data_generator/el_cl_genesis/el_cl_genesis_generator.star +++ b/src/prelaunch_data_generator/el_cl_genesis/el_cl_genesis_generator.star @@ -102,7 +102,7 @@ def new_env_file_for_el_cl_genesis_data( "SecondsPerSlot": network_params.seconds_per_slot, "PreregisteredValidatorKeysMnemonic": network_params.preregistered_validator_keys_mnemonic, "NumValidatorKeysToPreregister": total_num_validator_keys_to_preregister, - "GenesisDelay": network_params.genesis_delay, + "GenesisDelay": 0, # This delay is already precaculated in the final_genesis_timestamp "GenesisGasLimit": network_params.genesis_gaslimit, "MaxPerEpochActivationChurnLimit": network_params.max_per_epoch_activation_churn_limit, "ChurnLimitQuotient": network_params.churn_limit_quotient, From 67bc1cb2b81d009656bc8ba12b1a5162b0b51fbf Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Wed, 30 Oct 2024 11:56:47 +0100 Subject: [PATCH 15/17] add electra fork to mev relay --- src/mev/flashbots/mev_relay/mev_relay_launcher.star | 1 + src/package_io/sanity_check.star | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/mev/flashbots/mev_relay/mev_relay_launcher.star b/src/mev/flashbots/mev_relay/mev_relay_launcher.star index 5b2e6a32c..26dc15e57 100644 --- a/src/mev/flashbots/mev_relay/mev_relay_launcher.star +++ b/src/mev/flashbots/mev_relay/mev_relay_launcher.star @@ -82,6 +82,7 @@ def launch_mev_relay( "BELLATRIX_FORK_VERSION": constants.BELLATRIX_FORK_VERSION, "CAPELLA_FORK_VERSION": constants.CAPELLA_FORK_VERSION, "DENEB_FORK_VERSION": constants.DENEB_FORK_VERSION, + "ELECTRA_FORK_VERSION": constants.ELECTRA_FORK_VERSION, "GENESIS_VALIDATORS_ROOT": validator_root, "SEC_PER_SLOT": str(seconds_per_slot), "LOG_LEVEL": "debug", diff --git a/src/package_io/sanity_check.star b/src/package_io/sanity_check.star index e95624a8d..0dbae3637 100644 --- a/src/package_io/sanity_check.star +++ b/src/package_io/sanity_check.star @@ -106,6 +106,7 @@ PARTICIPANT_MATRIX_PARAMS = { "vc_max_cpu", "vc_min_mem", "vc_max_mem", + "validator_count", ], "vc": [ "vc_type", @@ -120,6 +121,7 @@ PARTICIPANT_MATRIX_PARAMS = { "vc_max_cpu", "vc_min_mem", "vc_max_mem", + "validator_count", ], "remote_signer": [ "remote_signer_type", From 96a4459c3dce453c6ab25f0612ec89637442bc19 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Fri, 1 Nov 2024 13:11:28 +0100 Subject: [PATCH 16/17] update tests --- .github/tests/mev-pectra.yaml | 13 +++++++++++++ .github/tests/mev-rbuilder.yaml | 10 ---------- .github/tests/mev.yaml | 6 ++---- 3 files changed, 15 insertions(+), 14 deletions(-) create mode 100644 .github/tests/mev-pectra.yaml delete mode 100644 .github/tests/mev-rbuilder.yaml diff --git a/.github/tests/mev-pectra.yaml b/.github/tests/mev-pectra.yaml new file mode 100644 index 000000000..820ac0288 --- /dev/null +++ b/.github/tests/mev-pectra.yaml @@ -0,0 +1,13 @@ +participants: + - el_type: reth + cl_type: teku +additional_services: + - dora + - tx_spammer +mev_type: flashbots + +mev_params: + mev_relay_image: jtraglia/mev-boost-relay:electra + mev_boost_image: jtraglia/mev-boost:electra + mev_builder_image: ethpandaops/rbuilder:develop-1b578f5 + mev_builder_cl_image: ethpandaops/lighthouse:pawan-electra-alpha7-0dd215c diff --git a/.github/tests/mev-rbuilder.yaml b/.github/tests/mev-rbuilder.yaml deleted file mode 100644 index 3a19fafba..000000000 --- a/.github/tests/mev-rbuilder.yaml +++ /dev/null @@ -1,10 +0,0 @@ -participants: - - el_type: reth - cl_type: teku -additional_services: - - dora - - tx_spammer -mev_type: flashbots - -mev_params: - mev_relay_image: flashbots/mev-boost-relay diff --git a/.github/tests/mev.yaml b/.github/tests/mev.yaml index 74bde2e6f..e3331ff0f 100644 --- a/.github/tests/mev.yaml +++ b/.github/tests/mev.yaml @@ -6,11 +6,9 @@ additional_services: - tx_spammer - blob_spammer - custom_flood - - el_forkmon + - goomy_blob - beacon_metrics_gazer - dora - prometheus_grafana -mev_params: - mev_relay_image: flashbots/mev-boost-relay:latest network_params: - seconds_per_slot: 3 + seconds_per_slot: 6 From 66335e137073ee9d8ca912a08e98882d00de4218 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Fri, 1 Nov 2024 13:12:43 +0100 Subject: [PATCH 17/17] update tests --- .github/tests/mev-pectra.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/tests/mev-pectra.yaml b/.github/tests/mev-pectra.yaml index 820ac0288..f78356f99 100644 --- a/.github/tests/mev-pectra.yaml +++ b/.github/tests/mev-pectra.yaml @@ -11,3 +11,6 @@ mev_params: mev_boost_image: jtraglia/mev-boost:electra mev_builder_image: ethpandaops/rbuilder:develop-1b578f5 mev_builder_cl_image: ethpandaops/lighthouse:pawan-electra-alpha7-0dd215c + +network_params: + electra_fork_epoch: 1