Commit 286654c7 authored by Piotr Piwoński's avatar Piotr Piwoński Committed by GitHub

fix: Use unused accounts for mev flood (#359)

parent e2739935
...@@ -535,14 +535,15 @@ Here's a table of where the keys are used ...@@ -535,14 +535,15 @@ Here's a table of where the keys are used
| Account Index | Component Used In | Private Key Used | Public Key Used | Comment | | Account Index | Component Used In | Private Key Used | Public Key Used | Comment |
|---------------|---------------------|------------------|-----------------|-----------------------------| |---------------|---------------------|------------------|-----------------|-----------------------------|
| 0 | mev_flood | ✅ | | As the admin_key | | 0 | Builder | ✅ | | As coinbase |
| 0 | mev_custom_flood | | ✅ | As the receiver of balance | | 0 | mev_custom_flood | | ✅ | As the receiver of balance |
| 1 | blob_spammer | ✅ | | As the sender of blobs | | 1 | blob_spammer | ✅ | | As the sender of blobs |
| 2 | mev_flood | ✅ | | As the user_key |
| 3 | transaction_spammer | ✅ | | To spam transactions with | | 3 | transaction_spammer | ✅ | | To spam transactions with |
| 4 | goomy_blob | ✅ | | As the sender of blobs | | 4 | goomy_blob | ✅ | | As the sender of blobs |
| 5 | eip4788_deployment | ✅ | | As contract deployer | | 5 | eip4788_deployment | ✅ | | As contract deployer |
| 6 | mev_custom_flood | ✅ | | As the sender of balance | | 6 | mev_flood | ✅ | | As the contract owner |
| 7 | mev_flood | ✅ | | As the user_key |
| 11 | mev_custom_flood | ✅ | | As the sender of balance |
## Developing On This Package ## Developing On This Package
......
...@@ -195,11 +195,13 @@ def run(plan, args={}): ...@@ -195,11 +195,13 @@ def run(plan, args={}):
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
contract_owner, normal_user = genesis_constants.PRE_FUNDED_ACCOUNTS[6:8]
mev_flood.launch_mev_flood( mev_flood.launch_mev_flood(
plan, plan,
mev_params.mev_flood_image, mev_params.mev_flood_image,
fuzz_target, fuzz_target,
genesis_constants.PRE_FUNDED_ACCOUNTS, contract_owner.private_key,
normal_user.private_key,
) )
epoch_recipe = GetHttpRequestRecipe( epoch_recipe = GetHttpRequestRecipe(
endpoint="/eth/v2/beacon/blocks/head", endpoint="/eth/v2/beacon/blocks/head",
...@@ -228,7 +230,8 @@ def run(plan, args={}): ...@@ -228,7 +230,8 @@ def run(plan, args={}):
fuzz_target, fuzz_target,
mev_params.mev_flood_extra_args, mev_params.mev_flood_extra_args,
mev_params.mev_flood_seconds_per_bundle, mev_params.mev_flood_seconds_per_bundle,
genesis_constants.PRE_FUNDED_ACCOUNTS, contract_owner.private_key,
normal_user.private_key,
) )
mev_endpoints.append(endpoint) mev_endpoints.append(endpoint)
......
...@@ -6,7 +6,7 @@ def prefixed_address(address): ...@@ -6,7 +6,7 @@ def prefixed_address(address):
return "0x" + address return "0x" + address
def launch_mev_flood(plan, image, el_uri, genesis_accounts): def launch_mev_flood(plan, image, el_uri, contract_owner, normal_user):
plan.add_service( plan.add_service(
name="mev-flood", name="mev-flood",
config=ServiceConfig( config=ServiceConfig(
...@@ -23,8 +23,8 @@ def launch_mev_flood(plan, image, el_uri, genesis_accounts): ...@@ -23,8 +23,8 @@ def launch_mev_flood(plan, image, el_uri, genesis_accounts):
"-c", "-c",
"./run init -r {0} -k {1} -u {2} -s deployment.json".format( "./run init -r {0} -k {1} -u {2} -s deployment.json".format(
el_uri, el_uri,
prefixed_address(genesis_accounts[0].private_key), prefixed_address(contract_owner),
prefixed_address(genesis_accounts[2].private_key), prefixed_address(normal_user),
), ),
] ]
), ),
...@@ -32,16 +32,14 @@ def launch_mev_flood(plan, image, el_uri, genesis_accounts): ...@@ -32,16 +32,14 @@ def launch_mev_flood(plan, image, el_uri, genesis_accounts):
def spam_in_background( def spam_in_background(
plan, el_uri, mev_flood_extra_args, seconds_per_bundle, genesis_accounts plan, el_uri, mev_flood_extra_args, seconds_per_bundle, contract_owner, normal_user
): ):
admin_key, user_key = prefixed_address( owner, user = prefixed_address(contract_owner), prefixed_address(normal_user)
genesis_accounts[0].private_key
), prefixed_address(genesis_accounts[2].private_key)
command = [ command = [
"/bin/sh", "/bin/sh",
"-c", "-c",
"nohup ./run spam -r {0} -k {1} -u {2} -l deployment.json --secondsPerBundle {3} >main.log 2>&1 &".format( "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 el_uri, owner, user, seconds_per_bundle
), ),
] ]
if mev_flood_extra_args: if mev_flood_extra_args:
...@@ -50,7 +48,7 @@ def spam_in_background( ...@@ -50,7 +48,7 @@ def spam_in_background(
"/bin/sh", "/bin/sh",
"-c", "-c",
"nohup ./run spam -r {0} -k {1} -u {2} -l deployment.json --secondsPerBundle {3} {4} >main.log 2>&1 &".format( "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 el_uri, owner, user, seconds_per_bundle, joined_extra_args
), ),
] ]
plan.exec(service_name="mev-flood", recipe=ExecRecipe(command=command)) plan.exec(service_name="mev-flood", recipe=ExecRecipe(command=command))
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