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()
|
delay = wallTime - wallSlot.start_beacon_time()
|
||||||
waitDur = TimeDiff(nanoseconds: BLOB_GOSSIP_WAIT_TIME_NS)
|
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():
|
for blobless in rman.quarantine[].peekBlobless():
|
||||||
# give blobs a chance to arrive over gossip
|
# give blobs a chance to arrive over gossip
|
||||||
if blobless.message.slot == wallSlot and delay < waitDur:
|
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",
|
warn "missing blob handler found blobless block with all blobs",
|
||||||
blk=blobless.root,
|
blk=blobless.root,
|
||||||
commitments=len(blobless.message.body.blob_kzg_commitments)
|
commitments=len(blobless.message.body.blob_kzg_commitments)
|
||||||
discard rman.blockVerifier(ForkedSignedBeaconBlock.init(blobless),
|
ready.add(blobless.root)
|
||||||
false)
|
for root in ready:
|
||||||
rman.quarantine[].removeBlobless(blobless)
|
let blobless = rman.quarantine[].popBlobless(root).valueOr:
|
||||||
|
continue
|
||||||
|
discard rman.blockVerifier(blobless, false)
|
||||||
fetches
|
fetches
|
||||||
|
|
||||||
proc requestManagerBlobLoop(
|
proc requestManagerBlobLoop(
|
||||||
|
|
Loading…
Reference in New Issue