builder spec v0.3.0 URL updates (#4641)

* builder spec v0.3.0 URL updates

* remove stray non-URL/comment change
This commit is contained in:
tersec 2023-02-18 00:54:30 +00:00 committed by GitHub
parent 6b9381ef41
commit 0cc0c7e6b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 34 additions and 30 deletions

View File

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

View File

@ -11,30 +11,30 @@ from stew/byteutils import to0xHex
{.push raises: [].} {.push raises: [].}
type type
# https://github.com/ethereum/builder-specs/blob/v0.2.0/specs/builder.md#validatorregistrationv1 # https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/builder.md#validatorregistrationv1
ValidatorRegistrationV1* = object ValidatorRegistrationV1* = object
fee_recipient*: ExecutionAddress fee_recipient*: ExecutionAddress
gas_limit*: uint64 gas_limit*: uint64
timestamp*: uint64 timestamp*: uint64
pubkey*: ValidatorPubKey pubkey*: ValidatorPubKey
# https://github.com/ethereum/builder-specs/blob/v0.2.0/specs/builder.md#signedvalidatorregistrationv1 # https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/builder.md#signedvalidatorregistrationv1
SignedValidatorRegistrationV1* = object SignedValidatorRegistrationV1* = object
message*: ValidatorRegistrationV1 message*: ValidatorRegistrationV1
signature*: ValidatorSig signature*: ValidatorSig
# https://github.com/ethereum/builder-specs/blob/v0.2.0/specs/builder.md#builderbid # https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/builder.md#builderbid
BuilderBid* = object BuilderBid* = object
header*: ExecutionPayloadHeader header*: ExecutionPayloadHeader
value*: UInt256 value*: UInt256
pubkey*: ValidatorPubKey pubkey*: ValidatorPubKey
# https://github.com/ethereum/builder-specs/blob/v0.2.0/specs/builder.md#signedbuilderbid # https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/builder.md#signedbuilderbid
SignedBuilderBid* = object SignedBuilderBid* = object
message*: BuilderBid message*: BuilderBid
signature*: ValidatorSig signature*: ValidatorSig
# https://github.com/ethereum/builder-specs/blob/v0.2.0/specs/builder.md#blindedbeaconblockbody # https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/builder.md#blindedbeaconblockbody
BlindedBeaconBlockBody = object BlindedBeaconBlockBody = object
randao_reveal*: ValidatorSig randao_reveal*: ValidatorSig
eth1_data*: Eth1Data eth1_data*: Eth1Data
@ -47,7 +47,7 @@ type
sync_aggregate*: SyncAggregate sync_aggregate*: SyncAggregate
execution_payload_header*: ExecutionPayloadHeader execution_payload_header*: ExecutionPayloadHeader
# https://github.com/ethereum/builder-specs/blob/v0.2.0/specs/builder.md#blindedbeaconblock # https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/builder.md#blindedbeaconblock
BlindedBeaconBlock* = object BlindedBeaconBlock* = object
slot*: Slot slot*: Slot
proposer_index*: uint64 proposer_index*: uint64
@ -55,16 +55,16 @@ type
state_root*: Eth2Digest state_root*: Eth2Digest
body*: BlindedBeaconBlockBody body*: BlindedBeaconBlockBody
# https://github.com/ethereum/builder-specs/blob/v0.2.0/specs/builder.md#signedblindedbeaconblock # https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/builder.md#signedblindedbeaconblock
SignedBlindedBeaconBlock* = object SignedBlindedBeaconBlock* = object
message*: BlindedBeaconBlock message*: BlindedBeaconBlock
signature*: ValidatorSig signature*: ValidatorSig
const const
# https://github.com/ethereum/builder-specs/blob/v0.2.0/specs/builder.md#domain-types # https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/builder.md#domain-types
DOMAIN_APPLICATION_BUILDER* = DomainType([byte 0x00, 0x00, 0x00, 0x01]) DOMAIN_APPLICATION_BUILDER* = DomainType([byte 0x00, 0x00, 0x00, 0x01])
# https://github.com/ethereum/builder-specs/blob/v0.2.0/specs/validator.md#constants # https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/validator.md#constants
EPOCHS_PER_VALIDATOR_REGISTRATION_SUBMISSION* = 1 EPOCHS_PER_VALIDATOR_REGISTRATION_SUBMISSION* = 1
BUILDER_PROPOSAL_DELAY_TOLERANCE* = 1.seconds BUILDER_PROPOSAL_DELAY_TOLERANCE* = 1.seconds

View File

@ -11,18 +11,20 @@ from stew/byteutils import to0xHex
{.push raises: [].} {.push raises: [].}
type type
# https://github.com/jimmygchen/builder-specs/blob/0e15394bc239d3fee1ba9e42f4ce67ff6565537b/specs/builder.md#builderbid-1 # 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
BuilderBid* = object BuilderBid* = object
header*: capella.ExecutionPayloadHeader # [Modified in Capella] header*: capella.ExecutionPayloadHeader # [Modified in Capella]
value*: UInt256 value*: UInt256
pubkey*: ValidatorPubKey pubkey*: ValidatorPubKey
# https://github.com/jimmygchen/builder-specs/blob/0e15394bc239d3fee1ba9e42f4ce67ff6565537b/specs/builder.md#signedbuilderbid-1 # 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
SignedBuilderBid* = object SignedBuilderBid* = object
message*: BuilderBid # [Modified in Capella] message*: BuilderBid # [Modified in Capella]
signature*: ValidatorSig signature*: ValidatorSig
# https://github.com/jimmygchen/builder-specs/blob/0e15394bc239d3fee1ba9e42f4ce67ff6565537b/specs/builder.md#blindedbeaconblockbody-1 # https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/capella/builder.md#blindedbeaconblockbody
BlindedBeaconBlockBody = object BlindedBeaconBlockBody = object
randao_reveal*: ValidatorSig randao_reveal*: ValidatorSig
eth1_data*: Eth1Data eth1_data*: Eth1Data
@ -39,7 +41,8 @@ type
List[SignedBLSToExecutionChange, List[SignedBLSToExecutionChange,
Limit MAX_BLS_TO_EXECUTION_CHANGES] # [New in Capella] Limit MAX_BLS_TO_EXECUTION_CHANGES] # [New in Capella]
# https://github.com/jimmygchen/builder-specs/blob/0e15394bc239d3fee1ba9e42f4ce67ff6565537b/specs/builder.md#blindedbeaconblock-1 # 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
BlindedBeaconBlock* = object BlindedBeaconBlock* = object
slot*: Slot slot*: Slot
proposer_index*: uint64 proposer_index*: uint64
@ -47,7 +50,8 @@ type
state_root*: Eth2Digest state_root*: Eth2Digest
body*: BlindedBeaconBlockBody # [Modified in Capella] body*: BlindedBeaconBlockBody # [Modified in Capella]
# https://github.com/jimmygchen/builder-specs/blob/0e15394bc239d3fee1ba9e42f4ce67ff6565537b/specs/builder.md#signedblindedbeaconblock-1 # 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
SignedBlindedBeaconBlock* = object SignedBlindedBeaconBlock* = object
message*: BlindedBeaconBlock message*: BlindedBeaconBlock
signature*: ValidatorSig signature*: ValidatorSig

View File

@ -16,8 +16,8 @@ proc registerValidator*(body: seq[SignedValidatorRegistrationV1]
): RestPlainResponse {. ): RestPlainResponse {.
rest, endpoint: "/eth/v1/builder/validators", rest, endpoint: "/eth/v1/builder/validators",
meth: MethodPost, connection: {Dedicated, Close}.} meth: MethodPost, connection: {Dedicated, Close}.}
## https://github.com/ethereum/builder-specs/blob/v0.2.0/apis/builder/validators.yaml ## https://github.com/ethereum/builder-specs/blob/v0.3.0/apis/builder/validators.yaml
## https://github.com/ethereum/beacon-APIs/blob/master/apis/validator/register_validator.yaml ## https://github.com/ethereum/beacon-APIs/blob/v2.3.0/apis/validator/register_validator.yaml
proc getHeader*(slot: Slot, proc getHeader*(slot: Slot,
parent_hash: Eth2Digest, parent_hash: Eth2Digest,
@ -25,15 +25,15 @@ proc getHeader*(slot: Slot,
): RestResponse[GetHeaderResponse] {. ): RestResponse[GetHeaderResponse] {.
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.2.0/apis/builder/header.yaml ## https://github.com/ethereum/builder-specs/blob/v0.3.0/apis/builder/header.yaml
proc submitBlindedBlock*(body: bellatrix_mev.SignedBlindedBeaconBlock proc submitBlindedBlock*(body: bellatrix_mev.SignedBlindedBeaconBlock
): RestResponse[SubmitBlindedBlockResponseBellatrix] {. ): RestResponse[SubmitBlindedBlockResponseBellatrix] {.
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.2.0/apis/builder/blinded_blocks.yaml ## https://github.com/ethereum/builder-specs/blob/v0.3.0/apis/builder/blinded_blocks.yaml
proc checkBuilderStatus*(): RestPlainResponse {. proc checkBuilderStatus*(): RestPlainResponse {.
rest, endpoint: "/eth/v1/builder/status", rest, endpoint: "/eth/v1/builder/status",
meth: MethodGet, connection: {Dedicated, Close}.} meth: MethodGet, connection: {Dedicated, Close}.}
## https://github.com/ethereum/builder-specs/blob/v0.2.0/apis/builder/status.yaml ## https://github.com/ethereum/builder-specs/blob/v0.3.0/apis/builder/status.yaml

View File

@ -90,7 +90,7 @@ proc verify_epoch_signature*(
func compute_block_signing_root*( func compute_block_signing_root*(
fork: Fork, genesis_validators_root: Eth2Digest, slot: Slot, fork: Fork, genesis_validators_root: Eth2Digest, slot: Slot,
blck: Eth2Digest | SomeForkyBeaconBlock | BeaconBlockHeader | blck: Eth2Digest | SomeForkyBeaconBlock | BeaconBlockHeader |
# https://github.com/ethereum/builder-specs/blob/v0.1.0/specs/README.md#signing # https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/builder.md#signing
BlindedBeaconBlock): Eth2Digest = BlindedBeaconBlock): Eth2Digest =
let let
epoch = epoch(slot) epoch = epoch(slot)
@ -345,7 +345,7 @@ proc verify_contribution_and_proof_signature*(
blsVerify(pubkey, signing_root.data, signature) blsVerify(pubkey, signing_root.data, signature)
# https://github.com/ethereum/builder-specs/blob/v0.2.0/specs/builder.md#signing # https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/builder.md#signing
func compute_builder_signing_root*( func compute_builder_signing_root*(
fork: Fork, msg: BuilderBid | ValidatorRegistrationV1): Eth2Digest = fork: Fork, msg: BuilderBid | ValidatorRegistrationV1): Eth2Digest =
# Uses genesis fork version regardless # Uses genesis fork version regardless

View File

@ -76,7 +76,7 @@ proc unblindAndRouteBlockMEV*(
else: else:
# Signature provided is consistent with unblinded execution payload, # Signature provided is consistent with unblinded execution payload,
# so construct full beacon block # so construct full beacon block
# https://github.com/ethereum/builder-specs/blob/v0.2.0/specs/validator.md#block-proposal # https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/validator.md#block-proposal
var signedBlock = bellatrix.SignedBeaconBlock( var signedBlock = bellatrix.SignedBeaconBlock(
signature: blindedBlock.signature) signature: blindedBlock.signature)
copyFields( copyFields(
@ -110,12 +110,12 @@ proc unblindAndRouteBlockMEV*(
debug "unblindAndRouteBlockMEV: submitBlindedBlock failed", debug "unblindAndRouteBlockMEV: submitBlindedBlock failed",
blindedBlock, payloadStatus = unblindedPayload.status blindedBlock, payloadStatus = unblindedPayload.status
# https://github.com/ethereum/builder-specs/blob/v0.2.0/specs/validator.md#proposer-slashing # https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/validator.md#proposer-slashing
# This means if a validator publishes a signature for a # This means if a validator publishes a signature for a
# `BlindedBeaconBlock` (via a dissemination of a # `BlindedBeaconBlock` (via a dissemination of a
# `SignedBlindedBeaconBlock`) then the validator **MUST** not use the # `SignedBlindedBeaconBlock`) then the validator **MUST** not use the
# local build process as a fallback, even in the event of some failure # local build process as a fallback, even in the event of some failure
# with the external buildernetwork. # with the external builder network.
return err("unblindAndRouteBlockMEV error") return err("unblindAndRouteBlockMEV error")
# TODO currently cannot be combined into one generic function # TODO currently cannot be combined into one generic function

View File

@ -605,7 +605,7 @@ func constructSignableBlindedBlock[T](
var blindedBlock: T var blindedBlock: T
# https://github.com/ethereum/builder-specs/blob/v0.2.0/specs/validator.md#block-proposal # https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/validator.md#block-proposal
copyFields(blindedBlock.message, forkedBlock.bellatrixData, blckFields) copyFields(blindedBlock.message, forkedBlock.bellatrixData, blckFields)
copyFields( copyFields(
blindedBlock.message.body, forkedBlock.bellatrixData.body, blckBodyFields) blindedBlock.message.body, forkedBlock.bellatrixData.body, blckBodyFields)
@ -622,7 +622,7 @@ func constructPlainBlindedBlock[T](
var blindedBlock: T var blindedBlock: T
# https://github.com/ethereum/builder-specs/blob/v0.2.0/specs/validator.md#block-proposal # https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/validator.md#block-proposal
copyFields(blindedBlock, forkedBlock.bellatrixData, blckFields) copyFields(blindedBlock, forkedBlock.bellatrixData, blckFields)
copyFields(blindedBlock.body, forkedBlock.bellatrixData.body, blckBodyFields) copyFields(blindedBlock.body, forkedBlock.bellatrixData.body, blckBodyFields)
blindedBlock.body.execution_payload_header = executionPayloadHeader blindedBlock.body.execution_payload_header = executionPayloadHeader
@ -1356,7 +1356,7 @@ proc registerValidators*(node: BeaconNode, epoch: Epoch) {.async.} =
toSeq(node.attachedValidators[].validators.keys) toSeq(node.attachedValidators[].validators.keys)
const emptyNestedSeq = @[newSeq[SignedValidatorRegistrationV1](0)] const emptyNestedSeq = @[newSeq[SignedValidatorRegistrationV1](0)]
# https://github.com/ethereum/builder-specs/blob/v0.2.0/specs/validator.md#validator-registration # https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/validator.md#validator-registration
# Seed with single empty inner list to avoid special cases # Seed with single empty inner list to avoid special cases
var validatorRegistrations = emptyNestedSeq var validatorRegistrations = emptyNestedSeq
@ -1406,7 +1406,7 @@ proc registerValidators*(node: BeaconNode, epoch: Epoch) {.async.} =
if validator.index.isNone: if validator.index.isNone:
continue continue
# https://ethereum.github.io/builder-specs/#/Builder/registerValidator # https://github.com/ethereum/builder-specs/blob/v0.3.0/apis/builder/validators.yaml
# Builders should verify that `pubkey` corresponds to an active or # Builders should verify that `pubkey` corresponds to an active or
# pending validator # pending validator
withState(node.dag.headState): withState(node.dag.headState):

View File

@ -618,7 +618,7 @@ proc getSlotSignature*(v: AttachedValidator, fork: Fork,
v.slotSignature = Opt.some((slot, signature.get)) v.slotSignature = Opt.some((slot, signature.get))
return signature return signature
# https://github.com/ethereum/builder-specs/blob/v0.2.0/specs/builder.md#signing # https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/builder.md#signing
proc getBuilderSignature*(v: AttachedValidator, fork: Fork, proc getBuilderSignature*(v: AttachedValidator, fork: Fork,
validatorRegistration: ValidatorRegistrationV1): validatorRegistration: ValidatorRegistrationV1):
Future[SignatureResult] {.async.} = Future[SignatureResult] {.async.} =