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

Report Peers that give incorrect (not deserializable) data #1350

Closed
MitchTurner opened this issue Sep 6, 2023 · 2 comments · Fixed by #1574
Closed

Report Peers that give incorrect (not deserializable) data #1350

MitchTurner opened this issue Sep 6, 2023 · 2 comments · Fixed by #1574
Assignees

Comments

@MitchTurner
Copy link
Member

This will require some error handling and possibly moving away from anyhow in our binary.

@xgreenx
Copy link
Collaborator

xgreenx commented Sep 18, 2023

I guess any error that we receive from the request/response protocol should decrease the reputation of the peer regardless of the reason.

@xgreenx
Copy link
Collaborator

xgreenx commented Sep 26, 2023

The current implementation ignores the error from the convert_to_response method.

image

We need to handle it and, in the same way, send an error or None into the channel.

xgreenx added a commit that referenced this issue Jan 6, 2024
For some reason we had a two layers of serialization for
request/response messages. This doesn't seem useful at all, and
complicates e.g. error handling. This PR removes the extra layer,
substantially simplifying that logic. One major upside of this is that
#1345 and #1350 can now be solved in a single follow-up PR.

~~Hopefully this doesn't conflict too much with the ongoing libp2p
update PR #1379.~~

---------

Co-authored-by: Green Baneling <XgreenX9999@gmail.com>
Dentosal added a commit that referenced this issue Feb 5, 2024
Closes #1345. Closes #1346 Closes #1350.

This PR stops discarding request errors from libp2p, and instead returns
them to the sender of the request. Also penalizes peers for sending
invalid responses or for not replying at all.

Making penalty configurable should be a follow-up PR, as there are other
penalties that should be configurable as well

TODO:
- [x] Make timeout configutable: Already seems to be case on master
branch
- [x] Add tests
- [x] Fix current tests that for some reason don't terminate

---------

Co-authored-by: xgreenx <xgreenx9999@gmail.com>
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

Successfully merging a pull request may close this issue.

3 participants