Set a minimum sector lifetime
This commit is contained in:
parent
e18904bff5
commit
41f1c74ae2
7
extern/storage-fsm/states_sealing.go
vendored
7
extern/storage-fsm/states_sealing.go
vendored
@ -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)})
|
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{
|
params := &miner.SectorPreCommitInfo{
|
||||||
Expiration: expiration,
|
Expiration: expiration,
|
||||||
SectorNumber: sector.SectorNumber,
|
SectorNumber: sector.SectorNumber,
|
||||||
|
Loading…
Reference in New Issue
Block a user