Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1103,8 +1103,10 @@ def tx_iterations_by_gas_limit(

If the fork's transaction gas limit cap is not `None`, the returned
list will contain one item per transaction that represents the
iteration count for that transaction, and no transaction will exceed
the gas limit cap.
iteration count for that transaction. The cap constrains each
transaction's compute gas; on forks with state gas (EIP-8037) the
transaction's combined gas limit may exceed the cap by the
state-gas portion.
"""
gas_limit_cap = fork.transaction_gas_limit_cap()
remaining_gas = gas_limit
Expand Down Expand Up @@ -1166,6 +1168,9 @@ def tx_iterations_by_total_iteration_count(

while remaining_iterations > 0:
if best_iterations is None or not constant_intrinsic_gas_cost:
# No block budget in this context, so the cap also bounds
# the combined gas to keep the search finite; under state
# gas (EIP-8037) this slightly under-fills transactions.
best_iterations, _ = self._binary_search_iterations(
fork=fork,
gas_limit=gas_limit_cap,
Expand Down
5 changes: 5 additions & 0 deletions tests/benchmark/stateful/bloatnet/test_single_opcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,11 @@ def test_sstore_bloated(
) -> None:
"""
Benchmark SSTORE opcodes targeting an EOA with storage bloated.

The bloated storage is assumed to be filled linearly from slot 1
upwards, with each slot holding its own key as value. The SSTORE gas
metadata for `existing_slots=True` relies on this layout; if the stub
account deviates, the test will not exercise the claimed gas case.
"""
sstore_metadata: dict[str, Any] = {}
# If CACHE_TX, there would be one cold SLOAD before SSTORE
Expand Down
Loading