Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ethereum-package
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
ethereum-package
Commits
21b0975f
Unverified
Commit
21b0975f
authored
Sep 05, 2023
by
Gyanendra Mishra
Committed by
GitHub
Sep 05, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: remove hardcoding of addresses in MEV flood (#184)
parent
4eb71278
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
main.star
main.star
+2
-2
mev_flood_launcher.star
src/mev_flood/mev_flood_launcher.star
+11
-7
No files found.
main.star
View file @
21b0975f
...
@@ -71,7 +71,7 @@ def run(plan, args):
...
@@ -71,7 +71,7 @@ def run(plan, args):
beacon_uris = beacon_uri
beacon_uris = beacon_uri
first_cl_client = all_cl_client_contexts[0]
first_cl_client = all_cl_client_contexts[0]
first_client_beacon_name = first_cl_client.beacon_service_name
first_client_beacon_name = first_cl_client.beacon_service_name
mev_flood_module.launch_mev_flood(plan, mev_params.mev_flood_image, el_uri)
mev_flood_module.launch_mev_flood(plan, mev_params.mev_flood_image, el_uri
, genesis_constants.PRE_FUNDED_ACCOUNTS
)
epoch_recipe = GetHttpRequestRecipe(
epoch_recipe = GetHttpRequestRecipe(
endpoint = "/eth/v2/beacon/blocks/head",
endpoint = "/eth/v2/beacon/blocks/head",
port_id = HTTP_PORT_ID_FOR_FACT,
port_id = HTTP_PORT_ID_FOR_FACT,
...
@@ -82,7 +82,7 @@ def run(plan, args):
...
@@ -82,7 +82,7 @@ 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, network_params.seconds_per_slot)
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_params.mev_flood_seconds_per_bundle)
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
)
mev_endpoints.append(endpoint)
mev_endpoints.append(endpoint)
...
...
src/mev_flood/mev_flood_launcher.star
View file @
21b0975f
ADMIN_KEY
= "0xef5177cd0b6b21c87db5a0bf35d4084a8a57a9d6a064f86d51ac85f2b873a4e2"
ADMIN_KEY
_INDEX = 0
USER_KEY
= "0x7988b3a148716ff800414935b305436493e1f25237a2a03e5eebc343735e2f31"
USER_KEY
_INDEX = 2
def launch_mev_flood(plan, image, el_uri):
def prefixed_address(address):
return "0x" + address
def launch_mev_flood(plan, image, el_uri, genesis_accounts):
plan.add_service(
plan.add_service(
name = "mev-flood",
name = "mev-flood",
config = ServiceConfig(
config = ServiceConfig(
...
@@ -13,15 +16,16 @@ def launch_mev_flood(plan, image, el_uri):
...
@@ -13,15 +16,16 @@ def launch_mev_flood(plan, image, el_uri):
plan.exec(
plan.exec(
service_name = "mev-flood",
service_name = "mev-flood",
recipe = ExecRecipe(
recipe = ExecRecipe(
command = ["/bin/sh", "-c", "./run init -r {0} -k {1} -u {2} -s deployment.json".format(el_uri,
ADMIN_KEY, USER_KEY
)]
command = ["/bin/sh", "-c", "./run init -r {0} -k {1} -u {2} -s deployment.json".format(el_uri,
prefixed_address(genesis_accounts[0].private_key), prefixed_address(genesis_accounts[2].private_key)
)]
)
)
)
)
def spam_in_background(plan, el_uri, mev_flood_extra_args, seconds_per_bundle):
def spam_in_background(plan, el_uri, mev_flood_extra_args, seconds_per_bundle, genesis_accounts):
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)]
admin_key, user_key = prefixed_address(genesis_accounts[0].private_key), prefixed_address(genesis_accounts[2].private_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 {3} {4} >main.log 2>&1 &".format(el_uri,
ADMIN_KEY, USER_KEY
, seconds_per_bundle, 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(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment