-
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
Peer Management: Connection and Disconnection #914
Comments
This module will just consume a generate Waku and Waku Relay interfaces so we already we want to extract it. It is also one opinionated to handle connection management, other ways might come with #914.
919: include wait_for_remote_peer in exports map r=fryorcraken a=fryorcraken This module will just consume a generate Waku and Waku Relay interfaces so we already we want to extract it. It is also one opinionated to handle connection management, other ways might come with #914. Co-authored-by: fryorcraken.eth <[email protected]>
Need to re-groom this issue to take peer discovery in account. Some draft notes:
|
Since this issue is a considerable overhaul, I'd like to be sure of my interpretation of the same. I think the biggest one is:
For this, my interpretation is that libp2p's connection manager doesn't emit an event when a peer disconnects/streams are closed (on Secondly, an explanation on the following, of how this fits with the initially described scope of the PR, will also be greatly appreciated.
Other than this, appreciate that the issue has been written very descriptively and will have a great impact! |
As mentioned. this is a considerable overhaul and would need to be tackled iteratively. Each iteration can increase the functionality/complexity of the manager while taking onboard feedback from dogfooding. I suggest to focus the first iterations on using the peer discovery protocols dns discovery and peer exchange with the following logic:
(3) introduces an issue: the first node discovery by DNS discovery will always be the same given a given enr tree. Hence we may need to introduce some pseudo random shuffling logic. this should probably be done in the connection manager. The final result above can already be split in several tasks/PRs. Then, we can add error resilience on top of it, I'd recommend in the following order:
|
We do two things with the peer, is that what we mean by "process" here?
also, a lot of the process you describe, from my understanding, takes place implicitly by libp2p
I'm not entirely sure what you mean by manually handling the above-described process we might not need to manually handle/connect to discovered peers as libp2p automatically dials to discovered peers and handles pruning if necessary (upper connection limit on ConnectionManager) — we should just focus on discovering the most number of peers (ref: #1117) Please let me know if I'm missing something |
The tagging is done by the discovery service:
The dialling is done by the connection manager: js-waku/packages/core/src/lib/waku.ts Line 140 in 0b08320
We will have to make this trivial logic more complex in the future and have a proper By "process" I mean deciding whether to dial and dialing.
Because if all js-waku nodes connects to Instead, I propose for the
I don't know. The node will be tagged as The
Yes. For the rest of the logic I assume the proposed default requirements are applied.
We should automatically connect to all node we discover. Which is why we need a Connection Manager and why we need to implement this logic.
Pass an invalid
We'll have to review in details the retry logic when it's time to implement.
We should not dial every node we discover. This is why custom connection management is needed.
|
How are we deducing whether to dial or not?
My interpretation so far:
is that a fair interpretation? |
Also, as concluded from #1117 (comment), libp2p by default autodials. Considering the scope of this PR, it's best to default |
Yes. |
As discussed with @danisharora099 the first step was actually a focus on connections to node discovered, Need to update description to record this first step. Next, would be exploratory work to understand what information we can get when a node is disconnected. |
Blocked by #1412 |
referring from #1412,
to address part of the as we concluded with #1403 (comment), js-waku redials automatically after the 10 mins mark, which is not a conscious disconnection and requires reconnection so perhaps the above question is enforced by default already? cc @fryorcraken |
Weekly Update
|
for this, we want to simply attempt reconnections For library consumers, For Filter,
|
Weekly Update
|
Weekly Update
|
Planned start date:
Due date:
Summary
In a browser environment, loss of connectivity may happen.
When it happens, this would impede the application to receive and send messages.
Strategies need to be designed to:
waitForRemotePeer
)Proposed Solutions
The result of this issue would be a mix of:
At this stage it is not sure what should go in waku core and what should be a library helper.
Acceptance Criteria
Tasks
N
attemptsdial all available bootstrap peers if no PX peers are dialable after N secondsTasks Moved to Out of Scope
Notes
libp2p/js-libp2p#744
RAID (Risks, Assumptions, Issues and Dependencies)
The text was updated successfully, but these errors were encountered: