From d8d7827579abfa5225e54c4b9803281036e6f6f4 Mon Sep 17 00:00:00 2001 From: whyrusleeping Date: Sat, 7 Dec 2019 23:16:39 +0100 Subject: [PATCH 1/2] other peer having different genesis is now a warning --- node/hello/hello.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/hello/hello.go b/node/hello/hello.go index cec56a48f..70e27422e 100644 --- a/node/hello/hello.go +++ b/node/hello/hello.go @@ -78,7 +78,7 @@ func (hs *Service) HandleStream(s inet.Stream) { "hash", hmsg.GenesisHash) if hmsg.GenesisHash != hs.syncer.Genesis.Cids()[0] { - log.Error("other peer has different genesis!") + log.Warnf("other peer has different genesis! (%s)", hmsg.GenesisHash) s.Conn().Close() return } From d3f08c524352e3b755f12702effcb988a6277aee Mon Sep 17 00:00:00 2001 From: whyrusleeping Date: Sat, 7 Dec 2019 23:32:34 +0100 Subject: [PATCH 2/2] remove more spammy logs --- chain/blocksync/blocksync.go | 2 +- chain/sub/incoming.go | 2 +- node/hello/hello.go | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/chain/blocksync/blocksync.go b/chain/blocksync/blocksync.go index a16bc78b0..2439a13fa 100644 --- a/chain/blocksync/blocksync.go +++ b/chain/blocksync/blocksync.go @@ -97,7 +97,7 @@ func (bss *BlockSyncService) HandleStream(s inet.Stream) { resp, err := bss.processRequest(ctx, &req) if err != nil { - log.Error("failed to process block sync request: ", err) + log.Warn("failed to process block sync request: ", err) return } diff --git a/chain/sub/incoming.go b/chain/sub/incoming.go index 2a9bb78b2..c14aed2d9 100644 --- a/chain/sub/incoming.go +++ b/chain/sub/incoming.go @@ -78,7 +78,7 @@ func HandleIncomingMessages(ctx context.Context, mpool *messagepool.MessagePool, } if err := mpool.Add(m); err != nil { - log.Warnf("failed to add message from network to message pool (From: %s, To: %s, Nonce: %d, Value: %s): %+v", m.Message.From, m.Message.To, m.Message.Nonce, types.FIL(m.Message.Value), err) + log.Warnf("failed to add message from network to message pool (From: %s, To: %s, Nonce: %d, Value: %s): %s", m.Message.From, m.Message.To, m.Message.Nonce, types.FIL(m.Message.Value), err) continue } } diff --git a/node/hello/hello.go b/node/hello/hello.go index 70e27422e..171579899 100644 --- a/node/hello/hello.go +++ b/node/hello/hello.go @@ -2,7 +2,6 @@ package hello import ( "context" - "fmt" "go.uber.org/fx" @@ -119,8 +118,7 @@ func (hs *Service) SayHello(ctx context.Context, pid peer.ID) error { HeaviestTipSetWeight: weight, GenesisHash: gen.Cid(), } - fmt.Println("SENDING HELLO MESSAGE: ", hts.Cids(), hts.Height()) - fmt.Println("hello message genesis: ", gen.Cid()) + log.Info("Sending hello message: ", hts.Cids(), hts.Height(), gen.Cid()) if err := cborutil.WriteCborRPC(s, hmsg); err != nil { return err