Test Deep Branch¶
Documentation for tests/benchmark/stateful/bloatnet/depth_benchmarks/test_deep_branch.py@7b8124a7.
Generate fixtures for these test cases for Osaka with:
fill -v tests/benchmark/stateful/bloatnet/depth_benchmarks/test_deep_branch.py --fork Osaka
abstract: BloatNet worst-case attack benchmark for maximum SSTORE stress.
This test implements a worst-case scenario for Ethereum block processing that exploits the computational complexity of Patricia Merkle Trie operations. It uses CREATE2 to deploy contracts at pre-mined addresses with shared prefixes, maximizing trie traversal depth.
Key features: - Attacks pre-deployed contracts via CREATE2 address derivation - Each contract has deep storage slots with configurable trie depth - Executes optimized attack bytecode with multiple SSTORE operations - Respects Fusaka tx gas limit (16M gas) and fills blocks fully - Verifies attack success via a storage check in each of the attack contracts
Test parameters: - storage_depth: Depth of storage slots (e.g., 10, 11) - account_depth: Account address prefix sharing depth (e.g., 6, 7)
Contract sources: - Pre-mined assets (depth_.sol, s_acc*.json): https://github.com/CPerezz/worst_case_miner/tree/master/mined_assets
Test Functions Overview¶
| Name | Type | Cases (Osaka) | Description |
|---|---|---|---|
test_worst_depth_stateroot_recomp |
benchmark_test | 13 | BloatNet worst-case SSTORE attack benchmark with pre-deployed contracts. |