@@ -575,12 +575,13 @@ def test_worst_selfdestruct_existing(
575
575
body = Op .POP (Op .CALL (address = Op .SHA3 (32 - 20 - 1 , 85 )))
576
576
+ Op .MSTORE (32 , Op .ADD (Op .MLOAD (32 ), 1 )),
577
577
# 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 ),
580
580
)
581
581
+ Op .SSTORE (0 , 42 ) # Done for successful tx execution assertion below.
582
582
)
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 })
584
585
opcode_tx = Transaction (
585
586
to = code_addr ,
586
587
gas_limit = attack_gas_limit ,
@@ -661,12 +662,13 @@ def test_worst_selfdestruct_created(
661
662
)
662
663
),
663
664
# 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 ),
666
667
)
667
668
+ Op .SSTORE (0 , 42 ) # Done for successful tx execution assertion below.
668
669
)
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 })
670
672
code_tx = Transaction (
671
673
to = code_addr ,
672
674
gas_limit = env .gas_limit ,
0 commit comments