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(filter): reliability monitor as a separate class to handle reliability logic #2117

Merged
merged 18 commits into from
Sep 13, 2024

Conversation

danisharora099
Copy link
Collaborator

@danisharora099 danisharora099 commented Aug 28, 2024

Problem

Based on #2075, the logic to detect messages that were missed from the Filter protocol were being detected inside of the Filter SDK implementation. This leads to a tight couple of primary objective of FilterSDK, and reliability goals.

This obstacle also extends to adding further actions that might be taken with additional protocols such as Store pings, and LightPush retries for certain messages.

Solution

Decouple reliability logic into a new ReliabilityMonitor class.

Notes

Contribution checklist:

  • covered by unit tests;
  • covered by e2e test;
  • add ! in title if breaks public API;

Copy link

github-actions bot commented Aug 28, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
Waku node 83.2 KB (+0.28% 🔺) 1.7 s (+0.28% 🔺) 13.6 s (+86.5% 🔺) 15.3 s
Waku Simple Light Node 134.91 KB (+0.05% 🔺) 2.7 s (+0.05% 🔺) 18.2 s (+21.51% 🔺) 20.9 s
ECIES encryption 22.94 KB (0%) 459 ms (0%) 5.8 s (+51.59% 🔺) 6.3 s
Symmetric encryption 22.39 KB (0%) 448 ms (0%) 4.4 s (-14.97% 🔽) 4.9 s
DNS discovery 72.28 KB (0%) 1.5 s (0%) 10.6 s (+26.97% 🔺) 12.1 s
Peer Exchange discovery 73.79 KB (0%) 1.5 s (0%) 11.8 s (+67.86% 🔺) 13.3 s
Local Peer Cache Discovery 67.63 KB (0%) 1.4 s (0%) 13 s (+28.82% 🔺) 14.4 s
Privacy preserving protocols 74.82 KB (+0.04% 🔺) 1.5 s (+0.04% 🔺) 12.9 s (+40.71% 🔺) 14.4 s
Waku Filter 78.33 KB (+0.34% 🔺) 1.6 s (+0.34% 🔺) 15.5 s (+36.4% 🔺) 17 s
Waku LightPush 75.53 KB (-0.08% 🔽) 1.6 s (-0.08% 🔽) 14.4 s (+8.89% 🔺) 15.9 s
History retrieval protocols 75.95 KB (-0.02% 🔽) 1.6 s (-0.02% 🔽) 9.2 s (-34.6% 🔽) 10.7 s
Deterministic Message Hashing 7.38 KB (0%) 148 ms (0%) 1.1 s (-48.58% 🔽) 1.2 s

@danisharora099 danisharora099 changed the title temp feat(filter): reliability monitor as a separate class to handle reliability logic Aug 28, 2024
@danisharora099 danisharora099 force-pushed the feat/filter-reliability-split branch from f36812f to f387f59 Compare August 28, 2024 10:26
@@ -0,0 +1,119 @@
import type { Peer, PeerId } from "@libp2p/interface";
Copy link
Collaborator

Choose a reason for hiding this comment

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

since it is a new entity - can you, please, add UT for it? it can be a follow up PR

Copy link
Collaborator

@weboko weboko left a comment

Choose a reason for hiding this comment

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

let's, please, check how it works in dogfooding app

@danisharora099
Copy link
Collaborator Author

danisharora099 commented Sep 10, 2024

superseding the work on this PR with #2127

@weboko
Copy link
Collaborator

weboko commented Sep 11, 2024

@danisharora099 just to double check is this PR main and #2127 should be dropped or vice versa?

@danisharora099
Copy link
Collaborator Author

@danisharora099 just to double check is this PR main and #2127 should be dropped or vice versa?

We will use this PR instead.

@@ -195,6 +196,7 @@ export class WakuNode implements Waku {
}

public async stop(): Promise<void> {
ReliabilityMonitorManager.destroyAll();
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: to disposal

this.monitorManager = ReliabilityManager.create();
this.reliabilityMonitor = this.monitorManager.create();

this.filter = new Filter (this.reliabilityManager);

...

stop() {
  this.monitorManager.dispose();
}

@danisharora099 danisharora099 force-pushed the feat/filter-reliability-split branch from 5ae69f0 to 2eddaf5 Compare September 12, 2024 11:41
@danisharora099 danisharora099 requested a review from a team September 13, 2024 08:35
@danisharora099 danisharora099 merged commit 7ad1d32 into master Sep 13, 2024
10 of 11 checks passed
@danisharora099 danisharora099 deleted the feat/filter-reliability-split branch September 13, 2024 09:27
@weboko weboko mentioned this pull request Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: message verification and retry
2 participants