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
2 changes: 2 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Test fixtures for use by clients are available for each release on the [Github r

### 📋 Misc

- ✨ Engine API updates for Osaka, add `get_blobs` rpc method ([#1510](https://github.com/ethereum/execution-spec-tests/pull/1510)).

### 🧪 Test Cases

## [v4.4.0](https://github.com/ethereum/execution-spec-tests/releases/tag/v4.4.0) - 2025-04-29
Expand Down
7 changes: 7 additions & 0 deletions src/ethereum_test_forks/forks/forks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1284,6 +1284,13 @@ def engine_forkchoice_updated_version(
class Osaka(Prague, solc_name="cancun"):
"""Osaka fork."""

@classmethod
def engine_get_payload_version(
cls, block_number: int = 0, timestamp: int = 0
) -> Optional[int]:
"""From Osaka, get payload calls must use version 5."""
return 5

@classmethod
def evm_code_types(cls, block_number: int = 0, timestamp: int = 0) -> List[EVMCodeType]:
"""EOF V1 is supported starting from Osaka."""
Expand Down
16 changes: 16 additions & 0 deletions src/ethereum_test_rpc/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from .types import (
ForkchoiceState,
ForkchoiceUpdateResponse,
GetBlobsResponse,
GetPayloadResponse,
JSONRPCError,
PayloadAttributes,
Expand Down Expand Up @@ -344,3 +345,18 @@ def get_payload(
),
context=self.response_validation_context,
)

def get_blobs(
self,
params: List[Hash],
*,
version: int,
) -> GetBlobsResponse:
"""`engine_getBlobsVX`: Retrieves blobs from an execution layers tx pool."""
return GetBlobsResponse.model_validate(
self.post_request(
f"getBlobsV{version}",
*[to_json(param) for param in params],
),
context=self.response_validation_context,
)
15 changes: 15 additions & 0 deletions src/ethereum_test_rpc/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,24 @@ def blob_versioned_hashes(self) -> List[Hash]:
return [Hash(b"\1" + commitment[1:]) for commitment in self.commitments]


class BlobAndProof(CamelModel):
"""Represents a blob and proof structure."""

blob: Bytes
proofs: List[Bytes] | None = None # >= Osaka (V2)

proof: Bytes | None = None # <= Prague (V1)


class GetPayloadResponse(CamelModel):
"""Represents the response of a get payload request."""

execution_payload: FixtureExecutionPayload
blobs_bundle: BlobsBundle | None = None
execution_requests: List[Bytes] | None = None


class GetBlobsResponse(CamelModel):
"""Represents the response of a get blobs request."""

result: List[BlobAndProof | None]
Loading