Skip to content

Commit dd4525e

Browse files
committed
1 parent 16934a4 commit dd4525e

File tree

4 files changed

+23
-5
lines changed

4 files changed

+23
-5
lines changed

web3/engine_api.nim

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ template forkchoiceUpdated*(
2424
payloadAttributes: Option[PayloadAttributesV2]): Future[ForkchoiceUpdatedResponse] =
2525
engine_forkchoiceUpdatedV2(rpcClient, forkchoiceState, payloadAttributes)
2626

27+
template forkchoiceUpdated*(
28+
rpcClient: RpcClient,
29+
forkchoiceState: ForkchoiceStateV1,
30+
payloadAttributes: Option[PayloadAttributesV3]): Future[ForkchoiceUpdatedResponse] =
31+
engine_forkchoiceUpdatedV3(rpcClient, forkchoiceState, payloadAttributes)
32+
2733
template getPayload*(
2834
rpcClient: RpcClient,
2935
T: type ExecutionPayloadV1,
@@ -61,5 +67,7 @@ template newPayload*(
6167
template newPayload*(
6268
rpcClient: RpcClient,
6369
payload: ExecutionPayloadV3,
64-
versioned_hashes: seq[VersionedHash]): Future[PayloadStatusV1] =
65-
engine_newPayloadV3(rpcClient, payload, versioned_hashes)
70+
versionedHashes: seq[VersionedHash],
71+
parentBeaconBlockRoot: FixedBytes[32]): Future[PayloadStatusV1] =
72+
engine_newPayloadV3(
73+
rpcClient, payload, versionedHashes, parentBeaconBlockRoot)

web3/engine_api_callsigs.nim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.3/src/engine/paris.md#methods
22
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.3/src/engine/shanghai.md#methods
3+
# https://github.com/ethereum/execution-apis/blob/ee3df5bc38f28ef35385cefc9d9ca18d5e502778/src/engine/cancun.md#methods
34

45
import ethtypes, engine_api_types
56

@@ -8,6 +9,7 @@ proc engine_newPayloadV2(payload: ExecutionPayloadV2): PayloadStatusV1
89
proc engine_newPayloadV3(payload: ExecutionPayloadV3, versioned_hashes: seq[VersionedHash]): PayloadStatusV1
910
proc engine_forkchoiceUpdatedV1(forkchoiceState: ForkchoiceStateV1, payloadAttributes: Option[PayloadAttributesV1]): ForkchoiceUpdatedResponse
1011
proc engine_forkchoiceUpdatedV2(forkchoiceState: ForkchoiceStateV1, payloadAttributes: Option[PayloadAttributesV2]): ForkchoiceUpdatedResponse
12+
proc engine_forkchoiceUpdatedV3(forkchoiceState: ForkchoiceStateV1, payloadAttributes: Option[PayloadAttributesV3]): ForkchoiceUpdatedResponse
1113
proc engine_getPayloadV1(payloadId: PayloadID): ExecutionPayloadV1
1214
proc engine_getPayloadV2(payloadId: PayloadID): GetPayloadV2Response
1315
proc engine_getPayloadV2_exact(payloadId: PayloadID): GetPayloadV2ResponseExact

web3/engine_api_types.nim

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ type
2525
suggestedFeeRecipient*: Address
2626
withdrawals*: seq[WithdrawalV1]
2727

28+
# https://github.com/ethereum/execution-apis/blob/ee3df5bc38f28ef35385cefc9d9ca18d5e502778/src/engine/cancun.md#payloadattributesv3
29+
PayloadAttributesV3* = object
30+
timestamp*: Quantity
31+
prevRandao*: FixedBytes[32]
32+
suggestedFeeRecipient*: Address
33+
withdrawals*: seq[WithdrawalV1]
34+
parentBeaconBlockRoot*: FixedBytes[32]
35+
2836
# This is ugly, but see the comment on ExecutionPayloadV1OrV2.
2937
PayloadAttributesV1OrV2* = object
3038
timestamp*: Quantity
@@ -73,7 +81,7 @@ type
7381
executionPayload*: ExecutionPayloadV2
7482
blockValue*: UInt256
7583

76-
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.3/src/engine/experimental/blob-extension.md#response-1
84+
# https://github.com/ethereum/execution-apis/blob/ee3df5bc38f28ef35385cefc9d9ca18d5e502778/src/engine/cancun.md#response-2
7785
GetPayloadV3Response* = object
7886
executionPayload*: ExecutionPayloadV3
7987
blockValue*: UInt256

web3/ethtypes.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ type
293293
transactions*: seq[TypedTransaction]
294294
withdrawals*: Option[seq[WithdrawalV1]]
295295

296-
# https://github.com/ethereum/execution-apis/pull/417
296+
# https://github.com/ethereum/execution-apis/blob/ee3df5bc38f28ef35385cefc9d9ca18d5e502778/src/engine/cancun.md#executionpayloadv3
297297
ExecutionPayloadV3* = object
298298
parentHash*: Hash256
299299
feeRecipient*: Address
@@ -318,7 +318,7 @@ type
318318
ExecutionPayloadV2 |
319319
ExecutionPayloadV3
320320

321-
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.3/src/engine/experimental/blob-extension.md#BlobsBundleV1
321+
# https://github.com/ethereum/execution-apis/blob/ee3df5bc38f28ef35385cefc9d9ca18d5e502778/src/engine/cancun.md#blobsbundlev1
322322
BlobsBundleV1* = object
323323
commitments*: seq[KZGCommitment]
324324
proofs*: seq[KZGProof]

0 commit comments

Comments
 (0)