From ae04d8aa9c0228cda7122f8294dad9dccc28ed59 Mon Sep 17 00:00:00 2001 From: LexLuthr Date: Fri, 5 Apr 2024 18:13:36 +0400 Subject: [PATCH] account for cc sectors --- storage/pipeline/commit_batch.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/storage/pipeline/commit_batch.go b/storage/pipeline/commit_batch.go index 24360d5cc7e..936ccced199 100644 --- a/storage/pipeline/commit_batch.go +++ b/storage/pipeline/commit_batch.go @@ -371,17 +371,19 @@ func (b *CommitBatcher) processBatchV2(cfg sealiface.Config, sectors []abi.Secto collateral = big.Add(collateral, sc) - pieces := b.todo[sector].ActivationManifest.Pieces + manifest := b.todo[sector].ActivationManifest precomitInfo, err := b.api.StateSectorPreCommitInfo(b.mctx, b.maddr, sector, ts.Key()) if err != nil { res.FailedSectors[sector] = err.Error() continue } - err = b.allocationCheck(pieces, precomitInfo, abi.ActorID(mid), ts) - if err != nil { - res.FailedSectors[sector] = err.Error() - continue + if len(manifest.Pieces) > 0 { + err = b.allocationCheck(manifest.Pieces, precomitInfo, abi.ActorID(mid), ts) + if err != nil { + res.FailedSectors[sector] = err.Error() + continue + } } params.SectorActivations = append(params.SectorActivations, b.todo[sector].ActivationManifest) @@ -925,6 +927,10 @@ func (b *CommitBatcher) aggregateProofType(nv network.Version) (abi.RegisteredAg func (b *CommitBatcher) allocationCheck(Pieces []miner.PieceActivationManifest, precomitInfo *miner.SectorPreCommitOnChainInfo, miner abi.ActorID, ts *types.TipSet) error { for _, p := range Pieces { p := p + // skip filler pieces + if p.VerifiedAllocationKey == nil { + continue + } addr, err := address.NewIDAddress(uint64(p.VerifiedAllocationKey.Client)) if err != nil { return err