Add gossipsub message-id specification

This commit is contained in:
Age Manning 2019-12-18 10:08:52 +11:00 committed by Danny Ryan
parent 1f06026bf7
commit 8a03e6d291
No known key found for this signature in database
GPG Key ID: 2765A792E42CE07A
1 changed files with 7 additions and 0 deletions

View File

@ -212,6 +212,13 @@ Topics are plain UTF-8 strings and are encoded on the wire as determined by prot
Each gossipsub [message](https://github.com/libp2p/go-libp2p-pubsub/blob/master/pb/rpc.proto#L17-L24) has a maximum size of `GOSSIP_MAX_SIZE`. Clients MUST reject (fail validation) messages that are over this size limit. Likewise, clients MUST NOT emit or propagate messages larger than this limit.
The message-id of a gossipsub message MUST be:
```python
message-id: base64(SHA256(message.data))
```
where `base64` is the [URL-safe base64 alphabet](https://tools.ietf.org/html/rfc4648#section-3.2) with padding characters omitted.
The payload is carried in the `data` field of a gossipsub message, and varies depending on the topic:
| Topic | Message Type |