feat: add depth-based worst-case attack benchmarks for execute mode #1936
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive benchmarks for testing worst-case depth attacks on Ethereum state and account tries in execute mode.
Description
These benchmarks test the worst-case scenario for Ethereum clients when dealing with extremely deep state and account tries. The attack exploits the computational complexity of Patricia Merkle Trie operations through:
The test measures the performance impact of state root recomputation and IO when modifying deep storage slots across thousands of contracts, simulating the maximum theoretical load on the state trie.
Setup Instructions
For complete deployment setup and instructions, see: https://gist.github.com/CPerezz/44d521c0f9e6adf7d84187a4f2c11978
Key Changes
test_worst_depth_stateroot_recomptest with configurable storage/account depth parametersAttackOrchestrator.solcontract for efficient batched attacksPerformance Improvements
This allows testing much larger attack surfaces within the same gas constraints.
Test Parameters
The test supports multiple depth configurations: