@@ -196,7 +196,7 @@ def test_worst_precompile_only_data_input(
196
196
197
197
calldata = Op .CODECOPY (0 , 0 , optimal_input_length )
198
198
attack_block = Op .POP (Op .STATICCALL (Op .GAS , address , 0 , optimal_input_length , 0 , 0 ))
199
- code = code_loop_precompile_call (calldata , attack_block )
199
+ code = code_loop_precompile_call (calldata , attack_block , fork )
200
200
201
201
code_address = pre .deploy_contract (code = code )
202
202
@@ -215,10 +215,7 @@ def test_worst_precompile_only_data_input(
215
215
216
216
217
217
@pytest .mark .valid_from ("Cancun" )
218
- def test_worst_modexp (
219
- state_test : StateTestFiller ,
220
- pre : Alloc ,
221
- ):
218
+ def test_worst_modexp (state_test : StateTestFiller , pre : Alloc , fork : Fork ):
222
219
"""Test running a block with as many MODEXP calls as possible."""
223
220
env = Environment ()
224
221
@@ -244,7 +241,7 @@ def test_worst_modexp(
244
241
iter_complexity = exp .bit_length () - 1
245
242
gas_cost = math .floor ((mul_complexity * iter_complexity ) / 3 )
246
243
attack_block = Op .POP (Op .STATICCALL (gas_cost , 0x5 , 0 , 32 * 6 , 0 , 0 ))
247
- code = code_loop_precompile_call (calldata , attack_block )
244
+ code = code_loop_precompile_call (calldata , attack_block , fork )
248
245
249
246
code_address = pre .deploy_contract (code = code )
250
247
@@ -411,6 +408,7 @@ def test_worst_modexp(
411
408
def test_worst_precompile_fixed_cost (
412
409
state_test : StateTestFiller ,
413
410
pre : Alloc ,
411
+ fork : Fork ,
414
412
precompile_address : Address ,
415
413
parameters : list [str ] | list [BytesConcatenation ] | list [bytes ],
416
414
):
@@ -445,7 +443,7 @@ def test_worst_precompile_fixed_cost(
445
443
attack_block = Op .POP (
446
444
Op .STATICCALL (Op .GAS , precompile_address , 0 , len (concatenated_bytes ), 0 , 0 )
447
445
)
448
- code = code_loop_precompile_call (calldata , attack_block )
446
+ code = code_loop_precompile_call (calldata , attack_block , fork )
449
447
code_address = pre .deploy_contract (code = bytes (code ))
450
448
451
449
tx = Transaction (
@@ -1114,7 +1112,7 @@ def test_amortized_bn128_pairings(
1114
1112
1115
1113
calldata = Op .CALLDATACOPY (size = Op .CALLDATASIZE )
1116
1114
attack_block = Op .POP (Op .STATICCALL (Op .GAS , 0x08 , 0 , Op .CALLDATASIZE , 0 , 0 ))
1117
- code = code_loop_precompile_call (calldata , attack_block )
1115
+ code = code_loop_precompile_call (calldata , attack_block , fork )
1118
1116
1119
1117
code_address = pre .deploy_contract (code = code )
1120
1118
0 commit comments