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 filter subscriptions #2193

Draft
wants to merge 4 commits into
base: weboko/peer-manager
Choose a base branch
from

Conversation

weboko
Copy link
Collaborator

@weboko weboko commented Oct 27, 2024

Problem

TBD

Solution

TBD

Notes

  • Resolves
  • Related to

Contribution checklist:

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

Copy link

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
Waku node 84.71 KB (+0.22% 🔺) 1.7 s (+0.22% 🔺) 7.2 s (+44.77% 🔺) 8.9 s
Waku Simple Light Node 135.16 KB (+0.19% 🔺) 2.8 s (+0.19% 🔺) 9.1 s (-8.09% 🔽) 11.8 s
ECIES encryption 22.88 KB (0%) 458 ms (0%) 1.2 s (-44.99% 🔽) 1.6 s
Symmetric encryption 22.37 KB (0%) 448 ms (0%) 3.1 s (+91.68% 🔺) 3.5 s
DNS discovery 70.49 KB (0%) 1.5 s (0%) 4.7 s (-18.27% 🔽) 6.1 s
Peer Exchange discovery 71.47 KB (0%) 1.5 s (0%) 5.6 s (+8.65% 🔺) 7 s
Local Peer Cache Discovery 65.08 KB (0%) 1.4 s (0%) 4.2 s (-43.86% 🔽) 5.5 s
Privacy preserving protocols 76.14 KB (0%) 1.6 s (0%) 7.9 s (+50.73% 🔺) 9.5 s
Waku Filter 78.58 KB (+0.16% 🔺) 1.6 s (+0.16% 🔺) 7 s (+56.55% 🔺) 8.6 s
Waku LightPush 75.15 KB (0%) 1.6 s (0%) 6.9 s (+12.86% 🔺) 8.4 s
History retrieval protocols 75.25 KB (0%) 1.6 s (0%) 5.5 s (+12.65% 🔺) 7 s
Deterministic Message Hashing 7.39 KB (0%) 148 ms (0%) 266 ms (-60.7% 🔽) 414 ms

Comment on lines 12 to +13
export async function createLightNode(
options: CreateWakuNodeOptions = {}
options: ProtocolCreateOptions = {}
Copy link
Collaborator

Choose a reason for hiding this comment

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

ProtocolCreateOptions used for a createNode argument -- perhaps change naming/functionality here?

@@ -31,6 +26,9 @@ type MetadataService = {

const log = new Logger("sdk:create");

const DefaultUserAgent = "js-waku";
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: we're using mostly SNAKE_CASE for constants

Comment on lines +61 to +68
if (this.messageCache.has(pubsubTopic, wakuMessage as IProtoMessage)) {
log.info(
`Skipping duplicate message for pubsubTopic:${pubsubTopic} peerId:${peerIdStr}`
);
return;
}

this.messageCache.set(pubsubTopic, wakuMessage as IProtoMessage);
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: we can move this to a private function

type Timestamp = number;

export class MessageCache {
private intervalID: number | undefined = undefined;
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit:

Suggested change
private intervalID: number | undefined = undefined;
private intervalId: number | undefined = undefined;

Comment on lines +71 to +73
log.info(
`requestRenew: Renewed peer ${peerId.toString()} to ${newPeer.id.toString()}`
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we provide a potential reason of why this could've failed?
Possibly no peers available to renew with?

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