specs/standards/core/rendezvous.md

75 lines
3.4 KiB
Markdown
Raw Normal View History

2024-08-13 10:47:55 -04:00
---
title: WAKU-RENDEZVOUS
2024-10-22 10:50:34 -04:00
name: Waku Rendezvous discovery
2024-08-13 10:47:55 -04:00
editor: Simon-Pierre Vivier <simvivier@status.im>
contributors:
---
## Abstract
2024-10-22 10:50:34 -04:00
This document describes the goal,
2024-08-13 10:47:55 -04:00
strategy and usage of the libp2p rendezvous protocol by Waku.
2024-10-22 10:50:34 -04:00
Rendezvous is one of the discovery methods that can be used by Waku.
It supplements Discovery v5 and Waku peer exchange.
2024-08-13 10:47:55 -04:00
2024-08-29 17:14:31 -04:00
## Background and Rationale
2024-08-13 10:47:55 -04:00
How do new nodes join the network is the question that discovery answers.
Discovery must be fast, pertinent and resilient to attacks.
Rendezvous is both fast and allow the discovery of relevant peers,
2024-10-22 10:50:34 -04:00
although it design can be easily abused
due to it's lack of protection against denial of service atacks.
2024-08-13 10:47:55 -04:00
The properties of rendezvous complements well the slower but safer methods like Discv5.
2024-10-22 10:50:34 -04:00
To contribute well, a Waku node must know a sufficient number of peers with
2024-08-13 10:47:55 -04:00
a wide variety of capabilities.
By using rendezvous in combination with
[Discv5](https://github.com/ethereum/devp2p/blob/master/discv5/discv5.md#node-discovery-protocol-v5) and
2024-12-03 08:32:55 -05:00
[34/WAKU2-PEER-EXCHANGE](https://github.com/vacp2p/rfc-index/blob/main/waku/standards/core/34/peer-exchange.md#abstract),
2024-08-13 10:47:55 -04:00
Waku nodes will reach a good number of meaningful peers
faster than through a single discovery method.
2024-08-29 17:14:31 -04:00
## Semantics
2024-10-22 10:50:34 -04:00
Waku rendezvous fully inherits the [libp2p rendezvous semantics](https://github.com/libp2p/specs/blob/master/rendezvous/README.md#rendezvous-protocol).
2024-08-13 10:47:55 -04:00
2024-08-29 17:14:31 -04:00
## Specifications
2024-10-22 10:50:34 -04:00
The namespaces used to register and request MUST be in the format `rs/cluster-id/shard`.
Refer to [RELAY-SHARDING](https://github.com/waku-org/specs/blob/master/standards/core/relay-sharding.md) for cluster and shard information.
2024-08-14 11:24:52 -04:00
2024-10-22 10:50:34 -04:00
Every [Waku Relay](https://github.com/vacp2p/rfc-index/blob/main/waku/standards/core/11/relay.md) node SHOULD be initialized as a rendezvous point.
2024-08-29 17:14:31 -04:00
2024-10-22 10:50:34 -04:00
Each relay node that participates in discovery
MUST register with random rendezvous points at regular intervals.
2024-08-29 17:14:31 -04:00
2024-10-22 10:50:34 -04:00
We RECOMMEND a registration interval of 10 seconds.
The node SHOULD register once for every shard it supports,
registering only the namespace corresponding to that shard.
We RECOMMEND that rendezvous points expire registrations after 1 minute,
in order to keep discovered peer records to those recentrly online.
At startup, every Waku node SHOULD discover peers by
sending requests to random rendezvous points,
2024-08-29 17:14:31 -04:00
once for each shard it supports.
2024-08-13 10:47:55 -04:00
2024-10-22 10:50:34 -04:00
We RECOMMEND a maximum of 12 peers will be requested each time.
2024-08-13 10:47:55 -04:00
This number is enough for good GossipSub connectivity and
minimize the load on rendezvous points.
2024-10-22 10:50:34 -04:00
We RECOMMEND that bootstrap nodes participate in rendezvous discovery and
that other discovery methods are used in conjunction and
continue discovering peers for the lifetime of the local node.
2024-08-13 10:47:55 -04:00
2024-08-14 11:24:52 -04:00
## Future Work
2024-08-13 10:47:55 -04:00
2024-08-14 11:24:52 -04:00
Namespaces will not contain capabilities yet but may in the future. If the need arise nodes could use rendezvous to discover peers with specific capabilities.
2024-09-04 11:16:29 -04:00
# Copyright
Copyright and related rights waived via
[CC0](https://creativecommons.org/publicdomain/zero/1.0/).
# References
- [Discv5](https://github.com/ethereum/devp2p/blob/master/discv5/discv5.md#node-discovery-protocol-v5)
2024-12-03 08:32:55 -05:00
- [34/WAKU2-PEER-EXCHANGE](https://github.com/vacp2p/rfc-index/blob/main/waku/standards/core/34/peer-exchange.md#abstract)
2024-09-04 11:16:29 -04:00
- [Libp2p Rendezvous](https://github.com/libp2p/specs/blob/master/rendezvous/README.md#rendezvous-protocol)
2024-12-03 08:09:37 -05:00
- [Relay](https://github.com/vacp2p/rfc-index/blob/main/waku/standards/core/11/relay.md)