Skip to content

Commit

Permalink
Merge pull request #779 from CosmWasm/prepare-0.24
Browse files Browse the repository at this point in the history
Prepare 0.24
  • Loading branch information
ethanfrey committed Mar 9, 2022
2 parents 2700e6b + 327f6b6 commit 3bc0bde
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 34 deletions.
33 changes: 24 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,32 @@

## [Unreleased](https://github.com/CosmWasm/wasmd/tree/HEAD)

**Fixed bugs + Api Breaking:**
[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.24.0...master)

## [v0.24.0](https://github.com/CosmWasm/wasmd/tree/v0.24.0) (2022-03-09)

**API Breaking**
- Add cosmwasm project prefix to REST query paths [\#743](https://github.com/CosmWasm/wasmd/issues/743)
- Add support for old contract addresses of length 20 [\#758](https://github.com/CosmWasm/wasmd/issues/758)
- Update wasmvm to 1.0.0-beta7 (incl wasmer 2.2) [\#774](https://github.com/CosmWasm/wasmd/issues/774)

**Fixed bugs**
- Add missing colons in String of some proposals [\#752](https://github.com/CosmWasm/wasmd/pull/752)
- Replace custom codec with SDK codec (needed for rosetta) [\#760](https://github.com/CosmWasm/wasmd/pull/760)
- Support `--no-admin` flag on cli for gov instantiation [\#771](https://github.com/CosmWasm/wasmd/pull/771)

**Implemented Enhancements**
- Add support for Buf Build [\#753](https://github.com/CosmWasm/wasmd/pull/753), [\#755](https://github.com/CosmWasm/wasmd/pull/755), [\#756](https://github.com/CosmWasm/wasmd/pull/756)
- Redact most errors sent to contracts, for better determinism guarantees [\#765](https://github.com/CosmWasm/wasmd/pull/765), [\#775](https://github.com/CosmWasm/wasmd/pull/775)

[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.23.0...HEAD)
[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.23.0...v0.24.0)

## [v0.23.0](https://github.com/CosmWasm/wasmd/tree/v0.23.0) (2022-01-28)

**Fixed bugs**
- Set end block order [\#736](https://github.com/CosmWasm/wasmd/issues/736)

[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.23.0...v0.22.0)
[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.22.0...v0.23.0)

## [v0.22.0](https://github.com/CosmWasm/wasmd/tree/v0.22.0) (2022-01-20)

Expand All @@ -33,12 +48,12 @@
- Remove unused run-as flag from Wasm Migrate proposals [\#730](https://github.com/CosmWasm/wasmd/pull/730) ([ethanfrey](https://github.com/ethanfrey))
- Expose wasm/Keeper.SetParams [\#732](https://github.com/CosmWasm/wasmd/pull/732) ([ethanfrey](https://github.com/ethanfrey))

[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.22.0...v0.21.0)
[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.21.0...v0.22.0)


## [v0.21.0](https://github.com/CosmWasm/wasmd/tree/v0.21.0) (2021-11-17)

[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.21.0...v0.20.0)
[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.20.0...v0.21.0)

**Fixed bugs + Api Breaking:**
- Prevent infinite gas consumption in simulation queries [\#670](https://github.com/CosmWasm/wasmd/issues/670)
Expand All @@ -58,7 +73,7 @@

## [v0.20.0](https://github.com/CosmWasm/wasmd/tree/v0.20.0) (2021-10-08)

[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.20.0...v0.19.0)
[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.19.0...v0.20.0)

**Fixed bugs:**

Expand All @@ -82,7 +97,7 @@

## [v0.19.0](https://github.com/CosmWasm/wasmd/tree/v0.19.0) (2021-09-15)

[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.19.0...v0.18.0)
[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.18.0...v0.19.0)

**Fixed bugs:**

Expand All @@ -103,7 +118,7 @@

## [v0.18.0](https://github.com/CosmWasm/wasmd/tree/v0.18.0) (2021-08-16)

[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.18.0...v0.17.0)
[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.17.0...v0.18.0)

**Api Breaking:**
- Events documented and refactored [\#448](https://github.com/CosmWasm/wasmd/issues/448), [\#589](https://github.com/CosmWasm/wasmd/pull/589), [\#587](https://github.com/CosmWasm/wasmd/issues/587)
Expand Down Expand Up @@ -131,7 +146,7 @@

## [v0.17.0](https://github.com/CosmWasm/wasmd/tree/v0.17.0) (2021-05-26)

[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.17.0...v0.16.0)
[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.16.0...v0.17.0)

**Features:**
- Remove json type cast for contract msgs [\#520](https://github.com/CosmWasm/wasmd/pull/520) ([alpe](https://github.com/alpe))
Expand Down
2 changes: 2 additions & 0 deletions INTEGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ hardware it runs on.

| wasmd | Cosmos SDK |
|:------:|:-----------:|
| v0.24 | v0.45.0 |
| v0.23 | v0.45.0 |
| v0.22 | v0.45.0 |
| v0.21 | v0.42.x |
| v0.20 | v0.42.x |
Expand Down
34 changes: 21 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ compatibility list:

| wasmd | cosmwasm-vm | cosmwasm-std |
| ----- | ----------- | ------------ |
| 0.22 | 1.0.0-beta | 1.0.0-beta |
| 0.21 | 1.0.0-beta | 1.0.0-beta |
| 0.20 | 1.0.0-beta | 1.0.0-beta |
| 0.24 | 1.0.0-beta7 | 1.0 |
| 0.23 | 1.0.0-beta5 | 1.0 |
| 0.22 | 1.0.0-beta5 | 1.0 |
| 0.21 | 1.0.0-beta2 | 1.0 |
| 0.20 | 1.0.0-beta | 1.0 |
| 0.19 | 0.16 | 0.16 |
| 0.18 | 0.16 | 0.16 |
| 0.17 | 0.14 | 0.14 |
Expand All @@ -42,6 +44,10 @@ compatibility list:
| 0.9 | 0.9 | 0.9 |
| 0.8 | 0.8 | 0.8 |

Note: `cosmwasm_std v1.0` means it supports contracts compiled by any `v1.0.0-betaX` or `1.0.x`.
It will also run contracts compiled with 1.x assuming they don't opt into any newer features.
The 1.x cosmwasm_vm will support all contracts with 1.0 <= version <= 1.x.

Note that `cosmwasm-std` version defines which contracts are compatible with this system. The wasm code uploaded must
have been compiled with one of the supported `cosmwasm-std` versions, or will be rejeted upon upload (with some error
message about "contract too old?" or "contract too new?"). `cosmwasm-vm` version defines the runtime used. It is a
Expand All @@ -51,7 +57,7 @@ using [wasmer](https://github.com/wasmerio/wasmer/) 1.0, which is significantly
## Supported Systems

The supported systems are limited by the dlls created in [`wasmvm`](https://github.com/CosmWasm/wasmvm). In particular, **we only support MacOS and Linux**.
However, **M1 macs are currently not supported.**
However, **M1 macs are not fully supported.** (Experimental support was merged with wasmd 0.24)
For linux, the default is to build for glibc, and we cross-compile with CentOS 7 to provide
backwards compatibility for `glibc 2.12+`. This includes all known supported distributions
using glibc (CentOS 7 uses 2.12, obsolete Debian Jessy uses 2.19).
Expand All @@ -65,18 +71,20 @@ binary for `muslc`. (Or just use this Dockerfile for your production setup).

## Stability

**This is alpha software, do not run on a production system.** Notably, we currently provide **no migration path** not even "dump state and restart" to move to future versions. At **beta** we will begin to offer migrations and better backwards compatibility guarantees.
**This is beta software** It is run in some production systems, but we cannot yet provide a stability guarantee
and have not yet gone through and audit of this codebase. Note that the
[CosmWasm smart contract framework](https://github.com/CosmWasm/cosmwasm) used by `wasmd` is in a 1.0 release candidate
as of March 2022, with stability guarantee and addressing audit results.

With the `v0.6.0` tag, we entered semver. That means anything with `v0.6.x` tags is compatible with each other,
and everything with `v0.7.x` tags is compatible with each other.
Between these minor versions, there is API breakage with no upgrade path provided.
As of `wasmd` 0.22, we will work to provide upgrade paths *for this module* for projects running a non-forked
version on their live networks. If there are Cosmos SDK upgrades, you will have to run their migration code
for their modules. If we change the internal storage of `x/wasm` we will provide a function to migrate state that
can be called by an `x/upgrade` handler.

We will have a stable `v0.x` version before the final `v1.0.0` version with
the same API as the `v1.0` version in order to run last testnets and manual testing on it.
We have not yet committed to that version number. Our `v1.0.0` release plans were also
delayed by upstream release cycles, and we have continued to refine APIs while we can.
The APIs are pretty stable, but we cannot guarantee their stability until we reach v1.0.
However, we will provide a way for you to hard-fork your way to v1.0.

Thank you to all projects who have run this code in your testnets and
Thank you to all projects who have run this code in your mainnets and testnets and
given feedback to improve stability.

## Encoding
Expand Down
4 changes: 4 additions & 0 deletions x/wasm/keeper/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import (
const firstCodeID = 1

func TestGenesisExportImport(t *testing.T) {
SkipIfM1(t)
wasmKeeper, srcCtx, srcStoreKeys := setupKeeper(t)
contractKeeper := NewGovPermissionKeeper(wasmKeeper)

Expand Down Expand Up @@ -148,6 +149,7 @@ func TestGenesisExportImport(t *testing.T) {
}

func TestGenesisInit(t *testing.T) {
SkipIfM1(t)
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
require.NoError(t, err)

Expand Down Expand Up @@ -449,6 +451,7 @@ func TestGenesisInit(t *testing.T) {
}

func TestImportContractWithCodeHistoryReset(t *testing.T) {
SkipIfM1(t)
genesisTemplate := `
{
"params":{
Expand Down Expand Up @@ -556,6 +559,7 @@ func TestImportContractWithCodeHistoryReset(t *testing.T) {
}

func TestSupportedGenMsgTypes(t *testing.T) {
SkipIfM1(t)
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
require.NoError(t, err)
var (
Expand Down
14 changes: 11 additions & 3 deletions x/wasm/keeper/msg_dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (d MessageDispatcher) DispatchSubmessages(ctx sdk.Context, contractAddr sdk
// Issue #759 - we don't return error string for worries of non-determinism
moduleLogger(ctx).Info("Redacting submessage error", "cause", err)
result = wasmvmtypes.SubcallResult{
Err: redactError(err),
Err: redactError(err).Error(),
}
}

Expand All @@ -159,13 +159,21 @@ func (d MessageDispatcher) DispatchSubmessages(ctx sdk.Context, contractAddr sdk
return rsp, nil
}

func redactError(err error) string {
// Issue #759 - we don't return error string for worries of non-determinism
func redactError(err error) error {
// Do not redact system errors
// SystemErrors must be created in x/wasm and we can ensure determinism
if wasmvmtypes.ToSystemError(err) != nil {
return err
}

// FIXME: do we want to hardcode some constant string mappings here as well?
// Or better document them? (SDK error string may change on a patch release to fix wording)
// sdk/11 is out of gas
// sdk/5 is insufficient funds (on bank send)
// (we can theoretically redact less in the future, but this is a first step to safety)
codespace, code, _ := sdkerrors.ABCIInfo(err, false)
return fmt.Sprintf("codespace: %s, code: %d", codespace, code)
return fmt.Errorf("codespace: %s, code: %d", codespace, code)
}

func filterEvents(events []sdk.Event) []sdk.Event {
Expand Down
19 changes: 10 additions & 9 deletions x/wasm/keeper/query_plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,19 @@ func (q QueryHandler) Query(request wasmvmtypes.QueryRequest, gasLimit uint64) (
}()

res, err := q.Plugins.HandleQuery(subCtx, q.Caller, request)
// Error mapping
if err == nil {
// short-circuit, the rest is dealing with handling existing errors
return res, nil
}

// special mappings to system error (which are not redacted)
var noSuchContract *types.ErrNoSuchContract
if ok := errors.As(err, &noSuchContract); ok {
return res, wasmvmtypes.NoSuchContract{Addr: noSuchContract.Addr}
err = wasmvmtypes.NoSuchContract{Addr: noSuchContract.Addr}
}
// Otherwise redact all (we can theoretically redact less in the future)
if err != nil {
// Issue #759 - we don't return error string for worries of non-determinism
// moduleLogger(ctx).Info("Redacting submessage error", "cause", err)
err = errors.New(redactError(err))
}
return res, err

// Issue #759 - we don't return error string for worries of non-determinism
return nil, redactError(err)
}

func (q QueryHandler) GasConsumed() uint64 {
Expand Down
1 change: 1 addition & 0 deletions x/wasm/keeper/reflect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ func TestReflectStargateQuery(t *testing.T) {
}

func TestReflectInvalidStargateQuery(t *testing.T) {
SkipIfM1(t)
cdc := MakeEncodingConfig(t).Marshaler
ctx, keepers := CreateTestInput(t, false, ReflectFeatures, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins()))
keeper := keepers.WasmKeeper
Expand Down

0 comments on commit 3bc0bde

Please sign in to comment.