Add topic interest to WMS (#83)

* Add topic interest to WMS

* Address comments

* Change cursor to *OCTET

* Add empty changelog
This commit is contained in:
Oskar Thorén 2019-12-19 19:42:43 +08:00 committed by GitHub
parent 15a913ae51
commit 5912e766de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 24 additions and 2 deletions

View File

@ -43,15 +43,27 @@ bloom = 64OCTET
limit = 4OCTET
; array of a cursor returned from the previous request (optional)
cursor = 32OCTET
cursor = *OCTET
payload = "[" lower upper bloom limit [ cursor ] "]"
; List of topics interested in
topic-interest = "[" *1000topic "]"
; 4 bytes of arbitrary data
topic = 4OCTET
payload_without_topic = "[" lower upper bloom limit [ cursor ] "]"
payload_with_topic = "[" lower upper bloom limit cursor [ topic-interest ] "]"
payload = payload_without_topic | payload_with_topic
```
The `Cursor` field SHOULD be filled in if a number of envelopes between `Lower` and `Upper` is greater than `Limit` so that the requester can send another request using the obtained `Cursor` value. What exactly is in the `Cursor` is up to the implementation. The requester SHOULD NOT use a `Cursor` obtained from one mailserver in a request to another mailserver because the format or the result MAY be different.
The envelope MUST be encrypted with a symmetric key agreed between the requester and Mailserver.
If `topic-interest` is used the `Cursor` field MUST be specified for the argument order to be unambiguous. However, it MAY be set to null. `topic-interest` is used to specify which topics a node is interested in. If this is specified, a mailserver MUST NOT send messages that aren't in in that topic. When `topic-interest` is set (even if it an empty array), the `bloom` filter parameter should be ignored.
### Receiving historic messages
Historic messages MUST be sent to a peer as a packet with a P2P Message code (`0x7f`) followed by an array of Waku envelopes.
@ -93,6 +105,16 @@ A mailserver client has to trust a mailserver, which means they can send direct
A mailserver has a direct TCP connection, which means they are trusted to send traffic. This means a malicious or malfunctioning mailserver can overwhelm an individual node.
## Changelog
| Version | Comment |
| :-----: | ------- |
| 0.1.0 (current) | Initial Release |
### Difference between wms/0 (0.1) and wms0 (0.2) (WIP)
- `topic-interest` option
## Copyright
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).