Skip to content

test_invalid_post_fork_block_without_slot_number()

Documentation for tests/amsterdam/eip7843_slotnum/test_fork_transition.py::test_invalid_post_fork_block_without_slot_number@26332146.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/amsterdam/eip7843_slotnum/test_fork_transition.py::test_invalid_post_fork_block_without_slot_number --fork Amsterdam

Reject an activation block whose header lacks the slot_number field.

From the fork activation onward the field is mandatory: a header without it is malformed and the engine payload is missing a parameter required by its version.

Source code in tests/amsterdam/eip7843_slotnum/test_fork_transition.py
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
@EIPChecklist.BlockHeaderField.Test.ForkTransition.After()
@pytest.mark.valid_at_transition_to("EIP7843")
@pytest.mark.exception_test
def test_invalid_post_fork_block_without_slot_number(
    blockchain_test: BlockchainTestFiller,
    pre: Alloc,
) -> None:
    """
    Reject an activation block whose header lacks the `slot_number`
    field.

    From the fork activation onward the field is mandatory: a header
    without it is malformed and the engine payload is missing a
    parameter required by its version.
    """
    sender = pre.fund_eoa()
    receiver = pre.fund_eoa(amount=0)

    tx = Transaction(sender=sender, to=receiver, value=100)

    blockchain_test(
        pre=pre,
        post={},
        blocks=[
            Block(
                timestamp=FORK_TIMESTAMP,
                txs=[tx],
                rlp_modifier=Header(slot_number=Header.REMOVE_FIELD),
                exception=BlockException.INCORRECT_BLOCK_FORMAT,
                engine_api_error_code=EngineAPIError.InvalidParams,
            ),
        ],
    )

Parametrized Test Cases

This test generates 1 parametrized test case across 1 fork.