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 #2105

Closed
wants to merge 6 commits into from

Conversation

danisharora099
Copy link
Collaborator

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 22, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
Waku node 86.68 KB (+0.2% 🔺) 1.8 s (+0.2% 🔺) 1.9 s (-40.48% 🔽) 3.7 s
Waku Simple Light Node 154.41 KB (+0.14% 🔺) 3.1 s (+0.14% 🔺) 1.7 s (-45.42% 🔽) 4.8 s
ECIES encryption 22.83 KB (0%) 457 ms (0%) 920 ms (+45.64% 🔺) 1.4 s
Symmetric encryption 22.33 KB (0%) 447 ms (0%) 908 ms (+31.76% 🔺) 1.4 s
DNS discovery 72.27 KB (0%) 1.5 s (0%) 1.5 s (-18.79% 🔽) 2.9 s
Peer Exchange discovery 73.75 KB (0%) 1.5 s (0%) 2.5 s (+38.73% 🔺) 3.9 s
Local Peer Cache Discovery 67.57 KB (0%) 1.4 s (0%) 1.7 s (-24.31% 🔽) 3 s
Privacy preserving protocols 38.91 KB (0%) 779 ms (0%) 1.1 s (+24.46% 🔺) 1.9 s
Waku Filter 81.14 KB (+0.09% 🔺) 1.7 s (+0.09% 🔺) 2.3 s (+2.87% 🔺) 3.9 s
Waku LightPush 78.56 KB (-0.04% 🔽) 1.6 s (-0.04% 🔽) 1.9 s (-5.37% 🔽) 3.5 s
History retrieval protocols 79.05 KB (-0.07% 🔽) 1.6 s (-0.07% 🔽) 2.5 s (+17% 🔺) 4 s
Deterministic Message Hashing 7.31 KB (0%) 147 ms (0%) 180 ms (-59.63% 🔽) 326 ms

@danisharora099 danisharora099 changed the title feat(filter): reliability monitor as a separate class to handle reliability logic chore(filter): reliability monitor as a separate class to handle reliability logic Aug 22, 2024
@danisharora099 danisharora099 changed the title chore(filter): reliability monitor as a separate class to handle reliability logic feat(filter): reliability monitor as a separate class to handle reliability logic Aug 22, 2024
@danisharora099 danisharora099 marked this pull request as ready for review August 22, 2024 13:40
@danisharora099 danisharora099 requested a review from a team as a code owner August 22, 2024 13:40
@danisharora099 danisharora099 force-pushed the feat/reliability-monitor branch 2 times, most recently from c7767dc to ca44b9c Compare August 23, 2024 10:27
@@ -0,0 +1,4 @@
export const DEFAULT_KEEP_ALIVE = 30 * 1000;
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: let's move filter folder to src

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it is under src/protocols - do you mean root of src?

this.pubsubTopic = pubsubTopic;
this.subscriptionCallbacks = new Map();

this.reliabilityMonitor = new ReliabilityMonitor(
Copy link
Collaborator

@weboko weboko Aug 26, 2024

Choose a reason for hiding this comment

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

based on the original design - we'd need to use it in lightPush too
or do you have another idea how to make retry there happen?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

correct. i want to split the PR such that there is cleaner diff and this PR can be followed up with lightpush changes similar to filter (this PR)

}
}

public resetPeerStats(peerIdStr: string): void {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: let's have public methods on top of the file

@weboko
Copy link
Collaborator

weboko commented Aug 26, 2024

Have you tried it in dogfooding app environment?

@danisharora099 danisharora099 force-pushed the feat/reliability-monitor branch from b6de656 to 4d20c67 Compare August 27, 2024 11:48
@danisharora099
Copy link
Collaborator Author

superseded by #2117

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