Skip to content

Test Blob Txs

Documentation for tests/cancun/eip4844_blobs/[email protected].

Generate fixtures for these test cases for Osaka with:

fill -v tests/cancun/eip4844_blobs/test_blob_txs.py --fork Osaka

Tests blob type transactions for EIP-4844: Shard Blob Transactions.

Note: To add a new test, add a function that is named test_<test_name>.

It must at least use the following arguments:

  • blockchain_test or state_test
  • pre
  • env
  • block or txs.

All other pytest.fixture fixtures can be parametrized to generate new combinations and test cases.

Test Functions Overview

Name Type Cases (Osaka) Description
test_valid_blob_tx_combinations blockchain_test 316 Test all valid blob combinations in a single block, assuming a given value
test_invalid_tx_max_fee_per_blob_gas blockchain_test 2 Reject blocks with invalid blob txs.
test_invalid_tx_max_fee_per_blob_gas_state state_test 2 Reject an invalid blob transaction.
test_invalid_normal_gas state_test 1 Reject an invalid blob transaction.
test_invalid_block_blob_count blockchain_test 68 Test all invalid blob combinations in a single block, where the sum of all
test_insufficient_balance_blob_tx state_test 144 Reject blocks where user cannot afford the blob gas specified (but
test_sufficient_balance_blob_tx state_test 576 Check that transaction is accepted when user can exactly afford the blob
test_sufficient_balance_blob_tx_pre_fund_tx blockchain_test 288 Check that transaction is accepted when user can exactly afford the blob
test_blob_gas_subtraction_tx state_test 128 Check that the blob gas fee for a transaction is subtracted from the sender
test_insufficient_balance_blob_tx_combinations blockchain_test 158 Reject all valid blob transaction combinations in a block, but block is
test_invalid_tx_blob_count state_test 2 Reject blocks that include blob transactions with invalid blob counts.
test_invalid_blob_hash_versioning_single_tx state_test 4 Reject blob transactions with invalid blob hash version.
test_invalid_blob_hash_versioning_multiple_txs blockchain_test 4 Reject blocks that include blob transactions with invalid blob hash
test_invalid_blob_tx_contract_creation blockchain_test 1 Reject blocks that include blob transactions that have nil to value
test_blob_tx_attribute_opcodes state_test 2 Test opcodes that read transaction attributes work properly for blob type
test_blob_tx_attribute_value_opcode state_test 3 Test the VALUE opcode with different blob type transaction value amounts.
test_blob_tx_attribute_calldata_opcodes state_test 9 Test calldata related opcodes to verify their behavior is not affected by
test_blob_tx_attribute_gasprice_opcode state_test 4 Test GASPRICE opcode to sanity check that the blob gas fee does not affect
test_blob_type_tx_pre_fork state_test 0 Reject blocks with blob type transactions before Cancun fork.