diff --git a/extern/storage-fsm/states_sealing.go b/extern/storage-fsm/states_sealing.go index b0e5c498c..bea411715 100644 --- a/extern/storage-fsm/states_sealing.go +++ b/extern/storage-fsm/states_sealing.go @@ -159,6 +159,13 @@ func (m *Sealing) handlePreCommitting(ctx statemachine.Context, sector SectorInf return ctx.Send(SectorSealPreCommit1Failed{xerrors.Errorf("handlePreCommitting: failed to compute pre-commit expiry: %w", err)}) } + // Sectors must last _at least_ MinSectorExpiration + MaxSealDuration. + // TODO: The "+10" allows the pre-commit to take 10 blocks to be accepted. + if minExpiration := height + miner.MaxSealDuration[sector.SectorType] + miner.MinSectorExpiration + 10; expiration < minExpiration { + expiration = minExpiration + } + // TODO: enforce a reasonable _maximum_ sector lifetime? + params := &miner.SectorPreCommitInfo{ Expiration: expiration, SectorNumber: sector.SectorNumber,