@@ -466,7 +466,7 @@ def test_worst_precompile_only_data_input(
466
466
467
467
calldata = Op .CODECOPY (0 , 0 , optimal_input_length )
468
468
attack_block = Op .POP (Op .STATICCALL (Op .GAS , address , 0 , optimal_input_length , 0 , 0 ))
469
- code = code_loop_precompile_call (calldata , attack_block )
469
+ code = code_loop_precompile_call (calldata , attack_block , fork )
470
470
471
471
code_address = pre .deploy_contract (code = code )
472
472
@@ -485,10 +485,7 @@ def test_worst_precompile_only_data_input(
485
485
486
486
487
487
@pytest .mark .valid_from ("Cancun" )
488
- def test_worst_modexp (
489
- state_test : StateTestFiller ,
490
- pre : Alloc ,
491
- ):
488
+ def test_worst_modexp (state_test : StateTestFiller , pre : Alloc , fork : Fork ):
492
489
"""Test running a block with as many MODEXP calls as possible."""
493
490
env = Environment ()
494
491
@@ -514,7 +511,7 @@ def test_worst_modexp(
514
511
iter_complexity = exp .bit_length () - 1
515
512
gas_cost = math .floor ((mul_complexity * iter_complexity ) / 3 )
516
513
attack_block = Op .POP (Op .STATICCALL (gas_cost , 0x5 , 0 , 32 * 6 , 0 , 0 ))
517
- code = code_loop_precompile_call (calldata , attack_block )
514
+ code = code_loop_precompile_call (calldata , attack_block , fork )
518
515
519
516
code_address = pre .deploy_contract (code = code )
520
517
@@ -681,6 +678,7 @@ def test_worst_modexp(
681
678
def test_worst_precompile_fixed_cost (
682
679
state_test : StateTestFiller ,
683
680
pre : Alloc ,
681
+ fork : Fork ,
684
682
precompile_address : Address ,
685
683
parameters : list [str ] | list [BytesConcatenation ] | list [bytes ],
686
684
):
@@ -715,7 +713,7 @@ def test_worst_precompile_fixed_cost(
715
713
attack_block = Op .POP (
716
714
Op .STATICCALL (Op .GAS , precompile_address , 0 , len (concatenated_bytes ), 0 , 0 )
717
715
)
718
- code = code_loop_precompile_call (calldata , attack_block )
716
+ code = code_loop_precompile_call (calldata , attack_block , fork )
719
717
code_address = pre .deploy_contract (code = bytes (code ))
720
718
721
719
tx = Transaction (
@@ -1507,7 +1505,7 @@ def test_amortized_bn128_pairings(
1507
1505
1508
1506
calldata = Op .CALLDATACOPY (size = Op .CALLDATASIZE )
1509
1507
attack_block = Op .POP (Op .STATICCALL (Op .GAS , 0x08 , 0 , Op .CALLDATASIZE , 0 , 0 ))
1510
- code = code_loop_precompile_call (calldata , attack_block )
1508
+ code = code_loop_precompile_call (calldata , attack_block , fork )
1511
1509
1512
1510
code_address = pre .deploy_contract (code = code )
1513
1511
0 commit comments