mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 23:48:06 -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).
|
// 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) {
|
func (f *blocksFetcher) fetchSidecars(ctx context.Context, pid peer.ID, peers []peer.ID, bwScs []blocks.BlockWithROSidecars) (peer.ID, error) {
|
||||||
samplesPerSlot := params.BeaconConfig().SamplesPerSlot
|
samplesPerSlot := params.BeaconConfig().SamplesPerSlot
|
||||||
|
count := len(bwScs)
|
||||||
|
|
||||||
if len(bwScs) == 0 {
|
if count == 0 {
|
||||||
return "", nil
|
return "", nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find the first block with a slot greater than or equal to the first Fulu slot.
|
preFuluBlocks, postFuluBlocks := make([]blocks.BlockWithROSidecars, 0, count), make([]blocks.BlockWithROSidecars, 0, count)
|
||||||
firstFuluIndex := sort.Search(len(bwScs), func(i int) bool {
|
|
||||||
return bwScs[i].Block.Version() >= version.Fulu
|
|
||||||
})
|
|
||||||
|
|
||||||
preFuluBlocks := bwScs[:firstFuluIndex]
|
for _, bwSc := range bwScs {
|
||||||
postFuluBlocks := bwScs[firstFuluIndex:]
|
if bwSc.Block.Version() >= version.Fulu {
|
||||||
|
postFuluBlocks = append(postFuluBlocks, bwSc)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
preFuluBlocks = append(preFuluBlocks, bwSc)
|
||||||
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
blobsPid peer.ID
|
blobsPid peer.ID
|
||||||
|
|||||||
Reference in New Issue
Block a user