Skip to content

Test Point Evaluation Precompile Gas

Documentation for test cases from tests/cancun/eip4844_blobs/test_point_evaluation_precompile_gas.py.

Generate fixtures for these test cases for Cancun with:

Cancun only:

fill -v tests/cancun/eip4844_blobs/test_point_evaluation_precompile_gas.py --fork=Cancun --evm-bin=/path/to/evm-tool-dev-version
For all forks up to and including Cancun:
fill -v tests/cancun/eip4844_blobs/test_point_evaluation_precompile_gas.py --until=Cancun --evm-bin=/path/to/evm-tool-dev-version

Tests gas usage on point evaluation precompile for EIP-4844: Shard Blob Transactions

Test gas usage on point evaluation precompile for EIP-4844: Shard Blob Transactions.

test_point_evaluation_precompile_gas_usage(blockchain_test, pre, tx, post)

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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
@pytest.mark.parametrize(
    "call_type",
    [Op.CALL, Op.DELEGATECALL, Op.CALLCODE, Op.STATICCALL],
)
@pytest.mark.parametrize(
    "call_gas",
    [
        POINT_EVALUATION_PRECOMPILE_GAS,
        POINT_EVALUATION_PRECOMPILE_GAS - 1,
        POINT_EVALUATION_PRECOMPILE_GAS + 1,
    ],
    ids=["exact_gas", "insufficient_gas", "extra_gas"],
)
@pytest.mark.parametrize("proof", ["correct", "incorrect"])
@pytest.mark.valid_from("Cancun")
def test_point_evaluation_precompile_gas_usage(
    blockchain_test: BlockchainTestFiller,
    pre: Dict,
    tx: Transaction,
    post: Dict,
):
    """
    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
    """
    blockchain_test(
        pre=pre,
        post=post,
        blocks=[Block(txs=[tx])],
    )