Skip to content

Commit

Permalink
only bypass gossip when EL can sends blobs against ALL kzg commitments
Browse files Browse the repository at this point in the history
  • Loading branch information
agnxsh committed Mar 3, 2025
1 parent b717d3a commit 891484c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
10 changes: 10 additions & 0 deletions beacon_chain/consensus_object_pools/block_quarantine.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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] =
Expand Down
7 changes: 6 additions & 1 deletion beacon_chain/gossip_processing/eth2_processor.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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,
Expand Down

0 comments on commit 891484c

Please sign in to comment.