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: enable back filterAll if set by consumer #2103

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

weboko
Copy link
Collaborator

@weboko weboko commented Aug 20, 2024

Problem

In #1989 we made it so fitlerAll is applied only in tests.
Reasoning for it was that in running dogfooding apps we were seeing a lot of errors and we wanted to prevent light node trying to establish a connection that will definitely fail.

But it prevents local development with js-waku so that locally run nodes or nodes run under IP - are ignored and connection is not established or event attempted.

Solution

Add fitlerMultiaddrs flag to libp2p configuration so that is it is set to false - then such behavior is off.

Notes

@weboko weboko requested a review from a team as a code owner August 20, 2024 22:47
Copy link

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
Waku node 86.6 KB (0%) 1.8 s (0%) 1.8 s (+81.04% 🔺) 3.5 s
Waku Simple Light Node 154.1 KB (-0.07% 🔽) 3.1 s (-0.07% 🔽) 2.6 s (+101.52% 🔺) 5.7 s
ECIES encryption 22.83 KB (0%) 457 ms (0%) 873 ms (+58.63% 🔺) 1.4 s
Symmetric encryption 22.33 KB (0%) 447 ms (0%) 855 ms (+125.18% 🔺) 1.4 s
DNS discovery 72.26 KB (0%) 1.5 s (0%) 1.8 s (+132.8% 🔺) 3.3 s
Peer Exchange discovery 73.79 KB (0%) 1.5 s (0%) 2 s (-1.86% 🔽) 3.5 s
Local Peer Cache Discovery 67.57 KB (0%) 1.4 s (0%) 1.3 s (-15.35% 🔽) 2.7 s
Privacy preserving protocols 38.92 KB (0%) 779 ms (0%) 875 ms (+26.26% 🔺) 1.7 s
Waku Filter 81 KB (0%) 1.7 s (0%) 1.9 s (+68.83% 🔺) 3.5 s
Waku LightPush 78.6 KB (0%) 1.6 s (0%) 1.1 s (-25.54% 🔽) 2.7 s
History retrieval protocols 79.03 KB (0%) 1.6 s (0%) 2 s (+69.37% 🔺) 3.6 s
Deterministic Message Hashing 7.31 KB (0%) 147 ms (0%) 192 ms (+22.74% 🔺) 338 ms

* Applies secure web socket filters.
* @default true
*/
filterMultiaddrs?: boolean;
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
filterMultiaddrs?: boolean;
onlyWssMultiaddrs?: boolean;

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I would stick to libp2p terminology with filters as we might apply other filtration in future. Not sure tbh

@weboko weboko merged commit 2beb359 into master Aug 22, 2024
14 of 15 checks passed
@weboko weboko deleted the weboko/enable-filter-ws branch August 22, 2024 13:55
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