Skip to content

test_point_evaluation_precompile_gas_usage()

Documentation for tests/cancun/eip4844_blobs/test_point_evaluation_precompile_gas.py::test_point_evaluation_precompile_gas_usage@20373115.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/cancun/eip4844_blobs/test_point_evaluation_precompile_gas.py::test_point_evaluation_precompile_gas_usage --fork Amsterdam

Test point evaluation precompile gas usage under different call contexts and gas limits.

  • Test using all call types (CALL, DELEGATECALL, CALLCODE, STATICCALL) - Test using different gas limits (exact gas, insufficient gas, extra gas) - Test using correct and incorrect proofs
Source code in tests/cancun/eip4844_blobs/test_point_evaluation_precompile_gas.py
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
@pytest.mark.parametrize(
    "call_type",
    [Op.CALL, Op.DELEGATECALL, Op.CALLCODE, Op.STATICCALL],
)
@pytest.mark.parametrize(
    "call_gas",
    [
        Spec.POINT_EVALUATION_PRECOMPILE_GAS,
        Spec.POINT_EVALUATION_PRECOMPILE_GAS - 1,
        Spec.POINT_EVALUATION_PRECOMPILE_GAS + 1,
    ],
    ids=["exact_gas", "insufficient_gas", "extra_gas"],
)
@pytest.mark.parametrize("proof", ["correct", "incorrect"])
@pytest.mark.valid_from("Cancun")
@pytest.mark.eels_base_coverage
def test_point_evaluation_precompile_gas_usage(
    state_test: StateTestFiller,
    pre: Dict,
    tx: Transaction,
    post: Dict,
) -> None:
    """
    Test point evaluation precompile gas usage under different call contexts
    and gas limits.

    - Test using all call types (CALL, DELEGATECALL, CALLCODE, STATICCALL) -
    Test using different gas limits (exact gas, insufficient gas, extra gas) -
    Test using correct and incorrect proofs
    """
    state_test(
        env=Environment(),
        pre=pre,
        post=post,
        tx=tx,
    )

Parametrized Test Cases

This test generates 24 parametrized test cases across 4 forks.