From 6c48ab3be4faf37dcf622ff20a16f3e815b1db7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 19 Sep 2019 20:38:58 +0200 Subject: [PATCH] Compute post more than once --- chain/actors/actor_miner.go | 1 + storage/miner.go | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/chain/actors/actor_miner.go b/chain/actors/actor_miner.go index c433404fd..80cd9a9f2 100644 --- a/chain/actors/actor_miner.go +++ b/chain/actors/actor_miner.go @@ -445,6 +445,7 @@ func (sma StorageMinerActor) SubmitPoSt(act *types.Actor, vmctx types.VMContext, } self.ProvingSet = self.Sectors + self.ProvingPeriodEnd = nextProvingPeriodEnd self.NextDoneSet = params.DoneSet c, err := vmctx.Storage().Put(self) diff --git a/storage/miner.go b/storage/miner.go index 1eb56bf2c..7642b426a 100644 --- a/storage/miner.go +++ b/storage/miner.go @@ -303,15 +303,20 @@ func (m *Miner) maybeDoPost(ctx context.Context, ts *types.TipSet) (<-chan error GasPrice: types.NewInt(1), } - _, err = m.api.MpoolPushMessage(ctx, msg) + smsg, err := m.api.MpoolPushMessage(ctx, msg) if err != nil { ret <- xerrors.Errorf("pushing message to mpool: %w", err) return } // make sure it succeeds... - // m.api.ChainWaitMsg() + _, err = m.api.ChainWaitMsg(ctx, smsg.Cid()) + if err != nil { + return + } + // TODO: check receipt + m.schedulePoSt(ctx, nil) }() return ret, sourceTs.MinTicketBlock(), nil