-
Notifications
You must be signed in to change notification settings - Fork 476
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: allow multi-role phonebook entries #6131
base: master
Are you sure you want to change the base?
network: allow multi-role phonebook entries #6131
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6131 +/- ##
==========================================
+ Coverage 55.99% 56.31% +0.31%
==========================================
Files 494 494
Lines 69958 69984 +26
==========================================
+ Hits 39174 39408 +234
+ Misses 28077 27901 -176
+ Partials 2707 2675 -32 ☔ View full report in Codecov by Sentry. |
// currently, we have two roles : relay role and archival role, which are mutually exclusive. | ||
// | ||
//msgp:ignore PhoneBookEntryRoles | ||
type PhoneBookEntryRoles int |
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.
renamed because of linter complaint about "phonebook.PhoneBookXYZ" repeating
network/p2pNetwork.go
Outdated
|
||
// also discover archival nodes | ||
var dhtArchivalPeers []peer.AddrInfo | ||
const numPeersToDiscover = 5 // some arbitrary number TODO: figure out a better value based on peerSelector/fetcher algorithm |
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.
out of curiosity why 5 vs 4 (or vs GossipFanout)?
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.
Maybe put this const at the top of the file?
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.
done
network/p2pNetwork.go
Outdated
if peerCore, ok := addrInfoToWsPeerCore(n, &info); ok { | ||
peers = append(peers, &peerCore) | ||
} | ||
const maxNodes = 5 // some arbitrary number |
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.
Should this be the same global const as numPeersToDiscover
like numArchivePeersToDiscover
at the top
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.
done
@@ -163,15 +194,20 @@ func (e *phonebookImpl) filterRetryTime(t time.Time, role PhoneBookEntryRoles) [ | |||
// new entries in addressesThey are being added | |||
// existing items that aren't included in addressesThey are being removed | |||
// matching entries don't change | |||
func (e *phonebookImpl) ReplacePeerList(addressesThey []string, networkName string, role PhoneBookEntryRoles) { | |||
func (e *phonebookImpl) ReplacePeerList(addressesThey []string, networkName string, role Roles) { |
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.
so phonebook.go's phonebookImpl.ReplacePeerList and peerstore.go's PeerStore.ReplacePeerList are the same?
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.
they surely have the same logic but a but different signatures
Summary
meshThread
fromGetPeers
:GeetPeers
be non-network query dependentTest Plan
Added unit tests for multi roles peers in phonebook and peerstore wrapper.