@@ -6,20 +6,23 @@ el_shared = import_module("../el_shared.star")
66node_metrics = import_module ("../../node_metrics_info.star" )
77constants = import_module ("../../package_io/constants.star" )
88mev_rs_builder = import_module ("../../mev/mev-rs/mev_builder/mev_builder_launcher.star" )
9+ lighthouse = import_module ("../../cl/lighthouse/lighthouse_launcher.star" )
10+ flashbots_rbuilder = import_module (
11+ "../../mev/flashbots/mev_builder/mev_builder_launcher.star"
12+ )
913
1014RPC_PORT_NUM = 8545
1115WS_PORT_NUM = 8546
1216DISCOVERY_PORT_NUM = 30303
1317ENGINE_RPC_PORT_NUM = 8551
1418METRICS_PORT_NUM = 9001
15-
19+ RBUILDER_PORT_NUM = 8645
1620# Paths
1721METRICS_PATH = "/metrics"
1822
1923# The dirpath of the execution data directory on the client container
2024EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER = "/data/reth/execution-data"
2125
22- ENTRYPOINT_ARGS = ["sh" , "-c" ]
2326
2427VERBOSITY_LEVELS = {
2528 constants .GLOBAL_LOG_LEVEL .error : "v" ,
@@ -132,10 +135,16 @@ def get_config(
132135 constants .WS_PORT_ID : WS_PORT_NUM ,
133136 constants .METRICS_PORT_ID : METRICS_PORT_NUM ,
134137 }
138+
139+ if launcher .builder_type == "flashbots" :
140+ used_port_assignments [constants .RBUILDER_PORT_ID ] = RBUILDER_PORT_NUM
141+
135142 used_ports = shared_utils .get_port_specs (used_port_assignments )
136143
137144 cmd = [
138- "/usr/local/bin/mev build" if launcher .builder else "reth" ,
145+ "{0}" .format (
146+ "/usr/local/bin/mev" if launcher .builder_type == "mev-rs" else "reth"
147+ ),
139148 "node" ,
140149 "-{0}" .format (log_level ),
141150 "--datadir=" + EXECUTION_DATA_DIRPATH_ON_CLIENT_CONTAINER ,
@@ -150,7 +159,9 @@ def get_config(
150159 "--http.corsdomain=*" ,
151160 # WARNING: The admin info endpoint is enabled so that we can easily get ENR/enode, which means
152161 # that users should NOT store private information in these Kurtosis nodes!
153- "--http.api=admin,net,eth,web3,debug,trace" ,
162+ "--http.api=admin,net,eth,web3,debug,trace{0}" .format (
163+ ",flashbots" if launcher .builder_type == "flashbots" else ""
164+ ),
154165 "--ws" ,
155166 "--ws.addr=0.0.0.0" ,
156167 "--ws.port={0}" .format (WS_PORT_NUM ),
@@ -191,8 +202,6 @@ def get_config(
191202 # this is a repeated<proto type>, we convert it into Starlark
192203 cmd .extend ([param for param in participant .el_extra_params ])
193204
194- cmd_str = " " .join (cmd )
195-
196205 files = {
197206 constants .GENESIS_DATA_MOUNTPOINT_ON_CLIENTS : launcher .el_cl_genesis_data .files_artifact_uuid ,
198207 constants .JWT_MOUNTPOINT_ON_CLIENTS : launcher .jwt_file ,
@@ -207,20 +216,48 @@ def get_config(
207216 constants .EL_TYPE .reth + "_volume_size"
208217 ],
209218 )
210-
211- if launcher .builder :
219+ cmd_str = " " .join (cmd )
220+ env_vars = {
221+ "RETH_CMD" : cmd_str ,
222+ }
223+ entrypoint_args = ["sh" , "-c" ]
224+ env_vars = env_vars | participant .el_extra_env_vars
225+ image = participant .el_image
226+ rbuilder_cmd = []
227+ if launcher .builder_type == "mev-rs" :
212228 files [
213229 mev_rs_builder .MEV_BUILDER_MOUNT_DIRPATH_ON_SERVICE
214230 ] = mev_rs_builder .MEV_BUILDER_FILES_ARTIFACT_NAME
231+ elif launcher .builder_type == "flashbots" :
232+ cl_client_name = service_name .split ("-" )[4 ]
233+ cmd .append ("--engine.legacy" )
234+ cmd_str = " " .join (cmd )
235+ files [
236+ flashbots_rbuilder .MEV_BUILDER_MOUNT_DIRPATH_ON_SERVICE
237+ ] = flashbots_rbuilder .MEV_BUILDER_FILES_ARTIFACT_NAME
238+ env_vars ["RETH_CMD" ] = cmd_str
239+ env_vars .update (
240+ {
241+ "RBUILDER_CONFIG" : flashbots_rbuilder .MEV_FILE_PATH_ON_CONTAINER ,
242+ "CL_ENDPOINT" : "http://cl-{0}-{1}-{2}:{3}" .format (
243+ participant_index + 1 ,
244+ cl_client_name ,
245+ constants .EL_TYPE .reth_builder ,
246+ lighthouse .BEACON_HTTP_PORT_NUM ,
247+ ),
248+ }
249+ )
250+ image = constants .DEFAULT_FLASHBOTS_BUILDER_IMAGE
251+ cmd_str = "./app/entrypoint.sh"
252+ entrypoint_args = []
215253
216- env_vars = participant .el_extra_env_vars
217254 config_args = {
218- "image" : participant . el_image ,
255+ "image" : image ,
219256 "ports" : used_ports ,
220257 "public_ports" : public_ports ,
221258 "cmd" : [cmd_str ],
222259 "files" : files ,
223- "entrypoint" : ENTRYPOINT_ARGS ,
260+ "entrypoint" : entrypoint_args ,
224261 "private_ip_address_placeholder" : constants .PRIVATE_IP_ADDRESS_PLACEHOLDER ,
225262 "env_vars" : env_vars ,
226263 "labels" : shared_utils .label_maker (
@@ -246,10 +283,10 @@ def get_config(
246283 return ServiceConfig (** config_args )
247284
248285
249- def new_reth_launcher (el_cl_genesis_data , jwt_file , network , builder = False ):
286+ def new_reth_launcher (el_cl_genesis_data , jwt_file , network , builder_type = False ):
250287 return struct (
251288 el_cl_genesis_data = el_cl_genesis_data ,
252289 jwt_file = jwt_file ,
253290 network = network ,
254- builder = builder ,
291+ builder_type = builder_type ,
255292 )
0 commit comments