Skip to content

Commit a8a464c

Browse files
committed
update engine API signatures to alpha.6
1 parent 7daafe7 commit a8a464c

File tree

3 files changed

+23
-16
lines changed

3 files changed

+23
-16
lines changed

web3/engine_api_callsigs.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.5/src/engine/specification.md
1+
# https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.6/src/engine/specification.md#core
22

33
import ethtypes, engine_api_types
44

5-
proc engine_executePayloadV1(payload: ExecutionPayloadV1): ExecutePayloadResponse
5+
proc engine_newPayloadV1(payload: ExecutionPayloadV1): PayloadStatusV1
66
proc engine_forkchoiceUpdatedV1(forkchoiceState: ForkchoiceStateV1, payloadAttributes: Option[PayloadAttributesV1]): ForkchoiceUpdatedResponse
77
proc engine_getPayloadV1(payloadId: PayloadID): ExecutionPayloadV1

web3/engine_api_types.nim

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,51 @@ export
66
ethtypes
77

88
type
9-
# https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.5/src/engine/specification.md#payloadattributesv1
9+
# https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.6/src/engine/specification.md#payloadattributesv1
1010
PayloadAttributesV1* = object
1111
timestamp*: Quantity
1212
random*: FixedBytes[32]
1313
suggestedFeeRecipient*: Address
1414

15+
# https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.6/src/engine/specification.md#payloadstatusv1
1516
PayloadExecutionStatus* {.pure.} = enum
16-
valid = "VALID"
17-
invalid = "INVALID"
18-
syncing = "SYNCING"
19-
20-
PayloadID* = FixedBytes[8]
21-
22-
ExecutePayloadResponse* = object
17+
valid = "VALID"
18+
invalid = "INVALID"
19+
syncing = "SYNCING"
20+
accepted = "ACCEPTED"
21+
invalid_block_hash = "INVALID_BLOCK_HASH"
22+
invalid_terminal_block = "INVALID_TERMINAL_BLOCK"
23+
24+
PayloadStatusV1* = object
2325
status*: PayloadExecutionStatus
2426
latestValidHash*: Option[BlockHash]
2527
validationError*: Option[string]
2628

27-
# https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.5/src/engine/specification.md#forkchoicestatev1
29+
# https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.6/src/engine/specification.md#forkchoicestatev1
2830
ForkchoiceStateV1* = object
2931
headBlockHash*: BlockHash
3032
safeBlockHash*: BlockHash
3133
finalizedBlockHash*: BlockHash
3234

35+
# https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.6/src/engine/specification.md#response-1
3336
ForkchoiceUpdatedStatus* {.pure.} = enum
34-
success = "SUCCESS"
35-
syncing = "SYNCING"
37+
valid = "VALID"
38+
invalid = "INVALID"
39+
syncing = "SYNCING"
40+
invalid_terminal_block = "INVALID_TERMINAL_BLOCK"
41+
42+
PayloadID* = FixedBytes[8]
3643

3744
ForkchoiceUpdatedResponse* = object
38-
status*: ForkchoiceUpdatedStatus
45+
payloadStatus*: ForkchoiceUpdatedStatus
3946
payloadId*: Option[PayloadID]
4047

4148
const
49+
# https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.6/src/engine/specification.md#errors
4250
engineApiParseError* = - 32700
4351
engineApiInvalidRequest* = -32600
4452
engineApiMethodNotFound* = -32601
4553
engineApiInvalidParams* = -32602
4654
engineApiInternalError* = -32603
4755
engineApiServerError* = -32000
4856
engineApiUnknownPayload* = -32001
49-
engineApiInvalidTerminalBlock* = -32002

web3/ethtypes.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ type
201201

202202
TypedTransaction* = distinct seq[byte]
203203

204-
# https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.5/src/engine/specification.md#executionpayloadv1
204+
# https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.6/src/engine/specification.md#executionpayloadv1
205205
ExecutionPayloadV1* = object
206206
parentHash*: BlockHash
207207
feeRecipient*: Address

0 commit comments

Comments
 (0)