diff --git a/main.star b/main.star index 32a3b0c85..22e2aa44c 100644 --- a/main.star +++ b/main.star @@ -51,12 +51,8 @@ def run(plan, args = {}): for participant in all_participants: all_el_client_contexts.append(participant.el_client_context) all_cl_client_contexts.append(participant.cl_client_context) - - if not args_with_right_defaults.launch_additional_services: - return - mev_endpoints = [] # passed external relays get priority # perhaps add mev_type External or remove this @@ -77,11 +73,22 @@ def run(plan, args = {}): first_cl_client = all_cl_client_contexts[0] first_client_beacon_name = first_cl_client.beacon_service_name mev_flood_module.launch_mev_flood(plan, mev_params.mev_flood_image, el_uri, genesis_constants.PRE_FUNDED_ACCOUNTS) + epoch_recipe = GetHttpRequestRecipe( + endpoint = "/eth/v2/beacon/blocks/head", + port_id = HTTP_PORT_ID_FOR_FACT, + extract = { + "epoch": ".data.message.body.attestations[0].data.target.epoch" + } + ) + plan.wait(recipe = epoch_recipe, field = "extract.epoch", assertion = ">=", target_value = str(network_params.capella_fork_epoch), timeout = "20m", service_name = first_client_beacon_name) endpoint = mev_relay_launcher_module.launch_mev_relay(plan, mev_params, network_params.network_id, beacon_uris, genesis_validators_root, builder_uri, network_params.seconds_per_slot, network_params.slots_per_epoch) mev_flood_module.spam_in_background(plan, el_uri, mev_params.mev_flood_extra_args, mev_params.mev_flood_seconds_per_bundle, genesis_constants.PRE_FUNDED_ACCOUNTS) if args_with_right_defaults.mev_params.launch_custom_flood: mev_custom_flood_module.spam_in_background(plan, genesis_constants.PRE_FUNDED_ACCOUNTS[-1].private_key, genesis_constants.PRE_FUNDED_ACCOUNTS[0].address, el_uri) - mev_endpoints.append(endpoint) + mev_endpoints.append(endpoint) + + if not args_with_right_defaults.launch_additional_services: + return plan.print("Launching transaction spammer") tx_spammer_params = args_with_right_defaults.tx_spammer_params