Skip to content

test_blob_tx_attribute_calldata_opcodes()

Documentation for tests/cancun/eip4844_blobs/test_blob_txs.py::test_blob_tx_attribute_calldata_opcodes@verkle@v0.0.6.

Generate fixtures for these test cases for Cancun with:

Cancun only:

fill -v tests/cancun/eip4844_blobs/test_blob_txs.py::test_blob_tx_attribute_calldata_opcodes --fork=Cancun --evm-bin=/path/to/evm-tool-dev-version

For all forks up to and including Cancun:

fill -v tests/cancun/eip4844_blobs/test_blob_txs.py::test_blob_tx_attribute_calldata_opcodes --until=Cancun

Test calldata related opcodes to verify their behavior is not affected by blobs:

  • CALLDATALOAD
  • CALLDATASIZE
  • CALLDATACOPY
Source code in tests/cancun/eip4844_blobs/test_blob_txs.py
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
@pytest.mark.parametrize(
    "opcode",
    [
        Op.CALLDATALOAD,
        Op.CALLDATASIZE,
        Op.CALLDATACOPY,
    ],
    indirect=True,
)
@pytest.mark.parametrize(
    "tx_calldata",
    [
        b"",
        b"\x01",
        b"\x00\x01" * 16,
    ],
    ids=["empty", "single_byte", "word"],
)
@pytest.mark.parametrize("tx_gas", [500_000])
@pytest.mark.valid_from("Cancun")
def test_blob_tx_attribute_calldata_opcodes(
    state_test: StateTestFiller,
    pre: Alloc,
    sender: EOA,
    tx_value: int,
    tx_gas: int,
    tx_calldata: bytes,
    tx_max_fee_per_gas: int,
    tx_max_fee_per_blob_gas: int,
    tx_max_priority_fee_per_gas: int,
    tx_access_list: List[AccessList],
    blob_hashes_per_tx: List[List[bytes]],
    opcode: Tuple[Bytecode, Storage.StorageDictType],
    state_env: Environment,
):
    """
    Test calldata related opcodes to verify their behavior is not affected by blobs:

    - CALLDATALOAD
    - CALLDATASIZE
    - CALLDATACOPY
    """
    code, storage = opcode
    destination_account = pre.deploy_contract(code=code)
    tx = Transaction(
        ty=Spec.BLOB_TX_TYPE,
        sender=sender,
        to=destination_account,
        value=tx_value,
        gas_limit=tx_gas,
        data=tx_calldata,
        max_fee_per_gas=tx_max_fee_per_gas,
        max_priority_fee_per_gas=tx_max_priority_fee_per_gas,
        max_fee_per_blob_gas=tx_max_fee_per_blob_gas,
        access_list=tx_access_list,
        blob_versioned_hashes=blob_hashes_per_tx[0],
    )
    post = {
        destination_account: Account(
            storage=storage,
        )
    }
    state_test(
        pre=pre,
        post=post,
        tx=tx,
        env=state_env,
    )

Parametrized Test Cases

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

Skipped Parameters

For more concise readability, the table below does not list the following parameter values: fork, blockchain_test, state_test, state_test_only, eof_test, eof_state_test.

Test ID opcode tx_gas tx_calldata
tx_gas_500000-empty-opcode_CALLDATALOAD CALLDATALOAD 500000
tx_gas_500000-empty-opcode_CALLDATASIZE CALLDATASIZE 500000
tx_gas_500000-empty-opcode_CALLDATACOPY CALLDATACOPY 500000
tx_gas_500000-single_byte-opcode_CALLDATALOAD CALLDATALOAD 500000 01
tx_gas_500000-single_byte-opcode_CALLDATASIZE CALLDATASIZE 500000 01
tx_gas_500000-single_byte-opcode_CALLDATACOPY CALLDATACOPY 500000 01
tx_gas_500000-word-opcode_CALLDATALOAD CALLDATALOAD 500000 00010001000100010001000100010001 00010001000100010001000100010001
tx_gas_500000-word-opcode_CALLDATASIZE CALLDATASIZE 500000 00010001000100010001000100010001 00010001000100010001000100010001
tx_gas_500000-word-opcode_CALLDATACOPY CALLDATACOPY 500000 00010001000100010001000100010001 00010001000100010001000100010001
tx_gas_500000-empty-opcode_CALLDATALOAD CALLDATALOAD 500000
tx_gas_500000-empty-opcode_CALLDATASIZE CALLDATASIZE 500000
tx_gas_500000-empty-opcode_CALLDATACOPY CALLDATACOPY 500000
tx_gas_500000-single_byte-opcode_CALLDATALOAD CALLDATALOAD 500000 01
tx_gas_500000-single_byte-opcode_CALLDATASIZE CALLDATASIZE 500000 01
tx_gas_500000-single_byte-opcode_CALLDATACOPY CALLDATACOPY 500000 01
tx_gas_500000-word-opcode_CALLDATALOAD CALLDATALOAD 500000 00010001000100010001000100010001 00010001000100010001000100010001
tx_gas_500000-word-opcode_CALLDATASIZE CALLDATASIZE 500000 00010001000100010001000100010001 00010001000100010001000100010001
tx_gas_500000-word-opcode_CALLDATACOPY CALLDATACOPY 500000 00010001000100010001000100010001 00010001000100010001000100010001