From f880fb4ee404e9dd6a7d5de06c387c8e8ba865b7 Mon Sep 17 00:00:00 2001 From: Nishant Das Date: Wed, 22 Apr 2020 09:21:12 +0800 Subject: [PATCH] Shift To Trace Logs (#5561) * shift to trace * Merge branch 'master' into shiftTrace * Merge refs/heads/master into shiftTrace * Merge refs/heads/master into shiftTrace * Merge refs/heads/master into shiftTrace * Merge refs/heads/master into shiftTrace * Merge refs/heads/master into shiftTrace * Merge refs/heads/master into shiftTrace * fix test * Merge branch 'shiftTrace' of https://github.com/prysmaticlabs/geth-sharding into shiftTrace --- beacon-chain/p2p/handshake.go | 2 +- beacon-chain/p2p/service.go | 5 +++-- beacon-chain/p2p/subnets_test.go | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/beacon-chain/p2p/handshake.go b/beacon-chain/p2p/handshake.go index 94b02822ad4e..a34e42de584d 100644 --- a/beacon-chain/p2p/handshake.go +++ b/beacon-chain/p2p/handshake.go @@ -55,7 +55,7 @@ func (s *Service) AddConnectionHandler(reqFunc func(ctx context.Context, id peer ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() if err := reqFunc(ctx, conn.RemotePeer()); err != nil && err != io.EOF { - log.WithError(err).Debug("Handshake failed") + log.WithError(err).Trace("Handshake failed") if err.Error() == "protocol not supported" { // This is only to ensure the smooth running of our testnets. This will not be // used in production. diff --git a/beacon-chain/p2p/service.go b/beacon-chain/p2p/service.go index 698d006ff8be..3f8c8006b3f1 100644 --- a/beacon-chain/p2p/service.go +++ b/beacon-chain/p2p/service.go @@ -456,7 +456,8 @@ func (s *Service) FindPeersWithSubnet(index uint64) (bool, error) { } s.peers.Add(node.Record(), info.ID, multiAddr, network.DirUnknown) if err := s.connectWithPeer(*info); err != nil { - log.WithError(err).Debugf("Could not connect with peer %s", info.String()) + log.WithError(err).Tracef("Could not connect with peer %s", info.String()) + continue } exists = true } @@ -530,7 +531,7 @@ func (s *Service) connectWithAllPeers(multiAddrs []ma.Multiaddr) { // make each dial non-blocking go func(info peer.AddrInfo) { if err := s.connectWithPeer(info); err != nil { - log.WithError(err).Debugf("Could not connect with peer %s", info.String()) + log.WithError(err).Tracef("Could not connect with peer %s", info.String()) } }(info) } diff --git a/beacon-chain/p2p/subnets_test.go b/beacon-chain/p2p/subnets_test.go index ca3236de72d9..b924ef70e563 100644 --- a/beacon-chain/p2p/subnets_test.go +++ b/beacon-chain/p2p/subnets_test.go @@ -103,7 +103,7 @@ func TestStartDiscV5_DiscoverPeersWithSubnets(t *testing.T) { } // Wait for the nodes to have their local routing tables to be populated with the other nodes - time.Sleep(2 * discoveryWaitTime) + time.Sleep(4 * discoveryWaitTime) // look up 3 different subnets exists, err := s.FindPeersWithSubnet(1)