Skip to content

Commit fee6e2e

Browse files
committed
feat(tests/benchmarking): Update deep branch tests
1 parent 7266f6e commit fee6e2e

3 files changed

Lines changed: 481 additions & 538 deletions

File tree

tests/benchmark/stateful/bloatnet/depth_benchmarks/README.md

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ The test measures the performance impact of state root recomputation and IO when
1515

1616
## Contract Sources
1717

18-
- **AttackOrchestrator.sol** and **Verifier.sol**: https://gist.github.com/CPerezz/8686da933fa5c045fbdf7c31e20e6c71
1918
- **Pre-mined assets** (depth_*.sol, s*_acc*.json): https://github.com/CPerezz/worst_case_miner/tree/master/mined_assets
2019

2120
For complete deployment setup and instructions, see the gist: https://gist.github.com/CPerezz/44d521c0f9e6adf7d84187a4f2c11978
@@ -24,7 +23,7 @@ For complete deployment setup and instructions, see the gist: https://gist.githu
2423

2524
- Python with `uv` package manager
2625
- Anvil (Ethereum node implementation) or another EVM client
27-
- Nick's factory deployed at `0x4e59b44847b379578588920ca78fbf26c0b4956c`
26+
- Nick's factory deployed at `0x4e59b44847b379578588920ca78fbf26c0b4956c` (automatically deployed by `execute` otherwise)
2827

2928
## Workflow
3029

@@ -35,50 +34,28 @@ For complete deployment setup and instructions, see the gist: https://gist.githu
3534
anvil --hardfork prague --block-time 6 --steps-tracing --gas-limit 500000000 --balance 99999999999999 --port 8545
3635
```
3736

38-
### Step 2: Deploy Contracts
39-
40-
Deploy contracts using the provided script with batched transactions:
37+
### Step 2: Obtain the mined assets
4138

4239
```bash
43-
# Deploy contracts (example for depth 10, account depth 6)
44-
uv run python deploy_deep_branches.py \
45-
--rpc-url http://localhost:8546 \
46-
--private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \
47-
--storage-depth 10 \
48-
--account-depth 6 \
49-
--num-contracts 1000 \
50-
--output deployed_contracts.json
40+
git submodule update --init --recursive
5141
```
5242

53-
The script:
54-
- Funds auxiliary accounts in batches
55-
- Deploys contracts via CREATE2 for deterministic addresses
56-
- Dynamically calculates batch sizes based on network gas limit
57-
5843
### Step 3: Run Attack Test
5944

6045
Execute the worst-case depth attack test:
6146

6247
```bash
6348
# Run the attack test
49+
export RPC_ENDPOINT=<RPC endpoint>
50+
export RPC_SEED_KEY=<Account with funds>
51+
export RPC_CHAIN_ID=<RPC chain ID>
6452
uv run execute remote \
65-
--rpc-endpoint=http://localhost:8546 \
66-
--rpc-seed-key=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \
67-
--rpc-chain-id=31337 \
6853
--gas-benchmark-values 60 \
6954
--fork Prague \
7055
-m stateful \
71-
deep_branch_testing.py::test_worst_depth_stateroot_recomp
56+
tests/benchmark/stateful/bloatnet/depth_benchmarks/test_deep_branch.py
7257
```
7358

74-
## Asset Downloads
75-
76-
The test automatically downloads required assets from GitHub:
77-
- `s{storage_depth}_acc{account_depth}.json` - Pre-mined CREATE2 addresses and auxiliary accounts
78-
- `depth_{storage_depth}.sol` - Solidity contract source (used to extract deep storage slot)
79-
80-
Downloaded assets are cached locally in `.cache/` directory.
81-
8259
## Available Configurations
8360

8461
Currently available pre-mined assets from [worst_case_miner](https://github.com/CPerezz/worst_case_miner/tree/master/mined_assets):

0 commit comments

Comments
 (0)