Pass correct randomness to EPoSt Verification

This commit is contained in:
Łukasz Magiera 2019-11-26 18:29:18 +01:00
parent fc72da1d0c
commit 8297feb1d3

View File

@ -3,6 +3,7 @@ package chain
import ( import (
"bytes" "bytes"
"context" "context"
"crypto/sha256"
"errors" "errors"
"fmt" "fmt"
"sync" "sync"
@ -643,7 +644,8 @@ func (syncer *Syncer) VerifyElectionPoStProof(ctx context.Context, h *types.Bloc
} }
return xerrors.Errorf("[TESTING] election post was invalid") return xerrors.Errorf("[TESTING] election post was invalid")
} }
ok, err := sectorbuilder.VerifyPost(ctx, ssize, *sectorInfo, h.EPostProof.PostRand, h.EPostProof.Proof, winners, h.Miner) hvrf := sha256.Sum256(h.EPostProof.PostRand)
ok, err := sectorbuilder.VerifyPost(ctx, ssize, *sectorInfo, hvrf[:], h.EPostProof.Proof, winners, h.Miner)
if err != nil { if err != nil {
return xerrors.Errorf("failed to verify election post: %w", err) return xerrors.Errorf("failed to verify election post: %w", err)
} }