Skip to content

test_invalid_tx_max_fee_per_blob_gas()

Documentation for tests/cancun/eip4844_blobs/test_blob_txs.py::test_invalid_tx_max_fee_per_blob_gas@21507778.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/cancun/eip4844_blobs/test_blob_txs.py::test_invalid_tx_max_fee_per_blob_gas --fork Amsterdam

Reject blocks with invalid blob txs.

  • tx max_fee_per_blob_gas is barely not enough
  • tx max_fee_per_blob_gas is zero
Source code in tests/cancun/eip4844_blobs/test_blob_txs.py
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
@pytest.mark.parametrize_by_fork(
    "parent_excess_blobs,parent_blobs,tx_max_fee_per_blob_gas,tx_error",
    generate_invalid_tx_max_fee_per_blob_gas_tests,
)
@pytest.mark.parametrize(
    "account_balance_modifier",
    [1_000_000_000],
)  # Extra balance to cover block blob gas cost
@pytest.mark.valid_from("Cancun")
@pytest.mark.eels_base_coverage
def test_invalid_tx_max_fee_per_blob_gas(
    blockchain_test: BlockchainTestFiller,
    pre: Alloc,
    env: Environment,
    block: Block,
    non_zero_blob_gas_used_genesis_block: Optional[Block],
) -> None:
    """
    Reject blocks with invalid blob txs.

    - tx max_fee_per_blob_gas is barely not enough
    - tx max_fee_per_blob_gas is zero
    """
    if non_zero_blob_gas_used_genesis_block is not None:
        blocks = [non_zero_blob_gas_used_genesis_block, block]
    else:
        blocks = [block]
    blockchain_test(
        pre=pre,
        post={},
        blocks=blocks,
        genesis_environment=env,
    )

Parametrized Test Cases

This test generates 2 parametrized test cases across 4 forks.