Commit 3f2c7979 authored by pk910's avatar pk910 Committed by GitHub

feat: added another blob spamming tool (`goomy_blob`) (#268)

Added Goomy the Blob Tool to the package.
With default parameters it will generate a low, but continuous amount of
blobs (2-4 blobs per block).
parent 7bbba4c2
...@@ -210,6 +210,12 @@ To configure the package behaviour, you can modify your `network_params.json` fi ...@@ -210,6 +210,12 @@ To configure the package behaviour, you can modify your `network_params.json` fi
"tx_spammer_extra_args": [] "tx_spammer_extra_args": []
}, },
// Configuration place for goomy the blob spammer - https://github.com/ethpandaops/goomy-blob
"goomy_blob_params": {
// A list of optional params that will be passed to the blob-spammer comamnd for modifying its behaviour
"goomy_blob_args": []
},
// True by defaults, adds services defined in "additional_services" alongside the Ethereum network // True by defaults, adds services defined in "additional_services" alongside the Ethereum network
// If set to false: // If set to false:
// - only Ethereum network (EL and CL nodes) will be launched. Nothing else (no transaction spammer) // - only Ethereum network (EL and CL nodes) will be launched. Nothing else (no transaction spammer)
...@@ -223,6 +229,7 @@ To configure the package behaviour, you can modify your `network_params.json` fi ...@@ -223,6 +229,7 @@ To configure the package behaviour, you can modify your `network_params.json` fi
"additional_services": [ "additional_services": [
"tx_spammer", "tx_spammer",
"blob_spammer", "blob_spammer",
"goomy_blob"
"cl_forkmon", "cl_forkmon",
"el_forkmon", "el_forkmon",
"beacon_metrics_gazer", "beacon_metrics_gazer",
...@@ -481,6 +488,7 @@ Here's a table of where the keys are used ...@@ -481,6 +488,7 @@ Here's a table of where the keys are used
| 0 | mev_custom_flood | | ✅ | As the receiver of balance | | 0 | mev_custom_flood | | ✅ | As the receiver of balance |
| 6 | mev_custom_flood | ✅ | | As the sender of balance | | 6 | mev_custom_flood | ✅ | | As the sender of balance |
| 1 | blob_spammer | ✅ | | As the sender of blobs | | 1 | blob_spammer | ✅ | | As the sender of blobs |
| 4 | goomy_blob | ✅ | | As the sender of blobs |
## Developing On This Package ## Developing On This Package
......
...@@ -11,6 +11,7 @@ transaction_spammer = import_module( ...@@ -11,6 +11,7 @@ transaction_spammer = import_module(
"./src/transaction_spammer/transaction_spammer.star" "./src/transaction_spammer/transaction_spammer.star"
) )
blob_spammer = import_module("./src/blob_spammer/blob_spammer.star") blob_spammer = import_module("./src/blob_spammer/blob_spammer.star")
goomy_blob = import_module("./src/goomy_blob/goomy_blob.star")
cl_forkmon = import_module("./src/cl_forkmon/cl_forkmon_launcher.star") cl_forkmon = import_module("./src/cl_forkmon/cl_forkmon_launcher.star")
el_forkmon = import_module("./src/el_forkmon/el_forkmon_launcher.star") el_forkmon = import_module("./src/el_forkmon/el_forkmon_launcher.star")
beacon_metrics_gazer = import_module( beacon_metrics_gazer = import_module(
...@@ -241,6 +242,18 @@ def run(plan, args={}): ...@@ -241,6 +242,18 @@ def run(plan, args={}):
network_params.genesis_delay, network_params.genesis_delay,
) )
plan.print("Succesfully launched blob spammer") plan.print("Succesfully launched blob spammer")
elif additional_service == "goomy_blob":
plan.print("Launching Goomy the blob spammer")
goomy_blob_params = args_with_right_defaults.goomy_blob_params
goomy_blob.launch_goomy_blob(
plan,
genesis_constants.PRE_FUNDED_ACCOUNTS,
all_el_client_contexts,
all_cl_client_contexts[0],
network_params.slots_per_epoch,
goomy_blob_params,
)
plan.print("Succesfully launched goomy the blob spammer")
# We need a way to do time.sleep # We need a way to do time.sleep
# TODO add code that waits for CL genesis # TODO add code that waits for CL genesis
elif additional_service == "cl_forkmon": elif additional_service == "cl_forkmon":
......
SERVICE_NAME = "goomy-blob-spammer"
IMAGE_NAME = "ethpandaops/goomy-blob:master"
ENTRYPOINT_ARGS = ["/bin/sh", "-c"]
def launch_goomy_blob(
plan,
prefunded_addresses,
el_client_contexts,
cl_client_context,
seconds_per_slot,
goomy_blob_params,
):
config = get_config(
prefunded_addresses,
el_client_contexts,
cl_client_context,
seconds_per_slot,
goomy_blob_params.goomy_blob_args,
)
plan.add_service(SERVICE_NAME, config)
def get_config(
prefunded_addresses,
el_client_contexts,
cl_client_context,
seconds_per_slot,
goomy_blob_args,
):
goomy_cli_args = []
for index, client in enumerate(el_client_contexts):
goomy_cli_args.append(
"-h http://{0}:{1}".format(
client.ip_addr,
client.rpc_port_num,
)
)
goomy_args = " ".join(goomy_blob_args)
if goomy_args == "":
goomy_args = "combined -b 2 -t 2 --max-pending 3"
goomy_cli_args.append(goomy_args)
return ServiceConfig(
image=IMAGE_NAME,
entrypoint=ENTRYPOINT_ARGS,
cmd=[
" && ".join(
[
"apt-get update",
"apt-get install -y curl jq",
'current_epoch=$(curl -s http://{0}:{1}/eth/v2/beacon/blocks/head | jq -r ".version")'.format(
cl_client_context.ip_addr, cl_client_context.http_port_num
),
'while [ $current_epoch != "deneb" ]; do echo "waiting for deneb, current epoch is $current_epoch"; current_epoch=$(curl -s http://{0}:{1}/eth/v2/beacon/blocks/head | jq -r ".version"); sleep {2}; done'.format(
cl_client_context.ip_addr,
cl_client_context.http_port_num,
seconds_per_slot,
),
'echo "sleep is over, starting to send blob transactions"',
"./blob-spammer -p {0} {1}".format(
prefunded_addresses[4].private_key,
" ".join(goomy_cli_args),
),
]
)
],
)
...@@ -43,6 +43,7 @@ ATTR_TO_BE_SKIPPED_AT_ROOT = ( ...@@ -43,6 +43,7 @@ ATTR_TO_BE_SKIPPED_AT_ROOT = (
"participants", "participants",
"mev_params", "mev_params",
"tx_spammer_params", "tx_spammer_params",
"goomy_blob_params",
) )
DEFAULT_EXPLORER_VERSION = "dora" DEFAULT_EXPLORER_VERSION = "dora"
...@@ -95,6 +96,7 @@ def parse_input(plan, input_args): ...@@ -95,6 +96,7 @@ def parse_input(plan, input_args):
) )
result["tx_spammer_params"] = get_default_tx_spammer_params() result["tx_spammer_params"] = get_default_tx_spammer_params()
result["goomy_blob_params"] = get_default_goomy_blob_params()
return struct( return struct(
participants=[ participants=[
...@@ -168,6 +170,9 @@ def parse_input(plan, input_args): ...@@ -168,6 +170,9 @@ def parse_input(plan, input_args):
tx_spammer_params=struct( tx_spammer_params=struct(
tx_spammer_extra_args=result["tx_spammer_params"]["tx_spammer_extra_args"], tx_spammer_extra_args=result["tx_spammer_params"]["tx_spammer_extra_args"],
), ),
goomy_blob_params=struct(
goomy_blob_args=result["goomy_blob_params"]["goomy_blob_args"],
),
launch_additional_services=result["launch_additional_services"], launch_additional_services=result["launch_additional_services"],
additional_services=result["additional_services"], additional_services=result["additional_services"],
wait_for_finalization=result["wait_for_finalization"], wait_for_finalization=result["wait_for_finalization"],
...@@ -405,6 +410,10 @@ def get_default_tx_spammer_params(): ...@@ -405,6 +410,10 @@ def get_default_tx_spammer_params():
return {"tx_spammer_extra_args": []} return {"tx_spammer_extra_args": []}
def get_default_goomy_blob_params():
return {"goomy_blob_args": []}
# TODO perhaps clean this up into a map # TODO perhaps clean this up into a map
def enrich_mev_extra_params(parsed_arguments_dict, mev_prefix, mev_port, mev_type): def enrich_mev_extra_params(parsed_arguments_dict, mev_prefix, mev_port, mev_type):
for index, participant in enumerate(parsed_arguments_dict["participants"]): for index, participant in enumerate(parsed_arguments_dict["participants"]):
......
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