Skip to content

Commit

Permalink
Merge pull request #11550 from filecoin-project/fix/worker-multipart-…
Browse files Browse the repository at this point in the history
…post-err

fix: wdpost: fix vanilla proof indexes
  • Loading branch information
snadrus authored Jan 4, 2024
2 parents a959c04 + fafaf0d commit 1d75af7
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions storage/sealer/worker_local.go
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ func (l *LocalWorker) GenerateWindowPoStAdv(ctx context.Context, ppt abi.Registe
var wg sync.WaitGroup
wg.Add(len(sectors))

vproofs := make([][]byte, 0, len(sectors))
vproofs := make([][]byte, len(sectors))

for i, s := range sectors {
if l.challengeThrottle != nil {
Expand Down Expand Up @@ -702,8 +702,7 @@ func (l *LocalWorker) GenerateWindowPoStAdv(ctx context.Context, ppt abi.Registe
return
}

//vproofs[i] = vanilla // todo substitutes??
vproofs = append(vproofs, vanilla)
vproofs[i] = vanilla
}(i, s)
}
wg.Wait()
Expand All @@ -717,6 +716,22 @@ func (l *LocalWorker) GenerateWindowPoStAdv(ctx context.Context, ppt abi.Registe
return storiface.WindowPoStResult{Skipped: skipped}, nil
}

// compact skipped sectors
var skippedSoFar int
for i := range vproofs {
if len(vproofs[i]) == 0 {
skippedSoFar++
continue
}

if skippedSoFar > 0 {
vproofs[i-skippedSoFar] = vproofs[i]
}
}

vproofs = vproofs[:len(vproofs)-skippedSoFar]

// compute the PoSt!
res, err := sb.GenerateWindowPoStWithVanilla(ctx, ppt, mid, randomness, vproofs, partitionIdx)
r := storiface.WindowPoStResult{
PoStProofs: res,
Expand Down

0 comments on commit 1d75af7

Please sign in to comment.