-
Notifications
You must be signed in to change notification settings - Fork 85
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
Add message compression and versioning #466
Conversation
# Conflicts: # identity-iota/src/tangle/client.rs
we might need to check if the license of Brotli is compatible with the library |
It looks like it is licensed under the BSD 3-Clause. According to the accepted answer here: https://softwareengineering.stackexchange.com/questions/40561/is-bsd-license-compatible-with-apache |
Would it maybe make more sense to move |
It's specific to IOTA messages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall.
Mostly nits and questions from my side. We need to decide whether or not to support uncompressed messages at all, for instance. We might want to move around some of the files since the tangle
folder is getting a bit crowded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, forgot to add these comments: tests should be wrapped in a tests module to prevent compiling them by default.
crypto.rs allows dependencies with a BSD 3-Clause licence so I think we should be good: https://github.com/iotaledger/crypto.rs/blob/fe43116710074f8e3930823bb130c736e51f32c4/.github/workflows/about.toml |
Remove unnecessary clone for uncompressed messages. Prevent panics when parsing empty messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be neater to change the module's constant to be an associated constant, apart from that this looks good to me.
Description of change
The format of a message on the tangle is as follows:
$message_version $encoding_version $data
where
$message_version
is a one byte flag indicating the message version (1 for the current, not-modified message).$encoding_version
is a one byte flag indicating the encoding version (1 for json + brotli).$data
is the compressed data.$message_version
can be used in the future to indicate the format that follows the first byte.Links to any relevant issues
implements issue #434
Type of change
Add an
x
to the boxes that are relevant to your changes.How the change has been tested
Unit tests, manual tests, wasm bindings tests.
Change checklist
Add an
x
to the boxes that are relevant to your changes.