@@ -59,14 +59,14 @@ proc forkchoiceUpdatedV1*(client: RpcClient,
5959
6060proc forkchoiceUpdatedV2 * (client: RpcClient ,
6161 update: ForkchoiceStateV1 ,
62- payloadAttributes = Opt .none (PayloadAttributes )):
62+ payloadAttributes = Opt .none (PayloadAttributesV2 )):
6363 Result [ForkchoiceUpdatedResponse , string ] =
6464 wrapTrySimpleRes:
6565 client.engine_forkchoiceUpdatedV2 (update, payloadAttributes)
6666
6767proc forkchoiceUpdatedV3 * (client: RpcClient ,
6868 update: ForkchoiceStateV1 ,
69- payloadAttributes = Opt .none (PayloadAttributes )):
69+ payloadAttributes = Opt .none (PayloadAttributesV3 )):
7070 Result [ForkchoiceUpdatedResponse , string ] =
7171 wrapTrySimpleRes:
7272 client.engine_forkchoiceUpdatedV3 (update, payloadAttributes)
@@ -78,8 +78,8 @@ proc forkchoiceUpdated*(client: RpcClient,
7878 Result [ForkchoiceUpdatedResponse , string ] =
7979 case version
8080 of Version .V1 : return client.forkchoiceUpdatedV1 (update, attr.V1 )
81- of Version .V2 : return client.forkchoiceUpdatedV2 (update, attr)
82- of Version .V3 : return client.forkchoiceUpdatedV3 (update, attr)
81+ of Version .V2 : return client.forkchoiceUpdatedV2 (update, attr. V2 )
82+ of Version .V3 : return client.forkchoiceUpdatedV3 (update, attr. V3 )
8383 of Version .V4 , Version .V5 , Version .V6 : discard
8484
8585proc getPayloadV1 * (client: RpcClient , payloadId: Bytes8 ): Result [ExecutionPayloadV1 , string ] =
@@ -98,10 +98,38 @@ proc getPayloadV4*(client: RpcClient, payloadId: Bytes8): Result[GetPayloadV4Res
9898 wrapTrySimpleRes:
9999 client.engine_getPayloadV4 (payloadId)
100100
101+ proc getPayloadV5 * (client: RpcClient , payloadId: Bytes8 ): Result [GetPayloadV5Response , string ] =
102+ wrapTrySimpleRes:
103+ client.engine_getPayloadV5 (payloadId)
104+
105+ proc getPayloadV6 * (client: RpcClient , payloadId: Bytes8 ): Result [GetPayloadV6Response , string ] =
106+ wrapTrySimpleRes:
107+ client.engine_getPayloadV6 (payloadId)
108+
101109proc getPayload * (client: RpcClient ,
102110 version: Version ,
103111 payloadId: Bytes8 ): Result [GetPayloadResponse , string ] =
104- if version == Version .V4 :
112+ if version == Version .V6 :
113+ let x = client.getPayloadV6 (payloadId).valueOr:
114+ return err (error)
115+ ok (GetPayloadResponse (
116+ executionPayload: executionPayload (x.executionPayload),
117+ blockValue: Opt .some (x.blockValue),
118+ blobsBundleV2: Opt .some (x.blobsBundle),
119+ shouldOverrideBuilder: Opt .some (x.shouldOverrideBuilder),
120+ executionRequests: Opt .some (x.executionRequests),
121+ ))
122+ elif version == Version .V5 :
123+ let x = client.getPayloadV5 (payloadId).valueOr:
124+ return err (error)
125+ ok (GetPayloadResponse (
126+ executionPayload: executionPayload (x.executionPayload),
127+ blockValue: Opt .some (x.blockValue),
128+ blobsBundleV2: Opt .some (x.blobsBundle),
129+ shouldOverrideBuilder: Opt .some (x.shouldOverrideBuilder),
130+ executionRequests: Opt .some (x.executionRequests),
131+ ))
132+ elif version == Version .V4 :
105133 let x = client.getPayloadV4 (payloadId).valueOr:
106134 return err (error)
107135 ok (GetPayloadResponse (
@@ -171,6 +199,16 @@ proc newPayloadV4*(client: RpcClient,
171199 client.engine_newPayloadV4 (payload, versionedHashes,
172200 parentBeaconBlockRoot, executionRequests)
173201
202+ proc newPayloadV5 * (client: RpcClient ,
203+ payload: ExecutionPayloadV4 ,
204+ versionedHashes: seq [VersionedHash ],
205+ parentBeaconBlockRoot: Hash32 ,
206+ executionRequests: seq [seq [byte ]]):
207+ Result [PayloadStatusV1 , string ] =
208+ wrapTrySimpleRes:
209+ client.engine_newPayloadV5 (payload, versionedHashes,
210+ parentBeaconBlockRoot, executionRequests)
211+
174212proc newPayloadV1 * (client: RpcClient ,
175213 payload: ExecutionPayload ):
176214 Result [PayloadStatusV1 , string ] =
@@ -202,21 +240,38 @@ proc newPayloadV4*(client: RpcClient,
202240 client.engine_newPayloadV4 (payload, versionedHashes,
203241 parentBeaconBlockRoot, executionRequests)
204242
243+ proc newPayloadV5 * (client: RpcClient ,
244+ payload: ExecutionPayload ,
245+ versionedHashes: Opt [seq [VersionedHash ]],
246+ parentBeaconBlockRoot: Opt [Hash32 ],
247+ executionRequests: Opt [seq [seq [byte ]]]):
248+ Result [PayloadStatusV1 , string ] =
249+ wrapTrySimpleRes:
250+ client.engine_newPayloadV5 (payload, versionedHashes,
251+ parentBeaconBlockRoot, executionRequests)
252+
205253proc newPayload * (client: RpcClient ,
206254 version: Version ,
207255 payload: ExecutableData ): Result [PayloadStatusV1 , string ] =
208256 case version
209- of Version .V1 : return client.newPayloadV1 (payload.basePayload)
210- of Version .V2 : return client.newPayloadV2 (payload.basePayload)
257+ of Version .V1 :
258+ return client.newPayloadV1 (payload.basePayload)
259+ of Version .V2 :
260+ return client.newPayloadV2 (payload.basePayload)
211261 of Version .V3 :
212262 return client.newPayloadV3 (payload.basePayload,
213263 payload.versionedHashes,
214264 payload.beaconRoot)
215- of Version .V4 , Version . V5 : # Osaka doesn't define any new newPayloadV5
265+ of Version .V4 :
216266 return client.newPayloadV4 (payload.basePayload,
217267 payload.versionedHashes,
218268 payload.beaconRoot,
219269 payload.executionRequests)
270+ of Version .V5 :
271+ return client.newPayloadV5 (payload.basePayload,
272+ payload.versionedHashes,
273+ payload.beaconRoot,
274+ payload.executionRequests)
220275 of Version .V6 : discard
221276
222277proc exchangeCapabilities * (client: RpcClient ,
0 commit comments