Remove ChainCommitEpoch from wdpost params, split MaxSealDuration into MaxProveCommitDuration and MaxPreCommitRandomnessLookback
This commit is contained in:
parent
9fcbaa72cc
commit
179dd0d89f
2
extern/storage-sealing/checks.go
vendored
2
extern/storage-sealing/checks.go
vendored
@ -91,7 +91,7 @@ func checkPrecommit(ctx context.Context, maddr address.Address, si SectorInfo, t
|
||||
return &ErrBadCommD{xerrors.Errorf("on chain CommD differs from sector: %s != %s", commD, si.CommD)}
|
||||
}
|
||||
|
||||
if height-(si.TicketEpoch+SealRandomnessLookback) > SealRandomnessLookbackLimit(si.SectorType) {
|
||||
if height-(si.TicketEpoch+SealRandomnessLookback) > SealRandomnessLookbackLimit() {
|
||||
return &ErrExpiredTicket{xerrors.Errorf("ticket expired: seal height: %d, head: %d", si.TicketEpoch+SealRandomnessLookback, height)}
|
||||
}
|
||||
|
||||
|
4
extern/storage-sealing/constants.go
vendored
4
extern/storage-sealing/constants.go
vendored
@ -9,8 +9,8 @@ import (
|
||||
const SealRandomnessLookback = miner.ChainFinality
|
||||
|
||||
// Epochs
|
||||
func SealRandomnessLookbackLimit(spt abi.RegisteredSealProof) abi.ChainEpoch {
|
||||
return miner.MaxSealDuration[spt]
|
||||
func SealRandomnessLookbackLimit() abi.ChainEpoch {
|
||||
return miner.MaxPreCommitRandomnessLookback
|
||||
}
|
||||
|
||||
// Epochs
|
||||
|
4
extern/storage-sealing/states_sealing.go
vendored
4
extern/storage-sealing/states_sealing.go
vendored
@ -178,9 +178,9 @@ 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.
|
||||
// Sectors must last _at least_ MinSectorExpiration + MaxProveCommitDuration.
|
||||
// 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 {
|
||||
if minExpiration := height + miner.MaxProveCommitDuration[sector.SectorType] + miner.MinSectorExpiration + 10; expiration < minExpiration {
|
||||
expiration = minExpiration
|
||||
}
|
||||
// TODO: enforce a reasonable _maximum_ sector lifetime?
|
||||
|
@ -421,12 +421,10 @@ func (s *WindowPoStScheduler) runPost(ctx context.Context, di miner.DeadlineInfo
|
||||
|
||||
elapsed := time.Since(tsStart)
|
||||
|
||||
commEpoch := di.Open
|
||||
commRand, err := s.api.ChainGetRandomnessFromTickets(ctx, ts.Key(), crypto.DomainSeparationTag_PoStChainCommit, commEpoch, nil)
|
||||
commRand, err := s.api.ChainGetRandomnessFromTickets(ctx, ts.Key(), crypto.DomainSeparationTag_PoStChainCommit, di.Challenge, nil)
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("failed to get chain randomness for windowPost (ts=%d; deadline=%d): %w", ts.Height(), di, err)
|
||||
}
|
||||
params.ChainCommitEpoch = commEpoch
|
||||
params.ChainCommitRand = commRand
|
||||
|
||||
log.Infow("submitting window PoSt", "elapsed", elapsed)
|
||||
|
Loading…
Reference in New Issue
Block a user