This release contains ideas, features, and work from many contributors and different teams. A big thank you for all your effort and energy in making this happen!
- Latest CosmWasm v1.2 integration
- No CGO needed as a library
- Better UX
- Goodbye genesis messages
- Dependency updates
- State breaking
CosmWasm v1.2
The new version was released recently and wasmd v0.31.0 integrates for new message and query support. Simon has written this nice article that highlights the new features for contract developers with some examples.
To enable the new v1.2 features for contracts on your chain, the ‘cosmwasm_1_2’ capability should be passed to the wasm keeper (in app.go). Please note that capabilities are additive which means ‘1_2’ does not include ‘1_1’.
No CGO needed as a library
Before this version, WasmVm and Wasmd required the `CGO_ENABLED` flag and toolchain to be installed. This is still the case to compile a full server binary but for other scenarios this came with quite some downsides.
We encapsulate the CGO related code with buildflags, now so that wasmd can also be used as a library by other projects for types or code other than the VM. This is also one step towards client support for Windows.
Better UX
New features and internal improvements provide a better use experience for contract developers and chain users
Chain
- We emit events for a contract admin updates or code access config modifications, now. This provides better data for client applications and tools.
- The instantiate2 method is supported by gov in this release with the new `InstantiateContract2Proposal` type
- More gov proposal types are added to the simulations and better test coverage for quality and regression
CLI
- The `ACCESS_TYPE_ONLY_ADDRESS` type permission was deprecated in favour of `ACCESS_TYPE_ANY_OF_ADDRESSES` before. Now we disallow storing new codes with ACCESS_TYPE_ONLY_ADDRESS to enforce the use of the new permission. In flight gov proposals are not restricted
- To make it more convenient, the key name can also be used for the
- ‘ — admin’ parameter. The correct address is resolved automatically.
Contracts
- Unsorted or empty coin values have probably caused some headache in the past. The converting from CosmWasm Coins to SDK Coins takes care of this now. Coins are sorted and empty amounts are filtered out so that this does not fail the operation anymore.
- We return the IBC packet sequence number in the handler plugin to the contract
Goodbye genesis messages
Genesis messages was a model to provide wasmd operations like store, instantiate or execute in a chain’s genesis file. It was introduced as a mechanism to support bootstrapping of wasm contracts on a chain’s startup. It worked well for simple use cases but required sophisticated tooling to be maintainable for humans, like calculating the contract address for an in-flight message.
While developing Tgrade with its PoE module built in wasm contracts, this turned out to be that genesis messages will not be good enough to handle complex setup scenarios and contract interactions.
We deprecated the genesis messages and asked for feedback on other use cases. With this release, we removed them finally, and with it, a complex part of the code base.
Dependency updates
- Upgrade IBC-Go to v4.3.0 which allows us to remove an ugly hack in our code base. Big shout out to the IBC-go team for their help!
- Upgrade Cosmos-SDK to v0.45.14 which includes a fix to the store. Thanks a lot to the SDK-team for backporting this!
- Use Informal fork for Tendermint v0.34.26
- Behind the scenes, the tendermint-db dependency was removed in WasmVM. This will help us with CometBFT in the future.
State breaking
As the version number indicates already, wasmd v0.31.0 is not a drop-in replacement for v0.30.0. The changes in this release require a coordinated chain upgrade. There are no migration scripts to apply, though. Please also see the changes in Cosmos-SDK and IBC-Go.
By Alex Peters