Skip to content

test_block_at_rlp_limit_with_logs()

Documentation for tests/osaka/eip7934_block_rlp_limit/test_max_block_rlp_size.py::test_block_at_rlp_limit_with_logs@20373115.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/osaka/eip7934_block_rlp_limit/test_max_block_rlp_size.py::test_block_at_rlp_limit_with_logs --fork Amsterdam

Test that a block at the RLP size limit is valid even when transactions emit logs.

Source code in tests/osaka/eip7934_block_rlp_limit/test_max_block_rlp_size.py
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
@EIPChecklist.BlockLevelConstraint.Test.Content.Logs()
@pytest.mark.verify_sync
@pytest.mark.valid_from("Osaka")
def test_block_at_rlp_limit_with_logs(
    blockchain_test: BlockchainTestFiller,
    pre: Alloc,
    post: Alloc,
    env: Environment,
    sender: EOA,
    fork: Fork,
    block_size_limit: int,
) -> None:
    """
    Test that a block at the RLP size limit is valid even when transactions
    emit logs.
    """
    transactions, extra_data_len = exact_size_transactions(
        sender,
        fork,
        pre,
        env.gas_limit,
        emit_logs=True,
    )

    block = Block(txs=transactions)
    block.extra_data = Bytes(b"\x00" * extra_data_len)
    block.timestamp = ZeroPaddedHexNumber(HEADER_TIMESTAMP)

    blockchain_test(
        genesis_environment=env,
        pre=pre,
        post=post,
        blocks=[block],
    )

Parametrized Test Cases

This test generates 1 parametrized test case across 2 forks.