Skip to content

feat: add bloated eoa scenario - #296

Open
LouisTsai-Csie wants to merge 1 commit into
ethpandaops:masterfrom
LouisTsai-Csie:storage-operation
Open

LouisTsai-Csie wants to merge 1 commit into
ethpandaops:masterfrom
LouisTsai-Csie:storage-operation

Conversation

@LouisTsai-Csie

Copy link
Copy Markdown

Adds a new bloated-eoa scenario under the Bloatnet category. It ports the EELS bloatnet benchmarks test_sload_bloated and test_sstore_bloated (tests/benchmark/stateful/bloatnet/) to spamoor.

How it works

  1. Deploy: a child wallet deploys the attack contract.
  2. Delegate: the storage-bloated EOA (--authority-privkey) is delegated to the attack contract through an EIP-7702 setcode tx.
  3. Attack: child wallets send max-gas txs to the bloated EOA, which then runs SLOAD/SSTORE loops over its own storage. The storage is assumed to be laid out as s[i] = i.

Modes:

  • sload: the slot counter lives in slot 0, so each tx continues where the previous one stopped. --keep-counter resumes a previous run.
  • sstore: each tx gets its own [start, end) slot range in calldata, so the ranges never overlap. --slots-per-tx sets the range size; the default is derived from the gas limit and includes EIP-8037 state gas.

Variants are selected with --existing-slots and --write-new-value (same value, increment, or zero writes).

Structure

scenarios/statebloat/bloated_eoa/
├── bloated_eoa.go        # scenario: options, deploy, delegation, attack loop
├── contract.go           # assembles initcode/runtime from the geas sources
├── bloated_eoa_test.go   # unit tests
├── README.md             # usage and flags
└── contract/             # geas sources
    ├── initcode.geas
    ├── loop.geas             # sload counter loop
    ├── range_loop.geas       # sstore calldata-range loop
    ├── sload.geas
    ├── sstore_same.geas
    ├── sstore_increment.geas
    └── sstore_zero.geas
  • scenarios/scenarios.go: registers the scenario in the Bloatnet category.
  • README.md: adds the scenario to the list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant