-
-
Notifications
You must be signed in to change notification settings - Fork 266
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
Fix peer score serialization #3520
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3520 +/- ##
==========================================
- Coverage 37.90% 37.89% -0.02%
==========================================
Files 308 308
Lines 8129 8134 +5
Branches 1248 1250 +2
==========================================
+ Hits 3081 3082 +1
- Misses 4900 4904 +4
Partials 148 148 |
Code Climate has analyzed commit 161b732 and detected 0 issues on this pull request. View more on Code Climate. |
* https://github.com/multiformats/js-multistream-select/blame/cf4e297b362a43bde2ea117085ceba78cbce1c12/src/select.js#L50 | ||
*/ | ||
const multiStreamSelectErrorCodes = { | ||
protocolSelectionFailed: "protocol selection failed", |
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.
once this error happens, it'll happen all the time and the peer is useless to us. It's similar to the ERR_UNSUPPORTED_PROTOCOL
error below
Performance Report✔️ no performance regression detected Full benchmark results
|
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.
Nice find! 🙏
Motivation
DIAL_ERROR
, I don't see we say goodbye to peers with "Peer score too low" or "Peer banned""protocol selection failed"
and it's still in our connected peer without being bannedDescription
Right now we use
ssz.Number64
type to serialize/deserialize peer score which is float, a peer score of-20
is serialized and deserialized back as a very big uint64Use a new
floatSerdes
which is similar tostringSerdes
but we parse float as an extra stepIf method is
ping
and we get"protocol selection failed"
, ban the peer immediatelyCloses #3517
Tested in contabo-19