This change introduces a rate limiting for peer's IP and ID. It allows for 10 messages per second from a single IP and 3 messages per second from a single peer ID. It does not enforce this policy though, it only collects stats for now.
Adds a function to send RawValue envelopes. This is needed as a
performance optimization, as currently most of the processing time is
spent decoding envelopes and coding them back when sending them.
This will allow us to skip this unnecessary step.
* Post completion event after every message was added to a filter
* Add test that request.completed received after all envelope.avaiable
* Process all p2p envelopes and completion events sequantially
* Stop whisper after test
* Receiver notifies sender with reasons for discarding envelopes
On a sender side we want to know if some messages were discarded. For this
purpose new message type was added - messagesResponse. This message type is versioned,
in order to make it easier transition to new message response, if we will want to extend it in near
future.
The response itself is formed from hash of envelopes received in a single batch, and errors
during processing of envelopes. Each error has a code and description, the reason for adding a code
is to provide some kind of user-friendly description to a client explaining why certain envelopes
were not yet delivered. Description will be simply logged on a sender side.
The followup for this change will be an extention on status-go side that will send particular envelope
errors to a client (e.g. status-react).
* Store errors as array and cover new changes with tests
Two opcodes were introduced p2pSyncRequestCode and p2pSyncResponseCode. MailServer interface got extended with SyncMail(*Peer, SyncMailRequest) error.
There are no breaking changes.
* whisper: fixes warnings from the code linter
* whisper: more non-API-breaking changes
The remaining lint errors are because of auto-generated
files and one is because an exported function has a non-
exported return type. Changing this would break the API,
and will be part of another commit for easier reversal.
* whisper: un-export NewSentMessage to please the linter
This is an API change, which is why it's in its own commit.
This change was initiated after the linter complained that
the returned type wasn't exported. I chose to un-export
the function instead of exporting the type, because that
type is an implementation detail that I would like to
change in the near future to make the code more
readable and with an increased coverage.
* whisper: update gencodec output after upgrading it to new lint standards
Changed the communication protocol for ordinary message,
according to EIP 627. Messages will be send in bundles, i.e.
array of messages will be sent instead of single message.