diff --git a/beacon_chain/consensus_object_pools/block_quarantine.nim b/beacon_chain/consensus_object_pools/block_quarantine.nim index da33499be1..0a5c603b10 100644 --- a/beacon_chain/consensus_object_pools/block_quarantine.nim +++ b/beacon_chain/consensus_object_pools/block_quarantine.nim @@ -381,6 +381,16 @@ func popBlobless*( else: Opt.none(ForkedSignedBeaconBlock) +func getBlobless*( + quarantine: var Quarantine, + root: Eth2Digest): Opt[ForkedSignedBeaconBlock] = + if quarantine.blobless.hasKey(root): + Opt.some((quarantine.blobless.getOrDefault( + root, + default(ForkedSignedBeaconBlock)))) + else: + Opt.none(ForkedSignedBeaconBlock) + func popColumnless*( quarantine: var Quarantine, root: Eth2Digest): Opt[ForkedSignedBeaconBlock] = diff --git a/beacon_chain/gossip_processing/eth2_processor.nim b/beacon_chain/gossip_processing/eth2_processor.nim index 7c3e799df3..45a65f7fd1 100644 --- a/beacon_chain/gossip_processing/eth2_processor.nim +++ b/beacon_chain/gossip_processing/eth2_processor.nim @@ -280,7 +280,7 @@ proc validateBlobSidecarFromEL( Future[Result[void, ValidationError]] {.async: (raises: [CancelledError]).} = - if (let o = self.quarantine[].popBlobless(block_root); o.isSome): + if (let o = self.quarantine[].getBlobless(block_root); o.isSome): let blobless = o.get() withBlck(blobless): when consensusFork >= ConsensusFork.Electra: @@ -292,6 +292,11 @@ proc validateBlobSidecarFromEL( # check lengths of array[BlobAndProofV1] with blobs # kzg commitments of the signed block if blobsEl.len == forkyBlck.message.body.blob_kzg_commitments.len: + + # we have got all blobs from EL, now we can + # conveniently the blobless block from quarantine + discard self.quarantine[].popBlobless(block_root) + let blob_sidecars_el = create_blob_sidecars( forkyBlck,