From bed7158212eb6b7e6a64b14083e6103920bed134 Mon Sep 17 00:00:00 2001 From: Aayush Rajasekaran Date: Thu, 27 Aug 2020 21:38:51 -0400 Subject: [PATCH] Use beacon entries in advance-block --- cmd/lotus/debug_advance.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/lotus/debug_advance.go b/cmd/lotus/debug_advance.go index 972107370..0c168b3be 100644 --- a/cmd/lotus/debug_advance.go +++ b/cmd/lotus/debug_advance.go @@ -60,7 +60,9 @@ func init() { } } - // TODO: beacon + + mbi, err := api.MinerGetBaseInfo(ctx, addr, head.Height()+1, head.Key()) + ep := &types.ElectionProof{} ep.WinCount = ep.ComputeWinCount(types.NewInt(1), types.NewInt(1)) for ep.WinCount == 0 { @@ -75,7 +77,7 @@ func init() { uts := head.MinTimestamp() + uint64(build.BlockDelaySecs) nheight := head.Height() + 1 blk, err := api.MinerCreateBlock(ctx, &lapi.BlockTemplate{ - addr, head.Key(), ticket, ep, nil, msgs, nheight, uts, gen.ValidWpostForTesting, + addr, head.Key(), ticket, ep, mbi.BeaconEntries, msgs, nheight, uts, gen.ValidWpostForTesting, }) if err != nil { return xerrors.Errorf("creating block: %w", err)