Skip to content

Test Blob Txs

Documentation for tests/cancun/eip4844_blobs/test_blob_txs.py@49c766fb.

Generate fixtures for these test cases for Prague with:

fill -v tests/cancun/eip4844_blobs/test_blob_txs.py --fork Prague
Tests blob type transactions for EIP-4844: Shard Blob Transactions

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

Adding a new test

Add a function that is named test_<test_name> and takes at least 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 (Prague) Description
test_valid_blob_tx_combinations blockchain_test 44 Test all valid blob combinations in a single block, assuming a given value of
test_invalid_tx_max_fee_per_blob_gas blockchain_test 2 Reject blocks with invalid blob txs due to:(📖🐛?)
test_invalid_tx_max_fee_per_blob_gas_state state_test_only 0 Reject an invalid blob transaction due to:(📖🐛?)
test_invalid_normal_gas state_test 1 Reject an invalid blob transaction due to:(📖🐛?)
test_invalid_block_blob_count blockchain_test 28 Test all invalid blob combinations in a single block, where the sum of all blobs in a block is
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 144 Check that transaction is accepted when user can exactly afford the blob gas specified (and
test_sufficient_balance_blob_tx_pre_fund_tx blockchain_test 144 Check that transaction is accepted when user can exactly afford the blob gas specified (and
test_blob_gas_subtraction_tx state_test 64 Check that the blob gas fee for a transaction is subtracted from the sender balance before the
test_insufficient_balance_blob_tx_combinations blockchain_test 44 Reject all valid blob transaction combinations in a block, but block is invalid due to:(📖🐛?)
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, including:(📖🐛?)
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 (contract creating).
test_blob_tx_attribute_opcodes state_test 2 Test opcodes that read transaction attributes work properly for blob type transactions:(📖🐛?)
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 blobs:(📖🐛?)
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.