From 17915dce5a71b3cbca1bcec92e4887a62a70efe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Sat, 27 May 2023 13:03:21 +0200 Subject: [PATCH] sealing: Don't select sectors with no deals lined up for upgrading --- storage/pipeline/input.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/storage/pipeline/input.go b/storage/pipeline/input.go index 9de2bd141..7eb02ae27 100644 --- a/storage/pipeline/input.go +++ b/storage/pipeline/input.go @@ -738,11 +738,16 @@ func (m *Sealing) maybeUpgradeSector(ctx context.Context, sp abi.RegisteredSealP continue } + if pb.dealBytesInBound.Padded() == 0 { + log.Debugw("skipping available sector", "sector", s.Number, "reason", "no deals in expiration bounds", "expiration", expirationEpoch) + continue + } + // if the sector has less than one sector worth of candidate deals, and // the best candidate has more candidate deals, this sector isn't better lessThanSectorOfData := pb.dealBytesInBound.Padded() < abi.PaddedPieceSize(ssize) - moreDealsThanBest := bestDealBytes > pb.dealBytesInBound.Padded() + moreDealsThanBest := pb.dealBytesInBound.Padded() > bestDealBytes // we want lower pledge, but only if we have more than one sector worth of deals