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@83970623.

Generate fixtures for these test cases for Prague with:

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

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
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
@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")
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],
):
    """
    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

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

Test ID (Abbreviated) parent_excess_blobs parent_blobs tx_max_fee_per_blob_gas tx_error account_balance_modifier
...fork_Cancun-insufficient_max_fee_per_blob_gas-blockchain_test-account_balance_modifier_1000000000 17 4 1 TransactionException.INSUFFICIENT_MAX_FEE_PER_BLOB_GAS 1000000000
...fork_Cancun-invalid_max_fee_per_blob_gas-blockchain_test-account_balance_modifier_1000000000 0 0 0 TransactionException.INSUFFICIENT_MAX_FEE_PER_BLOB_GAS 1000000000
...fork_Prague-insufficient_max_fee_per_blob_gas-blockchain_test-account_balance_modifier_1000000000 26 7 1 TransactionException.INSUFFICIENT_MAX_FEE_PER_BLOB_GAS 1000000000
...fork_Prague-invalid_max_fee_per_blob_gas-blockchain_test-account_balance_modifier_1000000000 0 0 0 TransactionException.INSUFFICIENT_MAX_FEE_PER_BLOB_GAS 1000000000
...fork_Osaka-insufficient_max_fee_per_blob_gas-blockchain_test-account_balance_modifier_1000000000 26 7 1 TransactionException.INSUFFICIENT_MAX_FEE_PER_BLOB_GAS 1000000000
...fork_Osaka-invalid_max_fee_per_blob_gas-blockchain_test-account_balance_modifier_1000000000 0 0 0 TransactionException.INSUFFICIENT_MAX_FEE_PER_BLOB_GAS 1000000000