From 7a6eb723ad17e50677ee5f9dcf8f95a9d29d94c5 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Thu, 26 Mar 2020 01:33:35 +0100 Subject: [PATCH] Use correct epoch for vrf Signed-off-by: Jakub Sztandera --- chain/sync.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chain/sync.go b/chain/sync.go index 146c139f8..cafa76723 100644 --- a/chain/sync.go +++ b/chain/sync.go @@ -624,7 +624,7 @@ func (syncer *Syncer) ValidateBlock(ctx context.Context, b *types.FullBlock) err if err := h.Miner.MarshalCBOR(buf); err != nil { return xerrors.Errorf("failed to marshal miner address to cbor: %w", err) } - vrfBase, err := syncer.sm.ChainStore().GetRandomness(ctx, baseTs.Cids(), crypto.DomainSeparationTag_TicketProduction, int64(baseTs.Height()), buf.Bytes()) + vrfBase, err := syncer.sm.ChainStore().GetRandomness(ctx, baseTs.Cids(), crypto.DomainSeparationTag_TicketProduction, int64(h.Height)-1, buf.Bytes()) if err != nil { return xerrors.Errorf("failed to get randomness for verifying election proof: %w", err) }