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

Peers should be banned when a request fails or when they misbehave #1442

Closed
tomaka opened this issue Dec 1, 2023 · 2 comments
Closed

Peers should be banned when a request fails or when they misbehave #1442

tomaka opened this issue Dec 1, 2023 · 2 comments

Comments

@tomaka
Copy link
Contributor

tomaka commented Dec 1, 2023

When a networking request fails, or when it succeeds but the result is invalid, the peer needs to be disconnected from and banned.

I thought I had an issue open about this, but I can't find it.

For some aspects this is easy, but for some, such as an invalid justification, this is harder due to the asynchronousness of communications between services.

@tomaka
Copy link
Contributor Author

tomaka commented Dec 1, 2023

I don't think that the network services should automatically ban peers due to failed requests. The network services always send requests only because the sync/consensus service called a function specifically to send a request. Banning a peer as a result feels like a hidden side effect.

Instead, the networking service should expose the concept of banning on its public API, letting the sync/consensus service ban peers.

When the sync/consensus service detect that a peer has misbehaved, it should be immediately removed from the list of sources, and the networking service then bans it. In the meanwhile, any message concerning this peer is ignored.

@tomaka tomaka changed the title Peers not to be banned when a request fails or when they misbehave Peers should be banned when a request fails or when they misbehave Dec 7, 2023
@tomaka
Copy link
Contributor Author

tomaka commented Dec 19, 2023

When the sync/consensus service detect that a peer has misbehaved, it should be immediately removed from the list of sources, and the networking service then bans it. In the meanwhile, any message concerning this peer is ignored.

I don't think we actually need to do that. It would add a lot of complexity, and isn't strictly necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant