Fix Potuz's comment.

This commit is contained in:
Manu NALEPA
2025-08-10 22:47:00 +02:00
parent 0af6591001
commit c45230b455

View File

@@ -356,18 +356,22 @@ func (f *blocksFetcher) handleRequest(ctx context.Context, start primitives.Slot
// It returns the peer ID from which blobs were fetched (if any).
func (f *blocksFetcher) fetchSidecars(ctx context.Context, pid peer.ID, peers []peer.ID, bwScs []blocks.BlockWithROSidecars) (peer.ID, error) {
samplesPerSlot := params.BeaconConfig().SamplesPerSlot
count := len(bwScs)
if len(bwScs) == 0 {
if count == 0 {
return "", nil
}
// Find the first block with a slot greater than or equal to the first Fulu slot.
firstFuluIndex := sort.Search(len(bwScs), func(i int) bool {
return bwScs[i].Block.Version() >= version.Fulu
})
preFuluBlocks, postFuluBlocks := make([]blocks.BlockWithROSidecars, 0, count), make([]blocks.BlockWithROSidecars, 0, count)
preFuluBlocks := bwScs[:firstFuluIndex]
postFuluBlocks := bwScs[firstFuluIndex:]
for _, bwSc := range bwScs {
if bwSc.Block.Version() >= version.Fulu {
postFuluBlocks = append(postFuluBlocks, bwSc)
continue
}
preFuluBlocks = append(preFuluBlocks, bwSc)
}
var (
blobsPid peer.ID