Skip to content

test_valid_inputs()

Documentation for tests/cancun/eip4844_blobs/test_point_evaluation_precompile.py::test_valid_inputs@0fe4295f.

Generate fixtures for these test cases for Prague with:

fill -v tests/cancun/eip4844_blobs/test_point_evaluation_precompile.py::test_valid_inputs --fork Prague

Test valid sanity precompile calls that are expected to succeed.

  • kzg_commitment and kzg_proof are set to values such that p(z)==0 for all values of z, hence y is tested to be zero, and call to be successful.
Source code in tests/cancun/eip4844_blobs/test_point_evaluation_precompile.py
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
@pytest.mark.parametrize(
    "z,y,kzg_commitment,kzg_proof,versioned_hash",
    [
        pytest.param(Spec.BLS_MODULUS - 1, 0, INF_POINT, INF_POINT, None, id="in_bounds_z"),
        pytest.param(
            # Example valid input from a Mainnet transaction
            # https://etherscan.io/tx/0xcb3dc8f3b14f1cda0c16a619a112102a8ec70dce1b3f1b28272227cf8d5fbb0e
            0x019123BCB9D06356701F7BE08B4494625B87A7B02EDC566126FB81F6306E915F,
            0x6C2EB1E94C2532935B8465351BA1BD88EABE2B3FA1AADFF7D1CD816E8315BD38,
            0xA9546D41993E10DF2A7429B8490394EA9EE62807BAE6F326D1044A51581306F58D4B9DFD5931E044688855280FF3799E,
            0xA2EA83D9391E0EE42E0C650ACC7A1F842A7D385189485DDB4FD54ADE3D9FD50D608167DCA6C776AAD4B8AD5C20691BFE,
            0x018156B94FE9735E573BAB36DAD05D60FEB720D424CCD20AAF719343C31E4246,
            id="mainnet_1",
        ),
    ],
)
@pytest.mark.parametrize("result", [Result.SUCCESS])
@pytest.mark.valid_from("Cancun")
def test_valid_inputs(
    state_test: StateTestFiller,
    pre: Alloc,
    tx: Transaction,
    post: Dict,
):
    """
    Test valid sanity precompile calls that are expected to succeed.

    - `kzg_commitment` and `kzg_proof` are set to values such that `p(z)==0` for all values of `z`,
    hence `y` is tested to be zero, and call to be successful.
    """
    state_test(
        env=Environment(),
        pre=pre,
        post=post,
        tx=tx,
    )

Parametrized Test Cases

The interactive table below is also available as a standalone page.

Test ID (Abbreviated) result z y kzg_commitment kzg_proof versioned_hash
...fork_Cancun-state_test-result_Result.SUCCESS-in_bounds_z Result.SUCCESS 52435875175126190479447740508185965837690552500527637822603658699938581184512 0 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 None
...fork_Cancun-state_test-result_Result.SUCCESS-mainnet_1 Result.SUCCESS 708752322136743035325904615527746868865504840551727068388104158728481050975 48932290510762567355215018952980625686085234701671636106116239558514631359800 26062240305731257297863486693640305908664292804455274611893778439019420491631461829634095890012226778671624519645598 25075078792916362002763283008209891154342216554215961360183188947087884859618019056361975176283376001508214854720510 680834666131342450585230780566931966477006918939036064738543038916426875462
...fork_Cancun-blockchain_test_from_state_test-result_Result.SUCCESS-in_bounds_z Result.SUCCESS 52435875175126190479447740508185965837690552500527637822603658699938581184512 0 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 None
...fork_Cancun-blockchain_test_from_state_test-result_Result.SUCCESS-mainnet_1 Result.SUCCESS 708752322136743035325904615527746868865504840551727068388104158728481050975 48932290510762567355215018952980625686085234701671636106116239558514631359800 26062240305731257297863486693640305908664292804455274611893778439019420491631461829634095890012226778671624519645598 25075078792916362002763283008209891154342216554215961360183188947087884859618019056361975176283376001508214854720510 680834666131342450585230780566931966477006918939036064738543038916426875462
...fork_Prague-state_test-result_Result.SUCCESS-in_bounds_z Result.SUCCESS 52435875175126190479447740508185965837690552500527637822603658699938581184512 0 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 None
...fork_Prague-state_test-result_Result.SUCCESS-mainnet_1 Result.SUCCESS 708752322136743035325904615527746868865504840551727068388104158728481050975 48932290510762567355215018952980625686085234701671636106116239558514631359800 26062240305731257297863486693640305908664292804455274611893778439019420491631461829634095890012226778671624519645598 25075078792916362002763283008209891154342216554215961360183188947087884859618019056361975176283376001508214854720510 680834666131342450585230780566931966477006918939036064738543038916426875462
...fork_Prague-blockchain_test_from_state_test-result_Result.SUCCESS-in_bounds_z Result.SUCCESS 52435875175126190479447740508185965837690552500527637822603658699938581184512 0 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 None
...fork_Prague-blockchain_test_from_state_test-result_Result.SUCCESS-mainnet_1 Result.SUCCESS 708752322136743035325904615527746868865504840551727068388104158728481050975 48932290510762567355215018952980625686085234701671636106116239558514631359800 26062240305731257297863486693640305908664292804455274611893778439019420491631461829634095890012226778671624519645598 25075078792916362002763283008209891154342216554215961360183188947087884859618019056361975176283376001508214854720510 680834666131342450585230780566931966477006918939036064738543038916426875462
...fork_Osaka-state_test-result_Result.SUCCESS-in_bounds_z Result.SUCCESS 52435875175126190479447740508185965837690552500527637822603658699938581184512 0 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 None
...fork_Osaka-state_test-result_Result.SUCCESS-mainnet_1 Result.SUCCESS 708752322136743035325904615527746868865504840551727068388104158728481050975 48932290510762567355215018952980625686085234701671636106116239558514631359800 26062240305731257297863486693640305908664292804455274611893778439019420491631461829634095890012226778671624519645598 25075078792916362002763283008209891154342216554215961360183188947087884859618019056361975176283376001508214854720510 680834666131342450585230780566931966477006918939036064738543038916426875462
...fork_Osaka-blockchain_test_from_state_test-result_Result.SUCCESS-in_bounds_z Result.SUCCESS 52435875175126190479447740508185965837690552500527637822603658699938581184512 0 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 None
...fork_Osaka-blockchain_test_from_state_test-result_Result.SUCCESS-mainnet_1 Result.SUCCESS 708752322136743035325904615527746868865504840551727068388104158728481050975 48932290510762567355215018952980625686085234701671636106116239558514631359800 26062240305731257297863486693640305908664292804455274611893778439019420491631461829634095890012226778671624519645598 25075078792916362002763283008209891154342216554215961360183188947087884859618019056361975176283376001508214854720510 680834666131342450585230780566931966477006918939036064738543038916426875462