Skip to content

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

varun-doshi
Copy link
Contributor

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 the TransactionFetcher. Will proceed as advised.

@varun-doshi varun-doshi changed the title feat: punish peers feat: punish malicious peers Jun 15, 2025
@@ -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);
Copy link
Contributor

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? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do

@varun-doshi varun-doshi requested a review from 0xMushow June 18, 2025 07:36
@emhane emhane added D-good-first-issue Nice and easy! A great choice to get started A-networking Related to networking in general labels Jun 18, 2025
@mattsse mattsse self-assigned this Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-networking Related to networking in general D-good-first-issue Nice and easy! A great choice to get started
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

4 participants