update engine API signatures to alpha.6

This commit is contained in:
Dustin Brody 2022-02-02 08:42:43 +00:00
parent 7daafe7b9c
commit a8a464c5fe
No known key found for this signature in database
GPG Key ID: 3D7A11A0156519DC
3 changed files with 22 additions and 15 deletions

View File

@ -1,7 +1,7 @@
# https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.5/src/engine/specification.md
# https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.6/src/engine/specification.md#core
import ethtypes, engine_api_types
proc engine_executePayloadV1(payload: ExecutionPayloadV1): ExecutePayloadResponse
proc engine_newPayloadV1(payload: ExecutionPayloadV1): PayloadStatusV1
proc engine_forkchoiceUpdatedV1(forkchoiceState: ForkchoiceStateV1, payloadAttributes: Option[PayloadAttributesV1]): ForkchoiceUpdatedResponse
proc engine_getPayloadV1(payloadId: PayloadID): ExecutionPayloadV1

View File

@ -6,39 +6,47 @@ export
ethtypes
type
# https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.5/src/engine/specification.md#payloadattributesv1
# https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.6/src/engine/specification.md#payloadattributesv1
PayloadAttributesV1* = object
timestamp*: Quantity
random*: FixedBytes[32]
suggestedFeeRecipient*: Address
# https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.6/src/engine/specification.md#payloadstatusv1
PayloadExecutionStatus* {.pure.} = enum
valid = "VALID"
invalid = "INVALID"
syncing = "SYNCING"
valid = "VALID"
invalid = "INVALID"
syncing = "SYNCING"
accepted = "ACCEPTED"
invalid_block_hash = "INVALID_BLOCK_HASH"
invalid_terminal_block = "INVALID_TERMINAL_BLOCK"
PayloadID* = FixedBytes[8]
ExecutePayloadResponse* = object
PayloadStatusV1* = object
status*: PayloadExecutionStatus
latestValidHash*: Option[BlockHash]
validationError*: Option[string]
# https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.5/src/engine/specification.md#forkchoicestatev1
# https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.6/src/engine/specification.md#forkchoicestatev1
ForkchoiceStateV1* = object
headBlockHash*: BlockHash
safeBlockHash*: BlockHash
finalizedBlockHash*: BlockHash
# https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.6/src/engine/specification.md#response-1
ForkchoiceUpdatedStatus* {.pure.} = enum
success = "SUCCESS"
syncing = "SYNCING"
valid = "VALID"
invalid = "INVALID"
syncing = "SYNCING"
invalid_terminal_block = "INVALID_TERMINAL_BLOCK"
PayloadID* = FixedBytes[8]
ForkchoiceUpdatedResponse* = object
status*: ForkchoiceUpdatedStatus
payloadStatus*: ForkchoiceUpdatedStatus
payloadId*: Option[PayloadID]
const
# https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.6/src/engine/specification.md#errors
engineApiParseError* = - 32700
engineApiInvalidRequest* = -32600
engineApiMethodNotFound* = -32601
@ -46,4 +54,3 @@ const
engineApiInternalError* = -32603
engineApiServerError* = -32000
engineApiUnknownPayload* = -32001
engineApiInvalidTerminalBlock* = -32002

View File

@ -201,7 +201,7 @@ type
TypedTransaction* = distinct seq[byte]
# https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.5/src/engine/specification.md#executionpayloadv1
# https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.6/src/engine/specification.md#executionpayloadv1
ExecutionPayloadV1* = object
parentHash*: BlockHash
feeRecipient*: Address