Commit 0165ef1a authored by Gyanendra Mishra's avatar Gyanendra Mishra Committed by GitHub

feat: make mev more configurable (#164)

parent 4eba65df
...@@ -81,8 +81,8 @@ def run(plan, args): ...@@ -81,8 +81,8 @@ def run(plan, args):
) )
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) 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)
plan.print("epoch 2 reached, can begin mev stuff") plan.print("epoch 2 reached, can begin mev stuff")
endpoint = mev_relay_launcher_module.launch_mev_relay(plan, mev_params, network_params.network_id, beacon_uris, genesis_validators_root, builder_uri) 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)
mev_flood_module.spam_in_background(plan, el_uri, mev_params.mev_flood_extra_args) mev_flood_module.spam_in_background(plan, el_uri, mev_params.mev_flood_extra_args, mev_params.mev_flood_seconds_per_bundle)
mev_endpoints.append(endpoint) mev_endpoints.append(endpoint)
......
...@@ -17,11 +17,11 @@ def launch_mev_flood(plan, image, el_uri): ...@@ -17,11 +17,11 @@ def launch_mev_flood(plan, image, el_uri):
) )
) )
def spam_in_background(plan, el_uri, mev_flood_extra_args): def spam_in_background(plan, el_uri, mev_flood_extra_args, seconds_per_bundle):
command = ["/bin/sh", "-c", "nohup ./run spam -r {0} -k {1} -u {2} -l deployment.json --secondsPerBundle 15 >main.log 2>&1 &".format(el_uri, ADMIN_KEY, USER_KEY)] command = ["/bin/sh", "-c", "nohup ./run spam -r {0} -k {1} -u {2} -l deployment.json --secondsPerBundle {3} >main.log 2>&1 &".format(el_uri, ADMIN_KEY, USER_KEY, seconds_per_bundle)]
if mev_flood_extra_args: if mev_flood_extra_args:
joined_extra_args = " ".join(mev_flood_extra_args) joined_extra_args = " ".join(mev_flood_extra_args)
command = ["/bin/sh", "-c", "nohup ./run spam -r {0} -k {1} -u {2} -l deployment.json --secondsPerBundle 15 {3} >main.log 2>&1 &".format(el_uri, ADMIN_KEY, USER_KEY, joined_extra_args)] command = ["/bin/sh", "-c", "nohup ./run spam -r {0} -k {1} -u {2} -l deployment.json --secondsPerBundle {3} {4} >main.log 2>&1 &".format(el_uri, ADMIN_KEY, USER_KEY, seconds_per_bundle, joined_extra_args)]
plan.exec( plan.exec(
service_name = "mev-flood", service_name = "mev-flood",
recipe = ExecRecipe( recipe = ExecRecipe(
......
...@@ -17,7 +17,7 @@ NETWORK_ID_TO_NAME = { ...@@ -17,7 +17,7 @@ NETWORK_ID_TO_NAME = {
"3": "ropsten", "3": "ropsten",
} }
def launch_mev_relay(plan, mev_params, network_id, beacon_uris, validator_root, builder_uri): def launch_mev_relay(plan, mev_params, network_id, beacon_uris, validator_root, builder_uri, seconds_per_slot):
redis = redis_module.run(plan, {}) redis = redis_module.run(plan, {})
# making the password postgres as the relay expects it to be postgres # making the password postgres as the relay expects it to be postgres
postgres = postgres_module.run(plan, {"password": "postgres", "user": "postgres", "database": "postgres", "name": "postgres"}) postgres = postgres_module.run(plan, {"password": "postgres", "user": "postgres", "database": "postgres", "name": "postgres"})
...@@ -32,7 +32,8 @@ def launch_mev_relay(plan, mev_params, network_id, beacon_uris, validator_root, ...@@ -32,7 +32,8 @@ def launch_mev_relay(plan, mev_params, network_id, beacon_uris, validator_root,
"BELLATRIX_FORK_VERSION": "0x30000038", "BELLATRIX_FORK_VERSION": "0x30000038",
"CAPELLA_FORK_VERSION": "0x40000038", "CAPELLA_FORK_VERSION": "0x40000038",
"DENEB_FORK_VERSION": "0x50000038", "DENEB_FORK_VERSION": "0x50000038",
"GENESIS_VALIDATORS_ROOT": validator_root "GENESIS_VALIDATORS_ROOT": validator_root,
"SEC_PER_SLOT": str(seconds_per_slot)
} }
plan.add_service( plan.add_service(
......
...@@ -150,7 +150,8 @@ def parse_input(input_args): ...@@ -150,7 +150,8 @@ def parse_input(input_args):
mev_relay_website_extra_args = result["mev_params"]["mev_relay_website_extra_args"], mev_relay_website_extra_args = result["mev_params"]["mev_relay_website_extra_args"],
mev_builder_extra_args = result["mev_params"]["mev_builder_extra_args"], mev_builder_extra_args = result["mev_params"]["mev_builder_extra_args"],
mev_flood_image = result["mev_params"]["mev_flood_image"], mev_flood_image = result["mev_params"]["mev_flood_image"],
mev_flood_extra_args = result["mev_params"]["mev_flood_extra_args"] mev_flood_extra_args = result["mev_params"]["mev_flood_extra_args"],
mev_flood_seconds_per_bundle = result["mev_params"]["mev_flood_seconds_per_bundle"]
), ),
launch_additional_services=result["launch_additional_services"], launch_additional_services=result["launch_additional_services"],
wait_for_finalization=result["wait_for_finalization"], wait_for_finalization=result["wait_for_finalization"],
...@@ -223,7 +224,8 @@ def get_default_mev_params(): ...@@ -223,7 +224,8 @@ def get_default_mev_params():
"mev_relay_website_extra_args": [], "mev_relay_website_extra_args": [],
"mev_builder_extra_args": [], "mev_builder_extra_args": [],
"mev_flood_image": "flashbots/mev-flood", "mev_flood_image": "flashbots/mev-flood",
"mev_flood_extra_args": [] "mev_flood_extra_args": [],
"mev_flood_seconds_per_bundle": 15,
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment