Skip to content

network: allow multi-role phonebook entries#6131

Merged
algorandskiy merged 19 commits intoalgorand:masterfrom
algorandskiy:pavel/p2p-archival-get-peers
Feb 27, 2025
Merged

network: allow multi-role phonebook entries#6131
algorandskiy merged 19 commits intoalgorand:masterfrom
algorandskiy:pavel/p2p-archival-get-peers

Conversation

@algorandskiy
Copy link
Copy Markdown
Contributor

@algorandskiy algorandskiy commented Sep 13, 2024

Summary

  1. Allowed a single phonebook entry to have multiple roles
    • P2P node can advertise both gossip and archival capabilities
    • The existing implementation did not support that but it was not an issue because (2) below
  2. Moved DHT operations to meshThread from GetPeers:
    • To have all DHT ops in one place
    • To have GeetPeers be non-network query dependent
  3. Updated phonebook/peerstore entries to exclude the persisted flag and move to per-role into RoleSet

Test Plan

Added unit tests for multi roles peers in phonebook and peerstore wrapper.

@codecov
Copy link
Copy Markdown

codecov bot commented Sep 13, 2024

Codecov Report

Attention: Patch coverage is 91.01124% with 8 lines in your changes missing coverage. Please review.

Project coverage is 51.82%. Comparing base (ad57857) to head (947cca1).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
network/p2pNetwork.go 76.00% 4 Missing and 2 partials ⚠️
network/p2p/p2p.go 0.00% 1 Missing ⚠️
network/phonebook/phonebook.go 97.29% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6131      +/-   ##
==========================================
+ Coverage   51.77%   51.82%   +0.05%     
==========================================
  Files         644      644              
  Lines       86604    86641      +37     
==========================================
+ Hits        44840    44904      +64     
+ Misses      38893    38876      -17     
+ Partials     2871     2861      -10     

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

@algorandskiy algorandskiy changed the title WIP: network: allow multi-role phonebook entries network: allow multi-role phonebook entries Sep 16, 2024
@algorandskiy algorandskiy requested review from cce and gmalouf September 16, 2024 14:44
@algorandskiy algorandskiy marked this pull request as ready for review September 16, 2024 14:44
@algorandskiy algorandskiy requested a review from cce October 29, 2024 19:45
algorandskiy and others added 2 commits February 19, 2025 13:50
Co-authored-by: John Jannotti <jannotti@gmail.com>
Co-authored-by: John Jannotti <jannotti@gmail.com>
@algorandskiy
Copy link
Copy Markdown
Contributor Author

Implemented CR suggestions

Copy link
Copy Markdown
Contributor

@jannotti jannotti left a comment

Choose a reason for hiding this comment

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

I'm ok with this. I'll wait for a little discussion about reusing the same type, but I could approve as is.

@algorandskiy
Copy link
Copy Markdown
Contributor Author

Updated comments are requested

@algorandskiy algorandskiy merged commit 02bfca4 into algorand:master Feb 27, 2025
@algorandskiy algorandskiy deleted the pavel/p2p-archival-get-peers branch March 16, 2026 20:06
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.

4 participants