Skip to content

Commit cefa7c5

Browse files
fix: execute benchmark wrapper support
1 parent 3d638d9 commit cefa7c5

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

packages/testing/src/execution_testing/specs/benchmark.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,9 @@ def execute(
323323
) -> BaseExecute:
324324
"""Execute the benchmark test by sending it to the live network."""
325325
if execute_format == TransactionPost:
326+
assert self.blocks is not None
326327
return TransactionPost(
327-
blocks=[[self.tx]],
328+
blocks=[block.txs for block in self.blocks],
328329
post=self.post,
329330
)
330331
raise Exception(f"Unsupported execute format: {execute_format}")

tests/benchmark/test_worst_bytecode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def test_worst_bytecode_single_opcode(
183183

184184
contracts_deployment_tx = Transaction(
185185
to=factory_caller_address,
186-
gas_limit=env.gas_limit,
186+
gas_limit=20 * gas_benchmark_value,
187187
gas_price=10**6,
188188
data=Hash(num_contracts),
189189
sender=pre.fund_eoa(),

tests/benchmark/test_worst_stateful_opcodes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def test_worst_address_state_cold(
9595

9696
setup_tx = Transaction(
9797
to=factory_address,
98-
gas_limit=env.gas_limit,
98+
gas_limit=20 * gas_benchmark_value,
9999
sender=pre.fund_eoa(),
100100
)
101101
blocks.append(Block(txs=[setup_tx]))
@@ -362,7 +362,7 @@ def test_worst_storage_access_cold(
362362
sender_addr = pre.fund_eoa()
363363
setup_tx = Transaction(
364364
to=None,
365-
gas_limit=env.gas_limit,
365+
gas_limit=20 * gas_benchmark_value,
366366
data=creation_code,
367367
sender=sender_addr,
368368
)
@@ -441,7 +441,7 @@ def test_worst_storage_access_warm(
441441
sender_addr = pre.fund_eoa()
442442
setup_tx = Transaction(
443443
to=None,
444-
gas_limit=env.gas_limit,
444+
gas_limit=20 * gas_benchmark_value,
445445
data=creation_code,
446446
sender=sender_addr,
447447
)
@@ -631,7 +631,7 @@ def test_worst_selfdestruct_existing(
631631

632632
contracts_deployment_tx = Transaction(
633633
to=factory_caller_address,
634-
gas_limit=env.gas_limit,
634+
gas_limit=20 * gas_benchmark_value,
635635
data=Hash(num_contracts),
636636
sender=pre.fund_eoa(),
637637
)

0 commit comments

Comments
 (0)