Merge pull request #3369 from filecoin-project/asr/advance-block

Use beacon entries in advance-block
This commit is contained in:
Łukasz Magiera 2020-08-28 11:46:34 +02:00 committed by GitHub
commit 78ff5e270c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)