Skip to content
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 offline recoverability of Filter #2024

Closed
weboko opened this issue May 28, 2024 · 5 comments
Closed

feat: improve offline recoverability of Filter #2024

weboko opened this issue May 28, 2024 · 5 comments

Comments

@weboko
Copy link
Collaborator

weboko commented May 28, 2024

This is a feature request

Problem

Currently once js-waku looses and then recovers connection (either Internet or to all peers) - existing Filter subscriptions misbehave.

Proposed Solutions

If internet connection was lost:

  1. redial peers to which subscription was created;
  2. ping and if fails - try to create a new one;

If peers were disconnected:

  1. simply trying to redial should help;

These are things that helped me to recover subscriptions during my local experimentation.

Notes

Part of #2154

@weboko weboko added the enhancement New feature or request label May 28, 2024
@weboko weboko self-assigned this May 28, 2024
@weboko
Copy link
Collaborator Author

weboko commented May 28, 2024

@danisharora099 would be happy to hear your opinion on the approach

@danisharora099
Copy link
Collaborator

@danisharora099 would be happy to hear your opinion on the approach

Thanks for documenting @weboko.

I'd see these two cases under the same umbrella, as application is not aware if it's a peer disconnection or an internet connection loss -- both of them need to be inferred by recurring Filter pings failing:

  • upon failure, check if we still have a connection open with the peer
  • if not, create new filter subscriptions
    • also attempt to dial the lost connection with the same peer
  • if no peers are available for a filter subscription, keep retrying while toggling the node status to offline (ConnectionManager) as it means that there are no available Filter connect

--
PS: perhaps the online/offline state in ConnectionManager can be extended to be per protocol instead.

@danisharora099
Copy link
Collaborator

danisharora099 commented Jun 5, 2024

@weboko I see this is in progress. I'm curious of how this will be actioned. Can you help share your POV to this?
To me it looks like a followup after #2002 is implemented, where we have access to the state of peers used by each protocol, and in this case Filter.

redial peers to which subscription was created;
ping and if fails - try to create a new one;

@danisharora099
Copy link
Collaborator

Note: the Filter pings and renewals is a part of #2002. The scope of this issue is solving for js-waku's disconnection

@weboko
Copy link
Collaborator Author

weboko commented Aug 31, 2024

Should be resolved with #2049

@weboko weboko closed this as completed Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

3 participants