Use the deadline open as the wpost commit epoch

This commit is contained in:
Steven Allen 2020-08-12 10:29:35 -07:00
parent 41f1c74ae2
commit 6f031993ba

View File

@ -310,17 +310,13 @@ func (s *WindowPoStScheduler) runPost(ctx context.Context, di miner.DeadlineInfo
if err := s.actor.MarshalCBOR(buf); err != nil {
return nil, xerrors.Errorf("failed to marshal address to cbor: %w", err)
}
// TODO: This needs to use the beacon now.
rand, err := s.api.ChainGetRandomnessFromBeacon(ctx, ts.Key(), crypto.DomainSeparationTag_WindowedPoStChallengeSeed, di.Challenge, buf.Bytes())
if err != nil {
return nil, xerrors.Errorf("failed to get chain randomness for windowPost (ts=%d; deadline=%d): %w", ts.Height(), di, err)
}
// TODO: we should probably compute this when _submitting_ the ticket to
// get a fresher value. If it's more than ChallengeWindow epochs out of
// date by the time we submit, it'll be rejected.
// TODO: we need a better lookback value, but I'm not sure what it should be.
commEpoch := ts.Height() - StartConfidence
commEpoch := di.Open
commRand, err := s.api.ChainGetRandomnessFromTickets(ctx, ts.Key(), crypto.DomainSeparationTag_PoStChainCommit, commEpoch, nil)
if err != nil {
return nil, xerrors.Errorf("failed to get chain randomness for windowPost (ts=%d; deadline=%d): %w", ts.Height(), di, err)