Skip to content

Commit 83ed7e0

Browse files
committed
improvements
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
1 parent 3a6469b commit 83ed7e0

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

tests/zkevm/test_worst_stateful_opcodes.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -575,12 +575,13 @@ def test_worst_selfdestruct_existing(
575575
body=Op.POP(Op.CALL(address=Op.SHA3(32 - 20 - 1, 85)))
576576
+ Op.MSTORE(32, Op.ADD(Op.MLOAD(32), 1)),
577577
# Stop before we run out of gas for the whole tx execution.
578-
# The value was discovered practically rounded to the next 1000 multiple.
579-
condition=Op.GT(Op.GAS, 28_000),
578+
# The value was found by trial-error rounded to the next 1000 multiple.
579+
condition=Op.GT(Op.GAS, 12_000),
580580
)
581581
+ Op.SSTORE(0, 42) # Done for successful tx execution assertion below.
582582
)
583-
code_addr = pre.deploy_contract(code=code)
583+
# The 0 storage slot is initialize to avoid creation costs in SSTORE above.
584+
code_addr = pre.deploy_contract(code=code, storage={0: 1})
584585
opcode_tx = Transaction(
585586
to=code_addr,
586587
gas_limit=attack_gas_limit,
@@ -661,12 +662,13 @@ def test_worst_selfdestruct_created(
661662
)
662663
),
663664
# Stop before we run out of gas for the whole tx execution.
664-
# The value was discovered practically rounded to the next 1000 multiple.
665-
condition=Op.GT(Op.GAS, 40_000),
665+
# The value was found by trial-error rounded to the next 1000 multiple.
666+
condition=Op.GT(Op.GAS, 33_000),
666667
)
667668
+ Op.SSTORE(0, 42) # Done for successful tx execution assertion below.
668669
)
669-
code_addr = pre.deploy_contract(code=code)
670+
# The 0 storage slot is initialize to avoid creation costs in SSTORE above.
671+
code_addr = pre.deploy_contract(code=code, storage={0: 1})
670672
code_tx = Transaction(
671673
to=code_addr,
672674
gas_limit=env.gas_limit,

0 commit comments

Comments
 (0)