diff --git a/extern/storage-sealing/input.go b/extern/storage-sealing/input.go index a7428ad07..199892ca8 100644 --- a/extern/storage-sealing/input.go +++ b/extern/storage-sealing/input.go @@ -121,26 +121,22 @@ func (m *Sealing) maybeStartSealing(ctx statemachine.Context, sector SectorInfo, sealTime := time.Unix(sector.CreationTime, 0).Add(cfg.WaitDealsDelay) // check deal age, start sealing when the deal closest to starting is within slack time - safeSealTime := sealTime _, current, err := m.Api.ChainHead(ctx.Context()) blockTime := time.Second * time.Duration(build.BlockDelaySecs) if err != nil { return false, xerrors.Errorf("API error getting head: %w", err) } for _, piece := range sector.Pieces { - if piece.DealInfo == nil { // skip padding + if piece.DealInfo == nil { continue } dealSafeSealEpoch := piece.DealInfo.DealProposal.StartEpoch - cfg.StartEpochSealingBuffer dealSafeSealTime := time.Now().Add(time.Duration(dealSafeSealEpoch-current) * blockTime) - if dealSafeSealTime.Before(safeSealTime) { - safeSealTime = dealSafeSealTime + if dealSafeSealTime.Before(sealTime) { + sealTime = dealSafeSealTime } } - if safeSealTime.Before(sealTime) { - sealTime = safeSealTime - } if now.After(sealTime) { log.Infow("starting to seal deal sector", "sector", sector.SectorNumber, "trigger", "wait-timeout") return true, ctx.Send(SectorStartPacking{}) diff --git a/node/config/types.go b/node/config/types.go index db38ccd23..a03e3d3ea 100644 --- a/node/config/types.go +++ b/node/config/types.go @@ -120,7 +120,9 @@ type DealmakingConfig struct { // This includes the time the deal will need to get transferred and published // before being assigned to a sector ExpectedSealDuration Duration - // Whether new sectors are sealed to pack incoming deals + // Whether new sectors are created to pack incoming deals + // When this is set to false no new sectors will be created for sealing incoming deals + // This is useful for forcing all deals to be assigned as snap deals to sectors marked for upgrade MakeNewSectorForDeals bool // Maximum amount of time proposed deal StartEpoch can be in future MaxDealStartDelay Duration