Skip to content
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

peerstore: Clarify peer report warnings #5407

Merged
merged 9 commits into from
Aug 21, 2024
Merged

Conversation

lexnv
Copy link
Contributor

@lexnv lexnv commented Aug 19, 2024

This PR aims to make the logging from the peer store a bit more clear.

In the past, we aggressively produced warning logs from the peer store component, even in cases where the reputation change was not malicious. This has led to an extensive number of logs, as well to node operator confusion.

In this PR, we produce a warning message if:

  • The peer crosses the banned threshold for the first time. This is the actual reason of a ban
  • The peer misbehaves again while being banned. This may happen during a batch peer report

cc @paritytech/networking

Part of: #5379.

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
@lexnv lexnv added T0-node This PR/Issue is related to the topic “node”. I5-enhancement An additional feature request. D0-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder. labels Aug 19, 2024
@lexnv lexnv self-assigned this Aug 19, 2024
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
substrate/client/network/src/litep2p/peerstore.rs Outdated Show resolved Hide resolved
substrate/client/network/src/peer_store.rs Outdated Show resolved Hide resolved
@dmitry-markin dmitry-markin requested a review from a team August 19, 2024 10:27
lexnv and others added 2 commits August 19, 2024 14:00
Co-authored-by: Dmitry Markin <dmitry@markin.tech>
Co-authored-by: Dmitry Markin <dmitry@markin.tech>
lock.protocols.iter().for_each(|handle| handle.disconnect_peer(peer_id.into()));

// The peer is banned for the first time.
if !was_banned {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed something interesting, because of the asynchronous way of processing messages, you can also go from banned to unbanned really quickly if get rewarded for sending good messages, so can we also log when we go from banned to unbanned ?

@lexnv lexnv added this pull request to the merge queue Aug 21, 2024
Merged via the queue into master with commit 8b17f0f Aug 21, 2024
187 of 189 checks passed
@lexnv lexnv deleted the lexnv/report-peers-error branch August 21, 2024 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D0-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder. I5-enhancement An additional feature request. T0-node This PR/Issue is related to the topic “node”.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants