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

Network: Class-based Peer Selector #5937

Merged
merged 15 commits into from Feb 21, 2024

Conversation

gmalouf
Copy link
Contributor

@gmalouf gmalouf commented Feb 13, 2024

Summary

Introduce a class-based peer selector for explicitly ranking peer groups based on type and download performance. The intent is to be able to quickly move from one class of peers to the next in cases such as where a client needs older blocks that may only be present on archival nodes.

Test Plan

Introduce new unit tests for class-based peer selector, existing tests should be updated/pass.

Copy link

codecov bot commented Feb 13, 2024

Codecov Report

Attention: 41 lines in your changes are missing coverage. Please review.

Comparison is base (e1db9e1) 55.71% compared to head (c73fa06) 55.71%.
Report is 2 commits behind head on master.

Files Patch % Lines
catchup/catchpointService.go 6.89% 27 Missing ⚠️
catchup/service.go 71.42% 12 Missing ⚠️
catchup/classBasedPeerSelector.go 96.77% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5937   +/-   ##
=======================================
  Coverage   55.71%   55.71%           
=======================================
  Files         487      488    +1     
  Lines       68048    68103   +55     
=======================================
+ Hits        37911    37945   +34     
- Misses      27572    27584   +12     
- Partials     2565     2574    +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gmalouf gmalouf self-assigned this Feb 14, 2024
Copy link
Contributor

@algorandskiy algorandskiy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments/ideas

catchup/catchpointService.go Outdated Show resolved Hide resolved
catchup/catchpointService.go Outdated Show resolved Hide resolved
catchup/service.go Outdated Show resolved Hide resolved
catchup/classBasedPeerSelector.go Outdated Show resolved Hide resolved
catchup/classBasedPeerSelector.go Outdated Show resolved Hide resolved
… check violations of tolerance factor during iteration of peer selectors in getNextPeer().
…ll of it's download functionality (implying that failures around catchpoint downloads for a peer from a class put that class at risk of being disabled temporarily).
catchup/service.go Outdated Show resolved Hide resolved
catchup/service.go Outdated Show resolved Hide resolved
catchup/service.go Outdated Show resolved Hide resolved
catchup/classBasedPeerSelector_test.go Show resolved Hide resolved
…ises using actual peer selectors and expected ranking behavior.
Copy link
Contributor

@algorandskiy algorandskiy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to remove both priority and lastCheckedTime. It will make the initialization less verbose at least, and catchup itself faster (without re-checking disabled class every 10 minutes).

catchup/service.go Outdated Show resolved Hide resolved
catchup/classBasedPeerSelector.go Show resolved Hide resolved
catchup/classBasedPeerSelector.go Outdated Show resolved Hide resolved
@gmalouf gmalouf marked this pull request as ready for review February 20, 2024 21:10
…d by order of wrappedPeerSelectors at construction.
…resets when all selectors have been disabled.
Copy link
Member

@jasonpaulos jasonpaulos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct and I appreciate the simplifications

@gmalouf gmalouf merged commit 52964ed into algorand:master Feb 21, 2024
18 checks passed
@gmalouf gmalouf deleted the peer-ranking-updates branch February 21, 2024 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants