-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
p2p: refactor connectedness logger #1001
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1001 +/- ##
==========================================
+ Coverage 53.80% 54.16% +0.35%
==========================================
Files 117 118 +1
Lines 13141 13215 +74
==========================================
+ Hits 7071 7158 +87
+ Misses 5044 5030 -14
- Partials 1026 1027 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@@ -291,7 +291,7 @@ func NewDiscoveryRouter(tcpNode host.Host, udpNode *MutableUDPNode, peers []Peer | |||
// it returns false if the peer isn't discovered. | |||
func getDiscoveredAddress(udpNode *MutableUDPNode, p Peer) (ma.Multiaddr, bool, error) { | |||
resolved := udpNode.Resolve(&p.Enode) | |||
if resolved.Seq() == 0 || resolved.TCP() == 0 { | |||
if resolved.Seq() == p.Enode.Seq() || resolved.TCP() == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not consider lock file ENRs as "discovered".
@@ -88,7 +88,11 @@ func (s *Sender) addResult(ctx context.Context, peerID peer.ID, err error) { | |||
} | |||
} else if failure && (len(state.buffer) == 1 || !state.failing) { | |||
// First attempt failed or state changed to failing | |||
log.Warn(ctx, "P2P sending failing", err, z.Str("peer", PeerName(peerID))) | |||
|
|||
if _, ok := dialErrMsgs(err); !ok { // Only log non-dial errors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dial errors exclusively logged by ping service
p2p/errors.go
Outdated
"github.com/obolnetwork/charon/app/errors" | ||
) | ||
|
||
// hasErrDialBackoff returns true if the error is contains swarm.ErrDialBackoff. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// hasErrDialBackoff returns true if the error is contains swarm.ErrDialBackoff. | |
// hasErrDialBackoff returns true if the error is or contains swarm.ErrDialBackoff. |
9d3f9bc
to
82e2b90
Compare
Refactors the p2p connectedness logging:
category: refactor
ticket: #986