Skip to content

Comments

[pull] forks/amsterdam from ethereum:forks/amsterdam#60

Merged
pull[bot] merged 4 commits intoLuckQuack:forks/amsterdamfrom
ethereum:forks/amsterdam
Feb 13, 2026
Merged

[pull] forks/amsterdam from ethereum:forks/amsterdam#60
pull[bot] merged 4 commits intoLuckQuack:forks/amsterdamfrom
ethereum:forks/amsterdam

Conversation

@pull
Copy link

@pull pull bot commented Feb 13, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

edg-l and others added 4 commits February 13, 2026 10:50
Add INVALID_GASLIMIT substring mapping. Remove GAS_USED_OVERFLOW regex
since ethrex now uses a consistent "Gas allowance exceeded" message.
…reum state tries using deterministic deploy (#1976)

* feat: add worst-case depth attack benchmarks for Ethereum state tries

This PR introduces comprehensive benchmarks to test Ethereum clients under
worst-case scenarios involving extremely deep state and account tries.

The attack scenario:
- Pre-deployed contracts with deep storage tries (depth=9) maximizing traversal costs
- CREATE2-based deterministic addressing for reproducible benchmarks
- AttackOrchestrator contract that batches up to 2,510 attacks per transaction
- Tests measure state root recomputation impact when modifying deep slots

Key components:
- depth_9.sol, depth_10.sol: Contracts with deep storage tries
- s9_acc3.json: Pre-computed CREATE2 addresses and auxiliary accounts (15k contracts)
- AttackOrchestrator.sol: Optimized attack coordinator (3,650 gas per attack)
- deep_branch_testing.py: EEST test harness for pre-deployed contracts
- README.md: Complete documentation and setup instructions

Performance optimizations:
- Reduced gas forwarding from 50k to 3,650 per attack (8.3x throughput increase)
- MAX_ATTACKS_PER_TX increased from 303 to 2,510
- Precise EVM opcode cost analysis with safety margins
- Read init_code_hash directly from JSON instead of recompiling

Deployment setup and instructions available at:
https://gist.github.com/CPerezz/44d521c0f9e6adf7d84187a4f2c11978

This benchmark helps identify performance bottlenecks in state trie handling
and validates client implementations under extreme depth conditions.

* fix(AttackOrchestrator): increase gas forwarded to 5300 for SSTORE

The attack() call was forwarding only 3650 gas, which is insufficient
for SSTORE operations on cold storage slots. SSTORE requires:
- 2100 gas for cold slot access
- 2900 gas for zero-to-nonzero write
- Plus dispatch overhead (~200 gas)

Updated to forward 5300 gas to ensure SSTORE succeeds.

* feat(Verifier): add contract for post-attack storage verification

Adds a minimal Verifier contract that checks if a target contract's
deepest storage slot was updated to the expected attack value. This
enables the test to verify attack success without expensive post-state
checks on all attacked contracts.

The verify() function calls getDeepest() on the target and compares
the returned value against the expected attack value.

* refactor(deep_branch_testing): use CREATE2 address derivation and fix gas

Major refactor of the depth benchmark test for execute mode:

- Remove stubs dependency; derive contract addresses directly from
  init_code_hash + Nick's deployer using CREATE2 formula
- Deploy AttackOrchestrator and Verifier as part of test execution
- Dynamically compute NUM_CONTRACTS based on gas_benchmark_value
- Add verification transaction at end of block to confirm attack success
- Fix gas constants based on empirical measurements:
  - GAS_PER_ATTACK: 8014 -> 8050 (measured ~8042)
  - MAX_ATTACKS_PER_TX: 1990 -> 1980 (safety margin)
  - TX_OVERHEAD: 22900 -> 22600 (more accurate)

The previous gas constants caused all attack transactions to run out
of gas, as the 28 gas/attack shortfall compounded over 1990 attacks
to ~55k gas deficit.

* refactor(depth-benchmarks): download assets from GitHub, embed bytecode

- Embed AttackOrchestrator and Verifier bytecode directly in Python
- Add download_mined_asset() to fetch JSON/SOL files from GitHub
- Cache downloaded files locally in .cache/ directory
- Remove local .sol and .json asset files (now downloaded on demand)
- Update test parameters to use (10, 6) available from GitHub
- Add gist reference for contract sources

Contract sources: https://gist.github.com/CPerezz/8686da933fa5c045fbdf7c31e20e6c71
Mined assets: https://github.com/CPerezz/worst_case_miner/tree/master/mined_assets

* style: run ruff format on deep_branch_testing.py

* fix: add mypy type annotations for deep_branch_testing.py

* refactor(depth-benchmarks): code review improvements

- Remove unused ATTACK_SELECTOR constant
- Extract magic numbers to named constants (gas limits, fees, etc.)
- Add zero contracts validation to prevent edge case bugs
- Fix unused fork parameter (rename to _fork)
- Replace print warning with warnings.warn
- Fix docstring math discrepancy (~2,742 not 2,750)
- Fix line length issues and add proper type annotations

* feat(git): Add `CPerezz/worst_case_miner` submodule

* feat(tests/benchmarking): Update deep branch tests

* fix: Update test file description

* cleanup

* refactor: Simplify using new tools

* fix: Review comments

* fix(tests): Update submodule

* fix: review comments

---------

Co-authored-by: CPerezz <cperezz19@pm.me>
…2198)

* refactor: compute benchmark via gas cost calculator

* fix: logic issue

* fix: linting issue

* fix: apply changes

* refactor: remove hardcoded gas constant
* refactor: use bytecode gas cost calculator

* feat: add stateful helper function

* refactor: update multi-opcode benchmark

* refactor: update single-opcode benchmark

* refactor: update stub account
@pull pull bot locked and limited conversation to collaborators Feb 13, 2026
@pull pull bot added the ⤵️ pull label Feb 13, 2026
@pull pull bot merged commit 83852d6 into LuckQuack:forks/amsterdam Feb 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants