-
Notifications
You must be signed in to change notification settings - Fork 769
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
network/metrics: Expose number of banned peers from peerstore and enable litep2p metrics #4977
Conversation
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
|
||
/// Get the status of the peer store. | ||
fn status(&self) -> PeerStoreStatus; |
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.
Looking at the implementation of this function. Why don't we update the metrics directly in the peerstore? Then we don't need to lock any mutexes?
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
…rics Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
The CI pipeline was cancelled due to failure one of the required jobs. |
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
A malicious peer can submit random bytes on transaction protocol. In this case, the peer is not disconnected or reported back to the peerstore. This PR ensures the peer's reputation is properly reported. Discovered during testing: - #4977 cc @paritytech/networking Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: Dmitry Markin <dmitry@markin.tech>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
A malicious peer can submit random bytes on transaction protocol. In this case, the peer is not disconnected or reported back to the peerstore. This PR ensures the peer's reputation is properly reported. Discovered during testing: - paritytech#4977 cc @paritytech/networking Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
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.
Looks good to me!
I am going to repeat exactly what I said in #2944 (comment) + complain about the lack of: This PR should have not been marked as Silent. It is a breaking change in many ways :) |
A malicious peer can submit random bytes on transaction protocol. In this case, the peer is not disconnected or reported back to the peerstore. This PR ensures the peer's reputation is properly reported. Discovered during testing: - paritytech#4977 cc @paritytech/networking Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
…ble litep2p metrics (paritytech#4977) This PR extends the metrics exposed by the peerstore with the total number of banned peers. The new metric is exposed under `substrate_sub_libp2p_peerset_num_banned_peers`. To easily extend metrics in the future, the `fn num_known_peers` is removed in favor of `fn status`. While at it, enable the metrics for litep2p: - total number of peers from peerstore (needed to debug memory consumption) - total number of banned peers from peerstore (needed to debug reputation bans and disconnects) Have added a couple of tests to validate that the number of banned peers is exposed properly. Part of: paritytech#4681 ### Testing Done Using [subp2p-explorer](https://github.com/lexnv/subp2p-explorer) have submitted random data on tx protocol. The peer gets banned, the num of banned peers is incremented then the peer is disconnected. cc @paritytech/networking --------- Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> Co-authored-by: Dmitry Markin <dmitry@markin.tech>
A malicious peer can submit random bytes on transaction protocol. In this case, the peer is not disconnected or reported back to the peerstore. This PR ensures the peer's reputation is properly reported. Discovered during testing: - paritytech#4977 cc @paritytech/networking Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This PR extends the metrics exposed by the peerstore with the total number of banned peers.
The new metric is exposed under
substrate_sub_libp2p_peerset_num_banned_peers
.To easily extend metrics in the future, the
fn num_known_peers
is removed in favor offn status
.While at it, enable the metrics for litep2p:
Have added a couple of tests to validate that the number of banned peers is exposed properly.
Part of: #4681
Testing Done
Using subp2p-explorer have submitted random data on tx protocol.
The peer gets banned, the num of banned peers is incremented then the peer is disconnected.
cc @paritytech/networking