ee3c05c79b
- Skipped keys The purpose of limiting the number of skipped keys generated is to avoid a dos attack whereby an attacker would send a large N, forcing the device to compute all the keys between currentN..N . Previously the logic for handling skipped keys was: - If in the current receiving chain there are more than maxSkip keys, throw an error This is problematic as in long-lived session dropped/unreceived messages starts piling up, eventually reaching the threshold (1000 dropped/unreceived messages). This logic has been changed to be more inline with signals spec, and now it is: - If N is > currentN + maxSkip, throw an error The purpose of limiting the number of skipped keys stored is to avoid a dos attack whereby an attacker would force us to store a large number of keys, filling up our storage. Previously the logic for handling old keys was: - Once you have maxKeep ratchet steps, delete any key from currentRatchet - maxKeep. This, in combination with the maxSkip implementation, capped the number of stored keys to maxSkip * maxKeep. The logic has been changed to: - Keep a maximum of MaxMessageKeysPerSession and additionally we delete any key that has a sequence number < currentSeqNum - maxKeep - Version We check now the version of the bundle so that when we get a bundle from the same installationID with a higher version, we mark the previous bundle as expired and use the new bundle the next time a message is sent |
||
---|---|---|
.. | ||
chat | ||
dedup | ||
README.md | ||
api.go | ||
api_test.go | ||
debug.go | ||
service.go | ||
service_test.go | ||
signal.go |
README.md
Whisper API Extension
API
shhext_getNewFilterMessages
Accepts the same input as shh_getFilterMessages
.
Returns
Returns a list of whisper messages matching the specified filter. Filters out
the messages already confirmed received by shhext_confirmMessagesProcessed
Deduplication is made using the whisper envelope content and topic only, so the same content received in different whisper envelopes will be deduplicated.
shhext_confirmMessagesProcessed
Confirms whisper messages received and processed on the client side. These
messages won't appear anymore when shhext_getNewFilterMessages
is called.
Parameters
Gets a list of whisper envelopes.
shhext_post
Accepts same input as shh_post
.
Returns
DATA
, 32 Bytes - the envelope hash
shhext_requestMessages
Sends a request for historic messages to a mail server.
Parameters
Object
- The message request object:
mailServerPeer
:URL
- Mail servers' enode addessfrom
:QUANTITY
- (optional) Lower bound of time range as unix timestamp, default is 24 hours back from nowto
:QUANTITY
- (optional) Upper bound of time range as unix timestamp, default is nowtopic
:DATA
, 4 Bytes - Regular whisper topicsymKeyID
:DATA
- ID of a symmetric key to authenticate to mail server, derived from mail server password
Returns
Boolean
- returns true
if the request was send, otherwise false
.
Signals
Sends sent signal once per envelope.
{
"type": "envelope.sent",
"event": {
"hash": "0xea0b93079ed32588628f1cabbbb5ed9e4d50b7571064c2962c3853972db67790"
}
}
Sends expired signal if envelope dropped from whisper local queue before it was sent to any peer on the network.
{
"type": "envelope.expired",
"event": {
"hash": "0x754f4c12dccb14886f791abfeb77ffb86330d03d5a4ba6f37a8c21281988b69e"
}
}