From 325eb9028e025a1493b985462ae0e3fa1e800acd Mon Sep 17 00:00:00 2001 From: danceratopz Date: Tue, 31 Mar 2026 19:00:11 +0200 Subject: [PATCH] fix(tests): resolve transition fork blob methods in EIP-4844 conftest (#2602) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(tests): resolve transition fork blob methods in EIP-4844 conftest Transition forks like `ShanghaiToCancunAtTime15k` inherit from `TransitionBaseClass`, not `BaseFork`, so they lack blob-related methods (`blob_gas_per_blob`, `target_blobs_per_block`, etc.). Chain `.transitions_to()` before each blob method call — a no-op for regular forks, resolves to the target fork for transition forks. * ci: trigger CI --- tests/cancun/eip4844_blobs/conftest.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/cancun/eip4844_blobs/conftest.py b/tests/cancun/eip4844_blobs/conftest.py index 8383f3fe4b9..1504daa458f 100644 --- a/tests/cancun/eip4844_blobs/conftest.py +++ b/tests/cancun/eip4844_blobs/conftest.py @@ -26,25 +26,25 @@ def block_base_fee_per_gas() -> int: @pytest.fixture def target_blobs_per_block(fork: Fork) -> int: """Return default number of blobs to be included in the block.""" - return fork.target_blobs_per_block() + return fork.transitions_to().target_blobs_per_block() @pytest.fixture def max_blobs_per_block(fork: Fork) -> int: """Return default number of blobs to be included in the block.""" - return fork.max_blobs_per_block() + return fork.transitions_to().max_blobs_per_block() @pytest.fixture def max_blobs_per_tx(fork: Fork) -> int: """Return max number of blobs per transaction.""" - return fork.max_blobs_per_tx() + return fork.transitions_to().max_blobs_per_tx() @pytest.fixture def blob_gas_per_blob(fork: Fork) -> int: """Return default blob gas cost per blob.""" - return fork.blob_gas_per_blob() + return fork.transitions_to().blob_gas_per_blob() @pytest.fixture(autouse=True) @@ -97,7 +97,7 @@ def excess_blob_gas( """ if parent_excess_blobs is None or parent_blobs is None: return None - return fork.excess_blob_gas_calculator()( + return fork.transitions_to().excess_blob_gas_calculator()( parent_excess_blobs=parent_excess_blobs, parent_blob_count=parent_blobs, parent_base_fee_per_gas=block_base_fee_per_gas, @@ -119,7 +119,7 @@ def correct_excess_blob_gas( """ if parent_excess_blobs is None or parent_blobs is None: return 0 - return fork.excess_blob_gas_calculator()( + return fork.transitions_to().excess_blob_gas_calculator()( parent_excess_blobs=parent_excess_blobs, parent_blob_count=parent_blobs, parent_base_fee_per_gas=block_base_fee_per_gas, @@ -132,7 +132,7 @@ def block_fee_per_blob_gas( correct_excess_blob_gas: int, ) -> int: """Calculate the blob gas price for the current block.""" - get_blob_gas_price = fork.blob_gas_price_calculator() + get_blob_gas_price = fork.transitions_to().blob_gas_price_calculator() return get_blob_gas_price(excess_blob_gas=correct_excess_blob_gas) @@ -145,7 +145,7 @@ def blob_gas_price( if excess_blob_gas is None: return None - get_blob_gas_price = fork.blob_gas_price_calculator() + get_blob_gas_price = fork.transitions_to().blob_gas_price_calculator() return get_blob_gas_price( excess_blob_gas=excess_blob_gas, )