-
Notifications
You must be signed in to change notification settings - Fork 72
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
Log reason of peer banning #2667
Conversation
e63fd0d
to
fb96e4d
Compare
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'd have changed the CloseReason::MaliciousPeer
variant to be CloseReason::MaliciousPeer(String)
such that we enforce always the reason and then we log it in the network
I thought about this but this will cause the log messages to double:
Basically to remove the existing tracing logs but don't lose context, you would need to format the extra values into the |
fb96e4d
to
a90a2d2
Compare
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.
@Eligioo remarked that the peer banning in the testnet should already have a log for the ban unless it came from validator/src/proposal_buffer.rs.
a90a2d2
to
37e0a9d
Compare
Rebased for merge. |
What's in this pull request?
All paths to a
CloseReason::MaliciousPeer
as reason for closing the connection now contain a WARN log message to annotate the reason for banning a peer.I chose for WARN as log level for now but can easily changed if one believes there is a reason for it.
This fixes #2661 .
Pull request checklist
clippy
andrustfmt
warnings.