Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -818,3 +818,21 @@ kurtosis-test .
```

The tests can be found in `*_test.star` scripts located in the `test` directory.

### Dev accounts being used

Index| Address | Private Key | In use | Tool
---|---|---|---|---
0| `0xf39F...2266` | `0xac09...f80` | ✅ | [op-transaction-spammer](src/transaction_spammer/transaction_spammer.star#L33)
1| `0x7099...79C8` | `0x59c6...690d` | ❌ | ""
2| `0x3C49...3359` | `0x5de4...365a` | ❌ | ""
3| `0x90F7...9b906` | `0x7c85...a07a6` | ❌ | ""
4| `0x15d3...9f1b9` | `0x47e1...9c6` | ❌ | ""
5| `0x9965...0A4dc` | `0x8b3a...ba` | ❌ | ""
6| `0x976E...9b906` | `0x92db...64e` | ❌ | ""
7| `0x14dC...3356` | `0x4bbbf...356` | ❌ | ""
8| `0x2361...226a` | `0xdbda...b97` | ❌ | ""
9| `0xa0Ee...720` | `0xa0Ee...c6` | ❌ | ""

mnemonic: `test test test test test test test test test test test junk`

2 changes: 2 additions & 0 deletions network_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ optimism_package:
builder_host: ""
builder_port: ""
additional_services: []
tx_fuzzer_params:
tx_fuzzer_extra_args: []
op_contract_deployer_params:
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-deployer:v0.0.12
l1_artifacts_locator: https://storage.googleapis.com/oplabs-contract-artifacts/artifacts-v1-fffcbb0ebf7f83311791534a41e65ef90df47797f9ca8f86941452f597f7128c.tar.gz
Expand Down
15 changes: 15 additions & 0 deletions src/l2.star
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ da_server_launcher = import_module("./alt-da/da-server/da_server_launcher.star")
contract_deployer = import_module("./contracts/contract_deployer.star")
input_parser = import_module("./package_io/input_parser.star")
util = import_module("./util.star")
tx_fuzzer = import_module("./transaction_spammer/transaction_spammer.star")
Comment thread
emhane marked this conversation as resolved.
Outdated


def launch_l2(
Expand All @@ -29,6 +30,7 @@ def launch_l2(
challenger_params = l2_args.challenger_params
proposer_params = l2_args.proposer_params
mev_params = l2_args.mev_params
tx_fuzzer_params = l2_args.tx_fuzzer_params

plan.print("Deploying L2 with name {0}".format(network_params.name))

Expand Down Expand Up @@ -99,6 +101,19 @@ def launch_l2(
network_params.network_id,
)
plan.print("Successfully launched op-blockscout")
elif additional_service == "tx_fuzzer":
plan.print("Launching transaction spammer")
fuzz_target = "http://{0}:{1}".format(
all_el_contexts[0].ip_addr,
all_el_contexts[0].rpc_port_num,
)
tx_fuzzer.launch_transaction_spammer(
plan,
fuzz_target,
tx_fuzzer_params,
global_node_selectors,
)
plan.print("Successfully launched transaction spammer")

plan.print(l2.participants)
plan.print(
Expand Down
45 changes: 45 additions & 0 deletions src/package_io/constants.star
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,48 @@ VOLUME_SIZE = {
"hildr_volume_size": 1000, # 1GB
},
}

dev_accounts = [
{
"address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"private_key": "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80",
},
{
"address": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
"private_key": "0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d",
},
{
"address": "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC",
"private_key": "0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a",
},
{
"address": "0x90F79bf6EB2c4f870365E785982E1f101E93b906",
"private_key": "0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6",
},
{
"address": "0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65",
"private_key": "0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a",
},
{
"address": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc",
"private_key": "0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba",
},
{
"address": "0x976EA74026E726554dB657fA54763abd0C3a0aa9",
"private_key": "0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e",
},
{
"address": "0x14dC79964da2C08b23698B3D3cc7Ca32193d9955",
"private_key": "0x4bbbf85ce3377467afe5d46f804f221813b2bb87f24d81f60f1fcdbf7cbf4356",
},
{
"address": "0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f",
"private_key": "0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97",
},
{
"address": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
"private_key": "0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6",
},
]

mnemonic = "test test test test test test test test test test test junk"
Comment thread
janjakubnanista marked this conversation as resolved.
18 changes: 18 additions & 0 deletions src/package_io/input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,12 @@ def input_parser(plan, input_args):
cmd=result["da_server_params"]["cmd"],
),
additional_services=result["additional_services"],
tx_fuzzer_params=struct(
image=result["tx_fuzzer_params"]["image"],
tx_fuzzer_extra_args=result["tx_fuzzer_params"][
"tx_fuzzer_extra_args"
],
),
)
for result in results["chains"]
],
Expand Down Expand Up @@ -411,6 +417,9 @@ def parse_network_params(plan, input_args):
)
participants.append(participant_copy)

tx_fuzzer_params = default_tx_fuzzer_params()
tx_fuzzer_params.update(chain.get("tx_fuzzer_params", {}))

result = {
"participants": participants,
"network_params": network_params,
Expand All @@ -423,6 +432,7 @@ def parse_network_params(plan, input_args):
"additional_services": chain.get(
"additional_services", DEFAULT_ADDITIONAL_SERVICES
),
"tx_fuzzer_params": tx_fuzzer_params,
}
chains.append(result)

Expand Down Expand Up @@ -547,6 +557,7 @@ def default_chains():
"mev_params": default_mev_params(),
"da_server_params": default_da_server_params(),
"additional_services": DEFAULT_ADDITIONAL_SERVICES,
"tx_fuzzer_params": default_tx_fuzzer_params(),
}
]

Expand Down Expand Up @@ -704,3 +715,10 @@ def default_da_server_params():
"image": DEFAULT_DA_SERVER_PARAMS["image"],
"cmd": DEFAULT_DA_SERVER_PARAMS["cmd"],
}


def default_tx_fuzzer_params():
return {
"image": "ethpandaops/tx-fuzz:master",
"tx_fuzzer_extra_args": [],
}
10 changes: 5 additions & 5 deletions src/package_io/sanity_check.star
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ SUBCATEGORY_PARAMS = {
"image",
"cmd",
],
"tx_fuzzer_params": [
"image",
"tx_fuzzer_extra_args",
],
}

OP_CONTRACT_DEPLOYER_PARAMS = [
Expand All @@ -171,11 +175,7 @@ OP_CONTRACT_DEPLOYER_PARAMS = [

OP_CONTRACT_DEPLOYER_GLOBAL_DEPLOY_OVERRIDES = ["faultGameAbsolutePrestate"]

ADDITIONAL_SERVICES_PARAMS = [
"blockscout",
"rollup-boost",
"da_server",
]
ADDITIONAL_SERVICES_PARAMS = ["blockscout", "rollup-boost", "da_server", "tx_fuzzer"]

EXTERNAL_L1_NETWORK_PARAMS = [
"network_id",
Expand Down
47 changes: 47 additions & 0 deletions src/transaction_fuzzer/transaction_fuzzer.star
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
constants = import_module("../package_io/constants.star")
SERVICE_NAME = "op-transaction-spammer"

# The min/max CPU/memory that tx-fuzzer can use
MIN_CPU = 100
MAX_CPU = 1000
MIN_MEMORY = 20
MAX_MEMORY = 300


def launch_transaction_spammer(
plan,
el_uri,
tx_fuzzer_params,
global_node_selectors,
):
config = get_config(
el_uri,
tx_fuzzer_params,
global_node_selectors,
)
plan.add_service(SERVICE_NAME, config)


def get_config(
el_uri,
tx_fuzzer_params,
node_selectors,
):
cmd = [
"spam",
"--rpc={}".format(el_uri),
"--sk={0}".format(constants.dev_accounts[0]["private_key"]),
]

if len(tx_fuzzer_params.tx_fuzzer_extra_args) > 0:
cmd.extend([param for param in tx_fuzzer_params.tx_fuzzer_extra_args])

return ServiceConfig(
image=tx_fuzzer_params.image,
cmd=cmd,
min_cpu=MIN_CPU,
max_cpu=MAX_CPU,
min_memory=MIN_MEMORY,
max_memory=MAX_MEMORY,
node_selectors=node_selectors,
)