Skip to content

Commit bf7fb53

Browse files
committed
Set a minimum sector lifetime
1 parent 8fd4424 commit bf7fb53

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

extern/storage-fsm/states_sealing.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,13 @@ func (m *Sealing) handlePreCommitting(ctx statemachine.Context, sector SectorInf
159159
return ctx.Send(SectorSealPreCommit1Failed{xerrors.Errorf("handlePreCommitting: failed to compute pre-commit expiry: %w", err)})
160160
}
161161

162+
// Sectors must last _at least_ MinSectorExpiration + MaxSealDuration.
163+
// TODO: The "+10" allows the pre-commit to take 10 blocks to be accepted.
164+
if minExpiration := height + miner.MaxSealDuration[sector.SectorType] + miner.MinSectorExpiration + 10; expiration < minExpiration {
165+
expiration = minExpiration
166+
}
167+
// TODO: enforce a reasonable _maximum_ sector lifetime?
168+
162169
params := &miner.SectorPreCommitInfo{
163170
Expiration: expiration,
164171
SectorNumber: sector.SectorNumber,

0 commit comments

Comments
 (0)