mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 23:18:15 -05:00
Fix Potuz's comment.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user