diff --git a/tests/benchmark/compute/precompile/test_bls12_381.py b/tests/benchmark/compute/precompile/test_bls12_381.py index 0d2ea91310..653473dac6 100644 --- a/tests/benchmark/compute/precompile/test_bls12_381.py +++ b/tests/benchmark/compute/precompile/test_bls12_381.py @@ -177,6 +177,7 @@ def test_bls12_g1_msm( def test_bls12_g2_msm( benchmark_test: BenchmarkTestFiller, fork: Fork, + gas_benchmark_value: int, k: int, ) -> None: """Benchmark BLS12_G2_MSM precompile with varying number of points.""" @@ -190,6 +191,13 @@ def test_bls12_g2_msm( * k ) + intrinsic_gas_cost = fork.transaction_intrinsic_cost_calculator()( + calldata=calldata + ) + + if intrinsic_gas_cost > gas_benchmark_value: + pytest.skip("k configuration exceeds the gas limit") + attack_block = Op.POP( Op.STATICCALL( gas=Op.GAS, address=precompile_address, args_size=Op.CALLDATASIZE