From d6894046a5adeff6d9e4fe69616f53ce38592be6 Mon Sep 17 00:00:00 2001 From: thedevbirb Date: Thu, 27 Jun 2024 09:22:19 +0200 Subject: [PATCH 01/17] feat(mev-boost): proxy with sidecar --- src/package_io/input_parser.star | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/package_io/input_parser.star b/src/package_io/input_parser.star index 25d6e0fcc..fe2578c8c 100644 --- a/src/package_io/input_parser.star +++ b/src/package_io/input_parser.star @@ -3,6 +3,7 @@ shared_utils = import_module("../shared_utils/shared_utils.star") genesis_constants = import_module( "../prelaunch_data_generator/genesis_constants/genesis_constants.star" ) +mev_sidecar = import_module("../mev_sidecar/mev_sidecar_launcher.star") DEFAULT_EL_IMAGES = { "geth": "ethereum/client-go:latest", @@ -143,7 +144,7 @@ def input_parser(plan, input_args): result = enrich_mev_extra_params( result, MEV_BOOST_SERVICE_NAME_PREFIX, - FLASHBOTS_MEV_BOOST_PORT, + mev_sidecar.MEV_SIDECAR_ENDPOINT_PORT, result.get("mev_type"), ) From b729f971cfa467c09887ab08b000c230528b8d97 Mon Sep 17 00:00:00 2001 From: thedevbirb Date: Thu, 27 Jun 2024 10:10:25 +0200 Subject: [PATCH 02/17] feat(sidecar): add execution api url, engine api url --- main.star | 10 +++++++++- src/mev/mev_sidecar/mev_sidecar_launcher.star | 10 ++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/main.star b/main.star index a38bef857..76065d1ba 100644 --- a/main.star +++ b/main.star @@ -290,7 +290,15 @@ def run(plan, args={}): mev_params, global_node_selectors, mev_boost_context, - all_cl_contexts[0].beacon_http_url + all_cl_contexts[0].beacon_http_url, + "http://{0}:{1}".format( + all_el_contexts[0].ip_addr, + all_el_contexts[0].rpc_port_num, + ), + 'http://{0}:{1}'".format( + all_el_contexts[0].ip_addr, + all_el_contexts[0].engine_rpc_port_num + ) ) if len(args_with_right_defaults.additional_services) == 0: diff --git a/src/mev/mev_sidecar/mev_sidecar_launcher.star b/src/mev/mev_sidecar/mev_sidecar_launcher.star index ce8658ca7..25dc15b1d 100644 --- a/src/mev/mev_sidecar/mev_sidecar_launcher.star +++ b/src/mev/mev_sidecar/mev_sidecar_launcher.star @@ -18,7 +18,9 @@ def launch_mev_sidecar( mev_params, node_selectors, mev_boost_context, - beacon_client_url + beacon_client_url, + execution_api_url, + engine_api_url ): image = mev_params.mev_sidecar_image @@ -40,7 +42,11 @@ def launch_mev_sidecar( "--mevboost-url", mev_boost_context_util.mev_boost_endpoint(mev_boost_context), "--beacon-client-url", - beacon_client_url + beacon_client_url, + "--execution-api", + execution_api_url, + "--engine-api-url", + engine_api_url ], # + mev_params.mev_relay_api_extra_args, ports={ From 3ed75eeb7b298f66eb6ef96f923aaaf5f9ee6f3a Mon Sep 17 00:00:00 2001 From: thedevbirb Date: Thu, 27 Jun 2024 10:33:30 +0200 Subject: [PATCH 03/17] feat(sidecar): add mevboost proxy port --- src/mev/mev_sidecar/mev_sidecar_launcher.star | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mev/mev_sidecar/mev_sidecar_launcher.star b/src/mev/mev_sidecar/mev_sidecar_launcher.star index 25dc15b1d..4e5a74e5a 100644 --- a/src/mev/mev_sidecar/mev_sidecar_launcher.star +++ b/src/mev/mev_sidecar/mev_sidecar_launcher.star @@ -41,6 +41,8 @@ def launch_mev_sidecar( "18d1c5302e734fd6fbfaa51828d42c4c6d3cbe020c42bab7dd15a2799cf00b82", "--mevboost-url", mev_boost_context_util.mev_boost_endpoint(mev_boost_context), + "--mevboost-proxy-port", + mev_boost_context.port + 1, "--beacon-client-url", beacon_client_url, "--execution-api", From b46b7b8cb1e5bb53aac2c17f1fd2d6c0db4116a2 Mon Sep 17 00:00:00 2001 From: thedevbirb Date: Thu, 27 Jun 2024 10:54:30 +0200 Subject: [PATCH 04/17] fix: format --- main.star | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.star b/main.star index 76065d1ba..d0739d28c 100644 --- a/main.star +++ b/main.star @@ -295,7 +295,7 @@ def run(plan, args={}): all_el_contexts[0].ip_addr, all_el_contexts[0].rpc_port_num, ), - 'http://{0}:{1}'".format( + "http://{0}:{1}".format( all_el_contexts[0].ip_addr, all_el_contexts[0].engine_rpc_port_num ) From 54318cb471f3465e6b3937066170dfdada682579 Mon Sep 17 00:00:00 2001 From: thedevbirb Date: Thu, 27 Jun 2024 11:00:23 +0200 Subject: [PATCH 05/17] fix: imports; flags name --- src/mev/mev_sidecar/mev_sidecar_launcher.star | 8 ++++---- src/package_io/input_parser.star | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mev/mev_sidecar/mev_sidecar_launcher.star b/src/mev/mev_sidecar/mev_sidecar_launcher.star index 4e5a74e5a..47d943293 100644 --- a/src/mev/mev_sidecar/mev_sidecar_launcher.star +++ b/src/mev/mev_sidecar/mev_sidecar_launcher.star @@ -18,7 +18,7 @@ def launch_mev_sidecar( mev_params, node_selectors, mev_boost_context, - beacon_client_url, + beacon_api_url, execution_api_url, engine_api_url ): @@ -43,9 +43,9 @@ def launch_mev_sidecar( mev_boost_context_util.mev_boost_endpoint(mev_boost_context), "--mevboost-proxy-port", mev_boost_context.port + 1, - "--beacon-client-url", - beacon_client_url, - "--execution-api", + "--beacon-api-url", + beacon_api_url, + "--execution-api-url", execution_api_url, "--engine-api-url", engine_api_url diff --git a/src/package_io/input_parser.star b/src/package_io/input_parser.star index fe2578c8c..fd50fbfb0 100644 --- a/src/package_io/input_parser.star +++ b/src/package_io/input_parser.star @@ -3,7 +3,7 @@ shared_utils = import_module("../shared_utils/shared_utils.star") genesis_constants = import_module( "../prelaunch_data_generator/genesis_constants/genesis_constants.star" ) -mev_sidecar = import_module("../mev_sidecar/mev_sidecar_launcher.star") +mev_sidecar = import_module("../mev/mev_sidecar/mev_sidecar_launcher.star") DEFAULT_EL_IMAGES = { "geth": "ethereum/client-go:latest", From 45df49286035a328aa061f06add9338077f85919 Mon Sep 17 00:00:00 2001 From: thedevbirb Date: Thu, 27 Jun 2024 11:12:56 +0200 Subject: [PATCH 06/17] fix(sidecar): conversion to string --- src/mev/mev_sidecar/mev_sidecar_launcher.star | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mev/mev_sidecar/mev_sidecar_launcher.star b/src/mev/mev_sidecar/mev_sidecar_launcher.star index 47d943293..f9583a2c7 100644 --- a/src/mev/mev_sidecar/mev_sidecar_launcher.star +++ b/src/mev/mev_sidecar/mev_sidecar_launcher.star @@ -42,7 +42,7 @@ def launch_mev_sidecar( "--mevboost-url", mev_boost_context_util.mev_boost_endpoint(mev_boost_context), "--mevboost-proxy-port", - mev_boost_context.port + 1, + str(mev_boost_context.port + 1), "--beacon-api-url", beacon_api_url, "--execution-api-url", From 74785975a4c047bef92ca7e52a83eac03fca0d12 Mon Sep 17 00:00:00 2001 From: nicolas <48695862+merklefruit@users.noreply.github.com> Date: Thu, 27 Jun 2024 11:23:56 +0200 Subject: [PATCH 07/17] chore: log level for debugging --- src/mev/mev_sidecar/mev_sidecar_launcher.star | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mev/mev_sidecar/mev_sidecar_launcher.star b/src/mev/mev_sidecar/mev_sidecar_launcher.star index f9583a2c7..173a204b2 100644 --- a/src/mev/mev_sidecar/mev_sidecar_launcher.star +++ b/src/mev/mev_sidecar/mev_sidecar_launcher.star @@ -25,7 +25,7 @@ def launch_mev_sidecar( image = mev_params.mev_sidecar_image env_vars = { - "RUST_LOG": "info", + "RUST_LOG": "trace", } api = plan.add_service( From db7d9826db8106f4d74d4c4dee5f9f86a6b61916 Mon Sep 17 00:00:00 2001 From: nicolas <48695862+merklefruit@users.noreply.github.com> Date: Thu, 27 Jun 2024 11:41:42 +0200 Subject: [PATCH 08/17] chore: update mev url to point to bolt sidecar --- src/package_io/input_parser.star | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/package_io/input_parser.star b/src/package_io/input_parser.star index fd50fbfb0..e9bc5afcd 100644 --- a/src/package_io/input_parser.star +++ b/src/package_io/input_parser.star @@ -795,13 +795,14 @@ def enrich_mev_extra_params(parsed_arguments_dict, mev_prefix, mev_port, mev_typ index_str = shared_utils.zfill_custom( index + 1, len(str(len(parsed_arguments_dict["participants"]))) ) - mev_url = "http://{0}-{1}-{2}-{3}:{4}".format( - MEV_BOOST_SERVICE_NAME_PREFIX, - index_str, - participant["cl_type"], - participant["el_type"], - mev_port, - ) + # mev_url = "http://{0}-{1}-{2}-{3}:{4}".format( + # MEV_BOOST_SERVICE_NAME_PREFIX, + # index_str, + # participant["cl_type"], + # participant["el_type"], + # mev_port, + # ) + mev_url = "http://mev-sidecar-api:{0}".format(mev_port) if participant["cl_type"] == "lighthouse": participant["vc_extra_params"].append("--builder-proposals") From 287a090c8e6a60e3d282733b8acc8203ce5de466 Mon Sep 17 00:00:00 2001 From: nicolas <48695862+merklefruit@users.noreply.github.com> Date: Thu, 27 Jun 2024 12:14:04 +0200 Subject: [PATCH 09/17] wip: mev boost proxy port --- src/mev/mev_sidecar/mev_sidecar_launcher.star | 8 ++++++-- src/package_io/input_parser.star | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/mev/mev_sidecar/mev_sidecar_launcher.star b/src/mev/mev_sidecar/mev_sidecar_launcher.star index 173a204b2..2f75715ea 100644 --- a/src/mev/mev_sidecar/mev_sidecar_launcher.star +++ b/src/mev/mev_sidecar/mev_sidecar_launcher.star @@ -6,6 +6,7 @@ mev_boost_context_util = import_module("../mev_boost/mev_boost_context.star") MEV_SIDECAR_ENDPOINT = "mev-sidecar-api" MEV_SIDECAR_ENDPOINT_PORT = 9061 +MEV_SIDECAR_BOOST_PROXY_PORT = 9062 # The min/max CPU/memory that mev-sidecar can use MEV_SIDECAR_MIN_CPU = 100 @@ -42,7 +43,7 @@ def launch_mev_sidecar( "--mevboost-url", mev_boost_context_util.mev_boost_endpoint(mev_boost_context), "--mevboost-proxy-port", - str(mev_boost_context.port + 1), + str(MEV_SIDECAR_BOOST_PROXY_PORT), "--beacon-api-url", beacon_api_url, "--execution-api-url", @@ -54,7 +55,10 @@ def launch_mev_sidecar( ports={ "api": PortSpec( number=MEV_SIDECAR_ENDPOINT_PORT, transport_protocol="TCP" - ) + ), + "mevboost-proxy": PortSpec( + number=MEV_SIDECAR_BOOST_PROXY_PORT, transport_protocol="TCP" + ), }, env_vars=env_vars, min_cpu=MEV_SIDECAR_MIN_CPU, diff --git a/src/package_io/input_parser.star b/src/package_io/input_parser.star index e9bc5afcd..14653b14b 100644 --- a/src/package_io/input_parser.star +++ b/src/package_io/input_parser.star @@ -144,7 +144,7 @@ def input_parser(plan, input_args): result = enrich_mev_extra_params( result, MEV_BOOST_SERVICE_NAME_PREFIX, - mev_sidecar.MEV_SIDECAR_ENDPOINT_PORT, + mev_sidecar.MEV_SIDECAR_BOOST_PROXY_PORT, result.get("mev_type"), ) @@ -802,6 +802,8 @@ def enrich_mev_extra_params(parsed_arguments_dict, mev_prefix, mev_port, mev_typ # participant["el_type"], # mev_port, # ) + + # connection: beacon node -> mev-boost mev_url = "http://mev-sidecar-api:{0}".format(mev_port) if participant["cl_type"] == "lighthouse": From 3b51b19b813e504cf2c3af4c62bedc3400471685 Mon Sep 17 00:00:00 2001 From: thedevbirb Date: Fri, 28 Jun 2024 12:15:15 +0200 Subject: [PATCH 10/17] feat(sidecar): add fee-recipient and jwt --- main.star | 3 ++- src/mev/mev_sidecar/mev_sidecar_launcher.star | 9 +++++++-- src/package_io/input_parser.star | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/main.star b/main.star index d0739d28c..0ce28f2ea 100644 --- a/main.star +++ b/main.star @@ -298,7 +298,8 @@ def run(plan, args={}): "http://{0}:{1}".format( all_el_contexts[0].ip_addr, all_el_contexts[0].engine_rpc_port_num - ) + ), + raw_jwt_secret, ) if len(args_with_right_defaults.additional_services) == 0: diff --git a/src/mev/mev_sidecar/mev_sidecar_launcher.star b/src/mev/mev_sidecar/mev_sidecar_launcher.star index 2f75715ea..9e17a01fe 100644 --- a/src/mev/mev_sidecar/mev_sidecar_launcher.star +++ b/src/mev/mev_sidecar/mev_sidecar_launcher.star @@ -21,7 +21,8 @@ def launch_mev_sidecar( mev_boost_context, beacon_api_url, execution_api_url, - engine_api_url + engine_api_url, + raw_jwt_secret, ): image = mev_params.mev_sidecar_image @@ -49,7 +50,11 @@ def launch_mev_sidecar( "--execution-api-url", execution_api_url, "--engine-api-url", - engine_api_url + engine_api_url, + "--fee-recipient", + "0x0000000000000000000000000000000000000000", + "--jwt-hex", + raw_jwt_secret, ], # + mev_params.mev_relay_api_extra_args, ports={ diff --git a/src/package_io/input_parser.star b/src/package_io/input_parser.star index 14653b14b..15b054258 100644 --- a/src/package_io/input_parser.star +++ b/src/package_io/input_parser.star @@ -795,6 +795,7 @@ def enrich_mev_extra_params(parsed_arguments_dict, mev_prefix, mev_port, mev_typ index_str = shared_utils.zfill_custom( index + 1, len(str(len(parsed_arguments_dict["participants"]))) ) + # mev_url = "http://{0}-{1}-{2}-{3}:{4}".format( # MEV_BOOST_SERVICE_NAME_PREFIX, # index_str, From 58ce03b9e6dfac5c3a15524e0e4de381b2d56262 Mon Sep 17 00:00:00 2001 From: thedevbirb Date: Fri, 28 Jun 2024 17:19:07 +0200 Subject: [PATCH 11/17] chore: sidecar logs --- src/mev/mev_sidecar/mev_sidecar_launcher.star | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mev/mev_sidecar/mev_sidecar_launcher.star b/src/mev/mev_sidecar/mev_sidecar_launcher.star index 9e17a01fe..99eef95bb 100644 --- a/src/mev/mev_sidecar/mev_sidecar_launcher.star +++ b/src/mev/mev_sidecar/mev_sidecar_launcher.star @@ -27,7 +27,7 @@ def launch_mev_sidecar( image = mev_params.mev_sidecar_image env_vars = { - "RUST_LOG": "trace", + "RUST_LOG": "bolt_sidecar=trace", } api = plan.add_service( From 0774e90f86ffcdfb2bece4f65fdf48b464593cd7 Mon Sep 17 00:00:00 2001 From: thedevbirb Date: Tue, 2 Jul 2024 13:51:38 +0200 Subject: [PATCH 12/17] chore(mev-sidecar): commitment deadline for testnet --- src/mev/mev_sidecar/mev_sidecar_launcher.star | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mev/mev_sidecar/mev_sidecar_launcher.star b/src/mev/mev_sidecar/mev_sidecar_launcher.star index 99eef95bb..6435e7c0f 100644 --- a/src/mev/mev_sidecar/mev_sidecar_launcher.star +++ b/src/mev/mev_sidecar/mev_sidecar_launcher.star @@ -55,6 +55,8 @@ def launch_mev_sidecar( "0x0000000000000000000000000000000000000000", "--jwt-hex", raw_jwt_secret, + "--commitment-deadline", + str(100) ], # + mev_params.mev_relay_api_extra_args, ports={ From 6bf9fead0b5ef0b1121d4b36b282ff0ebb7756ac Mon Sep 17 00:00:00 2001 From: thedevbirb Date: Tue, 2 Jul 2024 17:14:47 +0200 Subject: [PATCH 13/17] feat(mev-sidecar): seconds per slot flag --- main.star | 1 + src/mev/mev_sidecar/mev_sidecar_launcher.star | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/main.star b/main.star index 0ce28f2ea..81a73cfd7 100644 --- a/main.star +++ b/main.star @@ -300,6 +300,7 @@ def run(plan, args={}): all_el_contexts[0].engine_rpc_port_num ), raw_jwt_secret, + network_params.seconds_per_slot ) if len(args_with_right_defaults.additional_services) == 0: diff --git a/src/mev/mev_sidecar/mev_sidecar_launcher.star b/src/mev/mev_sidecar/mev_sidecar_launcher.star index 6435e7c0f..4434eba10 100644 --- a/src/mev/mev_sidecar/mev_sidecar_launcher.star +++ b/src/mev/mev_sidecar/mev_sidecar_launcher.star @@ -23,6 +23,7 @@ def launch_mev_sidecar( execution_api_url, engine_api_url, raw_jwt_secret, + seconds_per_slot, ): image = mev_params.mev_sidecar_image @@ -56,7 +57,9 @@ def launch_mev_sidecar( "--jwt-hex", raw_jwt_secret, "--commitment-deadline", - str(100) + str(100), + "--slot-time-in-seconds", + str(seconds_per_slot) ], # + mev_params.mev_relay_api_extra_args, ports={ From 7cb2fc8abfbde2d14e1938ad6b6a0c3ab4203765 Mon Sep 17 00:00:00 2001 From: nicolas <48695862+merklefruit@users.noreply.github.com> Date: Tue, 2 Jul 2024 23:35:22 +0200 Subject: [PATCH 14/17] chore: add chain option --- src/mev/mev_sidecar/mev_sidecar_launcher.star | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mev/mev_sidecar/mev_sidecar_launcher.star b/src/mev/mev_sidecar/mev_sidecar_launcher.star index 4434eba10..e74f94ff8 100644 --- a/src/mev/mev_sidecar/mev_sidecar_launcher.star +++ b/src/mev/mev_sidecar/mev_sidecar_launcher.star @@ -58,8 +58,8 @@ def launch_mev_sidecar( raw_jwt_secret, "--commitment-deadline", str(100), - "--slot-time-in-seconds", - str(seconds_per_slot) + "--chain", + "kurtosis", ], # + mev_params.mev_relay_api_extra_args, ports={ From dc068bbb48a8d29fcd3150892aa071301640543c Mon Sep 17 00:00:00 2001 From: thedevbirb Date: Mon, 15 Jul 2024 15:09:36 +0200 Subject: [PATCH 15/17] fix: launch command of sidecar --- src/mev/mev_sidecar/mev_sidecar_launcher.star | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mev/mev_sidecar/mev_sidecar_launcher.star b/src/mev/mev_sidecar/mev_sidecar_launcher.star index e74f94ff8..eee116c67 100644 --- a/src/mev/mev_sidecar/mev_sidecar_launcher.star +++ b/src/mev/mev_sidecar/mev_sidecar_launcher.star @@ -36,7 +36,6 @@ def launch_mev_sidecar( config=ServiceConfig( image=image, cmd=[ - "/bolt-sidecar", "--port", str(MEV_SIDECAR_ENDPOINT_PORT), "--private-key", @@ -60,6 +59,8 @@ def launch_mev_sidecar( str(100), "--chain", "kurtosis", + "--validator-indexes", + "0..64" ], # + mev_params.mev_relay_api_extra_args, ports={ From a338730030747ca3b0059ec8afd6c26e4739c26e Mon Sep 17 00:00:00 2001 From: thedevbirb Date: Tue, 16 Jul 2024 11:53:33 +0200 Subject: [PATCH 16/17] chore(sidecar): commitment deadline of 100ms for devnet --- src/mev/mev_sidecar/mev_sidecar_launcher.star | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mev/mev_sidecar/mev_sidecar_launcher.star b/src/mev/mev_sidecar/mev_sidecar_launcher.star index eee116c67..e150fb885 100644 --- a/src/mev/mev_sidecar/mev_sidecar_launcher.star +++ b/src/mev/mev_sidecar/mev_sidecar_launcher.star @@ -61,6 +61,8 @@ def launch_mev_sidecar( "kurtosis", "--validator-indexes", "0..64" + "--commitment-deadline", + "100" ], # + mev_params.mev_relay_api_extra_args, ports={ From 6f379ea1b92f1d7fb5b6fe178e95811209d2d6f1 Mon Sep 17 00:00:00 2001 From: thedevbirb Date: Tue, 16 Jul 2024 11:57:37 +0200 Subject: [PATCH 17/17] chore(sidecar): slot time cli --- src/mev/mev_sidecar/mev_sidecar_launcher.star | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mev/mev_sidecar/mev_sidecar_launcher.star b/src/mev/mev_sidecar/mev_sidecar_launcher.star index e150fb885..69a285681 100644 --- a/src/mev/mev_sidecar/mev_sidecar_launcher.star +++ b/src/mev/mev_sidecar/mev_sidecar_launcher.star @@ -60,9 +60,9 @@ def launch_mev_sidecar( "--chain", "kurtosis", "--validator-indexes", - "0..64" - "--commitment-deadline", - "100" + "0..64", + "--slot-time", + str(seconds_per_slot), ], # + mev_params.mev_relay_api_extra_args, ports={