waku-org / js-waku

JavaScript implementation of Waku v2
https://js.waku.org
Apache License 2.0
162 stars 41 forks source link

fix: filter for wss in libp2p websocket transport #1989

Closed adklempner closed 2 months ago

adklempner commented 2 months ago

Problem

Current libp2p transport filter allows all connections. This is fine for testing, but in production we want to limit transports to secure WebSockets (wss or tls/ws).

Solution

Allow all transport types when running tests by setting `process.env.NODE_ENV=test` but otherwise use the libp2p filter for secure websockets peers ## Notes

Contribution checklist:

github-actions[bot] commented 2 months ago

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
Waku node 181.21 KB (-0.01% 🔽) 3.7 s (-0.01% 🔽) 21.6 s (-0.07% 🔽) 25.3 s
Waku Simple Light Node 181.21 KB (-0.06% 🔽) 3.7 s (-0.06% 🔽) 18.1 s (-34.75% 🔽) 21.7 s
ECIES encryption 23.08 KB (0%) 462 ms (0%) 7.6 s (-18.92% 🔽) 8 s
Symmetric encryption 22.55 KB (0%) 452 ms (0%) 5.6 s (-25.74% 🔽) 6.1 s
DNS discovery 72.42 KB (0%) 1.5 s (0%) 15.1 s (-25.88% 🔽) 16.6 s
Peer Exchange discovery 74.1 KB (0%) 1.5 s (0%) 11.7 s (+11.62% 🔺) 13.2 s
Local Peer Cache Discovery 67.64 KB (0%) 1.4 s (0%) 11.5 s (-6.51% 🔽) 12.8 s
Privacy preserving protocols 38.87 KB (0%) 778 ms (0%) 11.1 s (+55.2% 🔺) 11.8 s
Waku Filter 111.79 KB (0%) 2.3 s (0%) 15.4 s (+2.39% 🔺) 17.6 s
Waku LightPush 110.15 KB (0%) 2.3 s (0%) 9 s (-55.85% 🔽) 11.2 s
History retrieval protocols 110.74 KB (0%) 2.3 s (0%) 13.9 s (-35.64% 🔽) 16.1 s
Deterministic Message Hashing 7.25 KB (0%) 145 ms (0%) 2.2 s (+19.82% 🔺) 2.3 s