Merge pull request #776 from filecoin-project/feat/late-block-log
flag blocks that are received too late
This commit is contained in:
commit
99aa4e9d36
@ -2,6 +2,7 @@ package sub
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"time"
|
||||||
|
|
||||||
logging "github.com/ipfs/go-log"
|
logging "github.com/ipfs/go-log"
|
||||||
pubsub "github.com/libp2p/go-libp2p-pubsub"
|
pubsub "github.com/libp2p/go-libp2p-pubsub"
|
||||||
@ -46,6 +47,9 @@ func HandleIncomingBlocks(ctx context.Context, bsub *pubsub.Subscription, s *cha
|
|||||||
}
|
}
|
||||||
|
|
||||||
log.Debugw("new block over pubsub", "cid", blk.Header.Cid(), "source", msg.GetFrom())
|
log.Debugw("new block over pubsub", "cid", blk.Header.Cid(), "source", msg.GetFrom())
|
||||||
|
if delay := time.Now().Unix() - int64(blk.Header.Timestamp); delay > 5 {
|
||||||
|
log.Warnf("Received block with large delay %d from miner %s", delay, blk.Header.Miner)
|
||||||
|
}
|
||||||
s.InformNewBlock(msg.GetFrom(), &types.FullBlock{
|
s.InformNewBlock(msg.GetFrom(), &types.FullBlock{
|
||||||
Header: blk.Header,
|
Header: blk.Header,
|
||||||
BlsMessages: bmsgs,
|
BlsMessages: bmsgs,
|
||||||
|
2
extern/filecoin-ffi
vendored
2
extern/filecoin-ffi
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 6ac840062c094b35c87a87638cd7a262f43edd49
|
Subproject commit 6d9e80001bfa2d80eec4e157da46d783038d9b42
|
Loading…
Reference in New Issue
Block a user