rendezvous/: Clarify UNREGISTER behaviour and remove id (#348)

* Remove `id` field from `Unregister` message

All connections in libp2p are authenticated. As such, we don't have
to include the PeerId in the `Unregister` message. We only allow
peers to unregister themselves and therefore, this `id` would always
be equal to the one we are learn from the authentication layer. Having
to compare those and ensure they are equal is an unnecessary error
path.

To be backwards-compatible with existing deployments of the rendezvous
protocol, the field is only commented out. If this record ever gets
extended, the next field should use id `3`.

* Clarify absence of `UNREGISTER` response
This commit is contained in:
Thomas Eizinger
2021-07-22 20:00:27 +10:00
committed by GitHub
parent 99a43197d7
commit da57d78c48

View File

@@ -2,7 +2,7 @@
| Lifecycle Stage | Maturity | Status | Latest Revision |
|-----------------|---------------|--------|-----------------|
| 1A | Working Draft | Active | r2, 2021-06-24 |
| 1A | Working Draft | Active | r3, 2021-07-12 |
Authors: [@vyzo]
@@ -122,7 +122,9 @@ an `E_INVALID_TTL` status.
Peers can refresh their registrations at any time with a new
`REGISTER` message; the TTL of the new message supersedes previous
registrations. Peers can also cancel existing registrations at any
time with an explicit `UNREGISTER` message.
time with an explicit `UNREGISTER` message. An `UNREGISTER` message does
**not** have an explicit response. `UNREGISTER` messages for a namespace
that a client is currently not registered for should be treated as a no-op.
The registration response includes the actual TTL of the registration,
so that peers know when to refresh.
@@ -225,7 +227,7 @@ message Message {
message Unregister {
optional string ns = 1;
optional bytes id = 2;
// optional bytes id = 2; deprecated as per https://github.com/libp2p/specs/issues/335
}
message Discover {