Skip to content

Commit 479ca5c

Browse files
committed
chore: add osaka engine updates.
1 parent e934abb commit 479ca5c

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

src/ethereum_test_forks/forks/forks.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,6 +1284,13 @@ def engine_forkchoice_updated_version(
12841284
class Osaka(Prague, solc_name="cancun"):
12851285
"""Osaka fork."""
12861286

1287+
@classmethod
1288+
def engine_get_payload_version(
1289+
cls, block_number: int = 0, timestamp: int = 0
1290+
) -> Optional[int]:
1291+
"""From Osaka, get payload calls must use version 5."""
1292+
return 5
1293+
12871294
@classmethod
12881295
def evm_code_types(cls, block_number: int = 0, timestamp: int = 0) -> List[EVMCodeType]:
12891296
"""EOF V1 is supported starting from Osaka."""

src/ethereum_test_rpc/rpc.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from .types import (
1616
ForkchoiceState,
1717
ForkchoiceUpdateResponse,
18+
GetBlobsResponse,
1819
GetPayloadResponse,
1920
JSONRPCError,
2021
PayloadAttributes,
@@ -344,3 +345,18 @@ def get_payload(
344345
),
345346
context=self.response_validation_context,
346347
)
348+
349+
def get_blobs(
350+
self,
351+
params: List[Hash],
352+
*,
353+
version: int,
354+
) -> GetBlobsResponse:
355+
"""`engine_getBlobsVX`: Retrieves blobs from an execution layers tx pool."""
356+
return GetBlobsResponse.model_validate(
357+
self.post_request(
358+
f"getBlobsV{version}",
359+
*[to_json(param) for param in params],
360+
),
361+
context=self.response_validation_context,
362+
)

src/ethereum_test_rpc/types.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,22 @@ def blob_versioned_hashes(self) -> List[Hash]:
136136
return [Hash(b"\1" + commitment[1:]) for commitment in self.commitments]
137137

138138

139+
class BlobAndProof(CamelModel):
140+
"""Represents a blob and proof structure."""
141+
142+
blob: Bytes
143+
proofs: List[Bytes]
144+
145+
139146
class GetPayloadResponse(CamelModel):
140147
"""Represents the response of a get payload request."""
141148

142149
execution_payload: FixtureExecutionPayload
143150
blobs_bundle: BlobsBundle | None = None
144151
execution_requests: List[Bytes] | None = None
152+
153+
154+
class GetBlobsResponse(CamelModel):
155+
"""Represents the response of a get blobs request."""
156+
157+
result: List[BlobAndProof]

0 commit comments

Comments
 (0)