js-waku icon indicating copy to clipboard operation
js-waku copied to clipboard

[Epic] Waku Relay scalability in the Browser

Open fryorcraken opened this issue 1 year ago • 5 comments

Problem

See https://forum.vac.dev/t/waku-v2-scalability-studies/142/9?u=fryorcraken for original post

tl;dr:

  1. Browser nodes do not connect to each other with the currently available transport protocols (tcp, websocket).
  2. Browser nodes do not advertise themselves via the currently available discovery protocols (static list, DNS Discovery, discv5).
  3. If browser nodes were to advertise themselves, because of the ephemeral nature of a browser tab being opened, they would likely to poorly contribute to the Waku Relay network.

Proposed Solutions

0. Make Relay Production Ready

  • [ ] https://github.com/waku-org/js-waku-examples/issues/199
  • [ ] #1349

1. Enable browser to browser connection

  • [ ] browser-to-browser connection using WebRTC:
    • [x] https://github.com/status-im/js-waku/issues/20
    • [ ] ~https://github.com/status-im/js-waku/issues/681~
    • [ ] #1181
  • [ ] browser-to-node connection using WebTransport?

Ref https://github.com/libp2p/specs/issues/220

2. Peer Exchange "Push"

Once browser-to-browser connection is possible, then browser need to advertise themselves in way that works for short live nodes.

  • [x] Peer exchange push RFC
  • [x] Implement it #910
  • [ ] More dogfooding #1309

3. Waku Browser Extension

  • [ ] Scope and create a PoC that uses browser-to-browser connection
  • [ ] Scope and create a PoC that uses a local/user control service node to access the Waku network

Notes:

  • usage of the extension should be pseudo-transparent to the developer
  • Waku apps with a browser such as Status could provide an interface equivalent to the extension

fryorcraken avatar Aug 25 '22 05:08 fryorcraken

Weekly update

  • achieved: draft of direct browser-browser RTC example https://github.com/waku-org/js-waku-examples/pull/260
  • next: improve the example (connection re-usage), work on contentTopic based RTC example

weboko avatar Aug 07 '23 09:08 weboko

Need to review this:

  1. new transport protocols (webrtc browser<>server, webtransport) are likely to be used for Waku scalability in general so that browser nodes can connect to status desktop nodes
  2. relay in the browser is more for a privacy focused item, probably better handled in 2024. It is also a very watched/requested topic, so it could somehow fall under making js-waku relevant for the projects using it

For now, let's continue on the current work wich aims to chip a PoC that run Waku Relay over WebRTC to other node. Once done, we can review the work we want to do this year.

fryorcraken avatar Aug 09 '23 04:08 fryorcraken

Weekly update:

  • achieved: complete PoC of Waku Relay over WebRTC using circuit relay
  • next: pause this to prioritize Waku Network milestone

weboko avatar Sep 04 '23 09:09 weboko

As a part of this epic, we should also track work around looking into implementing other more reliable NAT traversal techniques by libp2p like:

  • autonat (https://github.com/libp2p/specs/tree/master/autonat)
  • circuit-relay v2 (https://github.com/libp2p/specs/blob/master/relay/circuit-v2.md)

Both of these have support for js-libp2p in browser and might help with NAT traversal, along with WebRTC

danisharora099 avatar Sep 06 '23 07:09 danisharora099

Icebox'd, see https://github.com/waku-org/pm/issues/50#issuecomment-1778451567

fryorcraken avatar Oct 27 '23 05:10 fryorcraken