Skip to content

Commit

Permalink
feat: added another blob spamming tool (goomy_blob) (#268)
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
pk910 committed Oct 10, 2023
1 parent 7bbba4c commit 3f2c797
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,12 @@ To configure the package behaviour, you can modify your `network_params.json` fi
"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
// If set to false:
// - only Ethereum network (EL and CL nodes) will be launched. Nothing else (no transaction spammer)
Expand All @@ -223,6 +229,7 @@ To configure the package behaviour, you can modify your `network_params.json` fi
"additional_services": [
"tx_spammer",
"blob_spammer",
"goomy_blob"
"cl_forkmon",
"el_forkmon",
"beacon_metrics_gazer",
Expand Down Expand Up @@ -481,6 +488,7 @@ Here's a table of where the keys are used
| 0 | mev_custom_flood | | ✅ | As the receiver of balance |
| 6 | mev_custom_flood | ✅ | | As the sender of balance |
| 1 | blob_spammer | ✅ | | As the sender of blobs |
| 4 | goomy_blob | ✅ | | As the sender of blobs |
## Developing On This Package
Expand Down
13 changes: 13 additions & 0 deletions main.star
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ transaction_spammer = import_module(
"./src/transaction_spammer/transaction_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")
el_forkmon = import_module("./src/el_forkmon/el_forkmon_launcher.star")
beacon_metrics_gazer = import_module(
Expand Down Expand Up @@ -241,6 +242,18 @@ def run(plan, args={}):
network_params.genesis_delay,
)
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
# TODO add code that waits for CL genesis
elif additional_service == "cl_forkmon":
Expand Down
70 changes: 70 additions & 0 deletions src/goomy_blob/goomy_blob.star
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
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),
),
]
)
],
)
9 changes: 9 additions & 0 deletions src/package_io/parse_input.star
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ ATTR_TO_BE_SKIPPED_AT_ROOT = (
"participants",
"mev_params",
"tx_spammer_params",
"goomy_blob_params",
)

DEFAULT_EXPLORER_VERSION = "dora"
Expand Down Expand Up @@ -95,6 +96,7 @@ def parse_input(plan, input_args):
)

result["tx_spammer_params"] = get_default_tx_spammer_params()
result["goomy_blob_params"] = get_default_goomy_blob_params()

return struct(
participants=[
Expand Down Expand Up @@ -168,6 +170,9 @@ def parse_input(plan, input_args):
tx_spammer_params=struct(
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"],
additional_services=result["additional_services"],
wait_for_finalization=result["wait_for_finalization"],
Expand Down Expand Up @@ -405,6 +410,10 @@ def get_default_tx_spammer_params():
return {"tx_spammer_extra_args": []}


def get_default_goomy_blob_params():
return {"goomy_blob_args": []}


# TODO perhaps clean this up into a map
def enrich_mev_extra_params(parsed_arguments_dict, mev_prefix, mev_port, mev_type):
for index, participant in enumerate(parsed_arguments_dict["participants"]):
Expand Down

0 comments on commit 3f2c797

Please sign in to comment.