From 51470a6e2e5b9ad7029c6a8e32b6758ad6f9dcc0 Mon Sep 17 00:00:00 2001 From: ltitanb <163874448+ltitanb@users.noreply.github.com> Date: Thu, 17 Oct 2024 10:22:54 +0100 Subject: [PATCH 1/7] chore: merge commit ebbbe83 from upstream --- .github/tests/mev-commit-boost.yaml | 17 +++ main.star | 33 ++++- .../mev_boost/mev_boost_context.star | 11 ++ .../mev_boost/mev_boost_launcher.star | 119 ++++++++++++++++++ src/package_io/constants.star | 2 + src/package_io/input_parser.star | 17 ++- src/static_files/static_files.star | 4 + .../mev/commit-boost/cb-config.toml.tmpl | 14 +++ 8 files changed, 214 insertions(+), 3 deletions(-) create mode 100644 .github/tests/mev-commit-boost.yaml create mode 100644 src/mev/commit-boost/mev_boost/mev_boost_context.star create mode 100644 src/mev/commit-boost/mev_boost/mev_boost_launcher.star create mode 100644 static_files/mev/commit-boost/cb-config.toml.tmpl diff --git a/.github/tests/mev-commit-boost.yaml b/.github/tests/mev-commit-boost.yaml new file mode 100644 index 000000000..249624fb5 --- /dev/null +++ b/.github/tests/mev-commit-boost.yaml @@ -0,0 +1,17 @@ +participants: + - el_type: geth + cl_type: lighthouse +mev_type: commit-boost +additional_services: + - tx_spammer + - blob_spammer + - custom_flood + - el_forkmon + - beacon_metrics_gazer + - dora + - prometheus_grafana +mev_params: + mev_boost_image: ghcr.io/commit-boost/pbs:latest + mev_relay_image: flashbots/mev-boost-relay:latest +network_params: + seconds_per_slot: 3 diff --git a/main.star b/main.star index 2274dbe7c..460e101b2 100644 --- a/main.star +++ b/main.star @@ -33,6 +33,9 @@ full_beaconchain_explorer = import_module( blockscout = import_module("./src/blockscout/blockscout_launcher.star") prometheus = import_module("./src/prometheus/prometheus_launcher.star") grafana = import_module("./src/grafana/grafana_launcher.star") +commit_boost_mev_boost = import_module( + "./src/mev/commit-boost/mev_boost/mev_boost_launcher.star" +) mev_rs_mev_boost = import_module("./src/mev/mev-rs/mev_boost/mev_boost_launcher.star") mev_rs_mev_relay = import_module("./src/mev/mev-rs/mev_relay/mev_relay_launcher.star") mev_rs_mev_builder = import_module( @@ -259,6 +262,7 @@ def run(plan, args={}): elif args_with_right_defaults.mev_type and ( 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 ): builder_uri = "http://{0}:{1}".format( all_el_contexts[-1].ip_addr, all_el_contexts[-1].rpc_port_num @@ -292,7 +296,10 @@ def run(plan, args={}): timeout="20m", service_name=first_client_beacon_name, ) - if args_with_right_defaults.mev_type == constants.FLASHBOTS_MEV_TYPE: + if ( + args_with_right_defaults.mev_type == constants.FLASHBOTS_MEV_TYPE + or args_with_right_defaults.mev_type == constants.COMMIT_BOOST_MEV_TYPE + ): endpoint = flashbots_mev_relay.launch_mev_relay( plan, mev_params, @@ -396,6 +403,30 @@ def run(plan, args={}): el_cl_data_files_artifact_uuid, global_node_selectors, ) + elif ( + args_with_right_defaults.mev_type == constants.COMMIT_BOOST_MEV_TYPE + ): + plan.print("Launching commit-boost PBS service") + mev_boost_launcher = commit_boost_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_str, + participant.cl_type, + participant.el_type, + ) + mev_boost_context = commit_boost_mev_boost.launch( + plan, + mev_boost_launcher, + mev_boost_service_name, + network_params.network, + mev_params, + mev_endpoints, + el_cl_data_files_artifact_uuid, + global_node_selectors, + ) else: fail("Invalid MEV type") all_mevboost_contexts.append(mev_boost_context) diff --git a/src/mev/commit-boost/mev_boost/mev_boost_context.star b/src/mev/commit-boost/mev_boost/mev_boost_context.star new file mode 100644 index 000000000..1d6cb6c1d --- /dev/null +++ b/src/mev/commit-boost/mev_boost/mev_boost_context.star @@ -0,0 +1,11 @@ +def new_mev_boost_context(private_ip_address, port): + return struct( + private_ip_address=private_ip_address, + port=port, + ) + + +def mev_boost_endpoint(mev_boost_context): + return "http://{0}:{1}".format( + mev_boost_context.private_ip_address, mev_boost_context.port + ) diff --git a/src/mev/commit-boost/mev_boost/mev_boost_launcher.star b/src/mev/commit-boost/mev_boost/mev_boost_launcher.star new file mode 100644 index 000000000..5b67a5dd0 --- /dev/null +++ b/src/mev/commit-boost/mev_boost/mev_boost_launcher.star @@ -0,0 +1,119 @@ +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") +static_files = import_module("../../../static_files/static_files.star") +constants = import_module("../../../package_io/constants.star") + +CB_CONFIG_FILENAME = "cb-config.toml" +CB_CONFIG_MOUNT_DIRPATH_ON_SERVICE = "/config" +CB_CONFIG_FILES_ARTIFACT_NAME = "commit-boost-config" + +USED_PORTS = { + "http": shared_utils.new_port_spec( + input_parser.MEV_BOOST_PORT, shared_utils.TCP_PROTOCOL + ) +} + +# The min/max CPU/memory that mev-boost can use +MIN_CPU = 10 +MAX_CPU = 500 +MIN_MEMORY = 16 +MAX_MEMORY = 256 + + +def launch( + plan, + mev_boost_launcher, + service_name, + network, + mev_params, + relays, + el_cl_genesis_data, + global_node_selectors, +): + network = ( + network + if network in constants.PUBLIC_NETWORKS + else constants.GENESIS_CONFIG_MOUNT_PATH_ON_CONTAINER + "/config.yaml" + ) + + image = mev_params.mev_boost_image + template_data = new_config_template_data( + network, + input_parser.MEV_BOOST_PORT, + relays, + ) + + mev_rs_boost_config_template = read_file(static_files.COMMIT_BOOST_CONFIG_FILEPATH) + + template_and_data = shared_utils.new_template_and_data( + mev_rs_boost_config_template, template_data + ) + + template_and_data_by_rel_dest_filepath = {} + template_and_data_by_rel_dest_filepath[CB_CONFIG_FILENAME] = template_and_data + + config_files_artifact_name = plan.render_templates( + template_and_data_by_rel_dest_filepath, + CB_CONFIG_FILES_ARTIFACT_NAME + service_name, + ) + + config_file_path = shared_utils.path_join( + CB_CONFIG_MOUNT_DIRPATH_ON_SERVICE, CB_CONFIG_FILENAME + ) + + config = get_config( + mev_boost_launcher, + image, + config_file_path, + config_files_artifact_name, + el_cl_genesis_data, + global_node_selectors, + ) + + mev_boost_service = plan.add_service(service_name, config) + + return mev_boost_context_module.new_mev_boost_context( + mev_boost_service.ip_address, input_parser.MEV_BOOST_PORT + ) + + +def get_config( + mev_boost_launcher, + image, + config_file_path, + config_file, + el_cl_genesis_data, + node_selectors, +): + return ServiceConfig( + image=image, + ports=USED_PORTS, + cmd=[], + env_vars={ + "CB_CONFIG": config_file_path, + }, + files={ + CB_CONFIG_MOUNT_DIRPATH_ON_SERVICE: config_file, + constants.GENESIS_DATA_MOUNTPOINT_ON_CLIENTS: el_cl_genesis_data, + }, + min_cpu=MIN_CPU, + max_cpu=MAX_CPU, + min_memory=MIN_MEMORY, + max_memory=MAX_MEMORY, + node_selectors=node_selectors, + ) + + +def new_mev_boost_launcher(should_check_relay, relay_end_points): + return struct( + should_check_relay=should_check_relay, relay_end_points=relay_end_points + ) + + +def new_config_template_data(network, port, relays): + return { + "Network": network, + "Port": port, + "Relays": relays, + } diff --git a/src/package_io/constants.star b/src/package_io/constants.star index 741317a78..ec0e8ae16 100644 --- a/src/package_io/constants.star +++ b/src/package_io/constants.star @@ -83,6 +83,7 @@ KEYMANAGER_MOUNT_PATH_ON_CONTAINER = ( MOCK_MEV_TYPE = "mock" FLASHBOTS_MEV_TYPE = "flashbots" MEV_RS_MEV_TYPE = "mev-rs" +COMMIT_BOOST_MEV_TYPE = "commit-boost" DEFAULT_SNOOPER_IMAGE = "ethpandaops/rpc-snooper:latest" DEFAULT_FLASHBOTS_RELAY_IMAGE = "flashbots/mev-boost-relay:0.27" @@ -90,6 +91,7 @@ DEFAULT_FLASHBOTS_BUILDER_IMAGE = "flashbots/builder: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" +DEFAULT_COMMIT_BOOST_MEV_BOOST_IMAGE = "ghcr.io/commit-boost/pbs:latest" DEFAULT_MEV_PUBKEY = "0xa55c1285d84ba83a5ad26420cd5ad3091e49c55a813eee651cd467db38a8c8e63192f47955e9376f6b42f6d190571cb5" DEFAULT_MEV_SECRET_KEY = ( "0x607a11b45a7219cc61a3d9c5fd08c7eebd602a6a19a977f8d3771d5711a550f2" diff --git a/src/package_io/input_parser.star b/src/package_io/input_parser.star index 48ab4a190..59c2b3a3c 100644 --- a/src/package_io/input_parser.star +++ b/src/package_io/input_parser.star @@ -177,6 +177,7 @@ def input_parser(plan, input_args): constants.MOCK_MEV_TYPE, constants.FLASHBOTS_MEV_TYPE, constants.MEV_RS_MEV_TYPE, + constants.COMMIT_BOOST_MEV_TYPE, ): result = enrich_mev_extra_params( result, @@ -188,7 +189,7 @@ def input_parser(plan, input_args): pass else: fail( - "Unsupported MEV type: {0}, please use 'mock', 'flashbots' or 'mev-rs' type".format( + "Unsupported MEV type: {0}, please use 'mock', 'flashbots', 'mev-rs' or 'commit-boost' type".format( result.get("mev_type") ) ) @@ -978,6 +979,15 @@ def get_default_mev_params(mev_type, preset): mev_builder_extra_data = "0x68656C6C6F20776F726C640A" # "hello world\n" mev_builder_extra_args = ["--mev-builder-config=" + "/config/config.toml"] + if mev_type == constants.COMMIT_BOOST_MEV_TYPE: + mev_relay_image = constants.DEFAULT_FLASHBOTS_RELAY_IMAGE + mev_builder_image = constants.DEFAULT_FLASHBOTS_BUILDER_IMAGE + mev_boost_image = constants.DEFAULT_COMMIT_BOOST_MEV_BOOST_IMAGE + mev_builder_cl_image = DEFAULT_CL_IMAGES[constants.CL_TYPE.lighthouse] + mev_builder_extra_data = ( + "0x436f6d6d69742d426f6f737420f09f93bb" # Commit-Boost 📻 + ) + return { "mev_relay_image": mev_relay_image, "mev_builder_image": mev_builder_image, @@ -1143,7 +1153,10 @@ def enrich_mev_extra_params(parsed_arguments_dict, mev_prefix, mev_port, mev_typ index_str = shared_utils.zfill_custom( num_participants + 1, len(str(num_participants + 1)) ) - if mev_type == constants.FLASHBOTS_MEV_TYPE: + if ( + mev_type == constants.FLASHBOTS_MEV_TYPE + or mev_type == constants.COMMIT_BOOST_MEV_TYPE + ): mev_participant = default_participant() mev_participant["el_type"] = "geth-builder" mev_participant.update( diff --git a/src/static_files/static_files.star b/src/static_files/static_files.star index b05031d71..2a4248a5f 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" ) + +COMMIT_BOOST_CONFIG_FILEPATH = ( + STATIC_FILES_DIRPATH + "/mev/commit-boost/cb-config.toml.tmpl" +) diff --git a/static_files/mev/commit-boost/cb-config.toml.tmpl b/static_files/mev/commit-boost/cb-config.toml.tmpl new file mode 100644 index 000000000..fdb6cb2eb --- /dev/null +++ b/static_files/mev/commit-boost/cb-config.toml.tmpl @@ -0,0 +1,14 @@ +chain = "{{ .Network }}" + +[pbs] +port = {{ .Port }} + +{{ range $index, $relay := .Relays }} +[[relays]] +id = "mev_relay_{{$index}}" +url = "{{ $relay }}" +{{- end }} + +[logs] +log_level = "debug" +max_log_files = 7 From b8335d4b5a7c7308de7f2be3dc79daebe5b78a26 Mon Sep 17 00:00:00 2001 From: nmjustinchan Date: Mon, 9 Dec 2024 18:48:12 +1100 Subject: [PATCH 2/7] debug: update mev image params and fix lighthouse --http-allow-sync-stalled error --- network_params.yaml | 8 ++++---- src/cl/lighthouse/lighthouse_launcher.star | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/network_params.yaml b/network_params.yaml index 08411b5ae..c72ded0d3 100644 --- a/network_params.yaml +++ b/network_params.yaml @@ -113,12 +113,12 @@ parallel_keystore_generation: false disable_peer_scoring: false grafana_additional_dashboards: [] persistent: false -mev_type: flashbots +mev_type: commit-boost mev_params: - mev_relay_image: ghcr.io/chainbound/bolt-relay:v0.2.1-alpha - mev_builder_image: ghcr.io/chainbound/bolt-builder:v0.2.1-alpha + mev_relay_image: flashbots/mev-boost-relay:latest + mev_builder_image: flashbots/builder:latest mev_builder_cl_image: sigp/lighthouse:latest - mev_boost_image: ghcr.io/chainbound/bolt-mev-boost:v0.2.1-alpha + mev_boost_image: ghcr.io/commit-boost/pbs:latest mev_boost_args: ["mev-boost", "--relay-check"] mev_relay_api_extra_args: [] mev_relay_housekeeper_extra_args: [] diff --git a/src/cl/lighthouse/lighthouse_launcher.star b/src/cl/lighthouse/lighthouse_launcher.star index 158763409..3350683de 100644 --- a/src/cl/lighthouse/lighthouse_launcher.star +++ b/src/cl/lighthouse/lighthouse_launcher.star @@ -285,7 +285,7 @@ def get_beacon_config( "--http", "--http-address=0.0.0.0", "--http-port={0}".format(BEACON_HTTP_PORT_NUM), - "--http-allow-sync-stalled", + # "--http-allow-sync-stalled", "--slots-per-restore-point={0}".format(32 if constants.ARCHIVE_MODE else 8192), # NOTE: This comes from: # https://github.com/sigp/lighthouse/blob/7c88f582d955537f7ffff9b2c879dcf5bf80ce13/scripts/local_testnet/beacon_node.sh From 4bc5319bb7f202862c5dc5ff1eebab47e63f610b Mon Sep 17 00:00:00 2001 From: mikhailUshakoff Date: Tue, 24 Dec 2024 23:07:44 +0000 Subject: [PATCH 3/7] Replace mev-boost withh bolt-mev-boost --- .github/tests/mev-commit-boost.yaml | 3 +- main.star | 139 ++++++++--- network_params.yaml | 7 +- src/mev/bolt_boost/bolt_boost_launcher.star | 138 +++++++++++ .../bolt_sidecar/bolt_sidecar_launcher.star | 99 ++++++++ src/mev/mev_boost/mev_boost_context.star | 11 + src/mev/mev_relay/helix_launcher.star | 218 ++++++++++++++++++ src/mev/mev_relay/mev_relay_launcher.star | 192 +++++++++++++++ src/package_io/constants.star | 2 +- src/package_io/input_parser.star | 11 +- src/package_io/sanity_check.star | 4 + src/static_files/static_files.star | 19 ++ .../cb-bolt-boost-config.toml.tmpl | 88 +++++++ .../helix-relay-config/config.yaml.tmpl | 51 ++++ .../network-config.yaml.tmpl | 35 +++ 15 files changed, 976 insertions(+), 41 deletions(-) create mode 100644 src/mev/bolt_boost/bolt_boost_launcher.star create mode 100644 src/mev/bolt_sidecar/bolt_sidecar_launcher.star create mode 100644 src/mev/mev_boost/mev_boost_context.star create mode 100644 src/mev/mev_relay/helix_launcher.star create mode 100644 src/mev/mev_relay/mev_relay_launcher.star create mode 100644 static_files/bolt-boost-config/cb-bolt-boost-config.toml.tmpl create mode 100644 static_files/helix-relay-config/config.yaml.tmpl create mode 100644 static_files/helix-relay-config/network-config.yaml.tmpl diff --git a/.github/tests/mev-commit-boost.yaml b/.github/tests/mev-commit-boost.yaml index 249624fb5..727e07d11 100644 --- a/.github/tests/mev-commit-boost.yaml +++ b/.github/tests/mev-commit-boost.yaml @@ -11,7 +11,8 @@ additional_services: - dora - prometheus_grafana mev_params: - mev_boost_image: ghcr.io/commit-boost/pbs:latest + #mev_boost_image: ghcr.io/commit-boost/pbs:latest + mev_boost_image: ghcr.io/chainbound/bolt-boost:v0.3.0-alpha mev_relay_image: flashbots/mev-boost-relay:latest network_params: seconds_per_slot: 3 diff --git a/main.star b/main.star index 460e101b2..752264c4b 100644 --- a/main.star +++ b/main.star @@ -36,6 +36,8 @@ grafana = import_module("./src/grafana/grafana_launcher.star") commit_boost_mev_boost = import_module( "./src/mev/commit-boost/mev_boost/mev_boost_launcher.star" ) +bolt_boost = import_module("./src/mev/bolt_boost/bolt_boost_launcher.star") +bolt_sidecar = import_module("./src/mev/bolt_sidecar/bolt_sidecar_launcher.star") mev_rs_mev_boost = import_module("./src/mev/mev-rs/mev_boost/mev_boost_launcher.star") mev_rs_mev_relay = import_module("./src/mev/mev-rs/mev_relay/mev_relay_launcher.star") mev_rs_mev_builder = import_module( @@ -47,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/mev_relay/helix_launcher.star") mock_mev = import_module("./src/mev/flashbots/mock_mev/mock_mev_launcher.star") mev_flood = import_module("./src/mev/flashbots/mev_flood/mev_flood_launcher.star") mev_custom_flood = import_module( @@ -296,32 +299,46 @@ def run(plan, args={}): timeout="20m", service_name=first_client_beacon_name, ) - if ( - args_with_right_defaults.mev_type == constants.FLASHBOTS_MEV_TYPE - or args_with_right_defaults.mev_type == constants.COMMIT_BOOST_MEV_TYPE - ): - endpoint = flashbots_mev_relay.launch_mev_relay( - plan, - mev_params, - network_id, - beacon_uris, - genesis_validators_root, - builder_uri, - network_params.seconds_per_slot, - persistent, - global_node_selectors, - ) - elif args_with_right_defaults.mev_type == constants.MEV_RS_MEV_TYPE: - endpoint, relay_ip_address, relay_port = mev_rs_mev_relay.launch_mev_relay( - plan, - mev_params, - network_params.network, - beacon_uri, - el_cl_data_files_artifact_uuid, - global_node_selectors, - ) - else: - fail("Invalid MEV type") + # if ( + # args_with_right_defaults.mev_type == constants.FLASHBOTS_MEV_TYPE + # or args_with_right_defaults.mev_type == constants.COMMIT_BOOST_MEV_TYPE + # ): + # endpoint = flashbots_mev_relay.launch_mev_relay( + # plan, + # mev_params, + # network_id, + # beacon_uris, + # genesis_validators_root, + # builder_uri, + # network_params.seconds_per_slot, + # persistent, + # global_node_selectors, + # ) + # elif args_with_right_defaults.mev_type == constants.MEV_RS_MEV_TYPE: + # endpoint, relay_ip_address, relay_port = mev_rs_mev_relay.launch_mev_relay( + # plan, + # mev_params, + # network_params.network, + # beacon_uri, + # el_cl_data_files_artifact_uuid, + # global_node_selectors, + # ) + # else: + # fail("Invalid MEV type") + + # Run helix relay + helix_endpoint = helix_relay.launch_helix_relay( + plan, + mev_params, + network_params, + beacon_uris, + genesis_validators_root, + builder_uri, + network_params.seconds_per_slot, + persistent, + final_genesis_timestamp, + global_node_selectors, + ) # Restart MEV builder plan.stop_service( @@ -342,7 +359,7 @@ def run(plan, args={}): contract_owner.private_key, normal_user.private_key, ) - mev_endpoints.append(endpoint) + mev_endpoints.append(helix_endpoint) mev_endpoint_names.append(args_with_right_defaults.mev_type) # spin up the mev boost contexts if some endpoints for relays have been passed @@ -358,6 +375,25 @@ def run(plan, args={}): ) ) if args_with_right_defaults.participants[index].validator_count != 0: + # Initialize the Bolt Sidecar configure if needed + bolt_sidecar_config = None + if mev_params.bolt_sidecar_image != None: + # NOTE: this is a stub missing the `"constraints_api_url"` entry + bolt_sidecar_config = { + "beacon_api_url": participant.cl_context.beacon_http_url, + "execution_api_url": "http://{0}:{1}".format( + participant.el_context.ip_addr, + participant.el_context.rpc_port_num, + ), + "engine_api_url": "http://{0}:{1}".format( + participant.el_context.ip_addr, + participant.el_context.engine_rpc_port_num + ), + "jwt_hex": raw_jwt_secret, + "metrics_port": bolt_sidecar.BOLT_SIDECAR_METRICS_PORT, + "validator_keystore_files_artifact_uuid": participant.cl_context.validator_keystore_files_artifact_uuid, + "participant_index": index, + } if ( args_with_right_defaults.mev_type == constants.FLASHBOTS_MEV_TYPE or args_with_right_defaults.mev_type == constants.MOCK_MEV_TYPE @@ -406,27 +442,58 @@ def run(plan, args={}): elif ( args_with_right_defaults.mev_type == constants.COMMIT_BOOST_MEV_TYPE ): - plan.print("Launching commit-boost PBS service") + plan.print("Launching bolt boost service") mev_boost_launcher = commit_boost_mev_boost.new_mev_boost_launcher( MEV_BOOST_SHOULD_CHECK_RELAY, mev_endpoints, ) - mev_boost_service_name = "{0}-{1}-{2}-{3}".format( + + bolt_boost_service_name = "{0}-{1}-{2}-{3}".format( input_parser.MEV_BOOST_SERVICE_NAME_PREFIX, index_str, participant.cl_type, participant.el_type, ) - mev_boost_context = commit_boost_mev_boost.launch( + relays_config = [{ + "id": "helix_relay", + "url": helix_endpoint, + }] + if bolt_sidecar_config != None: + bolt_sidecar_config["constraints_api_url"] = "http://{0}:{1}".format( + bolt_boost_service_name, input_parser.MEV_BOOST_PORT + ) + mev_boost_context = bolt_boost.launch( plan, - mev_boost_launcher, - mev_boost_service_name, - network_params.network, - mev_params, - mev_endpoints, - el_cl_data_files_artifact_uuid, + bolt_boost_service_name, + mev_params.bolt_boost_image, + relays_config, + bolt_sidecar_config, + network_params, + final_genesis_timestamp, global_node_selectors, ) + + # plan.print("Launching commit-boost PBS service") + # mev_boost_launcher = commit_boost_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_str, + # participant.cl_type, + # participant.el_type, + # ) + # mev_boost_context = commit_boost_mev_boost.launch( + # plan, + # mev_boost_launcher, + # mev_boost_service_name, + # network_params.network, + # mev_params, + # mev_endpoints, + # el_cl_data_files_artifact_uuid, + # global_node_selectors, + # ) else: fail("Invalid MEV type") all_mevboost_contexts.append(mev_boost_context) diff --git a/network_params.yaml b/network_params.yaml index c72ded0d3..cf12d51a4 100644 --- a/network_params.yaml +++ b/network_params.yaml @@ -118,7 +118,12 @@ mev_params: mev_relay_image: flashbots/mev-boost-relay:latest mev_builder_image: flashbots/builder:latest mev_builder_cl_image: sigp/lighthouse:latest - mev_boost_image: ghcr.io/commit-boost/pbs:latest + #mev_boost_image: ghcr.io/commit-boost/pbs:latest + mev_boost_image: ghcr.io/chainbound/bolt-boost:v0.3.0-alpha + bolt_sidecar_image: ghcr.io/chainbound/bolt-sidecar:v0.3.0-alpha + bolt_boost_image: ghcr.io/chainbound/bolt-boost:v0.3.0-alpha + helix_relay_image: ghcr.io/chainbound/helix:v0.3.0-alpha.rc2 + helix_relay_config_extension: {} mev_boost_args: ["mev-boost", "--relay-check"] mev_relay_api_extra_args: [] mev_relay_housekeeper_extra_args: [] diff --git a/src/mev/bolt_boost/bolt_boost_launcher.star b/src/mev/bolt_boost/bolt_boost_launcher.star new file mode 100644 index 000000000..4b1280a86 --- /dev/null +++ b/src/mev/bolt_boost/bolt_boost_launcher.star @@ -0,0 +1,138 @@ +shared_utils = import_module("../../shared_utils/shared_utils.star") +mev_boost_context_module = import_module("../mev_boost/mev_boost_context.star") +static_files = import_module("../../static_files/static_files.star") +constants = import_module("../../package_io/constants.star") +input_parser = import_module("../../package_io/input_parser.star") + +BOLT_BOOST_CONFIG_FILENAME="cb-bolt-config.toml" +BOLT_BOOST_CONFIG_MOUNT_DIRPATH_ON_SERVICE="/config" + +USED_PORTS = { + "api": shared_utils.new_port_spec( + input_parser.MEV_BOOST_PORT, "TCP", wait="5s" + ) +} + +# The min/max CPU/memory that mev-boost can use +MIN_CPU = 10 +MAX_CPU = 500 +MIN_MEMORY = 16 +MAX_MEMORY = 256 + + +def launch( + plan, + service_name, + bolt_boost_image, + relays_config, + bolt_sidecar_config, + network_params, + final_genesis_timestamp, + global_node_selectors, +): + plan.print(network_params) + config = get_bolt_boost_config( + plan, + bolt_boost_image, + relays_config, + bolt_sidecar_config, + network_params, + final_genesis_timestamp, + global_node_selectors, + ) + + bolt_boost_service = plan.add_service(service_name, config) + + return mev_boost_context_module.new_mev_boost_context( + bolt_boost_service.ip_address, bolt_boost_service.ports["api"].number + ) + + +def get_bolt_boost_config( + plan, + image, + relays_config, + bolt_sidecar_config, + network_params, + final_genesis_timestamp, + node_selectors, +): + # Read the template file for Bolt Boost configuration + bolt_boost_config_template = read_file( + static_files.BOLT_BOOST_CONFIG_TEMPLATE_FILEPATH + ) + + # Generate the data to be used in the Bolt Boost configuration, + # wrap them together in a struct + bolt_boost_config_template_data = new_bolt_boost_config_template_data( + image, + relays_config, + bolt_sidecar_config, + network_params, + final_genesis_timestamp, + ) + bolt_boost_config_template_and_data = shared_utils.new_template_and_data( + bolt_boost_config_template, bolt_boost_config_template_data + ) + + # Map the relative destination filepaths to the template/data pairs + template_and_data_by_rel_dest_filepath = {} + template_and_data_by_rel_dest_filepath[BOLT_BOOST_CONFIG_FILENAME] = bolt_boost_config_template_and_data + + # Render the templates to files in the artifact directory + config_files_artifact_name = plan.render_templates( + template_and_data_by_rel_dest_filepath + ) + + return ServiceConfig( + image=image, + ports=USED_PORTS, + files={ + BOLT_BOOST_CONFIG_MOUNT_DIRPATH_ON_SERVICE: config_files_artifact_name + }, + env_vars={ + "RUST_LOG": "debug", + "CB_CONFIG": shared_utils.path_join( + BOLT_BOOST_CONFIG_MOUNT_DIRPATH_ON_SERVICE, + BOLT_BOOST_CONFIG_FILENAME, + ) + }, + min_cpu=MIN_CPU, + max_cpu=MAX_CPU, + min_memory=MIN_MEMORY, + max_memory=MAX_MEMORY, + node_selectors=node_selectors, + ) + +def new_bolt_boost_config_template_data( + image, + relays_config, + bolt_sidecar_config, + network_params, + final_genesis_timestamp, +): + return { + "chain_config": { + "name": network_params.network.capitalize(), + "genesis_timestamp": final_genesis_timestamp, + "seconds_per_slot": network_params.seconds_per_slot, + "genesis_fork_version": constants.GENESIS_FORK_VERSION, + }, + "image": image, + "port": input_parser.MEV_BOOST_PORT, + "relays_config": [ + { + "id": relay_config["id"], + "url": relay_config["url"], + } for relay_config in relays_config + ], + "bolt_sidecar_config": { + "constraints_api_url": bolt_sidecar_config["constraints_api_url"], + "beacon_api_url": bolt_sidecar_config["beacon_api_url"], + "execution_api_url": bolt_sidecar_config["execution_api_url"], + "engine_api_url": bolt_sidecar_config["engine_api_url"], + "jwt_hex": bolt_sidecar_config["jwt_hex"], + "metrics_port": bolt_sidecar_config["metrics_port"], + "builder_proxy_port": input_parser.MEV_BOOST_PORT, + } + } \ No newline at end of file diff --git a/src/mev/bolt_sidecar/bolt_sidecar_launcher.star b/src/mev/bolt_sidecar/bolt_sidecar_launcher.star new file mode 100644 index 000000000..f6e309460 --- /dev/null +++ b/src/mev/bolt_sidecar/bolt_sidecar_launcher.star @@ -0,0 +1,99 @@ +redis_module = import_module("github.com/kurtosis-tech/redis-package/main.star") +postgres_module = import_module("github.com/kurtosis-tech/postgres-package/main.star") +constants = import_module("../../package_io/constants.star") +input_parser = import_module("../../package_io/input_parser.star") +validator_keystore_generator = import_module("../../prelaunch_data_generator/validator_keystores/validator_keystore_generator.star") + +BOLT_SIDECAR_COMMITMENTS_API_PORT = 9061 +BOLT_SIDECAR_METRICS_PORT = 9063 +BOLT_SIDECAR_KEYS_DIRMOUNT_PATH_ON_SERVICE = "/keys" + +# The min/max CPU/memory that bolt-sidecar can use +BOLT_SIDECAR_MIN_CPU = 100 +BOLT_SIDECAR_MAX_CPU = 1000 +BOLT_SIDECAR_MIN_MEMORY = 128 +BOLT_SIDECAR_MAX_MEMORY = 1024 + +def launch_bolt_sidecar( + plan, + image, + sidecar_config, + network_params, + node_selectors, +): + env_vars = { + "RUST_LOG": "bolt_sidecar=trace", + } + + node_keystore_path = validator_keystore_generator.NODE_KEYSTORES_OUTPUT_DIRPATH_FORMAT_STR.format(sidecar_config["participant_index"]) + full_keystore_path = "{0}{1}/keys".format(BOLT_SIDECAR_KEYS_DIRMOUNT_PATH_ON_SERVICE, node_keystore_path) + full_keystore_secrets_path = "{0}{1}/secrets".format(BOLT_SIDECAR_KEYS_DIRMOUNT_PATH_ON_SERVICE, node_keystore_path) + + api = plan.add_service( + name=sidecar_config["service_name"], + config=ServiceConfig( + image=image, + cmd=[ + "--port", + str(BOLT_SIDECAR_COMMITMENTS_API_PORT), + "--execution-api-url", + sidecar_config["execution_api_url"], + "--beacon-api-url", + sidecar_config["beacon_api_url"], + "--engine-api-url", + sidecar_config["engine_api_url"], + "--constraints-api-url", + sidecar_config["constraints_api_url"], + "--constraints-proxy-port", + str(input_parser.BOLT_SIDECAR_CONSTRAINTS_PROXY_PORT), + "--engine-jwt-hex", + sidecar_config["jwt_hex"], + "--fee-recipient", + "0x0000000000000000000000000000000000000000", + "--builder-private-key", # Random private key for testing + "0x20c815cb2d37561479c7b6cae9737356b144760d00f1387bff17df4a3712c262", + "--commitment-private-key", # Random private key for testing + "0x18d1c5302e734fd6fbfaa51828d42c4c6d3cbe020c42bab7dd15a2799cf00b82", + "--commitment-deadline", + str(100), + "--chain", + network_params.network, + "--slot-time", + str(network_params.seconds_per_slot), + # "--keystore-password", + # validator_keystore_generator.PRYSM_PASSWORD, + "--keystore-secrets-path", + full_keystore_secrets_path, + "--keystore-path", + full_keystore_path, + "--metrics-port", + str(BOLT_SIDECAR_METRICS_PORT), + ], + # + mev_params.mev_relay_api_extra_args, + ports={ + "api": PortSpec( + number=BOLT_SIDECAR_COMMITMENTS_API_PORT, transport_protocol="TCP" + ), + "bolt-sidecar": PortSpec( + number=input_parser.BOLT_SIDECAR_CONSTRAINTS_PROXY_PORT, transport_protocol="TCP" + ), + "metrics": PortSpec( + number=BOLT_SIDECAR_METRICS_PORT, transport_protocol="TCP" + ), + }, + files={ + BOLT_SIDECAR_KEYS_DIRMOUNT_PATH_ON_SERVICE: sidecar_config["validator_keystore_files_artifact_uuid"], + }, + env_vars=env_vars, + min_cpu=BOLT_SIDECAR_MIN_CPU, + max_cpu=BOLT_SIDECAR_MAX_CPU, + min_memory=BOLT_SIDECAR_MIN_MEMORY, + max_memory=BOLT_SIDECAR_MAX_MEMORY, + node_selectors=node_selectors, + ), + ) + + return struct( + ip_addr=api.ip_address, + metrics_port_num=BOLT_SIDECAR_METRICS_PORT, + ) \ No newline at end of file diff --git a/src/mev/mev_boost/mev_boost_context.star b/src/mev/mev_boost/mev_boost_context.star new file mode 100644 index 000000000..2cdeefbcf --- /dev/null +++ b/src/mev/mev_boost/mev_boost_context.star @@ -0,0 +1,11 @@ +def new_mev_boost_context(private_ip_address, port): + return struct( + private_ip_address=private_ip_address, + port=port, + ) + + +def mev_boost_endpoint(mev_boost_context): + return "http://{0}:{1}".format( + mev_boost_context.private_ip_address, mev_boost_context.port + ) \ No newline at end of file diff --git a/src/mev/mev_relay/helix_launcher.star b/src/mev/mev_relay/helix_launcher.star new file mode 100644 index 000000000..f0d321cb0 --- /dev/null +++ b/src/mev/mev_relay/helix_launcher.star @@ -0,0 +1,218 @@ +redis_module = import_module("github.com/kurtosis-tech/redis-package/main.star") +postgres_module = import_module("github.com/kurtosis-tech/postgres-package/main.star") +constants = import_module("../../package_io/constants.star") +shared_utils = import_module("../../shared_utils/shared_utils.star") +static_files = import_module("../../static_files/static_files.star") + +# Misc constants +SERVICE_NAME="helix-relay" +HELIX_CONFIG_FILENAME="helix-config.yaml" +HELIX_NETWORK_CONFIG_FILENAME = "network-config.yaml" +HELIX_CONFIG_MOUNT_DIRPATH_ON_SERVICE="/config" + +# The secret key and public key for the relay, exposed as environment variables +DUMMY_SECRET_KEY = "0x607a11b45a7219cc61a3d9c5fd08c7eebd602a6a19a977f8d3771d5711a550f2" +DUMMY_PUB_KEY = "0xa55c1285d84ba83a5ad26420cd5ad3091e49c55a813eee651cd467db38a8c8e63192f47955e9376f6b42f6d190571cb5" + +# This is currenlty hardcoded in the Helix relay +HELIX_RELAY_ENDPOINT_PORT = 4040 +HELIX_RELAY_WEBSITE_PORT = 8080 + +# The min/max CPU/memory that mev-relay can use +RELAY_MIN_CPU = 2000 # 2 cores +RELAY_MAX_CPU = 4000 # 2 cores +RELAY_MIN_MEMORY = 128 +RELAY_MAX_MEMORY = 1024 + +# The min/max CPU/memory that postgres can use +POSTGRES_MIN_CPU = 10 +POSTGRES_MAX_CPU = 1000 +POSTGRES_MIN_MEMORY = 32 +POSTGRES_MAX_MEMORY = 1024 + +# The min/max CPU/memory that redis can use +REDIS_MIN_CPU = 10 +REDIS_MAX_CPU = 1000 +REDIS_MIN_MEMORY = 16 +REDIS_MAX_MEMORY = 1024 + +def launch_helix_relay( + plan, + mev_params, + network_params, + beacon_uris, + validator_root, + builder_uri, + seconds_per_slot, + persistent, + genesis_timestamp, + global_node_selectors, +): + plan.print(network_params) + + node_selectors = global_node_selectors + + # Read the template files with Helix configuration and network configuration + helix_config_template = read_file( + static_files.HELIX_CONFIG_TEMPLATE_FILEPATH + ) + helix_network_config_template = read_file( + static_files.HELIX_NETWORK_CONFIG_TEMPLATE_FILEPATH + ) + + # Start both the Redis and Postgres services + redis = redis_module.run( + plan, + service_name="mev-relay-redis", + min_cpu=REDIS_MIN_CPU, + max_cpu=REDIS_MAX_CPU, + min_memory=REDIS_MIN_MEMORY, + max_memory=REDIS_MAX_MEMORY, + node_selectors=node_selectors, + ) + postgres = postgres_module.run( + plan, + # Postgres image with TimescaleDB extension: + # References: + # - https://docs.timescale.com/ + # - https://github.com/gattaca-com/helix/blob/9e078f1ec4710869b2e41e1ca20d31e1c7cfde52/crates/database/src/postgres/postgres_db_service_tests.rs#L41-L44 + image="timescale/timescaledb-ha:pg16", + password="postgres", + user="postgres", + database="helixdb", + service_name="helix-postgres", + persistent=persistent, + launch_adminer=True, + min_cpu=POSTGRES_MIN_CPU, + max_cpu=POSTGRES_MAX_CPU, + min_memory=POSTGRES_MIN_MEMORY, + max_memory=POSTGRES_MAX_MEMORY, + node_selectors=node_selectors, + ) + + image = mev_params.helix_relay_image + + # Convert beacon_uris from a comma-separated string to a list of URIs + beacon_uris = [uri.strip() for uri in beacon_uris.split(",")] + + network_config_dir_path_on_service = "{0}/{1}".format( + HELIX_CONFIG_MOUNT_DIRPATH_ON_SERVICE, HELIX_NETWORK_CONFIG_FILENAME + ) + + # See https://github.com/kurtosis-tech/postgres-package#use-this-package-in-your-package + # and https://docs.kurtosis.com/api-reference/starlark-reference/service/ + helix_config_template_data = new_config_template_data( + postgres.service.hostname, + postgres.port.number, + postgres.database, + postgres.user, + postgres.password, + redis.url, + builder_uri, + beacon_uris, + network_config_dir_path_on_service, + validator_root, + genesis_timestamp, + mev_params.helix_relay_config_extension, + ) + + helix_config_template_and_data = shared_utils.new_template_and_data( + helix_config_template, helix_config_template_data + ) + + helix_network_config_template_and_data = shared_utils.new_template_and_data( + helix_network_config_template, network_params + ) + template_and_data_by_rel_dest_filepath = {} + template_and_data_by_rel_dest_filepath[HELIX_CONFIG_FILENAME] = helix_config_template_and_data + template_and_data_by_rel_dest_filepath[HELIX_NETWORK_CONFIG_FILENAME] = helix_network_config_template_and_data + + config_files_artifact_name = plan.render_templates( + template_and_data_by_rel_dest_filepath + ) + + env_vars = { + "RELAY_KEY": DUMMY_SECRET_KEY, + "RUST_LOG": "helix_cmd=trace,helix_api=trace,helix_common=trace,helix_datastore=trace,helix_housekeeper=trace,helix_database=trace,helix_beacon_client=trace", + } + + helix = plan.add_service( + name=SERVICE_NAME, + config=ServiceConfig( + image=image, + files={ + HELIX_CONFIG_MOUNT_DIRPATH_ON_SERVICE: config_files_artifact_name + }, + cmd=[ + "--config", + shared_utils.path_join( + HELIX_CONFIG_MOUNT_DIRPATH_ON_SERVICE, + HELIX_CONFIG_FILENAME, + ) + ], + ports={ + "api": PortSpec( + number=HELIX_RELAY_ENDPOINT_PORT, transport_protocol="TCP" + ) + # "website": PortSpec( + # number=HELIX_RELAY_WEBSITE_PORT, transport_protocol="TCP" + # ) + }, + env_vars=env_vars, + min_cpu=RELAY_MIN_CPU, + max_cpu=RELAY_MAX_CPU, + min_memory=RELAY_MIN_MEMORY, + max_memory=RELAY_MAX_MEMORY, + node_selectors=node_selectors, + ), + ) + + plan.print(json.indent(json.encode(helix_config_template_data))) + + return "http://{0}@{1}:{2}".format( + DUMMY_PUB_KEY, helix.ip_address, HELIX_RELAY_ENDPOINT_PORT + ) + +def new_config_template_data( + postgres_hostname, + postgres_port, + postgres_db_name, + postgres_user, + postgres_password, + redis_url, + blocksim_url, + beacon_uris, + network_config_dir_path, + genesis_validator_root, + genesis_time, + config_extension, +): + config_hashmap = { + "postgres": { + "hostname": postgres_hostname, + "port": postgres_port, + "db_name": postgres_db_name, + "user": postgres_user, + "password": postgres_password, + }, + "redis": { + "url": redis_url, + }, + "simulator": { + "url": blocksim_url, + }, + "beacon_clients": [ + {"url": uri} for uri in beacon_uris + ], + "network_config": { + "dir_path": network_config_dir_path, + "genesis_validator_root": genesis_validator_root, + "genesis_time": genesis_time, + }, + } + + if config_extension != None: + for key, value in config_extension.items(): + config_hashmap[key] = value + + return config_hashmap \ No newline at end of file diff --git a/src/mev/mev_relay/mev_relay_launcher.star b/src/mev/mev_relay/mev_relay_launcher.star new file mode 100644 index 000000000..77e9a9d47 --- /dev/null +++ b/src/mev/mev_relay/mev_relay_launcher.star @@ -0,0 +1,192 @@ +redis_module = import_module("github.com/kurtosis-tech/redis-package/main.star") +postgres_module = import_module("github.com/kurtosis-tech/postgres-package/main.star") +constants = import_module("../../package_io/constants.star") + +DUMMY_SECRET_KEY = "0x607a11b45a7219cc61a3d9c5fd08c7eebd602a6a19a977f8d3771d5711a550f2" +DUMMY_PUB_KEY = "0xa55c1285d84ba83a5ad26420cd5ad3091e49c55a813eee651cd467db38a8c8e63192f47955e9376f6b42f6d190571cb5" + +MEV_RELAY_WEBSITE = "mev-relay-website" +MEV_RELAY_ENDPOINT = "mev-relay-api" +MEV_RELAY_HOUSEKEEPER = "mev-relay-housekeeper" + +MEV_RELAY_ENDPOINT_PORT = 9062 +MEV_RELAY_WEBSITE_PORT = 9060 + +NETWORK_ID_TO_NAME = { + "5": "goerli", + "11155111": "sepolia", + "3": "ropsten", +} + +LAUNCH_ADMINER = True + +# The min/max CPU/memory that mev-relay can use +RELAY_MIN_CPU = 100 +RELAY_MAX_CPU = 1000 +RELAY_MIN_MEMORY = 128 +RELAY_MAX_MEMORY = 1024 + +# The min/max CPU/memory that postgres can use +POSTGRES_MIN_CPU = 10 +POSTGRES_MAX_CPU = 1000 +POSTGRES_MIN_MEMORY = 32 +POSTGRES_MAX_MEMORY = 1024 + +# The min/max CPU/memory that redis can use +REDIS_MIN_CPU = 10 +REDIS_MAX_CPU = 1000 +REDIS_MIN_MEMORY = 16 +REDIS_MAX_MEMORY = 1024 + + +def launch_mev_relay( + plan, + mev_params, + network_id, + beacon_uris, + validator_root, + builder_uri, + seconds_per_slot, + persistent, + global_node_selectors, +): + node_selectors = global_node_selectors + redis = redis_module.run( + plan, + service_name="mev-relay-redis", + min_cpu=REDIS_MIN_CPU, + max_cpu=REDIS_MAX_CPU, + min_memory=REDIS_MIN_MEMORY, + max_memory=REDIS_MAX_MEMORY, + node_selectors=node_selectors, + ) + # making the password postgres as the relay expects it to be postgres + postgres = postgres_module.run( + plan, + password="postgres", + user="postgres", + database="postgres", + service_name="mev-relay-postgres", + persistent=persistent, + launch_adminer=LAUNCH_ADMINER, + min_cpu=POSTGRES_MIN_CPU, + max_cpu=POSTGRES_MAX_CPU, + min_memory=POSTGRES_MIN_MEMORY, + max_memory=POSTGRES_MAX_MEMORY, + node_selectors=node_selectors, + ) + + network_name = NETWORK_ID_TO_NAME.get(network_id, network_id) + + image = mev_params.mev_relay_image + + env_vars = { + "GENESIS_FORK_VERSION": constants.GENESIS_FORK_VERSION, + "BELLATRIX_FORK_VERSION": constants.BELLATRIX_FORK_VERSION, + "CAPELLA_FORK_VERSION": constants.CAPELLA_FORK_VERSION, + "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) + postgres_url = postgres.url + "?sslmode=disable" + plan.add_service( + name=MEV_RELAY_HOUSEKEEPER, + config=ServiceConfig( + image=image, + cmd=[ + "housekeeper", + "--network", + "custom", + "--db", + postgres_url, + "--redis-uri", + redis_url, + "--beacon-uris", + beacon_uris, + ] + + mev_params.mev_relay_housekeeper_extra_args, + env_vars=env_vars, + min_cpu=RELAY_MIN_CPU, + max_cpu=RELAY_MAX_CPU, + min_memory=RELAY_MIN_MEMORY, + max_memory=RELAY_MAX_MEMORY, + node_selectors=node_selectors, + ), + ) + + api = plan.add_service( + name=MEV_RELAY_ENDPOINT, + config=ServiceConfig( + image=image, + cmd=[ + "api", + "--network", + "custom", + "--db", + postgres_url, + "--secret-key", + DUMMY_SECRET_KEY, + "--listen-addr", + "0.0.0.0:{0}".format(MEV_RELAY_ENDPOINT_PORT), + "--redis-uri", + redis_url, + "--beacon-uris", + beacon_uris, + "--blocksim", + builder_uri, + ] + + mev_params.mev_relay_api_extra_args, + ports={ + "api": PortSpec( + number=MEV_RELAY_ENDPOINT_PORT, transport_protocol="TCP" + ) + }, + env_vars=env_vars, + min_cpu=RELAY_MIN_CPU, + max_cpu=RELAY_MAX_CPU, + min_memory=RELAY_MIN_MEMORY, + max_memory=RELAY_MAX_MEMORY, + node_selectors=node_selectors, + ), + ) + + plan.add_service( + name=MEV_RELAY_WEBSITE, + config=ServiceConfig( + image=image, + cmd=[ + "website", + "--network", + "custom", + "--db", + postgres_url, + "--listen-addr", + "0.0.0.0:{0}".format(MEV_RELAY_WEBSITE_PORT), + "--redis-uri", + redis_url, + "https://{0}@{1}".format(DUMMY_PUB_KEY, MEV_RELAY_ENDPOINT), + ] + + mev_params.mev_relay_website_extra_args, + ports={ + "api": PortSpec( + number=MEV_RELAY_WEBSITE_PORT, + transport_protocol="TCP", + application_protocol="http", + ) + }, + env_vars=env_vars, + min_cpu=RELAY_MIN_CPU, + max_cpu=RELAY_MAX_CPU, + min_memory=RELAY_MIN_MEMORY, + max_memory=RELAY_MAX_MEMORY, + node_selectors=node_selectors, + ), + ) + + return "http://{0}@{1}:{2}".format( + DUMMY_PUB_KEY, api.ip_address, MEV_RELAY_ENDPOINT_PORT + ) \ No newline at end of file diff --git a/src/package_io/constants.star b/src/package_io/constants.star index ec0e8ae16..31b2410a3 100644 --- a/src/package_io/constants.star +++ b/src/package_io/constants.star @@ -91,7 +91,7 @@ DEFAULT_FLASHBOTS_BUILDER_IMAGE = "flashbots/builder: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" -DEFAULT_COMMIT_BOOST_MEV_BOOST_IMAGE = "ghcr.io/commit-boost/pbs:latest" +DEFAULT_COMMIT_BOOST_MEV_BOOST_IMAGE = "chainbound/bolt-boost:v0.3.0-alpha" DEFAULT_MEV_PUBKEY = "0xa55c1285d84ba83a5ad26420cd5ad3091e49c55a813eee651cd467db38a8c8e63192f47955e9376f6b42f6d190571cb5" DEFAULT_MEV_SECRET_KEY = ( "0x607a11b45a7219cc61a3d9c5fd08c7eebd602a6a19a977f8d3771d5711a550f2" diff --git a/src/package_io/input_parser.star b/src/package_io/input_parser.star index 59c2b3a3c..c4722f8a5 100644 --- a/src/package_io/input_parser.star +++ b/src/package_io/input_parser.star @@ -59,6 +59,9 @@ HIGH_DENEB_VALUE_FORK_VERKLE = 2000000000 # MEV Params MEV_BOOST_PORT = 18550 MEV_BOOST_SERVICE_NAME_PREFIX = "mev-boost" +BOLT_SIDECAR_CONSTRAINTS_PROXY_PORT = 18551 +BOLT_BOOST_SERVICE_NAME_PREFIX = "bolt-boost" +BOLT_SIDECAR_SERVICE_NAME_PREFIX = "bolt-sidecar" # Minimum number of validators required for a network to be valid is 64 MIN_VALIDATORS = 4 @@ -189,8 +192,8 @@ def input_parser(plan, input_args): pass else: fail( - "Unsupported MEV type: {0}, please use 'mock', 'flashbots', 'mev-rs' or 'commit-boost' type".format( - result.get("mev_type") + "Unsupported MEV type: {0}, -{1}- please use 'mock', 'flashbots', 'mev-rs' or 'commit-boost' type".format( + result.get("mev_type"), constants.COMMIT_BOOST_MEV_TYPE ) ) @@ -324,6 +327,10 @@ def input_parser(plan, input_args): mev_flood_seconds_per_bundle=result["mev_params"][ "mev_flood_seconds_per_bundle" ], + bolt_sidecar_image=result["mev_params"]["bolt_sidecar_image"], + bolt_boost_image=result["mev_params"]["bolt_boost_image"], + helix_relay_image=result["mev_params"]["helix_relay_image"], + helix_relay_config_extension=result["mev_params"]["helix_relay_config_extension"], ) if result["mev_params"] else None, diff --git a/src/package_io/sanity_check.star b/src/package_io/sanity_check.star index 8f4d36425..b7cdfc690 100644 --- a/src/package_io/sanity_check.star +++ b/src/package_io/sanity_check.star @@ -183,6 +183,10 @@ SUBCATEGORY_PARAMS = { "mev_flood_extra_args", "mev_flood_seconds_per_bundle", "custom_flood_params", + "bolt_sidecar_image", + "bolt_boost_image", + "helix_relay_image", + "helix_relay_config_extension", ], "taiko_params": [ "taiko_deploy_image", diff --git a/src/static_files/static_files.star b/src/static_files/static_files.star index 2a4248a5f..54e3e0c33 100644 --- a/src/static_files/static_files.star +++ b/src/static_files/static_files.star @@ -100,3 +100,22 @@ MEV_RS_MEV_BUILDER_CONFIG_FILEPATH = ( COMMIT_BOOST_CONFIG_FILEPATH = ( STATIC_FILES_DIRPATH + "/mev/commit-boost/cb-config.toml.tmpl" ) + +# helix config +HELIX_CONFIG_DIRPATH = "/helix-relay-config" +HELIX_CONFIG_FULL_DIRPATH = ( + STATIC_FILES_DIRPATH + HELIX_CONFIG_DIRPATH +) +HELIX_CONFIG_TEMPLATE_FILEPATH = ( + STATIC_FILES_DIRPATH + HELIX_CONFIG_DIRPATH + "/config.yaml.tmpl" +) +HELIX_NETWORK_CONFIG_TEMPLATE_FILEPATH=HELIX_CONFIG_FULL_DIRPATH + "/network-config.yaml.tmpl" + +# bolt-boost config +BOLT_BOOST_CONFIG_DIRPATH = "/bolt-boost-config" +BOLT_BOOST_CONFIG_FULL_DIRPATH = ( + STATIC_FILES_DIRPATH + BOLT_BOOST_CONFIG_DIRPATH +) +BOLT_BOOST_CONFIG_TEMPLATE_FILEPATH = ( + STATIC_FILES_DIRPATH + BOLT_BOOST_CONFIG_DIRPATH + "/cb-bolt-boost-config.toml.tmpl" +) diff --git a/static_files/bolt-boost-config/cb-bolt-boost-config.toml.tmpl b/static_files/bolt-boost-config/cb-bolt-boost-config.toml.tmpl new file mode 100644 index 000000000..d9a6c4afa --- /dev/null +++ b/static_files/bolt-boost-config/cb-bolt-boost-config.toml.tmpl @@ -0,0 +1,88 @@ +# The main configuration file for the Commit-Boost sidecar. +# Some fields are optional and can be omitted, in which case the default value, if present, will be used. + +# Chain spec id. Supported values: Mainnet, Holesky, Helder, Custom +{{- if eq .chain_config.name "Kurtosis" }} +[chain] +genesis_time_secs = {{ .chain_config.genesis_timestamp }} +slot_time_secs = {{ .chain_config.seconds_per_slot }} +genesis_fork_version = "{{ .chain_config.genesis_fork_version }}" +{{- else }} +chain = "{{ .chain_config.name }}" +{{- end }} + +# Configuration for the PBS module +[pbs] +# Docker image to use for the PBS module. +# BOLT: We use the bolt-boost PBS module here. +docker_image = "{{ .image }}" + +# Whether to enable the PBS module to request signatures from the Signer module (not used in the default PBS image) +# OPTIONAL, DEFAULT: false +with_signer = {{ or .with_signer false }} + +# Port to receive BuilderAPI calls from beacon node +port = {{ .port }} + +# Whether to forward `status` calls to relays or skip and return 200 +# OPTIONAL, DEFAULT: true +relay_check = {{ or .relay_check true }} + +# Timeout in milliseconds for the `get_header` call to relays. Note that the CL has also a timeout (e.g. 1 second) so +# this should be lower than that, leaving some margin for overhead +# OPTIONAL, DEFAULT: 950 +timeout_get_header_ms = {{ or .timeout_get_header_ms "950" }} + +# Timeout in milliseconds for the `submit_blinded_block` call to relays. +# OPTIONAL, DEFAULT: 4000 +timeout_get_payload_ms = {{ or .timeout_get_payload_ms "4000" }} + +# Timeout in milliseconds for the `register_validator` call to relays. +# OPTIONAL, DEFAULT: 3000 +timeout_register_validator_ms = {{ or .timeout_register_validator_ms "3000" }} + +# Whether to skip signature verification of headers against the relay pubkey +# OPTIONAL, DEFAULT: false +skip_sigverify = {{ or .skip_sigverify false }} + +# Minimum bid in ETH that will be accepted from `get_header` +# OPTIONAL, DEFAULT: 0.0 +min_bid_eth = {{ or .min_bid_eth "0.0" }} + +# List of URLs of relay monitors to send registrations to +# OPTIONAL +relay_monitors = [] + +# How late in milliseconds in the slot is "late". This impacts the `get_header` requests, by shortening timeouts for `get_header` calls to +# relays and make sure a header is returned within this deadline. If the request from the CL comes later in the slot, then fetching headers is skipped +# to force local building and minimizing the risk of missed slots. +# OPTIONAL, DEFAULT: 2000 +late_in_slot_time_ms = {{ or .late_in_slot_time_ms "2000" }} + +# The PBS module needs one or more [[relays]] as defined below. +{{ range $relay_config := .relays_config }} +[[relays]] +# Relay ID to use in telemetry +# OPTIONAL, DEFAULT: URL hostname +id = "{{ $relay_config.id }}" + +# Relay URL in the format scheme://pubkey@host +url = "{{ $relay_config.url }}" + +# Headers to send with each request for this relay +# OPTIONAL +# headers = {{ or $relay_config.headers "{}" }} + +# Whether to enable timing games, as tuned by `target_first_request_ms` and `frequency_get_header_ms`. +# OPTIONAL, DEFAULT: false +enable_timing_games = {{ or $relay_config.enable_timing_games false }} + +# Target time in slot when to send the first header request +# OPTIONAL +target_first_request_ms = {{ or $relay_config.target_first_request_ms "200" }} + +# Frequency in ms to send get_header requests +# OPTIONAL +frequency_get_header_ms = {{ or .frequency_get_header_ms "300" }} + +{{ end }} \ No newline at end of file diff --git a/static_files/helix-relay-config/config.yaml.tmpl b/static_files/helix-relay-config/config.yaml.tmpl new file mode 100644 index 000000000..3a3991f31 --- /dev/null +++ b/static_files/helix-relay-config/config.yaml.tmpl @@ -0,0 +1,51 @@ +postgres: + hostname: {{ .postgres.hostname }} + port: {{ .postgres.port }} + db_name: {{ .postgres.db_name }} + user: {{ .postgres.user }} + password: {{ .postgres.password }} + region: 0 + region_name: "bolt" + +redis: + url: {{ .redis.url }} + +simulator: + url: {{ .simulator.url }} + +beacon_clients: + {{ range $bcConfig := .beacon_clients }} + - url: "{{ $bcConfig.url }}" + {{- end }} + +builders: + # Reference: https://github.com/chainbound/bolt-builder/blob/main/cmd/utils/flags.go#L691-L691 + - pub_key: "aa1488eae4b06a1fff840a2b6db167afc520758dc2c8af0dfb57037954df3431b747e2f900fe8805f05d635e9a29717b" + builder_info: + collateral: "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" + is_optimistic: false + builder_id: "Bolt Builder" + +{{- if .constraints_api_config }} +constraints_api_config: + check_constraints_signature: {{ .constraints_api_config.check_constraints_signature }} + max_block_value_to_verify_wei: {{ .constraints_api_config.max_block_value_to_verify_wei }} +{{- end }} + +network_config: + !Custom # this is a custom enum type and requies a '!' + dir_path: {{ .network_config.dir_path }} + genesis_validator_root: {{ .network_config.genesis_validator_root }} + genesis_time: {{ .network_config.genesis_time }} + +# If empty, all routes are enabled +router_config: + enabled_routes: [] + +website: + enabled: true + port: 8080 + listen_address: "0.0.0.0" + network_name: "kurtosis" + relay_url: http://0xa55c1285d84ba83a5ad26420cd5ad3091e49c55a813eee651cd467db38a8c8e63192f47955e9376f6b42f6d190571cb5@helix-relay:4040 + relay_pubkey: 0xa55c1285d84ba83a5ad26420cd5ad3091e49c55a813eee651cd467db38a8c8e63192f47955e9376f6b42f6d190571cb5 \ No newline at end of file diff --git a/static_files/helix-relay-config/network-config.yaml.tmpl b/static_files/helix-relay-config/network-config.yaml.tmpl new file mode 100644 index 000000000..418fc1ecb --- /dev/null +++ b/static_files/helix-relay-config/network-config.yaml.tmpl @@ -0,0 +1,35 @@ +# The preset for the network configuration. +# Needed for `NetworkConfig` inside Helix + +PRESET_BASE: {{ .preset }} +CONFIG_NAME: "mainnet" +TERMINAL_TOTAL_DIFFICULTY: 0 +TERMINAL_BLOCK_HASH: "0x0000000000000000000000000000000000000000000000000000000000000000" +TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH: 18446744073709551615 +MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: 2 +MIN_GENESIS_TIME: 1727185220 +GENESIS_FORK_VERSION: "0x10000038" +GENESIS_DELAY: 20 +ALTAIR_FORK_VERSION: "0x20000038" +ALTAIR_FORK_EPOCH: 0 +BELLATRIX_FORK_VERSION: "0x30000038" +BELLATRIX_FORK_EPOCH: 0 +CAPELLA_FORK_VERSION: "0x40000038" +CAPELLA_FORK_EPOCH: 0 +DENEB_FORK_VERSION: "0x50000038" +DENEB_FORK_EPOCH: 0 +SECONDS_PER_SLOT: {{ .seconds_per_slot }} +SECONDS_PER_ETH1_BLOCK: {{ .seconds_per_slot }} +MIN_VALIDATOR_WITHDRAWABILITY_DELAY: {{ .min_validator_withdrawability_delay }} +SHARD_COMMITTEE_PERIOD: {{ .shard_committee_period }} +ETH1_FOLLOW_DISTANCE: {{ .eth1_follow_distance }} +INACTIVITY_SCORE_BIAS: 4 +INACTIVITY_SCORE_RECOVERY_RATE: 16 +EJECTION_BALANCE: {{ .ejection_balance }} +MIN_PER_EPOCH_CHURN_LIMIT: 4 +MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT: {{ .max_per_epoch_activation_churn_limit }} +CHURN_LIMIT_QUOTIENT: 65536 +PROPOSER_SCORE_BOOST: 40 +DEPOSIT_CHAIN_ID: {{ .network_id }} +DEPOSIT_NETWORK_ID: {{ .network_id }} +DEPOSIT_CONTRACT_ADDRESS: {{ .deposit_contract_address }} \ No newline at end of file From 27f426112d38c1a8243778a7f54b46104f4dc2b0 Mon Sep 17 00:00:00 2001 From: mikhailUshakoff Date: Sat, 28 Dec 2024 12:43:05 +0000 Subject: [PATCH 4/7] Fix helix relay deployment --- main.star | 77 +++++++------------ network_params.yaml | 7 +- .../bolt_sidecar/bolt_sidecar_launcher.star | 5 +- src/package_io/input_parser.star | 2 +- .../cb-bolt-boost-config.toml.tmpl | 57 +++++++++++++- 5 files changed, 90 insertions(+), 58 deletions(-) diff --git a/main.star b/main.star index 752264c4b..9c63506f6 100644 --- a/main.star +++ b/main.star @@ -299,33 +299,18 @@ def run(plan, args={}): timeout="20m", service_name=first_client_beacon_name, ) - # if ( - # args_with_right_defaults.mev_type == constants.FLASHBOTS_MEV_TYPE - # or args_with_right_defaults.mev_type == constants.COMMIT_BOOST_MEV_TYPE - # ): - # endpoint = flashbots_mev_relay.launch_mev_relay( - # plan, - # mev_params, - # network_id, - # beacon_uris, - # genesis_validators_root, - # builder_uri, - # network_params.seconds_per_slot, - # persistent, - # global_node_selectors, - # ) - # elif args_with_right_defaults.mev_type == constants.MEV_RS_MEV_TYPE: - # endpoint, relay_ip_address, relay_port = mev_rs_mev_relay.launch_mev_relay( - # plan, - # mev_params, - # network_params.network, - # beacon_uri, - # el_cl_data_files_artifact_uuid, - # global_node_selectors, - # ) - # else: - # fail("Invalid MEV type") + # Get real genesis timestamp for helix + helix_genesis_timestamp = plan.run_python( + description="Getting real genesis timestamp for helix", + run=""" +import sys +a = int(sys.argv[1]) +b = int(sys.argv[2]) +print(int(a+b), end="") +""", + args=[str(final_genesis_timestamp),str(network_params.genesis_delay)], + ).output # Run helix relay helix_endpoint = helix_relay.launch_helix_relay( plan, @@ -336,7 +321,7 @@ def run(plan, args={}): builder_uri, network_params.seconds_per_slot, persistent, - final_genesis_timestamp, + helix_genesis_timestamp, global_node_selectors, ) @@ -472,32 +457,26 @@ def run(plan, args={}): final_genesis_timestamp, global_node_selectors, ) - - # plan.print("Launching commit-boost PBS service") - # mev_boost_launcher = commit_boost_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_str, - # participant.cl_type, - # participant.el_type, - # ) - # mev_boost_context = commit_boost_mev_boost.launch( - # plan, - # mev_boost_launcher, - # mev_boost_service_name, - # network_params.network, - # mev_params, - # mev_endpoints, - # el_cl_data_files_artifact_uuid, - # global_node_selectors, - # ) else: fail("Invalid MEV type") all_mevboost_contexts.append(mev_boost_context) + if bolt_sidecar_config != None: + service_name = "{0}-{1}-{2}-{3}".format( + input_parser.BOLT_SIDECAR_SERVICE_NAME_PREFIX, + index_str, + participant.cl_type, + participant.el_type, + ) + bolt_sidecar_config["service_name"] = service_name + bolt_sidecar_context = bolt_sidecar.launch_bolt_sidecar( + plan, + mev_params.bolt_sidecar_image, + bolt_sidecar_config, + network_params, + global_node_selectors, + ) + if len(args_with_right_defaults.additional_services) == 0: output = struct( all_participants=all_participants, diff --git a/network_params.yaml b/network_params.yaml index cf12d51a4..31f7ec0df 100644 --- a/network_params.yaml +++ b/network_params.yaml @@ -115,14 +115,13 @@ grafana_additional_dashboards: [] persistent: false mev_type: commit-boost mev_params: - mev_relay_image: flashbots/mev-boost-relay:latest - mev_builder_image: flashbots/builder:latest + mev_relay_image: ghcr.io/chainbound/bolt-relay:v0.2.1-alpha + mev_builder_image: ghcr.io/chainbound/bolt-builder:v0.3.0-alpha.rc3 mev_builder_cl_image: sigp/lighthouse:latest - #mev_boost_image: ghcr.io/commit-boost/pbs:latest mev_boost_image: ghcr.io/chainbound/bolt-boost:v0.3.0-alpha bolt_sidecar_image: ghcr.io/chainbound/bolt-sidecar:v0.3.0-alpha bolt_boost_image: ghcr.io/chainbound/bolt-boost:v0.3.0-alpha - helix_relay_image: ghcr.io/chainbound/helix:v0.3.0-alpha.rc2 + helix_relay_image: helix-debug:debug # TODO upload image helix_relay_config_extension: {} mev_boost_args: ["mev-boost", "--relay-check"] mev_relay_api_extra_args: [] diff --git a/src/mev/bolt_sidecar/bolt_sidecar_launcher.star b/src/mev/bolt_sidecar/bolt_sidecar_launcher.star index f6e309460..d22430c28 100644 --- a/src/mev/bolt_sidecar/bolt_sidecar_launcher.star +++ b/src/mev/bolt_sidecar/bolt_sidecar_launcher.star @@ -25,9 +25,8 @@ def launch_bolt_sidecar( "RUST_LOG": "bolt_sidecar=trace", } - node_keystore_path = validator_keystore_generator.NODE_KEYSTORES_OUTPUT_DIRPATH_FORMAT_STR.format(sidecar_config["participant_index"]) - full_keystore_path = "{0}{1}/keys".format(BOLT_SIDECAR_KEYS_DIRMOUNT_PATH_ON_SERVICE, node_keystore_path) - full_keystore_secrets_path = "{0}{1}/secrets".format(BOLT_SIDECAR_KEYS_DIRMOUNT_PATH_ON_SERVICE, node_keystore_path) + full_keystore_path = "{0}/keys".format(BOLT_SIDECAR_KEYS_DIRMOUNT_PATH_ON_SERVICE) + full_keystore_secrets_path = "{0}/secrets".format(BOLT_SIDECAR_KEYS_DIRMOUNT_PATH_ON_SERVICE) api = plan.add_service( name=sidecar_config["service_name"], diff --git a/src/package_io/input_parser.star b/src/package_io/input_parser.star index c4722f8a5..26017d879 100644 --- a/src/package_io/input_parser.star +++ b/src/package_io/input_parser.star @@ -1180,7 +1180,7 @@ def enrich_mev_extra_params(parsed_arguments_dict, mev_prefix, mev_port, mev_typ # 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.remote_relay_endpoint=http://helix-relay:4040", "--builder.beacon_endpoints=http://cl-{0}-lighthouse-geth-builder:4000".format( index_str ), diff --git a/static_files/bolt-boost-config/cb-bolt-boost-config.toml.tmpl b/static_files/bolt-boost-config/cb-bolt-boost-config.toml.tmpl index d9a6c4afa..ae950d1ac 100644 --- a/static_files/bolt-boost-config/cb-bolt-boost-config.toml.tmpl +++ b/static_files/bolt-boost-config/cb-bolt-boost-config.toml.tmpl @@ -85,4 +85,59 @@ target_first_request_ms = {{ or $relay_config.target_first_request_ms "200" }} # OPTIONAL frequency_get_header_ms = {{ or .frequency_get_header_ms "300" }} -{{ end }} \ No newline at end of file +{{ end }} + +# Configuration for the Signer Module, only required if any `commit` module is present, or if `pbs.with_signer = true` +# OPTIONAL +[signer] +# Docker image to use for the Signer module. +# OPTIONAL, DEFAULT: ghcr.io/commit-boost/signer:latest +docker_image = "{{ or .signer_image "ghcr.io/commit-boost/signer:latest" }}" + +# Configuration for how the Signer module should load validator keys. Currently two types of loaders are supported: +# - File: load keys from a plain text file (unsafe, use only for testing purposes) +# - ValidatorsDir: load keys from a `keys` and `secrets` folder (ERC-2335 style keystores as used in Lighthouse) +[signer.loader] +# File: path to the keys file +key_path = "./keys.json" +# ValidatorsDir: path to the keys directory +# keys_path = "" +# ValidatorsDir: path to the secrets directory +# secrets_path = "" + +# Commit-Boost can optionally run "modules" which extend the capabilities of the sidecar. +# Currently, two types of modules are supported: +# - "commit": modules which request commitment signatures from the validator keys +# - "events": modules which callback to BuilderAPI events as triggered from the PBS modules, used e.g. for monitoring +# If any "commit" module is present, then the [signer] section should also be configured +# OPTIONAL +[[modules]] +# Unique ID of the module +id = "BOLT" +# Type of the module. Supported values: commit, events +type = "commit" +# Docker image of the module +docker_image = "{{ .image }}" + +[modules.env] +BOLT_SIDECAR_CHAIN = "{{ or .chain "Kurtosis" }}" + +# The address of the PBS module +BOLT_SIDECAR_CONSTRAINTS_API = "{{ .bolt_sidecar_config.constraints_api_url }}" +BOLT_SIDECAR_BEACON_API = "{{ .bolt_sidecar_config.beacon_api_url }}" +BOLT_SIDECAR_EXECUTION_API = "{{ .bolt_sidecar_config.execution_api_url }}" + +# The execution layer engine API endpoint +BOLT_SIDECAR_ENGINE_API = "{{ .bolt_sidecar_config.engine_api_url }}" + +# The engine JWT +BOLT_SIDECAR_JWT_HEX = "{{ .bolt_sidecar_config.jwt_hex }}" + +# The port on which the sidecar builder-API will listen on. This is what your beacon node should connect to. +BOLT_SIDECAR_BUILDER_PROXY_PORT = {{ .bolt_sidecar_config.builder_proxy_port }} + +# The fee recipient +BOLT_SIDECAR_FEE_RECIPIENT = "{{ or .bolt_sidecar_config.fee_recipient "0x0000000000000000000000000000000000000000" }}" + +# Metrics port +BOLT_SIDECAR_METRICS_PORT = {{ or .bolt_sidecar_config.metrics_port "10000" }} \ No newline at end of file From f5d81e2f28b09abb035d543588b86c5aa06f00e8 Mon Sep 17 00:00:00 2001 From: mikhailUshakoff Date: Sat, 28 Dec 2024 16:59:26 +0000 Subject: [PATCH 5/7] Fix bolt-boost configuration --- main.star | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.star b/main.star index 9c63506f6..b3c533e21 100644 --- a/main.star +++ b/main.star @@ -301,7 +301,7 @@ def run(plan, args={}): ) # Get real genesis timestamp for helix - helix_genesis_timestamp = plan.run_python( + bolt_genesis_timestamp = plan.run_python( description="Getting real genesis timestamp for helix", run=""" import sys @@ -321,7 +321,7 @@ print(int(a+b), end="") builder_uri, network_params.seconds_per_slot, persistent, - helix_genesis_timestamp, + bolt_genesis_timestamp, global_node_selectors, ) @@ -454,7 +454,7 @@ print(int(a+b), end="") relays_config, bolt_sidecar_config, network_params, - final_genesis_timestamp, + bolt_genesis_timestamp, global_node_selectors, ) else: From a5bee0fbcaa44e3e00a966dc3d5532dd815b8571 Mon Sep 17 00:00:00 2001 From: mikhailUshakoff Date: Mon, 30 Dec 2024 14:06:20 +0000 Subject: [PATCH 6/7] Retrieve avs-node image from config file --- main.star | 3 ++- src/preconf_avs/avs_launcher.star | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/main.star b/main.star index b3c533e21..02792e8b9 100644 --- a/main.star +++ b/main.star @@ -823,10 +823,10 @@ print(int(a+b), end="") p2pbootnode_context = p2p_bootnode.launch( plan, ) - # Launch Preconf AVS 1 preconf_avs.launch( plan, + preconf_params.preconf_avs_image, network_id, all_el_contexts[0], all_cl_contexts[0], @@ -844,6 +844,7 @@ print(int(a+b), end="") # Launch Preconf AVS 2 preconf_avs.launch( plan, + preconf_params.preconf_avs_image, network_id, all_el_contexts[0], all_cl_contexts[0], diff --git a/src/preconf_avs/avs_launcher.star b/src/preconf_avs/avs_launcher.star index e0842ab37..4285d4e24 100644 --- a/src/preconf_avs/avs_launcher.star +++ b/src/preconf_avs/avs_launcher.star @@ -1,5 +1,6 @@ def launch( plan, + image, chain_id, el_context, cl_context, @@ -20,7 +21,7 @@ def launch( plan.add_service( name = "taiko-preconf-avs-{0}-register".format(index), config = ServiceConfig( - image = "nethswitchboard/avs-node:e2e", + image = image, private_ip_address_placeholder = "avs_ip_placeholder", entrypoint = [ "/bin/bash", @@ -71,7 +72,7 @@ def launch( plan.add_service( name = "taiko-preconf-avs-{0}-validator-1".format(index), config = ServiceConfig( - image = "nethswitchboard/avs-node:e2e", + image = image, private_ip_address_placeholder = "avs_ip_placeholder", entrypoint = [ "/bin/bash", @@ -173,7 +174,7 @@ def launch( plan.add_service( name = "taiko-preconf-avs-{0}".format(index), config = ServiceConfig( - image = "nethswitchboard/avs-node:e2e", + image = image, private_ip_address_placeholder = "avs_ip_placeholder", env_vars={ "AVS_NODE_ECDSA_PRIVATE_KEY": "0x{0}".format(prefunded_accounts[index].private_key), From ca6aa684883cdd0c0560040470a5c34c6d8d26b6 Mon Sep 17 00:00:00 2001 From: mikhailUshakoff <75278099+mikhailUshakoff@users.noreply.github.com> Date: Mon, 30 Dec 2024 16:14:57 +0100 Subject: [PATCH 7/7] Update network_params.yaml Signed-off-by: mikhailUshakoff <75278099+mikhailUshakoff@users.noreply.github.com> --- network_params.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network_params.yaml b/network_params.yaml index 31f7ec0df..185c90c02 100644 --- a/network_params.yaml +++ b/network_params.yaml @@ -121,7 +121,7 @@ mev_params: mev_boost_image: ghcr.io/chainbound/bolt-boost:v0.3.0-alpha bolt_sidecar_image: ghcr.io/chainbound/bolt-sidecar:v0.3.0-alpha bolt_boost_image: ghcr.io/chainbound/bolt-boost:v0.3.0-alpha - helix_relay_image: helix-debug:debug # TODO upload image + helix_relay_image: ghcr.io/chainbound/helix:v0.3.0-alpha.rc4 helix_relay_config_extension: {} mev_boost_args: ["mev-boost", "--relay-check"] mev_relay_api_extra_args: []