# 29/WAKU2-CONFIG | Vac Research
- Status: draft

Skip to main content

# 29/WAKU2-CONFIG

- Status: draft
- Editor: Hanno Cornelius <hanno@status.im>
- Contributors:
  - Filip Dimitrijevic <filip@status.im>

`29/WAKU2-CONFIG` describes the RECOMMENDED values to assign to configurable parameters for Waku v2 clients. Since Waku v2 is built on libp2p, most of the parameters and reasonable defaults are derived from there.

Waku v2 relay messaging is specified in `11/WAKU2-RELAY`, a minor extension of the libp2p GossipSub protocol. GossipSub behaviour is controlled by a series of adjustable parameters. Waku v2 clients SHOULD configure these parameters to the recommended values below.

## GossipSub v1.0 parameters​

GossipSub v1.0 parameters are defined in the corresponding libp2p specification. We repeat them here with RECOMMMENDED values for `11/WAKU2-RELAY` implementations.

Parameter | Purpose | RECOMMENDED value
--- | --- | ---
`D` | The desired outbound degree of the network | 6
`D_low` | Lower bound for outbound degree | 4
`D_high` | Upper bound for outbound degree | 8
`D_lazy` | (Optional) the outbound degree for gossip emission | `D`
`heartbeat_interval` | Time between heartbeats | 1 second
`fanout_ttl` | Time-to-live for each topic's fanout state | 60 seconds
`mcache_len` | Number of history windows in message cache | 5
`mcache_gossip` | Number of history windows to use when emitting gossip | 3
`seen_ttl` | Expiry time for cache of seen message ids | 2 minutes

## GossipSub v1.1 parameters​

GossipSub v1.1 extended GossipSub v1.0 and introduced several new parameters. We repeat the global parameters here with RECOMMMENDED values for `11/WAKU2-RELAY` implementations.

Parameter | Description | RECOMMENDED value
--- | --- | ---
`PruneBackoff` | Time after pruning a mesh peer before we consider grafting them again. | 1 minute
`FloodPublish` | Whether to enable flood publishing | true
`GossipFactor` | % of peers to send gossip to, if we have more than `D_lazy` available | 0.25
`D_score` | Number of peers to retain by score when pruning from oversubscription | `D_low`
`D_out` | Number of outbound connections to keep in the mesh. | `D_low` - 1

`11/WAKU2-RELAY` clients SHOULD implement a peer scoring mechanism with the parameter constraints as specified by libp2p.

## Other configuration​

The following behavioural parameters are not specified by `libp2p`, but nevertheless describes constraints that `11/WAKU2-RELAY` clients MAY choose to implement.

Parameter | Description | RECOMMENDED value
--- | --- | ---
`BackoffSlackTime` | Slack time to add to prune backoff before attempting to graft again | 2 seconds
`IWantPeerBudget` | Maximum number of IWANT messages to accept from a peer within a heartbeat | 25
`IHavePeerBudget` | Maximum number of IHAVE messages to accept from a peer within a heartbeat | 10
`IHaveMaxLength` | Maximum number of messages to include in an IHAVE message | 5000

## Copyright​

Copyright and related rights waived via CC0.

## References​

- libp2p
- 11/WAKU2-RELAY
- libp2p GossipSub protocol
- corresponding libp2p specification
- several new parameters