The AI Works community logo The Blockchain Works community logo The Functional Works community logo The Golang Works community logo The Java Works community logo The JavaScript Works community logo The Python Works community logo The Remote Works community logo The WorksHub company logo

We use cookies and other tracking technologies to improve your browsing experience on our site, analyze site traffic, and understand where our audience is coming from. To find out more, please read our privacy policy.

By choosing 'I Accept', you consent to our use of cookies and other tracking technologies.

We use cookies and other tracking technologies to improve your browsing experience on our site, analyze site traffic, and understand where our audience is coming from. To find out more, please read our privacy policy.

By choosing 'I Accept', you consent to our use of cookies and other tracking technologies. Less

We use cookies and other tracking technologies... More

Login or register
to publish this job!

Login or register
to save this job!

Login or register
to save interesting jobs!

Login or register
to get access to all your job applications!

Login or register to start contributing with an article!

Login or register
to see more jobs from this company!

Login or register
to boost this post!

Show some love to the author of this blog by giving their post some rocket fuel 🚀.

Login or register to search for your ideal job!

Login or register to start working on this issue!

Login or register
to save articles!

Login to see the application

Engineers who find a new job through WorksHub average a 15% increase in salary 🚀

You will be redirected back to this page right after signin

Allow gzip data in tx body

Issue closed
Pull requests: 1
Contributors: 0
Level: Beginner
  • Go
Issue closed
Pull requests: 1
Contributors: 0
Level: Beginner
  • Go

On GitHub

Go bindings to the running cosmwasm contracts with wasmer
More info >

Issue posted by: 
ethanfrey's avatar

Ethan Frey

Description

My experiments show that .wasm files can be gziped to 30-50% of the original size. That could get us from eg. 50kb down to 20kb. Very nice size to fit in a tx.

I would use only uncompressed wasm internally, but idea to optionally allow compressed variant in the tx body. Of course, you need to use a LimitReader when unzipping, with eg. 300-400kb limit, to avoid zip bombs going to many GB.

Look at https://golang.org/pkg/compress/gzip/

This means the Wasm []byte in CreateMsg may either be wasm or a gzip payload. The go-cosmwasm code should check if it starts with the gzip "magic bytes" and if so, decompress it and then pass it into the rust library.

The rust library will validate if the input is valid wasm and do some compatibility checks as well, so no need to check that part in go, just the unzipping.

Note: this logic can be implemented in github.com/cosmwasm/wasmd rather than go-cosmwasm if so desired.

    Use Open Source to hire or get hired

    On GitHub

    Go bindings to the running cosmwasm contracts with wasmer
    More info >

    Issue posted by: 
    ethanfrey's avatar

    Ethan Frey

    Use Open Source to hire or get hired

    Allow gzip data in tx body
    View on GitHub