Skip to content

Commit

Permalink
chore(helix): test sleep before starting it
Browse files Browse the repository at this point in the history
  • Loading branch information
thedevbirb committed Sep 30, 2024
1 parent 81d19b4 commit f51df0b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions main.star
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def run(plan, args={}):
timeout="20m",
service_name=first_client_beacon_name,
)
endpoint = helix_relay.launch_helix_relay(
helix_endpoint = helix_relay.launch_helix_relay(
plan,
mev_params,
network_params,
Expand All @@ -258,7 +258,7 @@ def run(plan, args={}):
contract_owner.private_key,
normal_user.private_key,
)
mev_endpoints.append(endpoint)
mev_endpoints.append(helix_endpoint)

# spin up the mev boost contexts if some endpoints for relays have been passed
all_mevboost_contexts = []
Expand Down
10 changes: 7 additions & 3 deletions src/mev/mev_relay/helix_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ REDIS_MAX_CPU = 1000
REDIS_MIN_MEMORY = 16
REDIS_MAX_MEMORY = 1024


def launch_helix_relay(
plan,
mev_params,
Expand Down Expand Up @@ -132,9 +131,14 @@ def launch_helix_relay(

env_vars = {
"RELAY_KEY": DUMMY_SECRET_KEY,
"RUST_LOG": "debug",
"RUST_LOG": "trace",
}

# Sleep `network_params.seconds_per_slot * 32` seconds (1 epoch) + genesis_delay before starting the relay
sleep_time = network_params.seconds_per_slot * 32 + network_params.genesis_delay

plan.print("Sleeping for {0} seconds before starting the relay".format(sleep_time))

helix = plan.add_service(
name=SERVICE_NAME,
config=ServiceConfig(
Expand All @@ -147,7 +151,7 @@ def launch_helix_relay(
shared_utils.path_join(
HELIX_CONFIG_MOUNT_DIRPATH_ON_SERVICE,
HELIX_CONFIG_FILENAME,
)
))
],
ports={
"api": PortSpec(
Expand Down

0 comments on commit f51df0b

Please sign in to comment.