waku-org / js-waku

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

feat: use `yamux` instead of `mplex` #1894

Open danisharora099 opened 6 months ago

danisharora099 commented 6 months ago

Problem

From libp2p docs:

Yamux natively supports flow control, it is better suited for applications that require the transfer of large amounts of data. Until recently, the reason mplex was still supported was compatibility with js-libp2p, which didn’t have yamux support. Now that js-libp2p has gained yamux support, mplex should only be used to provide backward-compatibility with legacy nodes.

Solution

Use yamux instead of mplex

Notes

Contribution checklist:

github-actions[bot] commented 6 months ago

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
Waku node 186.85 KB (+0.89% 🔺) 3.8 s (+0.89% 🔺) 2.8 s (+24.33% 🔺) 6.5 s
Waku Simple Light Node 186.91 KB (+0.81% 🔺) 3.8 s (+0.81% 🔺) 2.2 s (+3.1% 🔺) 5.9 s
ECIES encryption 22.88 KB (0%) 458 ms (0%) 935 ms (+51.07% 🔺) 1.4 s
Symmetric encryption 22.42 KB (0%) 449 ms (0%) 826 ms (+46.41% 🔺) 1.3 s
DNS discovery 73.67 KB (0%) 1.5 s (0%) 1.7 s (+23.46% 🔺) 3.1 s
Peer Exchange discovery 75.25 KB (0%) 1.6 s (0%) 1.7 s (+80.17% 🔺) 3.2 s
Local Peer Cache Discovery 68.99 KB (0%) 1.4 s (0%) 2.5 s (+65.34% 🔺) 3.8 s
Privacy preserving protocols 39.97 KB (0%) 800 ms (0%) 1.2 s (+26.67% 🔺) 2 s
Waku Filter 20.13 KB (0%) 403 ms (0%) 569 ms (+12.81% 🔺) 972 ms
Waku LightPush 115.4 KB (-0.09% 🔽) 2.4 s (-0.09% 🔽) 2 s (+12.81% 🔺) 4.3 s
History retrieval protocols 19.32 KB (0%) 387 ms (0%) 716 ms (+54.69% 🔺) 1.2 s
Deterministic Message Hashing 4.96 KB (0%) 100 ms (0%) 158 ms (+2.08% 🔺) 257 ms
danisharora099 commented 5 months ago

pfft, a failing test node run took 152minutes. moving to draft while these errors are investigated