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)}
|
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)}
|
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
|
package sealing
|
||||||
|
|
||||||
// Epochs
|
import (
|
||||||
const Finality = 500
|
"github.com/filecoin-project/specs-actors/actors/abi"
|
||||||
|
"github.com/filecoin-project/specs-actors/actors/builtin/miner"
|
||||||
|
)
|
||||||
|
|
||||||
// Epochs
|
// Epochs
|
||||||
const SealRandomnessLookback = Finality
|
const SealRandomnessLookback = miner.ChainFinalityish
|
||||||
|
|
||||||
// Epochs
|
// Epochs
|
||||||
const SealRandomnessLookbackLimit = SealRandomnessLookback + 2000
|
func SealRandomnessLookbackLimit(spt abi.RegisteredProof) abi.ChainEpoch {
|
||||||
|
return miner.MaxSealDuration[spt]
|
||||||
|
}
|
||||||
|
|
||||||
// Epochs
|
// Epochs
|
||||||
const InteractivePoRepConfidence = 6
|
const InteractivePoRepConfidence = 6
|
||||||
|
@ -53,7 +53,7 @@ func (m *Sealing) getTicket(ctx statemachine.Context, sector SectorInfo) (abi.Se
|
|||||||
return nil, 0, nil
|
return nil, 0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
ticketEpoch := epoch - miner.ChainFinalityish
|
ticketEpoch := epoch - SealRandomnessLookback
|
||||||
buf := new(bytes.Buffer)
|
buf := new(bytes.Buffer)
|
||||||
if err := m.maddr.MarshalCBOR(buf); err != nil {
|
if err := m.maddr.MarshalCBOR(buf); err != nil {
|
||||||
return nil, 0, err
|
return nil, 0, err
|
||||||
|
Loading…
Reference in New Issue
Block a user