Skip to content

Commit 7890a2f

Browse files
committed
address review comments
1 parent e14f76c commit 7890a2f

File tree

1 file changed

+41
-34
lines changed

1 file changed

+41
-34
lines changed

standards/core/rendezvous.md

Lines changed: 41 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ It supplements Discovery v5 and Waku peer exchange.
1515

1616
## Background and Rationale
1717

18-
Waku nodes need a discovery mechanism that is both rapid and robust against attacks. Rendezvous enables quick identification of relevant peers, complementing slower but more resilient approaches like Discv5. For healthy network participation, nodes must connect to a diverse set of peers. However, the rendezvous protocol is vulnerable to denial of service attacks and depends on centralized rendezvous points, so it is best used in conjunction with other discovery methods such as Discv5.
19-
20-
Ethereum Node Record (ENR) size constraints make it impractical to encode additional metadata, such as Mix public keys, in ENRs for Discv5-based discovery. Rendezvous, using a custom peer record (`WakuPeerRecord`), allows nodes to advertise Mix-specific information—including the Mix public key—without being restricted by ENR size. This serves as an interim solution until a comprehensive capability discovery mechanism is available.
18+
Waku needs discovery mechanism(s) that are both rapid and robust against attacks.
19+
Fully centralised discovery (such as DNS lookup) may be fast but is not secure.
20+
Fully decentralised discovery (such as discv5) may be robust, but too slow for some bootstrapping use cases
21+
Rendezvous provides a limited, balanced solution that trades off some robustness for speed.
22+
It's meant to complement not replaced fully decentralised discovery mechanisms, like discv5
2123

2224
By combining rendezvous with
2325
[Discv5](https://github.com/ethereum/devp2p/blob/master/discv5/discv5.md#node-discovery-protocol-v5) and
@@ -34,9 +36,41 @@ This allows nodes to advertise additional Waku-specific metadata beyond what is
3436

3537
**Libp2p Protocol identifier**: `/vac/waku/rendezvous/1.0.0`
3638

39+
### Wire Protocol
40+
41+
Nodes advertise their information through `WakuPeerRecord`, a custom peer record structure designed for Waku rendezvous.
42+
Since this is a customPeerRecord, we define a private multicodec value of `0x300000` as per [multicodec table](https://github.com/multiformats/multicodec/blob/master/table.csv).
43+
The `WakuPeerRecord` is defined as follows:
44+
45+
**WakuPeerRecord fields:**
46+
47+
- `peer_id`: The libp2p PeerId of the node.
48+
- `seqNo`: The time at which the record was created or last updated (Unix epoch, seconds).
49+
- `multiaddrs`: A list of multiaddresses for connectivity.
50+
- `mix_public_key`: The Mix protocol public key (only present for nodes supporting Mix).
51+
52+
**Encoding:**
53+
WakuPeerRecord is encoded as a protobuf message. The exact schema is:
54+
55+
```protobuf
56+
message WakuPeerRecord {
57+
string peer_id = 1;
58+
uint64 seqNo = 2;
59+
repeated string multiaddrs = 3;
60+
optional bytes mix_public_key = 4;
61+
}
62+
```
63+
64+
When a node discovers peers through rendezvous, it receives the complete `WakuPeerRecord` for each peer, allowing it to make informed decisions about which peers to connect to based on their advertised information.
65+
3766
### Namespace Format
3867

39-
The namespaces used to register and request MUST be in the format `rs/<cluster-id>/<capability>`.
68+
The [rendezvous namespaces](https://github.com/libp2p/specs/blob/69c4fdf5da3a07d2f392df6a892c07256c1885c0/rendezvous/README.md#the-protocol) used to register and request peer records
69+
MUST be in the format `rs/<cluster-id>/<capability>`.
70+
`<capability>` is a string representing the individual capability for which a discoverable Waku peer record is registered.
71+
The Waku peer record is separately registered against each capability for which discovery is desired.
72+
The only defined capability for now is `mix`, representing [Waku Mix](https://github.com/waku-org/specs/blob/master/standards/core/mix.md) support.
73+
For example, a Waku peer record for a node supporting mix protocol in cluster `1` will be registered against a namespace: `rs/1/mix`.
4074

4175
This allows for discovering peers with specific capabilities within a given cluster.
4276
Currently, this is used for Mix protocol discovery where the capability field specifies `mix`.
@@ -49,11 +83,11 @@ Every [Waku Relay](https://github.com/vacp2p/rfc-index/blob/main/waku/standards/
4983

5084
Each relay node that participates in discovery
5185
MUST register with random rendezvous points at regular intervals.
52-
53-
All relay nodes participating in rendezvous discovery SHOULD advertise their information using `WakuPeerRecord`. For nodes supporting the Mix protocol, the `mix_public_key` field MUST be included. For non-Mix relay nodes, the `mix_public_key` field SHOULD be omitted. The standard libp2p PeerRecord is not used for Waku rendezvous; all advertised records MUST conform to the `WakuPeerRecord` definition.
54-
5586
The RECOMMENDED registration interval is 10 seconds.
5687

88+
All relay nodes participating in rendezvous discovery SHOULD advertise their information using `WakuPeerRecord`. For nodes supporting the Mix protocol, the `mix_public_key` field MUST be included.
89+
All advertised records MUST conform to the `WakuPeerRecord` definition.
90+
5791
It is RECOMMENDED that rendezvous points expire registrations after 1 minute (60 seconds TTL)
5892
to keep discovered peer records limited to those recently online.
5993

@@ -64,33 +98,6 @@ It is RECOMMENDED a maximum of 12 peers be requested each time.
6498
This number is sufficient for good GossipSub connectivity and
6599
minimizes the load on rendezvous points.
66100

67-
### Peer Records
68-
69-
Nodes advertise their information through `WakuPeerRecord`, a custom peer record structure designed for Waku rendezvous.
70-
Since this is a customPeerRecord, it uses a private multicodec value of `0x300000` as per [multicodec table](https://github.com/multiformats/multicodec/blob/master/table.csv).
71-
The `WakuPeerRecord` is defined as follows:
72-
73-
**WakuPeerRecord fields:**
74-
75-
- `peer_id`: The libp2p PeerId of the node.
76-
- `seqNo`: The time at which the record was created or last updated (Unix epoch, seconds).
77-
- `multiaddrs`: A list of multiaddresses for connectivity.
78-
- `mix_public_key`: The Mix protocol public key (only present for nodes supporting Mix).
79-
80-
**Encoding:**
81-
WakuPeerRecord is encoded as a protobuf message. The exact schema is:
82-
83-
```protobuf
84-
message WakuPeerRecord {
85-
string peer_id = 1;
86-
uint64 seqNo = 2;
87-
repeated string multiaddrs = 3;
88-
optional bytes mix_public_key = 4;
89-
}
90-
```
91-
92-
When a node discovers peers through rendezvous, it receives the complete `WakuPeerRecord` for each peer, allowing it to make informed decisions about which peers to connect to based on their advertised information.
93-
94101
### Operational Recommendations
95102

96103
It is RECOMMENDED that bootstrap nodes participate in rendezvous discovery and

0 commit comments

Comments
 (0)