Skip to content

test_invalid_inputs()

Documentation for tests/cancun/eip4844_blobs/test_point_evaluation_precompile.py::test_invalid_inputs@verkle@v0.0.6.

Generate fixtures for these test cases for Cancun with:

Cancun only:

fill -v tests/cancun/eip4844_blobs/test_point_evaluation_precompile.py::test_invalid_inputs --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.py::test_invalid_inputs --until=Cancun

Test invalid precompile calls:

  • Out of bounds inputs z and y
  • Correct proof, commitment, z and y, but incorrect lengths
  • Null inputs
  • Zero inputs
  • Correct proof, commitment, z and y, but incorrect version versioned hash
Source code in tests/cancun/eip4844_blobs/test_point_evaluation_precompile.py
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
@pytest.mark.parametrize(
    "z,y,kzg_commitment,kzg_proof,versioned_hash",
    [
        (Spec.BLS_MODULUS, 0, INF_POINT, INF_POINT, None),
        (0, Spec.BLS_MODULUS, INF_POINT, INF_POINT, None),
        (Z, 0, INF_POINT, INF_POINT[:-1], None),
        (Z, 0, INF_POINT, INF_POINT[0:1], None),
        (Z, 0, INF_POINT, INF_POINT + bytes([0]), None),
        (Z, 0, INF_POINT, INF_POINT + bytes([0] * 1023), None),
        (bytes(), bytes(), bytes(), bytes(), bytes()),
        (0, 0, 0, 0, 0),
        (0, 0, 0, 0, None),
        (Z, 0, INF_POINT, INF_POINT, Spec.kzg_to_versioned_hash(0xC0 << 376, 0x00)),
        (Z, 0, INF_POINT, INF_POINT, Spec.kzg_to_versioned_hash(0xC0 << 376, 0x02)),
        (Z, 0, INF_POINT, INF_POINT, Spec.kzg_to_versioned_hash(0xC0 << 376, 0xFF)),
    ],
    ids=[
        "out_of_bounds_z",
        "out_of_bounds_y",
        "correct_proof_1_input_too_short",
        "correct_proof_1_input_too_short_2",
        "correct_proof_1_input_too_long",
        "correct_proof_1_input_extra_long",
        "null_inputs",
        "zeros_inputs",
        "zeros_inputs_correct_versioned_hash",
        "correct_proof_1_incorrect_versioned_hash_version_0x00",
        "correct_proof_1_incorrect_versioned_hash_version_0x02",
        "correct_proof_1_incorrect_versioned_hash_version_0xff",
    ],
)
@pytest.mark.parametrize("result", [Result.FAILURE])
@pytest.mark.valid_from("Cancun")
def test_invalid_inputs(
    state_test: StateTestFiller,
    pre: Alloc,
    tx: Transaction,
    post: Dict,
):
    """
    Test invalid precompile calls:

    - Out of bounds inputs `z` and `y`
    - Correct proof, commitment, z and y, but incorrect lengths
    - Null inputs
    - Zero inputs
    - Correct proof, commitment, z and y, but incorrect version versioned hash
    """
    state_test(
        env=Environment(),
        pre=pre,
        post=post,
        tx=tx,
    )

Parametrized Test Cases

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

Skipped Parameters

For more concise readability, the table below does not list the following parameter values: fork, blockchain_test, state_test, state_test_only, eof_test, eof_state_test.

