Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat: improve peer manager and re-integrate to light push #2191
feat: improve peer manager and re-integrate to light push #2191
Changes from 17 commits
c93b58e
7efbd26
a6dd499
e897d5c
e1813bc
9bdc2af
2edd856
7ae3b91
d0c6905
1eaedb3
984326b
8a3337d
d4210c7
7258a01
7f4033d
994d05e
1be6e2d
ebb00f4
b6ac054
b1f4adf
93eebfa
070b5a4
38067b3
fb9556a
e84d0db
8aac817
da1ffe6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Large diffs are not rendered by default.
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.
Do we still have access to this utility function from elsewhere?
Basically getting the connected peers for a particular protocol
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.
yes, in
ConnectionManager
there is method implemented for itpublic async getConnectedPeers(codec?: string): Promise<Peer[]>
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.
easier to do
waku.lightpush.connectedPeers()
vs
waku.connectionManager.getPeers(waku.lightpush.multicodec)
im in favor of not removing this
also is a breaking change
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.
why
waku.lightpush.connectedPeers()
even needed?I would assume to be used on the consumer side - but then it's something that we don't expect to be used
whereas
waku.connectionManager.getPeers(waku.lightpush.multicodec)
is for internal usage for protocols and shouldn't be used outsideagree, this PR is pretty much breaking change as we found out previous things were not working well enough
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.
we have had feedback in the past that convinces us that consumers want to be able to check the information of connected peers on the protocol (cc @vpavlin)
we can add it on the SDK layer instead of the
core
layerThere 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.
we can continue to use
ConnectionManager
to provide this API - do you see reason in switching out the use of multicodecs as arg for the function, with the enum type for protocols instead to help DX? (ref: #2191)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.
that should be tackled by
health
state of the node, otherwise I don't see a need for consumers for dowaku.lightPush.connectedPeers()
- if that is something they need to do we can tell them:waku.getConnectedPeers().filter(byMulticodec)
;connectionManager
so that they can do the same from it;Back then this functionality was added without clear need.
as I explained it in the other comment -
connectionManager.getPeers(multicodec)
- will return peers formetadata
and other protocols where asProtocols
is for consumers use and has onlyLightPush
/Filter
etc.Just to clarify here - let's not have unnecessary entry points and not needed code. This will be easier for us as to support, bug fix and improve our own code base.
I see us adding one method that does the job and then improving it if we find more evidence.
Of course I might be wrong as to this particular case, but then we can add it once requested.
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.
@danisharora099 let me know what you think.
Check warning on line 60 in packages/core/src/lib/connection_manager/connection_manager.ts
Check warning on line 60 in packages/core/src/lib/connection_manager/connection_manager.ts
Check warning on line 318 in packages/core/src/lib/connection_manager/connection_manager.ts
Check warning on line 318 in packages/core/src/lib/connection_manager/connection_manager.ts