Skip to content

test_modexp_over_boundary()

Documentation for tests/osaka/eip7823_modexp_upper_bounds/test_eip_mainnet.py::test_modexp_over_boundary@892e6d1e.

Generate fixtures for these test cases for Osaka with:

fill -v tests/osaka/eip7823_modexp_upper_bounds/test_eip_mainnet.py::test_modexp_over_boundary --fork Osaka

Mainnet test exceeding the 1024-byte boundary.

Tests that the ModExp precompile correctly rejects input exceeding the maximum allowed length (1024 bytes) per EIP-7823. This proves the EIP is correctly activated.

Source code in tests/osaka/eip7823_modexp_upper_bounds/test_eip_mainnet.py
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
@pytest.mark.parametrize(
    "modexp_input,modexp_expected",
    [
        pytest.param(
            ModExpInput(
                base=b"\x01" * (Spec.MAX_LENGTH_BYTES + 1),
                exponent=b"\x00",
                modulus=b"\x02",
            ),
            ModExpOutput(
                call_success=False,
                returned_data="",
            ),
            id="base-over-boundary-1025-bytes",
        ),
    ],
)
def test_modexp_over_boundary(
    state_test: StateTestFiller,
    pre: Alloc,
    tx: Transaction,
    post: Dict,
) -> None:
    """
    Mainnet test exceeding the 1024-byte boundary.

    Tests that the ModExp precompile correctly rejects input exceeding the
    maximum allowed length (1024 bytes) per EIP-7823. This proves the EIP
    is correctly activated.
    """
    state_test(pre=pre, tx=tx, post=post)

Parametrized Test Cases

This test generates 1 parametrized test case across 1 fork.