Skip to content

Commit

Permalink
storage: Only do 1 supra C1 in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed Jan 15, 2025
1 parent af64e1f commit e8473b3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/paths/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -1145,6 +1145,8 @@ func (st *Local) ReadSnapVanillaProof(ctx context.Context, sr storiface.SectorRe
return out, nil
}

var supraC1Token = make(chan struct{}, 1)

func (st *Local) supraPoRepVanillaProof(src storiface.SectorPaths, sr storiface.SectorRef, sealed, unsealed cid.Cid, ticket abi.SealRandomness, seed abi.InteractiveSealRandomness) ([]byte, error) {
batchMetaPath := filepath.Join(src.Cache, BatchMetaFile)
bmdata, err := os.ReadFile(batchMetaPath)
Expand Down Expand Up @@ -1200,7 +1202,10 @@ func (st *Local) supraPoRepVanillaProof(src storiface.SectorPaths, sr storiface.
}

// not found, compute it
supraC1Token <- struct{}{}
res := supraffi.C1(bm.BlockOffset, bm.BatchSectors, bm.NumInPipeline, replicaID[:], seed, ticket, src.Cache, parentsPath, src.Sealed, uint64(ssize))
<-supraC1Token

if res != 0 {
return nil, xerrors.Errorf("c1 failed: %d", res)
}
Expand Down

0 comments on commit e8473b3

Please sign in to comment.