-
Notifications
You must be signed in to change notification settings - Fork 42
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: fix peer renewal, change Filter keep alive #2065
Conversation
@@ -0,0 +1,22 @@ | |||
import type { Connection } from "@libp2p/interface"; | |||
|
|||
export function selectConnection( |
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 was moved from @waku/utils
@waku-org/js-waku-developers let's be cautious of not placing non public utils in @waku/utils
non public utils are those that are needed only by @waku/*
packages family and/or test package.
size-limit report 📦
|
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.
I'm curious how the peer renewal failure was observed/debugged? Any failing test cases? Should we add new tests that would reproduce it?
Peer renewal was working by dropping connection and then taking a peer from those with whom we have a connection. What we actually need to do is to get a peer to which we are not connected yet. Otherwise we need to always have connections to peers that we are not using in order to be able to use them as a replacement. As for repro - you can do this by running dogfooding app now and seeing that at dome point there are no peers to be used for light push |
Problem
Peer renewal doesn't work as intended.
Current behavior - it renews a peer to a one with which light node has a connection already.
Expected behavior - renews to a peer which we don't have a connection.
This PR also adds decrease for Filter keep alive queries to 30 seconds as was proposed in one of the threads in waku-org/specs#18, and some code improvements.
Solution
Fix the behavior and add some improvements.
Notes
Tested in the dogfooding app - waku-org/lab.waku.org#68