avoid modifying blobless collection during iteration in edge case (#6168)
The fallback when blobless quarantine contains a block with all blobs modifies collection while iterating, potentially asserting if reachable. Using a second loop to process this situation resolves that.
This commit is contained in:
parent
67ade106cc
commit
96e27d9d35
|
@ -299,7 +299,9 @@ proc getMissingBlobs(rman: RequestManager): seq[BlobIdentifier] =
|
|||
delay = wallTime - wallSlot.start_beacon_time()
|
||||
waitDur = TimeDiff(nanoseconds: BLOB_GOSSIP_WAIT_TIME_NS)
|
||||
|
||||
var fetches: seq[BlobIdentifier]
|
||||
var
|
||||
fetches: seq[BlobIdentifier]
|
||||
ready: seq[Eth2Digest]
|
||||
for blobless in rman.quarantine[].peekBlobless():
|
||||
# give blobs a chance to arrive over gossip
|
||||
if blobless.message.slot == wallSlot and delay < waitDur:
|
||||
|
@ -321,9 +323,11 @@ proc getMissingBlobs(rman: RequestManager): seq[BlobIdentifier] =
|
|||
warn "missing blob handler found blobless block with all blobs",
|
||||
blk=blobless.root,
|
||||
commitments=len(blobless.message.body.blob_kzg_commitments)
|
||||
discard rman.blockVerifier(ForkedSignedBeaconBlock.init(blobless),
|
||||
false)
|
||||
rman.quarantine[].removeBlobless(blobless)
|
||||
ready.add(blobless.root)
|
||||
for root in ready:
|
||||
let blobless = rman.quarantine[].popBlobless(root).valueOr:
|
||||
continue
|
||||
discard rman.blockVerifier(blobless, false)
|
||||
fetches
|
||||
|
||||
proc requestManagerBlobLoop(
|
||||
|
|
Loading…
Reference in New Issue