Skip to content

Commit 1c4cd5e

Browse files
committed
only bypass gossip when EL can sends blobs against ALL kzg commitments
1 parent c2d632b commit 1c4cd5e

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

beacon_chain/consensus_object_pools/block_quarantine.nim

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,16 @@ func popBlobless*(
381381
else:
382382
Opt.none(ForkedSignedBeaconBlock)
383383

384+
func getBlobless*(
385+
quarantine: var Quarantine,
386+
root: Eth2Digest): Opt[ForkedSignedBeaconBlock] =
387+
if quarantine.blobless.hasKey(root):
388+
Opt.some((quarantine.blobless.getOrDefault(
389+
root,
390+
default(ForkedSignedBeaconBlock))))
391+
else:
392+
Opt.none(ForkedSignedBeaconBlock)
393+
384394
func popColumnless*(
385395
quarantine: var Quarantine,
386396
root: Eth2Digest): Opt[ForkedSignedBeaconBlock] =

beacon_chain/gossip_processing/eth2_processor.nim

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ proc validateBlobSidecarFromEL(
280280
Future[Result[void, ValidationError]]
281281
{.async: (raises: [CancelledError]).} =
282282

283-
if (let o = self.quarantine[].popBlobless(block_root); o.isSome):
283+
if (let o = self.quarantine[].getBlobless(block_root); o.isSome):
284284
let blobless = o.get()
285285
withBlck(blobless):
286286
when consensusFork >= ConsensusFork.Electra:
@@ -292,6 +292,11 @@ proc validateBlobSidecarFromEL(
292292
# check lengths of array[BlobAndProofV1] with blobs
293293
# kzg commitments of the signed block
294294
if blobsEl.len == forkyBlck.message.body.blob_kzg_commitments.len:
295+
296+
# we have got all blobs from EL, now we can
297+
# conveniently the blobless block from quarantine
298+
discard self.quarantine[].popBlobless(block_root)
299+
295300
let blob_sidecars_el =
296301
create_blob_sidecars(
297302
forkyBlck,

0 commit comments

Comments
 (0)