Skip to content
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

Bump wasmvm to v1.0.0-rc.0 #844

Merged
merged 3 commits into from
May 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# Changelog

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

**Fixed bugs:**

- Fix: allow no admin in instantiation through proposal [\#828](https://github.com/CosmWasm/wasmd/pull/828) ([jhernandezb](https://github.com/jhernandezb))
- Fix SudoContractProposal and ExecuteContractProposal [\#808](https://github.com/CosmWasm/wasmd/pull/808) ([the-frey](https://github.com/the-frey))

**Implemented Enhancements**
- Upgrade wasmvm to v1.0.0-rc.0 [\#844](https://github.com/CosmWasm/wasmd/pull/844)
- Support state sync [\#478](https://github.com/CosmWasm/wasmd/issues/478)
- Upgrade to ibc-go v3 [\#806](https://github.com/CosmWasm/wasmd/issues/806)
- Initial ICA integration [\#837](https://github.com/CosmWasm/wasmd/pull/837) ([ethanfrey](https://github.com/ethanfrey))
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ WORKDIR /code
COPY . /code/

# See https://github.com/CosmWasm/wasmvm/releases
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta10/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-beta10/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a
RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 5b7abfdd307568f5339e2bea1523a6aa767cf57d6a8c72bc813476d790918e44
RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep 2f44efa9c6c1cda138bd1f46d8d53c5ebfe1f4a53cf3457b01db86472c4917ac
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-rc.0/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very important

ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0-rc.0/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a
RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 91a3f54e209345afa9a49aff50786d0a1ece510aa8e8530f5e68d9b42f6e0868
RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep eda70adcd2f09a0ae0a6c1e53ecc318809e6d57244bda7b7a29ccd9cf591aa37

# Copy the library you want to the final location that will be found by the linker flag `-lwasmvm_muslc`
RUN cp /lib/libwasmvm_muslc.${arch}.a /lib/libwasmvm_muslc.a
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ version is communicated by the contract via a Wasm export. This is the current
compatibility list:

| wasmd | wasmvm | cosmwasm-vm | cosmwasm-std |
| ----- | ------------ | ----------- | ------------ |
|-------|--------------| ----------- | ------------ |
| 0.27 | v1.0.0-rc.0 | | 1.0 |
| 0.26 | 1.0.0-beta10 | | 1.0 |
| 0.25 | 1.0.0-beta10 | | 1.0 |
| 0.24 | 1.0.0-beta7 | 1.0.0-beta6 | 1.0 |
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/CosmWasm/wasmd
go 1.17

require (
github.com/CosmWasm/wasmvm v1.0.0-beta10
github.com/CosmWasm/wasmvm v1.0.0-rc.0
github.com/cosmos/cosmos-sdk v0.45.4
github.com/cosmos/iavl v0.17.3
github.com/cosmos/ibc-go/v3 v3.0.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbi
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg=
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4=
github.com/CosmWasm/wasmvm v1.0.0-beta10 h1:N99+PRcrh4FeDP1xQuJGaAsr+7U+TZAHKG8mybnAsKU=
github.com/CosmWasm/wasmvm v1.0.0-beta10/go.mod h1:y+yd9piV8KlrB7ISRZz1sDwH4UVm4Q9rEX9501dBNog=
github.com/CosmWasm/wasmvm v1.0.0-rc.0 h1:YI0ytwQZewPhSNxlqsrZ3/bVKTYXmrR1bfVapleCXWk=
github.com/CosmWasm/wasmvm v1.0.0-rc.0/go.mod h1:ei0xpvomwSdONsxDuONzV7bL1jSET1M8brEx0FCXc+A=
github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
Expand Down
36 changes: 18 additions & 18 deletions x/wasm/keeper/gas_register_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ func TestReplyCost(t *testing.T) {
}{
"subcall response with events and data - pinned": {
src: wasmvmtypes.Reply{
Result: wasmvmtypes.SubcallResult{
Ok: &wasmvmtypes.SubcallResponse{
Result: wasmvmtypes.SubMsgResult{
Ok: &wasmvmtypes.SubMsgResponse{
Events: []wasmvmtypes.Event{
{Type: "foo", Attributes: []wasmvmtypes.EventAttribute{{Key: "myKey", Value: "myData"}}},
},
Expand All @@ -198,8 +198,8 @@ func TestReplyCost(t *testing.T) {
},
"subcall response with events - pinned": {
src: wasmvmtypes.Reply{
Result: wasmvmtypes.SubcallResult{
Ok: &wasmvmtypes.SubcallResponse{
Result: wasmvmtypes.SubMsgResult{
Ok: &wasmvmtypes.SubMsgResponse{
Events: []wasmvmtypes.Event{
{Type: "foo", Attributes: []wasmvmtypes.EventAttribute{{Key: "myKey", Value: "myData"}}},
},
Expand All @@ -212,8 +212,8 @@ func TestReplyCost(t *testing.T) {
},
"subcall response with events exceeds free tier- pinned": {
src: wasmvmtypes.Reply{
Result: wasmvmtypes.SubcallResult{
Ok: &wasmvmtypes.SubcallResponse{
Result: wasmvmtypes.SubMsgResult{
Ok: &wasmvmtypes.SubMsgResponse{
Events: []wasmvmtypes.Event{
{Type: "foo", Attributes: []wasmvmtypes.EventAttribute{{Key: strings.Repeat("x", DefaultEventAttributeDataFreeTier), Value: "myData"}}},
},
Expand All @@ -226,7 +226,7 @@ func TestReplyCost(t *testing.T) {
},
"subcall response error - pinned": {
src: wasmvmtypes.Reply{
Result: wasmvmtypes.SubcallResult{
Result: wasmvmtypes.SubMsgResult{
Err: "foo",
},
},
Expand All @@ -236,8 +236,8 @@ func TestReplyCost(t *testing.T) {
},
"subcall response with events and data - unpinned": {
src: wasmvmtypes.Reply{
Result: wasmvmtypes.SubcallResult{
Ok: &wasmvmtypes.SubcallResponse{
Result: wasmvmtypes.SubMsgResult{
Ok: &wasmvmtypes.SubMsgResponse{
Events: []wasmvmtypes.Event{
{Type: "foo", Attributes: []wasmvmtypes.EventAttribute{{Key: "myKey", Value: "myData"}}},
},
Expand All @@ -250,8 +250,8 @@ func TestReplyCost(t *testing.T) {
},
"subcall response with events - unpinned": {
src: wasmvmtypes.Reply{
Result: wasmvmtypes.SubcallResult{
Ok: &wasmvmtypes.SubcallResponse{
Result: wasmvmtypes.SubMsgResult{
Ok: &wasmvmtypes.SubMsgResponse{
Events: []wasmvmtypes.Event{
{Type: "foo", Attributes: []wasmvmtypes.EventAttribute{{Key: "myKey", Value: "myData"}}},
},
Expand All @@ -263,8 +263,8 @@ func TestReplyCost(t *testing.T) {
},
"subcall response with events exceeds free tier- unpinned": {
src: wasmvmtypes.Reply{
Result: wasmvmtypes.SubcallResult{
Ok: &wasmvmtypes.SubcallResponse{
Result: wasmvmtypes.SubMsgResult{
Ok: &wasmvmtypes.SubMsgResponse{
Events: []wasmvmtypes.Event{
{Type: "foo", Attributes: []wasmvmtypes.EventAttribute{{Key: strings.Repeat("x", DefaultEventAttributeDataFreeTier), Value: "myData"}}},
},
Expand All @@ -276,7 +276,7 @@ func TestReplyCost(t *testing.T) {
},
"subcall response error - unpinned": {
src: wasmvmtypes.Reply{
Result: wasmvmtypes.SubcallResult{
Result: wasmvmtypes.SubMsgResult{
Err: "foo",
},
},
Expand All @@ -285,8 +285,8 @@ func TestReplyCost(t *testing.T) {
},
"subcall response with empty events": {
src: wasmvmtypes.Reply{
Result: wasmvmtypes.SubcallResult{
Ok: &wasmvmtypes.SubcallResponse{
Result: wasmvmtypes.SubMsgResult{
Ok: &wasmvmtypes.SubMsgResponse{
Events: make([]wasmvmtypes.Event, 10),
},
},
Expand All @@ -296,8 +296,8 @@ func TestReplyCost(t *testing.T) {
},
"subcall response with events unset": {
src: wasmvmtypes.Reply{
Result: wasmvmtypes.SubcallResult{
Ok: &wasmvmtypes.SubcallResponse{},
Result: wasmvmtypes.SubMsgResult{
Ok: &wasmvmtypes.SubMsgResponse{},
},
},
srcConfig: DefaultGasRegisterConfig(),
Expand Down
10 changes: 5 additions & 5 deletions x/wasm/keeper/msg_dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,25 +117,25 @@ func (d MessageDispatcher) DispatchSubmessages(ctx sdk.Context, contractAddr sdk
continue
}

// otherwise, we create a SubcallResult and pass it into the calling contract
var result wasmvmtypes.SubcallResult
// otherwise, we create a SubMsgResult and pass it into the calling contract
var result wasmvmtypes.SubMsgResult
if err == nil {
// just take the first one for now if there are multiple sub-sdk messages
// and safely return nothing if no data
var responseData []byte
if len(data) > 0 {
responseData = data[0]
}
result = wasmvmtypes.SubcallResult{
Ok: &wasmvmtypes.SubcallResponse{
result = wasmvmtypes.SubMsgResult{
Ok: &wasmvmtypes.SubMsgResponse{
Events: sdkEventsToWasmVMEvents(filteredEvents),
Data: responseData,
},
}
} else {
// Issue #759 - we don't return error string for worries of non-determinism
moduleLogger(ctx).Info("Redacting submessage error", "cause", err)
result = wasmvmtypes.SubcallResult{
result = wasmvmtypes.SubMsgResult{
Err: redactError(err).Error(),
}
}
Expand Down
10 changes: 5 additions & 5 deletions x/wasm/keeper/submsg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,29 +196,29 @@ func TestDispatchSubMsgErrorHandling(t *testing.T) {
}
}

type assertion func(t *testing.T, ctx sdk.Context, contract, emptyAccount string, response wasmvmtypes.SubcallResult)
type assertion func(t *testing.T, ctx sdk.Context, contract, emptyAccount string, response wasmvmtypes.SubMsgResult)

assertReturnedEvents := func(expectedEvents int) assertion {
return func(t *testing.T, ctx sdk.Context, contract, emptyAccount string, response wasmvmtypes.SubcallResult) {
return func(t *testing.T, ctx sdk.Context, contract, emptyAccount string, response wasmvmtypes.SubMsgResult) {
require.Len(t, response.Ok.Events, expectedEvents)
}
}

assertGasUsed := func(minGas, maxGas uint64) assertion {
return func(t *testing.T, ctx sdk.Context, contract, emptyAccount string, response wasmvmtypes.SubcallResult) {
return func(t *testing.T, ctx sdk.Context, contract, emptyAccount string, response wasmvmtypes.SubMsgResult) {
gasUsed := ctx.GasMeter().GasConsumed()
assert.True(t, gasUsed >= minGas, "Used %d gas (less than expected %d)", gasUsed, minGas)
assert.True(t, gasUsed <= maxGas, "Used %d gas (more than expected %d)", gasUsed, maxGas)
}
}

assertErrorString := func(shouldContain string) assertion {
return func(t *testing.T, ctx sdk.Context, contract, emptyAccount string, response wasmvmtypes.SubcallResult) {
return func(t *testing.T, ctx sdk.Context, contract, emptyAccount string, response wasmvmtypes.SubMsgResult) {
assert.Contains(t, response.Err, shouldContain)
}
}

assertGotContractAddr := func(t *testing.T, ctx sdk.Context, contract, emptyAccount string, response wasmvmtypes.SubcallResult) {
assertGotContractAddr := func(t *testing.T, ctx sdk.Context, contract, emptyAccount string, response wasmvmtypes.SubMsgResult) {
// should get the events emitted on new contract
event := response.Ok.Events[0]
require.Equal(t, event.Type, "instantiate")
Expand Down