add/update Deneb Builder API types and RPC signatures (#5492)
This commit is contained in:
parent
447786518f
commit
48197e4d55
|
@ -134,6 +134,12 @@ type
|
||||||
blob_gas_used*: uint64 # [New in Deneb:EIP4844]
|
blob_gas_used*: uint64 # [New in Deneb:EIP4844]
|
||||||
excess_blob_gas*: uint64 # [New in Deneb:EIP4844]
|
excess_blob_gas*: uint64 # [New in Deneb:EIP4844]
|
||||||
|
|
||||||
|
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.2/specs/deneb/validator.md#blobsbundle
|
||||||
|
BlobsBundle* = object
|
||||||
|
commitments*: seq[KZGCommitment]
|
||||||
|
proofs*: seq[KZGProof]
|
||||||
|
blobs*: seq[Blob]
|
||||||
|
|
||||||
ExecutePayload* = proc(
|
ExecutePayload* = proc(
|
||||||
execution_payload: ExecutionPayload): bool {.gcsafe, raises: [].}
|
execution_payload: ExecutionPayload): bool {.gcsafe, raises: [].}
|
||||||
|
|
||||||
|
|
|
@ -97,6 +97,7 @@ type
|
||||||
SetGasLimitRequest |
|
SetGasLimitRequest |
|
||||||
bellatrix_mev.SignedBlindedBeaconBlock |
|
bellatrix_mev.SignedBlindedBeaconBlock |
|
||||||
capella_mev.SignedBlindedBeaconBlock |
|
capella_mev.SignedBlindedBeaconBlock |
|
||||||
|
deneb_mev.SignedBlindedBeaconBlockContents |
|
||||||
SignedValidatorRegistrationV1 |
|
SignedValidatorRegistrationV1 |
|
||||||
SignedVoluntaryExit |
|
SignedVoluntaryExit |
|
||||||
Web3SignerRequest |
|
Web3SignerRequest |
|
||||||
|
|
|
@ -21,6 +21,7 @@ import
|
||||||
".."/mev/[capella_mev, deneb_mev]
|
".."/mev/[capella_mev, deneb_mev]
|
||||||
|
|
||||||
from ".."/datatypes/capella import BeaconBlockBody
|
from ".."/datatypes/capella import BeaconBlockBody
|
||||||
|
from ".."/mev/deneb_mev import ExecutionPayloadAndBlobsBundle
|
||||||
|
|
||||||
export forks, phase0, altair, bellatrix, capella, capella_mev, deneb_mev,
|
export forks, phase0, altair, bellatrix, capella, capella_mev, deneb_mev,
|
||||||
tables, httputils
|
tables, httputils
|
||||||
|
@ -545,7 +546,7 @@ type
|
||||||
ProduceBlindedBlockResponse* = ForkedBlindedBeaconBlock
|
ProduceBlindedBlockResponse* = ForkedBlindedBeaconBlock
|
||||||
ProduceSyncCommitteeContributionResponse* = DataEnclosedObject[SyncCommitteeContribution]
|
ProduceSyncCommitteeContributionResponse* = DataEnclosedObject[SyncCommitteeContribution]
|
||||||
SubmitBlindedBlockResponseCapella* = DataEnclosedObject[capella.ExecutionPayload]
|
SubmitBlindedBlockResponseCapella* = DataEnclosedObject[capella.ExecutionPayload]
|
||||||
SubmitBlindedBlockResponseDeneb* = DataEnclosedObject[deneb.ExecutionPayload]
|
SubmitBlindedBlockResponseDeneb* = DataEnclosedObject[deneb_mev.ExecutionPayloadAndBlobsBundle]
|
||||||
GetValidatorsActivityResponse* = DataEnclosedObject[seq[RestActivityItem]]
|
GetValidatorsActivityResponse* = DataEnclosedObject[seq[RestActivityItem]]
|
||||||
GetValidatorsLivenessResponse* = DataEnclosedObject[seq[RestLivenessItem]]
|
GetValidatorsLivenessResponse* = DataEnclosedObject[seq[RestLivenessItem]]
|
||||||
|
|
||||||
|
|
|
@ -5,21 +5,28 @@
|
||||||
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
||||||
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
||||||
|
|
||||||
|
{.push raises: [].}
|
||||||
|
|
||||||
import ".."/datatypes/[altair, capella, deneb]
|
import ".."/datatypes/[altair, capella, deneb]
|
||||||
from stew/byteutils import to0xHex
|
from stew/byteutils import to0xHex
|
||||||
|
|
||||||
{.push raises: [].}
|
|
||||||
|
|
||||||
type
|
type
|
||||||
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/builder.md#builderbid
|
# https://github.com/ethereum/builder-specs/blob/534e4f81276b8346d785ed9aba12c4c74b927ec6/specs/deneb/builder.md#blindedblobsbundle
|
||||||
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/capella/builder.md#executionpayloadheader
|
BlindedBlobsBundle* = object
|
||||||
|
commitments*: List[KZGCommitment, Limit MAX_BLOB_COMMITMENTS_PER_BLOCK]
|
||||||
|
proofs*: List[KZGProof, Limit MAX_BLOB_COMMITMENTS_PER_BLOCK]
|
||||||
|
blob_roots*: List[Eth2Digest, Limit MAX_BLOB_COMMITMENTS_PER_BLOCK]
|
||||||
|
|
||||||
|
# https://github.com/ethereum/builder-specs/blob/534e4f81276b8346d785ed9aba12c4c74b927ec6/specs/deneb/builder.md#builderbid
|
||||||
BuilderBid* = object
|
BuilderBid* = object
|
||||||
header*: deneb.ExecutionPayloadHeader
|
header*: deneb.ExecutionPayloadHeader # [Modified in Deneb]
|
||||||
|
blinded_blobs_bundle*: BlindedBlobsBundle # [New in Deneb]
|
||||||
value*: UInt256
|
value*: UInt256
|
||||||
pubkey*: ValidatorPubKey
|
pubkey*: ValidatorPubKey
|
||||||
|
|
||||||
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/builder.md#signedbuilderbid
|
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/builder.md#signedbuilderbid
|
||||||
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/capella/builder.md#executionpayloadheader
|
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/capella/builder.md#executionpayloadheader
|
||||||
|
# https://github.com/ethereum/builder-specs/blob/534e4f81276b8346d785ed9aba12c4c74b927ec6/specs/deneb/builder.md#executionpayloadheader
|
||||||
SignedBuilderBid* = object
|
SignedBuilderBid* = object
|
||||||
message*: BuilderBid
|
message*: BuilderBid
|
||||||
signature*: ValidatorSig
|
signature*: ValidatorSig
|
||||||
|
@ -59,6 +66,33 @@ type
|
||||||
message*: BlindedBeaconBlock
|
message*: BlindedBeaconBlock
|
||||||
signature*: ValidatorSig
|
signature*: ValidatorSig
|
||||||
|
|
||||||
|
# https://github.com/ethereum/builder-specs/blob/534e4f81276b8346d785ed9aba12c4c74b927ec6/specs/deneb/builder.md#blindedblobsidecar
|
||||||
|
BlindedBlobSidecar* = object
|
||||||
|
block_root*: Eth2Digest
|
||||||
|
index*: uint64
|
||||||
|
slot*: uint64
|
||||||
|
block_parent_root*: Eth2Digest
|
||||||
|
proposer_index*: uint64
|
||||||
|
blob_root*: Eth2Digest
|
||||||
|
kzg_commitment*: KZGCommitment
|
||||||
|
kzg_proof*: KZGProof
|
||||||
|
|
||||||
|
# https://github.com/ethereum/builder-specs/blob/534e4f81276b8346d785ed9aba12c4c74b927ec6/specs/deneb/builder.md#signedblindedblobsidecar
|
||||||
|
SignedBlindedBlobSidecar* = object
|
||||||
|
message*: BlindedBlobSidecar
|
||||||
|
signature*: ValidatorSig
|
||||||
|
|
||||||
|
# https://github.com/ethereum/builder-specs/blob/534e4f81276b8346d785ed9aba12c4c74b927ec6/specs/deneb/builder.md#signedblindedblockcontents
|
||||||
|
SignedBlindedBeaconBlockContents* = object
|
||||||
|
signed_blinded_block*: SignedBlindedBeaconBlock
|
||||||
|
signed_blinded_blob_sidecars*:
|
||||||
|
List[SignedBlindedBlobSidecar, Limit MAX_BLOBS_PER_BLOCK]
|
||||||
|
|
||||||
|
# https://github.com/ethereum/builder-specs/blob/534e4f81276b8346d785ed9aba12c4c74b927ec6/specs/deneb/builder.md#executionpayloadandblobsbundle
|
||||||
|
ExecutionPayloadAndBlobsBundle* = object
|
||||||
|
execution_payload*: deneb.ExecutionPayload
|
||||||
|
blobs_bundle*: BlobsBundle
|
||||||
|
|
||||||
func shortLog*(v: BlindedBeaconBlock): auto =
|
func shortLog*(v: BlindedBeaconBlock): auto =
|
||||||
(
|
(
|
||||||
slot: shortLog(v.slot),
|
slot: shortLog(v.slot),
|
||||||
|
|
|
@ -18,10 +18,10 @@ proc getHeaderDeneb*(slot: Slot,
|
||||||
): RestResponse[GetHeaderResponseDeneb] {.
|
): RestResponse[GetHeaderResponseDeneb] {.
|
||||||
rest, endpoint: "/eth/v1/builder/header/{slot}/{parent_hash}/{pubkey}",
|
rest, endpoint: "/eth/v1/builder/header/{slot}/{parent_hash}/{pubkey}",
|
||||||
meth: MethodGet, connection: {Dedicated, Close}.}
|
meth: MethodGet, connection: {Dedicated, Close}.}
|
||||||
## https://github.com/ethereum/builder-specs/blob/v0.3.0/apis/builder/header.yaml
|
## https://github.com/ethereum/builder-specs/blob/34509da74237942aa15a4c0ca828f67acdf77652/apis/builder/header.yaml
|
||||||
|
|
||||||
proc submitBlindedBlock*(body: deneb_mev.SignedBlindedBeaconBlock
|
proc submitBlindedBlock*(body: deneb_mev.SignedBlindedBeaconBlockContents
|
||||||
): RestResponse[SubmitBlindedBlockResponseDeneb] {.
|
): RestResponse[SubmitBlindedBlockResponseDeneb] {.
|
||||||
rest, endpoint: "/eth/v1/builder/blinded_blocks",
|
rest, endpoint: "/eth/v1/builder/blinded_blocks",
|
||||||
meth: MethodPost, connection: {Dedicated, Close}.}
|
meth: MethodPost, connection: {Dedicated, Close}.}
|
||||||
## https://github.com/ethereum/builder-specs/blob/v0.3.0/apis/builder/blinded_blocks.yaml
|
## https://github.com/ethereum/builder-specs/blob/34509da74237942aa15a4c0ca828f67acdf77652/apis/builder/blinded_blocks.yaml
|
||||||
|
|
Loading…
Reference in New Issue