Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document all Whisper packet codes #72

Merged
merged 1 commit into from
Dec 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions status-whisper-usage-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- [Abstract](#abstract)
- [Reason](#reason)
- [Terminology](#terminology)
- [Whisper packets](#whisper-packets)
- [Whisper node configuration](#whisper-node-configuration)
- [Handshake](#handshake)
- [Rate limiting](#rate-limiting)
Expand Down Expand Up @@ -52,6 +53,23 @@ encryption properties to support asynchronous chat.
* *Offline message*: an archived envelope
* *Envelope*: encrypted message with metadata like topic and Time-To-Live

## Whisper packets

| Packet Name | Code | EIP-627 | References |
| --- | --: | --- | --- |
| Status | 0 | ✔ | [Handshake](#handshake) |
| Messages | 1 | ✔ | [EIP-627](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-627.md) |
| PoW Requirement | 2 | ✔ | [EIP-627](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-627.md) |
| Bloom Filter | 3 | ✔ | [EIP-627](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-627.md) |
| Batch Ack | 11 | 𝘅 | TODO |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When are these behaviors going to be described? Currently it is rather opaque, especially if this blocks nim-eth mailserver client capability implementation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

| Message Response | 12 | 𝘅 | TODO |
| P2P Sync Request | 123 | 𝘅 | TODO |
| P2P Sync Response | 124 | 𝘅 | TODO |
| P2P Request Complete | 125 | 𝘅 | [Status Whisper Mailserver Spec](status-whisper-mailserver-spec.md) |
| P2P Request | 126 | ✔ | [Status Whisper Mailserver Spec](status-whisper-mailserver-spec.md) |
| P2P Messages | 127 | ✔/𝘅 (EIP-627 supports only single envelope in a packet) | [Status Whisper Mailserver Spec](status-whisper-mailserver-spec.md) |


## Whisper node configuration

If you want to run a Whisper node and receive messages from Status clients, it must be properly configured.
Expand All @@ -75,6 +93,7 @@ Handshake is a RLP-encoded packet sent to a newly connected peer. It MUST start
`rateLimits`: is `[ RateLimitIP, RateLimitPeerID, RateLimitTopic ]` where each values is an integer with a number of accepted packets per second per IP, Peer ID, and Topic respectively

`bloom, isLightNode, confirmationsEnabled, and rateLimits` are all optional arguments in the handshake. However, if you specify optional field you MUST also specify all optional fields preceding it, in order to be unambiguous.

## Rate limiting

In order to provide an optional very basic Denial-of-Service attack protection, each node SHOULD define its own rate limits. The rate limits SHOULD be applied on IPs, peer IDs, and envelope topics.
Expand Down