update builder API spec reference URLs to v0.4.0 (#5812)

This commit is contained in:
tersec 2024-01-22 07:36:46 +00:00 committed by GitHub
parent 4ec36e0670
commit d8a2690a92
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 44 additions and 48 deletions

View File

@ -1580,7 +1580,7 @@ proc onSlotStart(node: BeaconNode, wallTime: BeaconTime,
await onSlotEnd(node, wallSlot)
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/validator.md#registration-dissemination
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/bellatrix/validator.md#registration-dissemination
# This specification suggests validators re-submit to builder software every
# `EPOCHS_PER_VALIDATOR_REGISTRATION_SUBMISSION` epochs.
if wallSlot.is_epoch and

View File

@ -1,5 +1,5 @@
# beacon_chain
# Copyright (c) 2023 Status Research & Development GmbH
# Copyright (c) 2023-2024 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
@ -13,32 +13,32 @@ from stew/byteutils import to0xHex
from ../datatypes/bellatrix import ExecutionAddress
type
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/builder.md#validatorregistrationv1
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/bellatrix/builder.md#validatorregistrationv1
ValidatorRegistrationV1* = object
fee_recipient*: ExecutionAddress
gas_limit*: uint64
timestamp*: uint64
pubkey*: ValidatorPubKey
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/builder.md#signedvalidatorregistrationv1
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/bellatrix/builder.md#signedvalidatorregistrationv1
SignedValidatorRegistrationV1* = object
message*: ValidatorRegistrationV1
signature*: ValidatorSig
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/builder.md#builderbid
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/capella/builder.md#executionpayloadheader
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/bellatrix/builder.md#builderbid
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/capella/builder.md#executionpayloadheader
BuilderBid* = object
header*: capella.ExecutionPayloadHeader # [Modified in Capella]
value*: UInt256
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/capella/builder.md#executionpayloadheader
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/bellatrix/builder.md#signedbuilderbid
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/capella/builder.md#executionpayloadheader
SignedBuilderBid* = object
message*: BuilderBid # [Modified in Capella]
signature*: ValidatorSig
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/capella/builder.md#blindedbeaconblockbody
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/capella/builder.md#blindedbeaconblockbody
BlindedBeaconBlockBody* = object
randao_reveal*: ValidatorSig
eth1_data*: Eth1Data
@ -55,8 +55,8 @@ type
List[SignedBLSToExecutionChange,
Limit MAX_BLS_TO_EXECUTION_CHANGES] # [New in Capella]
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/builder.md#blindedbeaconblock
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/capella/builder.md#blindedbeaconblockbody
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/bellatrix/builder.md#blindedbeaconblock
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/capella/builder.md#blindedbeaconblockbody
BlindedBeaconBlock* = object
slot*: Slot
proposer_index*: uint64
@ -71,17 +71,17 @@ type
of true:
blindedData*: BlindedBeaconBlock
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/builder.md#signedblindedbeaconblock
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/capella/builder.md#blindedbeaconblockbody
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/bellatrix/builder.md#signedblindedbeaconblock
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/capella/builder.md#blindedbeaconblockbody
SignedBlindedBeaconBlock* = object
message*: BlindedBeaconBlock
signature*: ValidatorSig
const
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/builder.md#domain-types
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/bellatrix/builder.md#domain-types
DOMAIN_APPLICATION_BUILDER* = DomainType([byte 0x00, 0x00, 0x00, 0x01])
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/validator.md#constants
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/bellatrix/validator.md#constants
EPOCHS_PER_VALIDATOR_REGISTRATION_SUBMISSION* = 1
# Spec is 1 second, but mev-boost indirection can induce delay when the relay

View File

@ -1,5 +1,5 @@
# beacon_chain
# Copyright (c) 2023 Status Research & Development GmbH
# Copyright (c) 2023-2024 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
@ -13,22 +13,20 @@ from stew/byteutils import to0xHex
from ".."/datatypes/capella import SignedBLSToExecutionChange
type
# https://github.com/ethereum/builder-specs/blob/534e4f81276b8346d785ed9aba12c4c74b927ec6/specs/deneb/builder.md#builderbid
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/deneb/builder.md#builderbid
BuilderBid* = object
header*: deneb.ExecutionPayloadHeader # [Modified in Deneb]
blob_kzg_commitments*: KzgCommitments # [New in Deneb]
value*: UInt256
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/capella/builder.md#executionpayloadheader
# https://github.com/ethereum/builder-specs/blob/534e4f81276b8346d785ed9aba12c4c74b927ec6/specs/deneb/builder.md#executionpayloadheader
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/bellatrix/builder.md#signedbuilderbid
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/deneb/builder.md#executionpayloadheader
SignedBuilderBid* = object
message*: BuilderBid
signature*: ValidatorSig
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/capella/builder.md#blindedbeaconblockbody
# https://github.com/ethereum/builder-specs/blob/0b913daaa491cd889083827375977a6285e684bd/specs/deneb/builder.md#blindedbeaconblockbody
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/deneb/builder.md#blindedbeaconblockbody
BlindedBeaconBlockBody* = object
randao_reveal*: ValidatorSig
eth1_data*: Eth1Data
@ -45,9 +43,8 @@ type
Limit MAX_BLS_TO_EXECUTION_CHANGES]
blob_kzg_commitments*: KzgCommitments # [New in Deneb]
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/builder.md#blindedbeaconblock
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/capella/builder.md#blindedbeaconblockbody
# https://github.com/ethereum/builder-specs/blob/0b913daaa491cd889083827375977a6285e684bd/specs/deneb/builder.md#blindedbeaconblockbody
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/bellatrix/builder.md#blindedbeaconblock
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/deneb/builder.md#blindedbeaconblockbody
BlindedBeaconBlock* = object
slot*: Slot
proposer_index*: uint64
@ -62,13 +59,13 @@ type
of true:
blindedData*: BlindedBeaconBlock
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/builder.md#signedblindedbeaconblock
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/capella/builder.md#blindedbeaconblockbody
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/bellatrix/builder.md#signedblindedbeaconblock
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/capella/builder.md#blindedbeaconblockbody
SignedBlindedBeaconBlock* = object
message*: BlindedBeaconBlock
signature*: ValidatorSig
# https://github.com/ethereum/builder-specs/blob/534e4f81276b8346d785ed9aba12c4c74b927ec6/specs/deneb/builder.md#executionpayloadandblobsbundle
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/deneb/builder.md#executionpayloadandblobsbundle
ExecutionPayloadAndBlobsBundle* = object
execution_payload*: deneb.ExecutionPayload
blobs_bundle*: BlobsBundle

View File

@ -16,7 +16,7 @@ proc registerValidator*(body: seq[SignedValidatorRegistrationV1]
): RestPlainResponse {.
rest, endpoint: "/eth/v1/builder/validators",
meth: MethodPost, connection: {Dedicated, Close}.}
## https://github.com/ethereum/builder-specs/blob/v0.3.0/apis/builder/validators.yaml
## https://github.com/ethereum/builder-specs/blob/v0.4.0/apis/builder/validators.yaml
## https://github.com/ethereum/beacon-APIs/blob/v2.3.0/apis/validator/register_validator.yaml
proc getHeaderCapella*(slot: Slot,
@ -25,10 +25,10 @@ proc getHeaderCapella*(slot: Slot,
): RestResponse[GetHeaderResponseCapella] {.
rest, endpoint: "/eth/v1/builder/header/{slot}/{parent_hash}/{pubkey}",
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/v0.4.0/apis/builder/header.yaml
proc submitBlindedBlock*(body: capella_mev.SignedBlindedBeaconBlock
): RestResponse[SubmitBlindedBlockResponseCapella] {.
rest, endpoint: "/eth/v1/builder/blinded_blocks",
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/v0.4.0/apis/builder/blinded_blocks.yaml

View File

@ -18,10 +18,10 @@ proc getHeaderDeneb*(slot: Slot,
): RestResponse[GetHeaderResponseDeneb] {.
rest, endpoint: "/eth/v1/builder/header/{slot}/{parent_hash}/{pubkey}",
meth: MethodGet, connection: {Dedicated, Close}.}
## https://github.com/ethereum/builder-specs/blob/34509da74237942aa15a4c0ca828f67acdf77652/apis/builder/header.yaml
## https://github.com/ethereum/builder-specs/blob/v0.4.0/apis/builder/header.yaml
proc submitBlindedBlock*(body: deneb_mev.SignedBlindedBeaconBlock
): RestResponse[SubmitBlindedBlockResponseDeneb] {.
rest, endpoint: "/eth/v1/builder/blinded_blocks",
meth: MethodPost, connection: {Dedicated, Close}.}
## https://github.com/ethereum/builder-specs/blob/34509da74237942aa15a4c0ca828f67acdf77652/apis/builder/blinded_blocks.yaml
## https://github.com/ethereum/builder-specs/blob/v0.4.0/apis/builder/blinded_blocks.yaml

View File

@ -80,7 +80,7 @@ proc verify_epoch_signature*(
func compute_block_signing_root*(
fork: Fork, genesis_validators_root: Eth2Digest, slot: Slot,
blck: Eth2Digest | SomeForkyBeaconBlock | BeaconBlockHeader |
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/builder.md#signing
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/bellatrix/builder.md#signing
capella_mev.BlindedBeaconBlock): Eth2Digest =
let
epoch = epoch(slot)
@ -335,7 +335,7 @@ proc verify_contribution_and_proof_signature*(
blsVerify(pubkey, signing_root.data, signature)
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/builder.md#signing
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/bellatrix/builder.md#signing
func compute_builder_signing_root(
fork: Fork,
msg: capella_mev.BuilderBid | deneb_mev.BuilderBid |

View File

@ -39,7 +39,7 @@ const
TIME_DELAY_FROM_SLOT* = 79.milliseconds
SUBSCRIPTION_BUFFER_SLOTS* = 2'u64
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/validator.md#constants
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/bellatrix/validator.md#constants
EPOCHS_BETWEEN_VALIDATOR_REGISTRATION* = 1
ZeroTimeDiff* = TimeDiff(nanoseconds: 0'i64)
@ -977,7 +977,7 @@ proc isDefault*(reg: SignedValidatorRegistrationV1): bool =
proc isExpired(vc: ValidatorClientRef,
reg: SignedValidatorRegistrationV1, slot: Slot): bool =
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/validator.md#registration-dissemination
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/bellatrix/validator.md#registration-dissemination
# This specification suggests validators re-submit to builder software every
# `EPOCHS_PER_VALIDATOR_REGISTRATION_SUBMISSION` epochs.
let

View File

@ -617,7 +617,7 @@ func constructSignableBlindedBlock[T: capella_mev.SignedBlindedBeaconBlock](
var blindedBlock: T
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/validator.md#block-proposal
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/bellatrix/validator.md#block-proposal
copyFields(blindedBlock.message, blck, blckFields)
copyFields(blindedBlock.message.body, blck.body, blckBodyFields)
assign(
@ -635,7 +635,7 @@ proc constructSignableBlindedBlock[T: deneb_mev.SignedBlindedBeaconBlock](
var blindedBlock: T
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/validator.md#block-proposal
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/bellatrix/validator.md#block-proposal
copyFields(blindedBlock.message, blck, blckFields)
copyFields(blindedBlock.message.body, blck.body, blckBodyFields)
assign(
@ -659,7 +659,7 @@ func constructPlainBlindedBlock[T: capella_mev.BlindedBeaconBlock](
var blindedBlock: T
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/validator.md#block-proposal
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/bellatrix/validator.md#block-proposal
copyFields(blindedBlock, blck, blckFields)
copyFields(blindedBlock.body, blck.body, blckBodyFields)
assign(blindedBlock.body.execution_payload_header, executionPayloadHeader)
@ -678,7 +678,7 @@ func constructPlainBlindedBlock[T: deneb_mev.BlindedBeaconBlock](
var blindedBlock: T
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/validator.md#block-proposal
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/bellatrix/validator.md#block-proposal
copyFields(blindedBlock, blck, blckFields)
copyFields(blindedBlock.body, blck.body, blckBodyFields)
assign(
@ -1710,7 +1710,7 @@ proc registerValidatorsPerBuilder(
return
const emptyNestedSeq = @[newSeq[SignedValidatorRegistrationV1](0)]
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/validator.md#validator-registration
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/bellatrix/validator.md#validator-registration
# Seed with single empty inner list to avoid special cases
var validatorRegistrations = emptyNestedSeq
@ -1762,9 +1762,8 @@ proc registerValidatorsPerBuilder(
if validator.index.isNone:
continue
# https://github.com/ethereum/builder-specs/blob/v0.3.0/apis/builder/validators.yaml
# Builders should verify that `pubkey` corresponds to an active or
# pending validator
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/bellatrix/builder.md#is_eligible_for_registration
# Validators should be active or pending
withState(node.dag.headState):
if distinctBase(validator.index.get) >=
forkyState.data.validators.lenu64:

View File

@ -70,7 +70,7 @@ proc unblindAndRouteBlockMEV*(
const httpOk = 200
if bundle.status != httpOk:
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/validator.md#proposer-slashing
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/bellatrix/validator.md#proposer-slashing
# This means if a validator publishes a signature for a
# `BlindedBeaconBlock` (via a dissemination of a
# `SignedBlindedBeaconBlock`) then the validator **MUST** not use the
@ -90,7 +90,7 @@ proc unblindAndRouteBlockMEV*(
# Signature provided is consistent with unblinded execution payload,
# so construct full beacon block
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/validator.md#block-proposal
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/bellatrix/validator.md#block-proposal
var signedBlock = consensusFork.SignedBeaconBlock(
signature: blindedBlock.signature)
copyFields(

View File

@ -811,7 +811,7 @@ proc getDepositMessageSignature*(v: AttachedValidator, version: Version,
let request = Web3SignerRequest.init(version, deposit_message)
await v.signData(request)
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/builder.md#signing
# https://github.com/ethereum/builder-specs/blob/v0.4.0/specs/bellatrix/builder.md#signing
proc getBuilderSignature*(v: AttachedValidator, fork: Fork,
validatorRegistration: ValidatorRegistrationV1):
Future[SignatureResult] {.async.} =