-
Notifications
You must be signed in to change notification settings - Fork 54
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-exchange issue #2889
fix: peer-exchange issue #2889
Conversation
You can find the image built from this PR at
Built from faee769 |
After understanding the discussion in issue #2414, try to implement @alrevuelta's proposed solution. Please review the code. Is it possible to test this complex scenario in a unit test? |
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! Thanks! 💯
I just added a naïve question :)
@@ -140,8 +145,10 @@ proc getPeersByProtocol*(peerStore: PeerStore, proto: string): seq[RemotePeerInf | |||
return peerStore.peers.filterIt(it.protocols.contains(proto)) | |||
|
|||
proc getReachablePeers*(peerStore: PeerStore): seq[RemotePeerInfo] = | |||
let threshold = Moment.fromNow(millis(-3*60*60*1000)) |
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.
Are we sure the units are in seconds?
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.
Actually, the secs and hours functions cause compilation errors. will try to move hourly formula. regarding 3 hours I will check with alvaro before merging.
4472a1e
to
7520eca
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.
Currently, there's nothing in this PR. I implemented Alvaro's suggested proposal, but Hanno recommended a more feasible long-term solution. so i revert older version. I'm working on that now and will update once it's done. Actually discussion going on this thread, https://discord.com/channels/1110799176264056863/1260493155791405096 |
8714beb
to
1c9eb27
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.
This is a good start. Perhaps we can evaluate if things improve? Afaics this is a very cheap refresh, so we may even lower interval further if needed.
Thank you for your suggestion. I've already created a draft PR to analyze peer exchange behavior: #2940. The plan is to investigate whether increasing the frequency of cache refreshes helps. If it doesn't, we would be unnecessarily loading the node. soon I will present matrics of analysis using these tools and then we will decide. cc @jm-clius |
bfb021f
to
99f79e7
Compare
As you suggest @jm-clius Tool Overview The process involved 60 iterations, accumulating 300 peer requests over 3 hours. I generated percentage charts to visualize success rates at different cache refresh intervals. The results are as follows: 15-minute interval: 265/300 Conclusion I’d welcome any suggestions or alternative approaches to this analysis cc @gabrielmer @chaitanyaprem @Ivansete-status @NagyZoltanPeter |
Thanks for the analysis in #2889 (comment) @darshankabariya . It seems reasonable to set it to 10min (considering very few test iterations but it is fine.) |
05099cf
to
1aeb35d
Compare
closes #2414
This implementation will enhance the reliability of the peers shared by the peer-exchange protocol with its clients. because now the cache updates every 10 min.
After the resolution of the peer_manager issue #2905, the reliability of peer exchanges has also been improved.