Use correct SealRandomnessLookbackLimit
This commit is contained in:
parent
1467fe4226
commit
7fc7221348
@ -80,7 +80,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 int64(height)-int64(si.TicketEpoch+SealRandomnessLookback) > SealRandomnessLookbackLimit {
|
||||
if height-si.TicketEpoch+SealRandomnessLookback > SealRandomnessLookbackLimit(si.SectorType) {
|
||||
return &ErrExpiredTicket{xerrors.Errorf("ticket expired: seal height: %d, head: %d", si.TicketEpoch+SealRandomnessLookback, height)}
|
||||
}
|
||||
|
||||
|
12
constants.go
12
constants.go
@ -1,13 +1,17 @@
|
||||
package sealing
|
||||
|
||||
// Epochs
|
||||
const Finality = 500
|
||||
import (
|
||||
"github.com/filecoin-project/specs-actors/actors/abi"
|
||||
"github.com/filecoin-project/specs-actors/actors/builtin/miner"
|
||||
)
|
||||
|
||||
// Epochs
|
||||
const SealRandomnessLookback = Finality
|
||||
const SealRandomnessLookback = miner.ChainFinalityish
|
||||
|
||||
// Epochs
|
||||
const SealRandomnessLookbackLimit = SealRandomnessLookback + 2000
|
||||
func SealRandomnessLookbackLimit(spt abi.RegisteredProof) abi.ChainEpoch {
|
||||
return miner.MaxSealDuration[spt]
|
||||
}
|
||||
|
||||
// Epochs
|
||||
const InteractivePoRepConfidence = 6
|
||||
|
@ -53,7 +53,7 @@ func (m *Sealing) getTicket(ctx statemachine.Context, sector SectorInfo) (abi.Se
|
||||
return nil, 0, nil
|
||||
}
|
||||
|
||||
ticketEpoch := epoch - miner.ChainFinalityish
|
||||
ticketEpoch := epoch - SealRandomnessLookback
|
||||
buf := new(bytes.Buffer)
|
||||
if err := m.maddr.MarshalCBOR(buf); err != nil {
|
||||
return nil, 0, err
|
||||
|
Loading…
Reference in New Issue
Block a user