From 7b0e3b1c04a45ec6f0dc92531ee2cd59fe278f34 Mon Sep 17 00:00:00 2001 From: henridf Date: Thu, 29 Jun 2023 03:17:54 +0200 Subject: [PATCH] Review feedbac from #5106 (#5141) --- beacon_chain/spec/datatypes/constants.nim | 2 +- beacon_chain/validators/message_router.nim | 3 +-- beacon_chain/validators/validator_duties.nim | 8 ++++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/beacon_chain/spec/datatypes/constants.nim b/beacon_chain/spec/datatypes/constants.nim index ae32b1c7f..e99f506c4 100644 --- a/beacon_chain/spec/datatypes/constants.nim +++ b/beacon_chain/spec/datatypes/constants.nim @@ -63,5 +63,5 @@ const # https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.0/specs/phase0/fork-choice.md#configuration PROPOSER_SCORE_BOOST*: uint64 = 40 - # https://github.com/ethereum/consensus-specs/blob/v1.4.0-alpha.3/specs/deneb/p2p-interface.md#configuration + # https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.0/specs/deneb/p2p-interface.md#configuration BLOB_SIDECAR_SUBNET_COUNT*: uint64 = 6 diff --git a/beacon_chain/validators/message_router.nim b/beacon_chain/validators/message_router.nim index c08348757..09a591573 100644 --- a/beacon_chain/validators/message_router.nim +++ b/beacon_chain/validators/message_router.nim @@ -111,7 +111,7 @@ proc routeSignedBeaconBlock*( let kzgCommits = blck.message.body.blob_kzg_commitments.asSeq if blobs.len > 0 or kzgCommits.len > 0: let res = validate_blobs(kzgCommits, blobs.mapIt(it.message.blob), - blobs.mapIt(it.message.kzg_proof)) + blobs.mapIt(it.message.kzg_proof)) if res.isErr(): warn "blobs failed validation", blockRoot = shortLog(blck.root), @@ -161,7 +161,6 @@ proc routeSignedBeaconBlock*( notice "Blob sent", blob = shortLog(signedBlobs[i]), error = res.error[] blobs = Opt.some(blobsOpt.get().mapIt(newClone(it.message))) - let newBlockRef = await router[].blockProcessor.storeBlock( MsgSource.api, sendTime, blck, blobs) diff --git a/beacon_chain/validators/validator_duties.nim b/beacon_chain/validators/validator_duties.nim index 59adb3774..1a30a49aa 100644 --- a/beacon_chain/validators/validator_duties.nim +++ b/beacon_chain/validators/validator_duties.nim @@ -976,11 +976,11 @@ proc proposeBlockAux( elif blck is deneb.BeaconBlock: # TODO: also route blobs deneb.SignedBeaconBlock(message: blck, signature: signature, root: blockRoot) - else: + else: static: doAssert "Unknown SignedBeaconBlock type" - newBlockRef = - (await node.router.routeSignedBeaconBlock(signedBlock, Opt.none(SignedBlobSidecars))).valueOr: - return head # Errors logged in router + newBlockRef = (await node.router.routeSignedBeaconBlock( + signedBlock, Opt.none(SignedBlobSidecars))).valueOr: + return head # Errors logged in router if newBlockRef.isNone(): return head # Validation errors logged in router