Skip to content

test_fork_transition_excess_blob_gas_post_blob_genesis()

Documentation for tests/cancun/eip4844_blobs/test_excess_blob_gas_fork_transition.py::test_fork_transition_excess_blob_gas_post_blob_genesis@636b5f17.

Generate fixtures for these test cases for Bogota with:

fill -v tests/cancun/eip4844_blobs/test_excess_blob_gas_fork_transition.py::test_fork_transition_excess_blob_gas_post_blob_genesis --fork Bogota

Test excessBlobGas calculation in the header when the fork is activated.

Source code in tests/cancun/eip4844_blobs/test_excess_blob_gas_fork_transition.py
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
@pytest.mark.valid_for_bpo_forks
@pytest.mark.valid_at_transition_to("Prague", subsequent_forks=True)
@pytest.mark.parametrize_by_fork(
    "post_fork_block_count,pre_fork_blobs_per_block,post_fork_blobs_per_block",
    lambda fork: [
        pytest.param(
            SpecHelpers.get_min_excess_blobs_for_blob_gas_price(
                fork=fork.transitions_from(), blob_gas_price=2
            )
            // (
                fork.transitions_to().max_blobs_per_block()
                - fork.transitions_to().target_blobs_per_block()
            )
            + 2,
            fork.transitions_from().max_blobs_per_block(),
            fork.transitions_to().max_blobs_per_block(),
            id="max_blobs_before_and_after",
        ),
        pytest.param(
            10,
            0,
            fork.transitions_to().max_blobs_per_block(),
            id="no_blobs_before_and_max_blobs_after",
        ),
        pytest.param(
            10,
            fork.transitions_from().max_blobs_per_block(),
            0,
            id="max_blobs_before_and_no_blobs_after",
        ),
        pytest.param(
            10,
            fork.transitions_from().target_blobs_per_block(),
            fork.transitions_to().target_blobs_per_block(),
            id="target_blobs_before_and_after",
        ),
        pytest.param(
            10,
            1,
            fork.transitions_to().max_blobs_per_block(),
            id="single_blob_before_and_max_blobs_after",
        ),
        pytest.param(
            10,
            fork.transitions_from().max_blobs_per_block(),
            1,
            id="max_blobs_before_and_single_blob_after",
        ),
    ],
)
@pytest.mark.parametrize_by_fork("reserve_price_case", reserve_price_cases)
def test_fork_transition_excess_blob_gas_post_blob_genesis(
    blockchain_test: BlockchainTestFiller,
    genesis_environment: Environment,
    pre: Alloc,
    pre_fork_blocks: List[Block],
    post_fork_blocks: List[Block],
    post: Mapping[Address, Account],
) -> None:
    """
    Test `excessBlobGas` calculation in the header when the fork is activated.
    """
    blockchain_test(
        pre=pre,
        post=post,
        blocks=pre_fork_blocks + post_fork_blocks,
        genesis_environment=genesis_environment,
    )

Parametrized Test Cases

This test generates 30 parametrized test cases across 7 forks.