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

chore(lightpush)!: move protocol implementation to @waku/sdk (1/n) #1964

Merged
merged 7 commits into from
Apr 19, 2024

Conversation

danisharora099
Copy link
Collaborator

@danisharora099 danisharora099 commented Apr 18, 2024

Problem

Part of #1886, the current Filter implementation is quite coupled in terms of the RFC specs + our opinions of using peers, handling subscriptions, etc

Solution

Decouple Filter into SDK and Core

Notes

Contribution checklist:

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

@danisharora099 danisharora099 changed the title chore!: unopinionated Filter (1/n) chore(lightpush)!: move protocol implementation to @waku/sdk (1/n) Apr 18, 2024
Copy link

github-actions bot commented Apr 18, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
Waku node 180.77 KB (-0.02% 🔽) 3.7 s (-0.02% 🔽) 3.3 s (+28.19% 🔺) 6.9 s
Waku Simple Light Node 180.85 KB (+0.05% 🔺) 3.7 s (+0.05% 🔺) 3.6 s (+31.37% 🔺) 7.2 s
ECIES encryption 23.12 KB (0%) 463 ms (0%) 762 ms (-6.32% 🔽) 1.3 s
Symmetric encryption 22.57 KB (0%) 452 ms (0%) 668 ms (+29.94% 🔺) 1.2 s
DNS discovery 72.44 KB (0%) 1.5 s (0%) 1.7 s (+36.43% 🔺) 3.2 s
Peer Exchange discovery 73.96 KB (0%) 1.5 s (0%) 1.8 s (-4.02% 🔽) 3.3 s
Local Peer Cache Discovery 67.68 KB (0%) 1.4 s (0%) 1.4 s (+28.42% 🔺) 2.7 s
Privacy preserving protocols 38.78 KB (0%) 776 ms (0%) 1.4 s (+15.53% 🔺) 2.2 s
Waku Filter 111.38 KB (+450.83% 🔺) 2.3 s (+450.83% 🔺) 3.1 s (+440.29% 🔺) 5.3 s
Waku LightPush 110.15 KB (+0.02% 🔺) 2.3 s (+0.02% 🔺) 2.6 s (+38.54% 🔺) 4.8 s
History retrieval protocols 110.66 KB (-0.07% 🔽) 2.3 s (-0.07% 🔽) 2.4 s (+25.56% 🔺) 4.7 s
Deterministic Message Hashing 4.83 KB (0%) 97 ms (0%) 22 ms (+2.88% 🔺) 119 ms

@danisharora099 danisharora099 marked this pull request as ready for review April 18, 2024 13:17
@danisharora099 danisharora099 requested a review from a team as a code owner April 18, 2024 13:17
Comment on lines +19 to +23
class LightPushSDK extends BaseProtocolSDK implements ILightPushSDK {
public readonly protocol: LightPushCore;

constructor(libp2p: Libp2p, options?: ProtocolCreateOptions) {
super({ numPeersToUse: options?.numPeersToUse ?? DEFAULT_NUM_PEERS });
super({ numPeersToUse: options?.numPeersToUse });
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

note: this is a side-change

): void {
const errors = results
.filter(
(result): result is PromiseRejectedResult =>
Copy link
Member

Choose a reason for hiding this comment

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

Learned something new today about Typescript :-)


const { contentTopic } = message;
if (!contentTopic) {
log.warn("Message has no content topic, skipping");
Copy link
Member

Choose a reason for hiding this comment

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

nit: may be worth adding the hash of the message to the log

@danisharora099 danisharora099 merged commit 5fb1006 into master Apr 19, 2024
9 of 11 checks passed
@danisharora099 danisharora099 deleted the chore/decouple-filter branch April 19, 2024 11:50
@weboko weboko mentioned this pull request Apr 19, 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.

2 participants