More blob tweaks/fixes from running in devnet (#4933)

* BeaconNode: don't call fetchMissingblobs with empty list

* More logging

* BlockProcessor.checkBloblessSignature: Add missing return value
This commit is contained in:
henridf 2023-05-11 02:36:35 +02:00 committed by GitHub
parent 4e715c877f
commit be3f5b1eac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 14 additions and 2 deletions

View File

@ -378,6 +378,7 @@ proc checkBloblessSignature(self: BlockProcessor,
dag.validatorKey(proposer).get(),
signed_beacon_block.signature):
return err("checkBloblessSignature: Invalid proposer signature")
ok()
proc storeBlock*(
self: ref BlockProcessor, src: MsgSource, wallTime: BeaconTime,

View File

@ -1377,8 +1377,9 @@ proc handleMissingBlobs(node: BeaconNode) =
blobless.root)
)
node.quarantine[].removeBlobless(blobless)
debug "Requesting detected missing blobs", blobs = shortLog(fetches)
node.requestManager.fetchMissingBlobs(fetches)
if fetches.len > 0:
debug "Requesting detected missing blobs", blobs = shortLog(fetches)
node.requestManager.fetchMissingBlobs(fetches)
proc handleMissingBlocks(node: BeaconNode) =
let missingBlocks = node.quarantine[].checkMissing()

View File

@ -598,6 +598,7 @@ func shortLog*(v: SomeBeaconBlock): auto =
sync_committee_participants: v.body.sync_aggregate.num_active_participants,
block_number: 0'u64, # Bellatrix compat
fee_recipient: "",
blob_kzg_commitments_len: 0, # Deneb compat
)
func shortLog*(v: SomeSignedBeaconBlock): auto =

View File

@ -403,6 +403,7 @@ func shortLog*(v: SomeBeaconBlock): auto =
block_number: v.body.execution_payload.block_number,
# TODO checksum hex? shortlog?
fee_recipient: to0xHex(v.body.execution_payload.fee_recipient.data),
blob_kzg_commitments_len: 0, # Deneb compat
)
func shortLog*(v: SomeSignedBeaconBlock): auto =

View File

@ -587,6 +587,7 @@ func shortLog*(v: SomeBeaconBlock): auto =
block_number: v.body.execution_payload.block_number,
# TODO checksum hex? shortlog?
fee_recipient: to0xHex(v.body.execution_payload.fee_recipient.data),
blob_kzg_commitments_len: 0, # Deneb compat
)
func shortLog*(v: SomeSignedBeaconBlock): auto =

View File

@ -534,6 +534,7 @@ func shortLog*(v: SomeBeaconBlock): auto =
block_number: v.body.execution_payload.block_number,
# TODO checksum hex? shortlog?
fee_recipient: to0xHex(v.body.execution_payload.fee_recipient.data),
blob_kzg_commitments_len: v.body.blob_kzg_commitments.len(),
)
func shortLog*(v: BlobSidecar): auto =

View File

@ -298,6 +298,7 @@ func shortLog*(v: SomeBeaconBlock): auto =
sync_committee_participants: -1, # Altair logging compatibility
block_number: 0'u64, # Bellatrix compat
fee_recipient: "",
blob_kzg_commitments_len: 0, # Deneb compat
)
# TODO: There should be only a single generic HashedBeaconState definition

View File

@ -85,6 +85,7 @@ func shortLog*(v: BlindedBeaconBlock): auto =
block_number: v.body.execution_payload_header.block_number,
# TODO checksum hex? shortlog?
fee_recipient: to0xHex(v.body.execution_payload_header.fee_recipient.data),
blob_kzg_commitments_len: 0, # Deneb compat
)
func shortLog*(v: SignedBlindedBeaconBlock): auto =

View File

@ -74,6 +74,7 @@ func shortLog*(v: BlindedBeaconBlock): auto =
# TODO checksum hex? shortlog?
fee_recipient: to0xHex(v.body.execution_payload_header.fee_recipient.data),
#bls_to_execution_changes_len: v.body.bls_to_execution_changes.len(), # TODO validator_client/block_service.nim seems to want same shape of shortLogs across all block types
blob_kzg_commitments_len: 0, # Deneb compat
)
func shortLog*(v: SignedBlindedBeaconBlock): auto =

View File

@ -153,6 +153,9 @@ proc fetchAncestorBlocksFromNetwork(rman: RequestManager,
peer_score = peer.getScore()
peer.updateScore(PeerScoreUnviableFork)
elif gotGoodBlock:
debug "Request manager got good block",
peer = peer, blocks = shortLog(items)
# We reward peer only if it returns something.
peer.updateScore(PeerScoreGoodValues)