Skip to content

Test Blob Txs Full

Documentation for tests/cancun/eip4844_blobs/test_blob_txs_full.py.

Generate fixtures for these test cases with:

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

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

test_reject_valid_full_blob_in_block_rlp(blockchain_test, pre, env, blocks)

Test valid blob combinations where one or more txs in the block serialized version contain a full blob (network version) tx.

Source code in tests/cancun/eip4844_blobs/test_blob_txs_full.py
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
@pytest.mark.parametrize(
    "txs_blobs,txs_wrapped_blobs",
    [
        (
            [  # Txs
                [  # Blobs per transaction
                    Blob(
                        blob=bytes(
                            Spec.FIELD_ELEMENTS_PER_BLOB * SpecHelpers.BYTES_PER_FIELD_ELEMENT
                        ),
                        kzg_commitment=INF_POINT,
                        kzg_proof=INF_POINT,
                    ),
                ]
            ],
            [True],
        ),
        (
            [  # Txs
                [  # Blobs per transaction
                    Blob(
                        blob=bytes(
                            Spec.FIELD_ELEMENTS_PER_BLOB * SpecHelpers.BYTES_PER_FIELD_ELEMENT
                        ),
                        kzg_commitment=INF_POINT,
                        kzg_proof=INF_POINT,
                    )
                ]
                for _ in range(SpecHelpers.max_blobs_per_block())
            ],
            [True] + ([False] * (SpecHelpers.max_blobs_per_block() - 1)),
        ),
        (
            [  # Txs
                [  # Blobs per transaction
                    Blob(
                        blob=bytes(
                            Spec.FIELD_ELEMENTS_PER_BLOB * SpecHelpers.BYTES_PER_FIELD_ELEMENT
                        ),
                        kzg_commitment=INF_POINT,
                        kzg_proof=INF_POINT,
                    )
                ]
                for _ in range(SpecHelpers.max_blobs_per_block())
            ],
            ([False] * (SpecHelpers.max_blobs_per_block() - 1)) + [True],
        ),
    ],
    ids=[
        "one_full_blob_one_tx",
        "one_full_blob_max_txs",
        "one_full_blob_at_the_end_max_txs",
    ],
)
@pytest.mark.valid_from("Cancun")
def test_reject_valid_full_blob_in_block_rlp(
    blockchain_test: BlockchainTestFiller,
    pre: Dict,
    env: Environment,
    blocks: List[Block],
):
    """
    Test valid blob combinations where one or more txs in the block
    serialized version contain a full blob (network version) tx.
    """
    blockchain_test(
        pre=pre,
        post={},
        blocks=blocks,
        genesis_environment=env,
    )