-
Notifications
You must be signed in to change notification settings - Fork 47
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
gs1.1 peer score #83
gs1.1 peer score #83
Conversation
Codecov Report
@@ Coverage Diff @@
## gsv1.1 #83 +/- ##
=======================================
Coverage 80.00% 80.00%
=======================================
Files 1 1
Lines 10 10
=======================================
Hits 8 8
Misses 2 2 Continue to review full report at Codecov.
|
56ab3ef
to
2303125
Compare
2303125
to
37d7020
Compare
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.
Awesome work in this first iteration @wemeetagain
I think it was a good call go lift this from go-libp2p-pubsub, it helped a lot for the review and I think it will help us on future iterations :)
I mostly commented minor details, except for the usage of the AddressBook, which does not seem what you want here (details in the review comments).
For things like the throttled, white list ips, etc, I am ok on doing that in follow up PRs, but we need to leave it documented somewhere
ts/score/peerScoreParams.ts
Outdated
try { | ||
validateTopicScoreParams(params) | ||
} catch (e) { | ||
throw new Error(`invalid score parameters for topic ${topic}: ${e.message}`) |
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.
Can we use the err-code
module for all these errors?
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.
Do you have access to the err-code
repo? I see that some of the contributors there are part of @moxystudio
would be nice to have typescript type definitions in IndigoUnited/js-err-code#21
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.
I bumped it and talked directly with them, but that will not be merged unfortunately. Declare it in types will be the solution for now
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 import @types/err-code once this PR is merged: DefinitelyTyped/DefinitelyTyped#45504
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.
thanks for the thorough review
* Update all peer IPs to currently open connections | ||
* @returns {void} | ||
*/ | ||
_updateIPs (): void { |
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.
here is the naive/simple synchronous IP updating
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.
LGTM
PeerScore
classAddressBook
from js-libp2p to fetch IP addresses / listen to IP address changes