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

Waku Network Testing #2

Open
6 tasks
jm-clius opened this issue Oct 26, 2022 · 6 comments
Open
6 tasks

Waku Network Testing #2

jm-clius opened this issue Oct 26, 2022 · 6 comments

Comments

@jm-clius
Copy link

Background

Waku network simulation and testing is done in collaboration with Kurtosis and uses their distributed network manipulation tools. The main aim of network testing is twofold:

  • benchmark Waku performance as it scales
  • test Waku network robustness against adverse and difficult network conditions

The side effect is the creation of an integrated, multi-client simulation environment that can be used for regular integration testing, regression checks, network experiments, etc.

This issue tracks the main simulation scenarios we want to create and desirable outputs/metrics.

NOTE: This issue is WIP and will be adapted as more requirements from platforms materialise and as we familiarise ourselves with Kurtosis features.

First network test: relay scalability and familiarising ourselves with Kurtosis tools

The rough idea for a first test comes from this forum thread. It asks at least two questions about the simplest possible network setup, running only the main routing protocol (relay) and using only the nwaku client:

  1. at exactly what messaging load performance, latency and reliability starts to degrade or fall below an acceptable threshold
  2. at what network sizes performance, latency and reliability starts to degrade or fall below an acceptable threshold

Other metrics (such as node resource consumption - CPU, bandwidth and memory usage) should form part of the experimental output data.

Setup

Run a relay network with x amount of nwaku nodes using discv5 to establish a well-connected mesh (afaik this approximates a typical Communities setup on Desktop clients).
Publish (from a random subset of nodes) messages of size s at a rate r.

Measure

Varying x, s and r, measure:

  • message delivery reliability
  • message delivery latency

To measure reliability we can add a simple seq counter to the message payload. Latency can already be measured using the sender timestamp field.

Laundry list of scenarios we want to build

The scenario above proposes a way to get started with Kurtosis for network testing. The list below, captures more clearly the type of outputs that we want from network testing in the longer term:

  • on top of relay, also testing store, filter, lightpush at scale
  • integrated network consisting of go-waku, js-waku and nwaku nodes
  • on top of discv5, alternative discovery methods such as waku peer exchange
  • simulate network latency
  • simulate % of node churn (nodes going online/offline)
  • include browser, iOS, Android nodes in simulation

It would be useful to come up with a set of automated e2e tests that can regularly run against an integrated simulated environment to detect regressions and performance issue early.

@jm-clius
Copy link
Author

Issue copied over from vacp2p/research#142

@jm-clius
Copy link
Author

Original comment from @fryorcraken:


The side effect is the creation of an integrated, multi-client simulation environment that can be used for regular integration testing, regression checks, network experiments, etc.

I would call it a phase 2 more than a side effect.

I agree that priority is on multi-client scalability of Waku, followed by extracting performance metrics.

Phase 2 tests

What we would also like to have mid-term.

Non-regression testing: delta analysis

What we also need is various non-regression tests when (before) releasing new software. Where we do a run and compare with a previous run:

  1. Metrics: Extract response times, CPU Usage, etc (see metrics laundry list above). Any performance degradation? If so, investigate. If performance improvement, good to note and highlight.
  2. Errors: Check logs across all clients, any errors returned? Any new errors returned?

Multi-client functional testing

What we also need is a multi-client non-regression functional testing. ie, suite of functional tests that demonstrate cross client compatibility of several protocols. Similar to what is done in js-waku CI: [1] [2].

Does this fall under the Kurtosis umbrella?

@jm-clius
Copy link
Author

Original comment from @fryorcraken:


Regarding phase 1, proving scalability. I suggest we focus on the Status client use case at first which enables to cover a good number of scenarios.
This would also help us focus on answering questions relevant to a specific use cases and have some idea on what should be the scales of x, s and r.

We can structure the tests around answering this question: Can the Waku network onboard 10 million users?

We can start progressively by dialing n: 1,000, 10,000, 1mil, 10mil users.
We can also identify a cap for a simulated environment and extrapolate from there (.e.g. maybe 10,000 is the max we can do with Kurtosis?).

We can start with topology similar to the expected one from Status clients:

  • go-waku nodes (mobile using filter/light push/store tcp transport and desktop using relay, providing store)
  • js-waku nodes (web using filter/light push/store websockets)
  • nwaku as service node (including store).

Where # of go-waku nodes + # of js-waku nodes = n

From this simulation, we can extract/extrapolate:

  • How many nwaku (service node) do we need to run to service n users.
  • What performances (connection response times, messages propagation, etc) are we getting?

@corpetty
Copy link

corpetty commented Dec 1, 2022

I've created a section in the Nomos tech roadmap that also details this work and tracks things, which can be viewed here.

You'll also find a document that I started to map out the detail the explicit differences between Status clients (Agents) w.r.t. what protocols they implement and their associated Waku messaging on the network. This is so that we can more realistically simulate the Status network during these tests. This WIP document can be found in the first link of the previously mentioned roadmap document.

@alrevuelta
Copy link
Collaborator

As a starting point to get started with Kurtosis and close the knowledge gap, @AlbertoSoutullo is willing to provide a set of configuration files to launch a simple simulation where:

  • A set of x nwaku nodes are deployed
  • Nodes can be configured via CLI arguments
  • We can interact with them via the RPC api (eg send a message)
  • Ideally, monitor the metrics of each node in an aggregated dashboard (this is not ready and has to be developed)

The main goal is to use this simple setup as a starting point and the build on top to eventually end up with the First network test described here.

cc @LNSD @Daimakaimura

Ref: https://github.com/logos-co/wakurtosis

@alrevuelta
Copy link
Collaborator

As a continuation of my latest comment and as per the discussions with @AlbertoSoutullo @Daimakaimura, we have broken down into lower level requirements/tasks the First Network Test and its progress can be tracked here: vacp2p/wakurtosis#7

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

No branches or pull requests

3 participants