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