-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat: punish malicious peers #16818
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
feat: punish malicious peers #16818
Conversation
34f17f1
to
47779d7
Compare
@@ -965,6 +969,10 @@ impl<N: NetworkPrimitives> TransactionFetcher<N> { | |||
|
|||
let transactions = valid_payload.into_data().into_values().collect(); | |||
|
|||
if has_bad_transactions { | |||
self.remove_peer(&peer_id); |
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.
As you mentioned in your PR, I don't think we immediately want to disconnect, rather just report_peer
to decrease his score. It would be ideal to keep the same actions and consistency across the codebase. Could you implement what's needed? :)
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.
Will do
thanks @mattsse :) ! |
Ref #16807
Currently removes peer for malicious activity, but maybe thats not ideal and we just want to report peer. But for that, we would need to introduce
NetworkHandle
in theTransactionFetcher
. Will proceed as advised.