post: More review addressing

This commit is contained in:
Łukasz Magiera 2019-09-19 22:34:18 +02:00
parent 5fd98b7d27
commit 73d1182121
2 changed files with 6 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import (
"crypto/sha256"
"encoding/json"
"fmt"
"github.com/filecoin-project/go-lotus/build"
"sync"
amt "github.com/filecoin-project/go-amt-ipld"
@ -755,6 +756,10 @@ func (cs *ChainStore) GetTipsetByHeight(ctx context.Context, h uint64, ts *types
return nil, xerrors.Errorf("looking for tipset with height less than start point")
}
if ts.Height()-h > build.ForkLengthThreshold {
log.Warnf("expensive call to GetTipsetByHeight, seeking %d levels", ts.Height()-h)
}
for {
mtb := ts.MinTicketBlock()
if h >= ts.Height()-uint64(len(mtb.Tickets)) {

View File

@ -250,7 +250,7 @@ func (m *Miner) maybeDoPost(ctx context.Context, ts *types.TipSet) (<-chan error
return nil, nil, xerrors.Errorf("failed to get proving period end for miner: %w", err)
}
if ppe < ts.Height() {
if ts.Height() > ppe {
log.Warnf("skipping post, supplied tipset too high: ppe=%d, ts.H=%d", ppe, ts.Height())
return nil, nil, nil
}