From 1d3877fab3e9d7cc28dd8d154e70627cefa2f964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 4 Mar 2020 06:32:33 +0100 Subject: [PATCH] sync: Use correct epost randomness --- chain/sync.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chain/sync.go b/chain/sync.go index 91f74accc..c52f6f4a3 100644 --- a/chain/sync.go +++ b/chain/sync.go @@ -2,6 +2,7 @@ package chain import ( "context" + "crypto/sha256" "errors" "fmt" "sync" @@ -722,8 +723,9 @@ func (syncer *Syncer) VerifyElectionPoStProof(ctx context.Context, h *types.Bloc // TODO: why do we need this here? challengeCount := sectorbuilder.ElectionPostChallengeCount(uint64(len(sectorInfo)), 0) + hvrf := sha256.Sum256(h.EPostProof.PostRand) pvi := abi.PoStVerifyInfo{ - Randomness: h.EPostProof.PostRand, + Randomness: hvrf[:], Candidates: candidates, Proofs: h.EPostProof.Proofs, EligibleSectors: sectorInfo, @@ -737,6 +739,7 @@ func (syncer *Syncer) VerifyElectionPoStProof(ctx context.Context, h *types.Bloc } if !ok { + log.Errorf("invalid election post (%x; %v)", pvi.Randomness, candidates) return xerrors.Errorf("election post was invalid") }