diff --git a/beacon_chain/nimbus_beacon_node.nim b/beacon_chain/nimbus_beacon_node.nim index e937d2ecf..461c32f58 100644 --- a/beacon_chain/nimbus_beacon_node.nim +++ b/beacon_chain/nimbus_beacon_node.nim @@ -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 diff --git a/beacon_chain/spec/mev/capella_mev.nim b/beacon_chain/spec/mev/capella_mev.nim index 82f70231d..90ab220af 100644 --- a/beacon_chain/spec/mev/capella_mev.nim +++ b/beacon_chain/spec/mev/capella_mev.nim @@ -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 diff --git a/beacon_chain/spec/mev/deneb_mev.nim b/beacon_chain/spec/mev/deneb_mev.nim index ff914dbeb..f3b470a18 100644 --- a/beacon_chain/spec/mev/deneb_mev.nim +++ b/beacon_chain/spec/mev/deneb_mev.nim @@ -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 diff --git a/beacon_chain/spec/mev/rest_capella_mev_calls.nim b/beacon_chain/spec/mev/rest_capella_mev_calls.nim index e7f35bd50..c25eeb08e 100644 --- a/beacon_chain/spec/mev/rest_capella_mev_calls.nim +++ b/beacon_chain/spec/mev/rest_capella_mev_calls.nim @@ -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 diff --git a/beacon_chain/spec/mev/rest_deneb_mev_calls.nim b/beacon_chain/spec/mev/rest_deneb_mev_calls.nim index e22d37640..c0b2aee58 100644 --- a/beacon_chain/spec/mev/rest_deneb_mev_calls.nim +++ b/beacon_chain/spec/mev/rest_deneb_mev_calls.nim @@ -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 diff --git a/beacon_chain/spec/signatures.nim b/beacon_chain/spec/signatures.nim index 8e2d9ea17..8c185e1f5 100644 --- a/beacon_chain/spec/signatures.nim +++ b/beacon_chain/spec/signatures.nim @@ -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 | diff --git a/beacon_chain/validator_client/common.nim b/beacon_chain/validator_client/common.nim index 6951d11e0..1c47a327d 100644 --- a/beacon_chain/validator_client/common.nim +++ b/beacon_chain/validator_client/common.nim @@ -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 diff --git a/beacon_chain/validators/beacon_validators.nim b/beacon_chain/validators/beacon_validators.nim index 29bfe75ab..355d20fbc 100644 --- a/beacon_chain/validators/beacon_validators.nim +++ b/beacon_chain/validators/beacon_validators.nim @@ -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: diff --git a/beacon_chain/validators/message_router_mev.nim b/beacon_chain/validators/message_router_mev.nim index bb2a987aa..bad4c3f10 100644 --- a/beacon_chain/validators/message_router_mev.nim +++ b/beacon_chain/validators/message_router_mev.nim @@ -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( diff --git a/beacon_chain/validators/validator_pool.nim b/beacon_chain/validators/validator_pool.nim index 57c8d71db..db7707b16 100644 --- a/beacon_chain/validators/validator_pool.nim +++ b/beacon_chain/validators/validator_pool.nim @@ -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.} =