-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Compress Wasm bytecodes when publishing #2382
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
Conversation
44ae7d3
to
dc15211
Compare
Instead of specifying the full path.
dc15211
to
d6ae9dd
Compare
The type was not a tuple.
Use Zstandard to compress Wasm bytecodes.
Only accept bytecodes published if they are compressed.
Use `CompressedBytecode` instead of `Bytecode`.
d6ae9dd
to
cd9ffdb
Compare
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.
Very nice! One thing I would say is that not all OS's ship with zstd
. Since the crate used is a binding to zstd
, perhaps we should have a fallback if it's not installed (gzip
and then no compression at all).
Nevermind! Looks like we're already linking against it.
These are our current dynamically-linked libraries:
I'm not sure which of these are included with the standard Rust install, which would be okay since we currently require source builds, and which we should list as dependencies in the manual. |
Motivation
Sometimes publishing application fails because the bytecodes are too large, and hit gRPC message size limits when sending the block proposal.
Proposal
Compress the bytecodes using Zstandard when including them in the
SystemOperation::PublishBytecode
. Use a newCompressedBytecode
type to represent the compressed bytecode, and make it simple to convert to and from an uncompressedBytecode
.Test Plan
CI should catch any regressions, since end-to-end tests cover publishing bytecodes and using them in applications.
Release Plan
A new major version must be released, because this breaks backward compatibility with bytecode publishing.
Links