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: changes for optimizing filter ping #1102

Merged
merged 13 commits into from
May 22, 2024

Conversation

chaitanyaprem
Copy link
Collaborator

@chaitanyaprem chaitanyaprem commented May 16, 2024

Description

Implementing #1099 , realized that there are some issues wrt approach taken in #1048

Following are the issues being addressed/to be addressed:

  1. For each subscription towards same peer, pings are sent which is unnecessary traffic periodically
  2. There is no check that if a Filter ping fails , a susbcribe is done what if it already chooses another peer for which we have subscription against? (tracked fix: avoid possible reuse of same peers during Filter resubscribe by Filter API #1104)

Taking an approach to not send an actual ping via Filter Subscription Ping API, rather check status of last ping. And trying to no refactor code much, so that we can check results faster.

Note: Tests are still pending.

Approach/Impementation Details:

  • Have a separate go-routine that collates unique peers from all subscriptions and sends a ping once in 5 seconds to each peer
  • If the ping fails, the same is notified in the subscription Closing channel(indicating that this subscription is closing..could use better wording i guess)
  • Filter API layer would then use this indication to take further actions such as resubscribing to another peer (Note that there is still a possible issue indicate in point-2 above that needs to be fixed)
  • Going forward, this same indication can be used to take actions such as initiate storev3 queries for this subscription based and compare with local message cache and fetch any missed messages from store node.

Pending Items:

@chaitanyaprem chaitanyaprem linked an issue May 16, 2024 that may be closed by this pull request
@status-im-auto
Copy link

status-im-auto commented May 16, 2024

Jenkins Builds

Click to see older builds (10)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ c636567 #1 2024-05-16 08:39:46 ~2 min nix-flake 📄log
✔️ 1bf42c6 #2 2024-05-16 08:42:28 ~2 min nix-flake 📄log
✔️ cbec661 #3 2024-05-17 05:40:43 ~2 min nix-flake 📄log
✔️ d20f81d #4 2024-05-17 06:05:08 ~2 min nix-flake 📄log
✔️ 6ed5c06 #5 2024-05-17 06:22:41 ~2 min nix-flake 📄log
✔️ f02cbbd #6 2024-05-17 11:06:58 ~2 min nix-flake 📄log
✔️ efac861 #7 2024-05-21 09:04:08 ~2 min nix-flake 📄log
✔️ e5772ac #8 2024-05-21 09:35:33 ~2 min nix-flake 📄log
✔️ adf19ce #9 2024-05-21 09:52:33 ~2 min nix-flake 📄log
✔️ 8c542e1 #10 2024-05-21 10:28:23 ~2 min nix-flake 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 629125f #11 2024-05-21 23:04:26 ~3 min nix-flake 📄log
✔️ 20c7bf5 #12 2024-05-22 06:11:37 ~2 min nix-flake 📄log

@chaitanyaprem chaitanyaprem changed the title feat: draft changes for optimizing filter ping feat:changes for optimizing filter ping May 17, 2024
@chaitanyaprem chaitanyaprem changed the title feat:changes for optimizing filter ping feat: changes for optimizing filter ping May 17, 2024
Copy link
Contributor

@kaichaosun kaichaosun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't think too much about peer management. My general feeling is that, one periodic loop to check health and close unhealthy ones, another periodic loop ensure the quoted connection requirements are properly provisioned.

waku/v2/api/filter.go Outdated Show resolved Hide resolved
waku/v2/protocol/filter/client.go Outdated Show resolved Hide resolved
waku/v2/protocol/filter/filter_health_check.go Outdated Show resolved Hide resolved
waku/v2/protocol/filter/client.go Dismissed Show dismissed Hide dismissed
waku/v2/protocol/subscription/subscription_details.go Outdated Show resolved Hide resolved
waku/v2/protocol/filter/client.go Outdated Show resolved Hide resolved
waku/v2/protocol/filter/client.go Outdated Show resolved Hide resolved
waku/v2/protocol/filter/filter_health_check.go Outdated Show resolved Hide resolved
waku/v2/api/filter.go Show resolved Hide resolved
waku/v2/protocol/filter/filter_health_check.go Outdated Show resolved Hide resolved
waku/v2/protocol/filter/filter_health_check.go Outdated Show resolved Hide resolved
waku/v2/protocol/filter/filter_health_check.go Outdated Show resolved Hide resolved
@chaitanyaprem chaitanyaprem marked this pull request as ready for review May 21, 2024 09:02
Copy link
Contributor

@kaichaosun kaichaosun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few nitpicks, overall LGTM 👍

waku/v2/protocol/filter/test_utils.go Outdated Show resolved Hide resolved
waku/v2/protocol/filter/filter_health_check.go Outdated Show resolved Hide resolved
@chaitanyaprem chaitanyaprem merged commit 8115ec7 into master May 22, 2024
12 checks passed
@chaitanyaprem chaitanyaprem deleted the feat/filter-ping-per-peer branch May 22, 2024 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
5 participants