Test ID result z y kzg_commitment kzg_proof versioned_hash
result_Result.FAILURE-out_of_bounds_z Result.FAILURE 52435875175126190479447740508185965837690552500527637822603658699938581184513 0 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 None
result_Result.FAILURE-out_of_bounds_y Result.FAILURE 0 52435875175126190479447740508185965837690552500527637822603658699938581184513 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 None
result_Result.FAILURE-correct_proof_1_input_too_short Result.FAILURE 44434237462617176941757081182233388991875531411361848851531703873752436619102 0 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 c0000000000000000000000000000000 00000000000000000000000000000000 000000000000000000000000000000 None
result_Result.FAILURE-correct_proof_1_input_too_short_2 Result.FAILURE 44434237462617176941757081182233388991875531411361848851531703873752436619102 0 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 c0 None
result_Result.FAILURE-correct_proof_1_input_too_long Result.FAILURE 44434237462617176941757081182233388991875531411361848851531703873752436619102 0 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00 None
result_Result.FAILURE-correct_proof_1_input_extra_long Result.FAILURE 44434237462617176941757081182233388991875531411361848851531703873752436619102 0 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 000000000000000000000000000000 None
result_Result.FAILURE-null_inputs Result.FAILURE
result_Result.FAILURE-zeros_inputs Result.FAILURE 0 0 0 0 0
result_Result.FAILURE-zeros_inputs_correct_versioned_hash Result.FAILURE 0 0 0 0 None
result_Result.FAILURE-correct_proof_1_incorrect_versioned_hash_version_0x00 Result.FAILURE 44434237462617176941757081182233388991875531411361848851531703873752436619102 0 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 000657f37554c781402a22917dee2f75 def7ab966d7b770905398eba3c444014
result_Result.FAILURE-correct_proof_1_incorrect_versioned_hash_version_0x02 Result.FAILURE 44434237462617176941757081182233388991875531411361848851531703873752436619102 0 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 020657f37554c781402a22917dee2f75 def7ab966d7b770905398eba3c444014
result_Result.FAILURE-correct_proof_1_incorrect_versioned_hash_version_0xff Result.FAILURE 44434237462617176941757081182233388991875531411361848851531703873752436619102 0 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 ff0657f37554c781402a22917dee2f75 def7ab966d7b770905398eba3c444014
result_Result.FAILURE-out_of_bounds_z Result.FAILURE 52435875175126190479447740508185965837690552500527637822603658699938581184513 0 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 None
result_Result.FAILURE-out_of_bounds_y Result.FAILURE 0 52435875175126190479447740508185965837690552500527637822603658699938581184513 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 None
result_Result.FAILURE-correct_proof_1_input_too_short Result.FAILURE 44434237462617176941757081182233388991875531411361848851531703873752436619102 0 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 c0000000000000000000000000000000 00000000000000000000000000000000 000000000000000000000000000000 None
result_Result.FAILURE-correct_proof_1_input_too_short_2 Result.FAILURE 44434237462617176941757081182233388991875531411361848851531703873752436619102 0 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 c0 None
result_Result.FAILURE-correct_proof_1_input_too_long Result.FAILURE 44434237462617176941757081182233388991875531411361848851531703873752436619102 0 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00 None
result_Result.FAILURE-correct_proof_1_input_extra_long Result.FAILURE 44434237462617176941757081182233388991875531411361848851531703873752436619102 0 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 000000000000000000000000000000 None
result_Result.FAILURE-null_inputs Result.FAILURE
result_Result.FAILURE-zeros_inputs Result.FAILURE 0 0 0 0 0
result_Result.FAILURE-zeros_inputs_correct_versioned_hash Result.FAILURE 0 0 0 0 None
result_Result.FAILURE-correct_proof_1_incorrect_versioned_hash_version_0x00 Result.FAILURE 44434237462617176941757081182233388991875531411361848851531703873752436619102 0 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 000657f37554c781402a22917dee2f75 def7ab966d7b770905398eba3c444014
result_Result.FAILURE-correct_proof_1_incorrect_versioned_hash_version_0x02 Result.FAILURE 44434237462617176941757081182233388991875531411361848851531703873752436619102 0 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 020657f37554c781402a22917dee2f75 def7ab966d7b770905398eba3c444014
result_Result.FAILURE-correct_proof_1_incorrect_versioned_hash_version_0xff Result.FAILURE 44434237462617176941757081182233388991875531411361848851531703873752436619102 0 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 c0000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 ff0657f37554c781402a22917dee2f75 def7ab966d7b770905398eba3c444014