update engine API from v1.0.0-beta.2 to beta.3
This commit is contained in:
parent
4c377e6e29
commit
437c768bc3
|
@ -14,7 +14,7 @@ from json_rpc/rpcserver import expect
|
|||
|
||||
template invalidQuantityPrefix(s: string): bool =
|
||||
# https://ethereum.org/en/developers/docs/apis/json-rpc/#hex-value-encoding
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.2/src/engine/common.md#encoding
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.3/src/engine/common.md#encoding
|
||||
# "When encoding quantities (integers, numbers): encode as hex, prefix with
|
||||
# "0x", the most compact representation (slight exception: zero should be
|
||||
# represented as "0x0")."
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.2/src/engine/paris.md#methods
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.2/src/engine/shanghai.md#methods
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.3/src/engine/paris.md#methods
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.3/src/engine/shanghai.md#methods
|
||||
|
||||
import ethtypes, engine_api_types
|
||||
|
||||
|
|
|
@ -12,13 +12,13 @@ type
|
|||
transactions*: seq[TypedTransaction]
|
||||
withdrawals*: seq[WithdrawalV1]
|
||||
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.2/src/engine/paris.md#payloadattributesv1
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.3/src/engine/paris.md#payloadattributesv1
|
||||
PayloadAttributesV1* = object
|
||||
timestamp*: Quantity
|
||||
prevRandao*: FixedBytes[32]
|
||||
suggestedFeeRecipient*: Address
|
||||
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.2/src/engine/shanghai.md#payloadattributesv2
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.3/src/engine/shanghai.md#payloadattributesv2
|
||||
PayloadAttributesV2* = object
|
||||
timestamp*: Quantity
|
||||
prevRandao*: FixedBytes[32]
|
||||
|
@ -32,7 +32,7 @@ type
|
|||
suggestedFeeRecipient*: Address
|
||||
withdrawals*: Option[seq[WithdrawalV1]]
|
||||
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.2/src/engine/paris.md#payloadstatusv1
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.3/src/engine/paris.md#payloadstatusv1
|
||||
PayloadExecutionStatus* {.pure.} = enum
|
||||
syncing = "SYNCING"
|
||||
valid = "VALID"
|
||||
|
@ -45,26 +45,26 @@ type
|
|||
latestValidHash*: Option[BlockHash]
|
||||
validationError*: Option[string]
|
||||
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.2/src/engine/paris.md#forkchoicestatev1
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.3/src/engine/paris.md#forkchoicestatev1
|
||||
ForkchoiceStateV1* = object
|
||||
headBlockHash*: BlockHash
|
||||
safeBlockHash*: BlockHash
|
||||
finalizedBlockHash*: BlockHash
|
||||
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.2/src/engine/paris.md#response-1
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.3/src/engine/paris.md#response-1
|
||||
PayloadID* = FixedBytes[8]
|
||||
|
||||
ForkchoiceUpdatedResponse* = object
|
||||
payloadStatus*: PayloadStatusV1
|
||||
payloadId*: Option[PayloadID]
|
||||
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.2/src/engine/paris.md#transitionconfigurationv1
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.3/src/engine/paris.md#transitionconfigurationv1
|
||||
TransitionConfigurationV1* = object
|
||||
terminalTotalDifficulty*: UInt256
|
||||
terminalBlockHash*: BlockHash
|
||||
terminalBlockNumber*: Quantity
|
||||
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.2/src/engine/shanghai.md#response-2
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.3/src/engine/shanghai.md#response-2
|
||||
GetPayloadV2Response* = object
|
||||
executionPayload*: ExecutionPayloadV1OrV2
|
||||
blockValue*: UInt256
|
||||
|
@ -73,7 +73,7 @@ type
|
|||
executionPayload*: ExecutionPayloadV2
|
||||
blockValue*: UInt256
|
||||
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.2/src/engine/experimental/blob-extension.md#response-1
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.3/src/engine/experimental/blob-extension.md#response-1
|
||||
GetPayloadV3Response* = object
|
||||
executionPayload*: ExecutionPayloadV3
|
||||
blockValue*: UInt256
|
||||
|
@ -84,7 +84,7 @@ type
|
|||
GetPayloadV3Response
|
||||
|
||||
const
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.2/src/engine/common.md#errors
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.3/src/engine/common.md#errors
|
||||
engineApiParseError* = -32700
|
||||
engineApiInvalidRequest* = -32600
|
||||
engineApiMethodNotFound* = -32601
|
||||
|
|
|
@ -216,14 +216,14 @@ type
|
|||
|
||||
TypedTransaction* = distinct seq[byte]
|
||||
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.2/src/engine/shanghai.md#withdrawalv1
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.3/src/engine/shanghai.md#withdrawalv1
|
||||
WithdrawalV1* = object
|
||||
index*: Quantity
|
||||
validatorIndex*: Quantity
|
||||
address*: Address
|
||||
amount*: Quantity
|
||||
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.2/src/engine/paris.md#executionpayloadv1
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.3/src/engine/paris.md#executionpayloadv1
|
||||
ExecutionPayloadV1* = object
|
||||
parentHash*: Hash256
|
||||
feeRecipient*: Address
|
||||
|
@ -240,7 +240,7 @@ type
|
|||
blockHash*: Hash256
|
||||
transactions*: seq[TypedTransaction]
|
||||
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.2/src/engine/shanghai.md#executionpayloadv2
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.3/src/engine/shanghai.md#executionpayloadv2
|
||||
ExecutionPayloadV2* = object
|
||||
parentHash*: Hash256
|
||||
feeRecipient*: Address
|
||||
|
@ -270,7 +270,7 @@ type
|
|||
# please fix this. (Maybe the RPC library does handle sum types?
|
||||
# Or maybe we can enhance it to do so?) --Adam
|
||||
#
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.2/src/engine/shanghai.md
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.3/src/engine/shanghai.md
|
||||
ExecutionPayloadV1OrV2* = object
|
||||
parentHash*: BlockHash
|
||||
feeRecipient*: Address
|
||||
|
@ -288,7 +288,7 @@ type
|
|||
transactions*: seq[TypedTransaction]
|
||||
withdrawals*: Option[seq[WithdrawalV1]]
|
||||
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.2/src/engine/experimental/blob-extension.md#executionpayloadv3
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.3/src/engine/experimental/blob-extension.md#executionpayloadv3
|
||||
ExecutionPayloadV3* = object
|
||||
parentHash*: Hash256
|
||||
feeRecipient*: Address
|
||||
|
@ -302,17 +302,17 @@ type
|
|||
timestamp*: Quantity
|
||||
extraData*: DynamicBytes[0, 32]
|
||||
baseFeePerGas*: UInt256
|
||||
excessDataGas*: UInt256
|
||||
blockHash*: Hash256
|
||||
transactions*: seq[TypedTransaction]
|
||||
withdrawals*: seq[WithdrawalV1]
|
||||
excessDataGas*: UInt256
|
||||
|
||||
SomeExecutionPayload* =
|
||||
ExecutionPayloadV1 |
|
||||
ExecutionPayloadV2 |
|
||||
ExecutionPayloadV3
|
||||
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.2/src/engine/experimental/blob-extension.md#BlobsBundleV1
|
||||
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.3/src/engine/experimental/blob-extension.md#BlobsBundleV1
|
||||
BlobsBundleV1* = object
|
||||
blockHash*: Hash256
|
||||
kzgs*: seq[KZGCommitment]
|
||||
|
|
Loading…
Reference in New Issue