-
Notifications
You must be signed in to change notification settings - Fork 20k
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/discover: add more packet information in logs #26307
Conversation
This adds more fields to discv5 packet logs. These can be useful when debugging multi-packet interactions. The FINDNODE message also gets an additional field, OpID for debugging purposes. This field is not encoded onto the wire. I'm also removing topic system related message types in this change. These will come back in the future, where support for them will be guarded by a config flag.
The new name captures the meaning of this field better.
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.
Good
Here's what this looks like in logs. The new thing are the fields
|
@@ -59,7 +61,7 @@ type ( | |||
Nonce Nonce | |||
} | |||
|
|||
// Whoareyou contains the handshake challenge. | |||
// WHOAREYOU contains the handshake challenge. |
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.
Why change these? They are "correct" as they were. You could change to
// Whoareyou contains the handshake challenge, representing the WHOAREYOU message
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.
I made these upper case because packet names are always uppercase (in the spec, and also in logs).
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.
LGTM, aside from what I think is a "wrong" way do write docstrings, but unless the linter complains, who am I to do so...
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.
LGTM
* p2p/discover: add more packet information in logs This adds more fields to discv5 packet logs. These can be useful when debugging multi-packet interactions. The FINDNODE message also gets an additional field, OpID for debugging purposes. This field is not encoded onto the wire. I'm also removing topic system related message types in this change. These will come back in the future, where support for them will be guarded by a config flag. * p2p/discover/v5wire: rename 'Total' to 'RespCount' The new name captures the meaning of this field better.
This adds more fields to discv5 packet logs. These can be useful when
debugging multi-packet interactions.
The FINDNODE message also an additional field, OpID, also for
debugging purposes. This field is not encoded onto the wire. The
OpID can be used to attribute requests to a specific lookup process.
I'm also removing topic system related message types in this change.
These will come back in the future, where support for them will be
guarded by a config flag.