Skip to content

Commit d1b868d

Browse files
committed
fix(benchmark): address review comments - remove redundant validation and fix ADD syntax
1 parent 6841f09 commit d1b868d

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

tests/benchmark/bloatnet/test_multi_opcode.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
Block,
1616
BlockchainTestFiller,
1717
Transaction,
18-
TransactionReceipt,
1918
While,
2019
)
2120
from ethereum_test_vm import Bytecode
@@ -164,11 +163,6 @@ def test_bloatnet_balance_extcodesize(
164163
to=attack_address,
165164
gas_limit=gas_benchmark_value,
166165
sender=pre.fund_eoa(),
167-
# Validate that all gas is consumed (benchmark runs to exhaustion)
168-
# If STATICCALL fails, only ~50K gas used -> test fails
169-
expected_receipt=TransactionReceipt(
170-
gas_used=gas_benchmark_value, # Must consume all gas
171-
),
172166
)
173167

174168
# Post-state: just verify attack contract exists
@@ -180,7 +174,6 @@ def test_bloatnet_balance_extcodesize(
180174
pre=pre,
181175
blocks=[Block(txs=[attack_tx])],
182176
post=post,
183-
skip_gas_used_validation=True,
184177
)
185178

186179

@@ -287,8 +280,7 @@ def test_bloatnet_balance_extcodecopy(
287280
+ Op.PUSH1(1) # size (1 byte)
288281
+ Op.PUSH2(max_contract_size - 1) # code offset (last byte)
289282
# Use salt as memory offset to avoid overlap
290-
+ Op.MLOAD(32) # Get current salt from position 32
291-
+ Op.ADD(96) # Add base memory offset for unique position
283+
+ Op.ADD(Op.MLOAD(32), 96) # Add base memory offset for unique position
292284
+ Op.DUP4 # address (duplicated earlier)
293285
+ Op.EXTCODECOPY
294286
+ Op.POP # Clean up address
@@ -309,11 +301,6 @@ def test_bloatnet_balance_extcodecopy(
309301
to=attack_address,
310302
gas_limit=gas_benchmark_value,
311303
sender=pre.fund_eoa(),
312-
# Validate that all gas is consumed (benchmark runs to exhaustion)
313-
# If STATICCALL fails, only ~50K gas used -> test fails
314-
expected_receipt=TransactionReceipt(
315-
gas_used=gas_benchmark_value, # Must consume all gas
316-
),
317304
)
318305

319306
# Post-state
@@ -325,5 +312,4 @@ def test_bloatnet_balance_extcodecopy(
325312
pre=pre,
326313
blocks=[Block(txs=[attack_tx])],
327314
post=post,
328-
skip_gas_used_validation=True,
329315
)

0 commit comments

Comments
 (0)