-
Notifications
You must be signed in to change notification settings - Fork 899
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(share/discovery)!: revamp Discovery #2117
Conversation
d3a4c1a
to
8f78aa8
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.
findCancel
and cancelFind
- lets pick one
I will also write tests over the weekends and maybe refactor if enough inspiration |
Codecov Report
@@ Coverage Diff @@
## main #2117 +/- ##
==========================================
- Coverage 55.80% 55.37% -0.43%
==========================================
Files 209 212 +3
Lines 13289 13643 +354
==========================================
+ Hits 7416 7555 +139
- Misses 5131 5327 +196
- Partials 742 761 +19
|
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.
only one comment re panic
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.
Wow 58 commits! Discovery is so much cleaner now!
Blocked because @vgonkivs has previously requested changes |
Closes #2107
There was a discrepancy between the amount of peers inside of the peer manager full node pool, and the limitedSet inside of discovery. It was possible for the node to get in a state where it had no more full nodes to sample from, because the peers inside the limitedSet were blocking on the connection, and never being handed off to the OnPeersUpdate callback.
To fix this, we (@Wondertan, @walldiss and I):
I have tested this locally, and it works well with various peer limits. The first few calls to findPeers cause the highest peer count in the limited set (roughly about double), but bad connections are trimmed relatively quickly, and within a few cycles, we land with a pretty stable peer set where there are only 1-2 peer changes every interval, if any.
NOTE: Config breaking!