From cd817906b200583a12da09fc5a3709db82433ef6 Mon Sep 17 00:00:00 2001 From: Jeromy Date: Wed, 3 Jun 2020 18:30:43 -0700 Subject: [PATCH] handle sourcing randomness from a future block --- chain/store/store.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chain/store/store.go b/chain/store/store.go index c9dac2e31..72c77ee36 100644 --- a/chain/store/store.go +++ b/chain/store/store.go @@ -914,6 +914,10 @@ func (cs *ChainStore) GetRandomness(ctx context.Context, blks []cid.Cid, pers cr return nil, err } + if round > ts.Height() { + return DrawRandomness(ts.MinTicket().VRFProof, pers, round, entropy) + } + searchHeight := round if searchHeight < 0 { searchHeight = 0