Blob accounting fixes/tweaks (#5044)

- Replace asset by warning
- change inequality to lt
This commit is contained in:
henridf 2023-06-09 12:52:03 +02:00 committed by GitHub
parent 7028cc45f5
commit eda631cd7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -70,7 +70,7 @@ func removeBlobs*(quarantine: var BlobQuarantine, digest: Eth2Digest) =
func hasBlobs*(quarantine: BlobQuarantine, blck: deneb.SignedBeaconBlock):
bool =
let idxs = quarantine.blobIndices(blck.root)
if len(blck.message.body.blob_kzg_commitments) != len(idxs):
if len(blck.message.body.blob_kzg_commitments) < len(idxs):
return false
for i in 0..<len(idxs):
if idxs[i] != uint64(i):

View File

@ -1362,7 +1362,11 @@ proc handleMissingBlobs(node: BeaconNode) =
if not node.blobQuarantine[].hasBlobs(blobless):
let missing = node.blobQuarantine[].blobFetchRecord(blobless)
doAssert not len(missing.indices) == 0
if len(missing.indices) == 0:
warn "quarantine missing blobs, but missing indices is empty",
blk=blobless.root,
indices=node.blobQuarantine[].blobIndices(blobless.root),
kzgs=len(blobless.message.body.blob_kzg_commitments)
fetches.add(missing)
else:
# this is a programming error should it occur.