Use spec complaiant SealRandomnessLookback

This commit is contained in:
Łukasz Magiera 2019-10-28 18:14:24 +01:00
parent 237f8e8018
commit ac98c8f451
2 changed files with 8 additions and 2 deletions

View File

@ -48,6 +48,9 @@ const ForkLengthThreshold = 100
// Blocks (e) // Blocks (e)
const BlocksPerEpoch = 1 const BlocksPerEpoch = 1
// Blocks
const Finality = 500
// ///// // /////
// Proofs // Proofs
@ -65,6 +68,9 @@ const PoStChallangeTime = ProvingPeriodDuration - 5
// Blocks // Blocks
const PoStRandomnessLookback = 1 const PoStRandomnessLookback = 1
// Blocks
const SealRandomnessLookback = Finality
// ///// // /////
// Mining // Mining

View File

@ -171,7 +171,7 @@ func SealTicketGen(api api.FullNode) sector.TicketFn {
return nil, xerrors.Errorf("getting head ts for SealTicket failed: %w", err) return nil, xerrors.Errorf("getting head ts for SealTicket failed: %w", err)
} }
r, err := api.ChainGetRandomness(ctx, ts, nil, build.RandomnessLookback) r, err := api.ChainGetRandomness(ctx, ts, nil, build.SealRandomnessLookback)
if err != nil { if err != nil {
return nil, xerrors.Errorf("getting randomness for SealTicket failed: %w", err) return nil, xerrors.Errorf("getting randomness for SealTicket failed: %w", err)
} }
@ -182,7 +182,7 @@ func SealTicketGen(api api.FullNode) sector.TicketFn {
} }
return &sectorbuilder.SealTicket{ return &sectorbuilder.SealTicket{
BlockHeight: ts.Height() - build.RandomnessLookback, BlockHeight: ts.Height() - build.SealRandomnessLookback,
TicketBytes: tkt, TicketBytes: tkt,
}, nil }, nil
} }