Skip to content

Commit 7f7358d

Browse files
committed
use tx_gas_limit
1 parent 9e4f54e commit 7f7358d

1 file changed

Lines changed: 6 additions & 11 deletions

File tree

tests/benchmark/compute/instruction/test_storage.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ def test_storage_access_warm(
302302
fork: Fork,
303303
gas_benchmark_value: int,
304304
env: Environment,
305+
tx_gas_limit: int,
305306
) -> None:
306307
"""
307308
Benchmark warm storage slot accesses.
@@ -335,12 +336,11 @@ def test_storage_access_warm(
335336
+ Op.RETURN(0, Op.MSIZE)
336337
)
337338

338-
tx_gas_limit_cap = fork.transaction_gas_limit_cap()
339339
with TestPhaseManager.setup():
340340
sender_addr = pre.fund_eoa()
341341
setup_tx = Transaction(
342342
to=None,
343-
gas_limit=tx_gas_limit_cap or env.gas_limit,
343+
gas_limit=tx_gas_limit,
344344
data=creation_code,
345345
sender=sender_addr,
346346
)
@@ -349,20 +349,15 @@ def test_storage_access_warm(
349349
contract_address = compute_create_address(address=sender_addr, nonce=0)
350350

351351
with TestPhaseManager.execution():
352-
tx_max_gas_limit = (
353-
min(gas_benchmark_value, tx_gas_limit_cap)
354-
if tx_gas_limit_cap is not None
355-
else gas_benchmark_value
356-
)
357-
num_exec_txs = math.ceil(gas_benchmark_value / tx_max_gas_limit)
352+
num_exec_txs = math.ceil(gas_benchmark_value / tx_gas_limit)
358353
txs = []
359354
for i in range(num_exec_txs):
360-
tx_gas_limit = min(
361-
tx_max_gas_limit, gas_benchmark_value - i * tx_max_gas_limit
355+
gas_limit = min(
356+
tx_gas_limit, gas_benchmark_value - i * tx_gas_limit
362357
)
363358
op_tx = Transaction(
364359
to=contract_address,
365-
gas_limit=tx_gas_limit,
360+
gas_limit=gas_limit,
366361
sender=pre.fund_eoa(),
367362
)
368363
txs.append(op_tx)

0 commit comments

Comments
 (0)