From ac98c8f45145ef8de7ec23625ddf84ef9b80b3c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Mon, 28 Oct 2019 18:14:24 +0100 Subject: [PATCH] Use spec complaiant SealRandomnessLookback --- build/params.go | 6 ++++++ node/modules/storageminer.go | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/build/params.go b/build/params.go index 480b90230..00808dbe4 100644 --- a/build/params.go +++ b/build/params.go @@ -48,6 +48,9 @@ const ForkLengthThreshold = 100 // Blocks (e) const BlocksPerEpoch = 1 +// Blocks +const Finality = 500 + // ///// // Proofs @@ -65,6 +68,9 @@ const PoStChallangeTime = ProvingPeriodDuration - 5 // Blocks const PoStRandomnessLookback = 1 +// Blocks +const SealRandomnessLookback = Finality + // ///// // Mining diff --git a/node/modules/storageminer.go b/node/modules/storageminer.go index ff51ca7b8..4f9df1c42 100644 --- a/node/modules/storageminer.go +++ b/node/modules/storageminer.go @@ -171,7 +171,7 @@ func SealTicketGen(api api.FullNode) sector.TicketFn { 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 { return nil, xerrors.Errorf("getting randomness for SealTicket failed: %w", err) } @@ -182,7 +182,7 @@ func SealTicketGen(api api.FullNode) sector.TicketFn { } return §orbuilder.SealTicket{ - BlockHeight: ts.Height() - build.RandomnessLookback, + BlockHeight: ts.Height() - build.SealRandomnessLookback, TicketBytes: tkt, }, nil }