Skip to content

Commit

Permalink
fix: bring back wait for capella fork epoch (#212)
Browse files Browse the repository at this point in the history
if someone explicitly sets capella we can have breaks for the default
seconds per slot as seen by @bharath-123 . I am wondering my
`protocolberg` example goes through, I am guessing that reaches epoch 1
as the seconds per slot ar elower
  • Loading branch information
h4ck3rk3y authored Sep 20, 2023
1 parent ac25458 commit c7cce7e
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions main.star
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit c7cce7e

Please sign in to comment.