vac.dev/_posts/2020-02-10-waku-current-sta...

139 lines
5.3 KiB
Markdown
Raw Normal View History

2020-02-10 05:51:16 +00:00
---
layout: post
name: "Waku current state"
title: "Waku current state"
date: 2020-02-10 12:00:00 +0800
author: oskarth
published: false
permalink: /waku-current-state
categories: research
summary: A research log. Waku current state.
image: /assets/img/TODOFIXME.png
discuss: https://forum.vac.dev/t/TODOFIXME
---
2020-02-12 05:00:18 +00:00
TODO: Picture for bottleneck or Waku
2020-02-10 05:51:16 +00:00
# Where we are at with Waku?
Waku is our fork of Whisper where we address the shortcomings of Whisper in an iterative manner. We've seen in previous post that Whisper doesn't scale, and why. Here's an update on where we are at with Waku since that [last post](https://vac.dev/fixing-whisper-with-waku).
## Current state
**Specs:**
2020-02-12 04:45:50 +00:00
We've cut the spec up into three components. These are:
2020-02-10 05:51:16 +00:00
2020-02-12 04:45:50 +00:00
- Waku (main spec), currently in [version 0.2.0](https://specs.vac.dev/waku/waku.html)
- Waku envelope data field, currently in [version 0.1.0](https://specs.vac.dev/waku/envelope-data-format.html)
- Waku mailserver, currently in [version 0.2.0](https://specs.vac.dev/waku/mailserver.html)
TODO: Update Waku spec to 0.3
2020-02-10 05:51:16 +00:00
**Clients:**
2020-02-12 04:45:50 +00:00
There are currently two clients that implement Waku, these are [Nimbus](https://github.com/status-im/nimbus/tree/master/waku) in Nim and [status-go](https://github.com/status-im/status-go) in Go.
2020-02-10 05:51:16 +00:00
2020-02-12 04:45:50 +00:00
At the time of this writing the Nimbus client implements the spec fully, but lacks mail server and mail client capability. The status-go client implements everything except bridging mode, which is currently a work in progress.
2020-02-10 05:51:16 +00:00
2020-02-12 04:45:50 +00:00
For more details, see [implementation matrix](https://specs.vac.dev/waku/waku.html#appendix-b-implementation-notes).
In terms of end user applications, work is currently in progress to integrate it into the [Status core app](https://github.com/status-im/status-react/pull/9949) and is expected to be released in their upcoming 1.1 release.
2020-02-10 05:51:16 +00:00
2020-02-12 04:45:50 +00:00
TODO: Fact check this with Adam and Kim
**Simulation:**
2020-02-10 05:51:16 +00:00
2020-02-12 04:45:50 +00:00
We've got a [simulation](https://github.com/status-im/nimbus/tree/master/waku#testing-waku-protocol) in the Nimbus client that verifies - or rather, fails to falsify - the scalability model posted in an [earlier post](https://vac.dev/fixing-whisper-with-waku). More on this below.
2020-02-10 05:51:16 +00:00
## How many users does Waku support?
2020-02-12 05:00:18 +00:00
This is our current understanding of how many users a network running the Waku protocol can support. Specifically in the context of the Status chat app, since that's the most immediate consumer of Waku. It should generalize fairly well to most deployments, but YMMW.
**tldr (for Status app):**
- beta: 100 DAU
- v1: 1k DAU
- v1.1 (waku only): 10k DAU (up to x10 with deployment hotfixes)
- v1.2 (waku+dns): 100k DAU (can optionally be folded into v1.1)
*Assuming 10 concurrent users = 100 DAU. Estimate uncertainty increases for each order of magnitude until real-world data is observed.*
As far as we know right now, there is one immediate bottleneck, a very likely bottleneck after that, and a third bottleneck that is still conjecture but not unlikely to appear. These are:
- Bottleneck 1 - Receive bandwidth for end user clients (aka Fixing Whisper with Waku)
- Bottleneck 2 - Nodes and cluster capacity (aka DNS based node discovery)
- Bottleneck 3 - Full node traffic (aka the routing / partition problem)
We've already seen the first bottleneck being discussed in the initial post. Dean wrote a post on [DNS based discovery](https://vac.dev/dns-based-discovery) which explains how we will address the likely second bottleneck. More on the third one in future posts.
For more details on these bottlenecks, uncertainty and mitigations, see [Scalability estimate: How many users can Waku and the Status app support?](https://discuss.status.im/t/scalability-estimate-how-many-users-can-waku-and-the-status-app-support/1514).
2020-02-10 05:51:16 +00:00
2020-02-12 05:00:18 +00:00
TODO: Elaborate on bottleneck 3, kad etc
2020-02-10 05:51:16 +00:00
2020-02-12 05:00:18 +00:00
## Simulation
2020-02-10 05:51:16 +00:00
2020-02-12 05:00:18 +00:00
The ultimate test is real-world usage. Until then, we have a simulation. Here's some data on this.
2020-02-10 05:51:16 +00:00
2020-02-12 05:00:18 +00:00
TODO: Insert picture
2020-02-10 05:51:16 +00:00
- Simulations
-- include data numbers (below raw data)
- Obvious test is real world
```
> ./build/start_network --topology:Star --amount:6 --test-node-peers:2
Send 10k random envelopes over random topics
Star simulation:
confirm invlaid
master node: connected peers 7 - 10001 / 0
full node 1: connected peers 3 - 10001 / 0
full node 2: connected peers 1 - 10001 / 0
full node 3: connected peers 1 - 10001 / 0
full node 4: connected peers 1 - 10001 / 0
full node 5: connected peers 1 - 10001 / 0
light node 1: connected peers 2 - 815 / 0 (next run 1094)
waku light node 1: connected peers 2 - 1 / 0
- Why 10001?
- Which bloom filter used exactly?
- Why invalid envelopes 815 and 1 respectively for light/waku nodes, and nothing for other full nodes?
Ok think I got, also roughly ~100 1%
- what precise bloom filter used?
Full mesh:
peers / valid envelopes / invalid
full node 0: connected peers 7 - 10001 / 20676
full node 1: connected peers 7 - 10001 / 9554
full node 2: connected peers 5 - 10001 / 23304
full node 3: connected peers 5 - 10001 / 11983
full node 4: connected peers 5 - 10001 / 24425
full node 5: connected peers 5 - 10001 / 23472
light node 1: connected peers 2 - 803 / 803
waku light node 1: connected peers 2 - 1 / 1
```
## Difference between Waku and Whisper
XXX: Add this in section above or here? In-line? How much emphasize?
Highlight spec and stuff
## Next steps and future plans
- Kad routing etc
- Roadmap
- Better spam proof and incentive
-> Future posts