Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/ethereum_test_forks/base_fork.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,12 @@ def max_blobs_per_block(cls, block_number: int = 0, timestamp: int = 0) -> int:
"""Return the max blobs per block at a given fork."""
pass

@classmethod
@abstractmethod
def full_blob_tx_wrapper_version(cls, block_number: int = 0, timestamp: int = 0) -> int | None:
"""Return the version of the full blob transaction wrapper at a given fork."""
pass

@classmethod
@prefer_transition_to_method
@abstractmethod
Expand Down
17 changes: 17 additions & 0 deletions src/ethereum_test_forks/forks/forks.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,13 @@ def max_blobs_per_block(cls, block_number: int = 0, timestamp: int = 0) -> int:
"""Return the max number of blobs per block at a given fork."""
raise NotImplementedError(f"Max blobs per block is not supported in {cls.name()}")

@classmethod
def full_blob_tx_wrapper_version(cls, block_number: int = 0, timestamp: int = 0) -> int | None:
"""Return the version of the full blob transaction wrapper."""
raise NotImplementedError(
f"Full blob transaction wrapper version is not supported in {cls.name()}"
)

@classmethod
def blob_schedule(cls, block_number: int = 0, timestamp: int = 0) -> BlobSchedule | None:
"""At genesis, no blob schedule is used."""
Expand Down Expand Up @@ -1014,6 +1021,11 @@ def max_blobs_per_block(cls, block_number: int = 0, timestamp: int = 0) -> int:
"""Blobs are enabled starting from Cancun, with a static max of 6 blobs."""
return 6

@classmethod
def full_blob_tx_wrapper_version(cls, block_number: int = 0, timestamp: int = 0) -> int | None:
"""Pre-Osaka forks don't use tx wrapper versions for full blob transactions."""
return None

@classmethod
def blob_schedule(cls, block_number: int = 0, timestamp: int = 0) -> BlobSchedule | None:
"""
Expand Down Expand Up @@ -1375,6 +1387,11 @@ def engine_get_blobs_version(cls, block_number: int = 0, timestamp: int = 0) ->
"""At Osaka, the engine get blobs version is 2."""
return 2

@classmethod
def full_blob_tx_wrapper_version(cls, block_number=0, timestamp=0) -> int | None:
"""At Osaka, the full blob transaction wrapper version is defined."""
return 1

@classmethod
def transaction_gas_limit_cap(cls, block_number: int = 0, timestamp: int = 0) -> int | None:
"""At Osaka, transaction gas limit is capped at 30 million."""
Expand Down
7 changes: 6 additions & 1 deletion tests/cancun/eip4844_blobs/test_blob_txs_full.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ def txs( # noqa: D103
tx_error: Optional[TransactionException],
txs_blobs: List[List[Blob]],
txs_wrapped_blobs: List[bool],
fork: Fork,
) -> List[Transaction]:
"""Prepare the list of transactions that are sent during the test."""
if len(txs_blobs) != len(txs_versioned_hashes) or len(txs_blobs) != len(txs_wrapped_blobs):
Expand All @@ -182,7 +183,11 @@ def txs( # noqa: D103
wrapped_blob_transaction=tx_wrapped_blobs,
)
if tx_wrapped_blobs:
network_wrapped_tx = NetworkWrappedTransaction(tx=tx, blob_objects=tx_blobs)
network_wrapped_tx = NetworkWrappedTransaction(
tx=tx,
blob_objects=tx_blobs,
wrapper_version=fork.full_blob_tx_wrapper_version(),
)
tx.rlp_override = network_wrapped_tx.rlp()
txs.append(tx)
return txs
Expand Down
10 changes: 2 additions & 8 deletions tests/osaka/eip7594_peerdas/test_get_blobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,6 @@ def tx_error() -> Optional[TransactionException]:
return None


@pytest.fixture
def tx_wrapper_version() -> int | None:
"""Return wrapper version used for the transactions sent during test."""
return 1


@pytest.fixture(autouse=True)
def txs( # noqa: D103
pre: Alloc,
Expand All @@ -172,7 +166,7 @@ def txs( # noqa: D103
txs_versioned_hashes: List[List[bytes]],
tx_error: Optional[TransactionException],
txs_blobs: List[List[Blob]],
tx_wrapper_version: int | None,
fork: Fork,
) -> List[NetworkWrappedTransaction | Transaction]:
"""Prepare the list of transactions that are sent during the test."""
if len(txs_blobs) != len(txs_versioned_hashes):
Expand All @@ -193,8 +187,8 @@ def txs( # noqa: D103
)
network_wrapped_tx = NetworkWrappedTransaction(
tx=tx,
wrapper_version=tx_wrapper_version,
blob_objects=tx_blobs,
wrapper_version=fork.full_blob_tx_wrapper_version(),
)
txs.append(network_wrapped_tx)
return txs
Expand Down
Loading