Bump wasmvm to v1.0.0-rc.0 (#844)
* Bump wasmvm to v1.0.0-rc.0 * Fix linter warning * Replace deprecated types Co-authored-by: Ethan Frey <ethanfrey@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
# Changelog
|
||||
|
||||
## [Unreleased](https://github.com/CosmWasm/wasmd/tree/HEAD)
|
||||
**API Breaking**
|
||||
Yes
|
||||
|
||||
**Fixed bugs:**
|
||||
|
||||
@@ -8,6 +10,7 @@
|
||||
- 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))
|
||||
|
||||
@@ -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
|
||||
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
|
||||
|
||||
@@ -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 |
|
||||
|
||||
2
go.mod
2
go.mod
@@ -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
|
||||
|
||||
4
go.sum
4
go.sum
@@ -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=
|
||||
|
||||
@@ -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"}}},
|
||||
},
|
||||
@@ -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"}}},
|
||||
},
|
||||
@@ -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"}}},
|
||||
},
|
||||
@@ -226,7 +226,7 @@ func TestReplyCost(t *testing.T) {
|
||||
},
|
||||
"subcall response error - pinned": {
|
||||
src: wasmvmtypes.Reply{
|
||||
Result: wasmvmtypes.SubcallResult{
|
||||
Result: wasmvmtypes.SubMsgResult{
|
||||
Err: "foo",
|
||||
},
|
||||
},
|
||||
@@ -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"}}},
|
||||
},
|
||||
@@ -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"}}},
|
||||
},
|
||||
@@ -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"}}},
|
||||
},
|
||||
@@ -276,7 +276,7 @@ func TestReplyCost(t *testing.T) {
|
||||
},
|
||||
"subcall response error - unpinned": {
|
||||
src: wasmvmtypes.Reply{
|
||||
Result: wasmvmtypes.SubcallResult{
|
||||
Result: wasmvmtypes.SubMsgResult{
|
||||
Err: "foo",
|
||||
},
|
||||
},
|
||||
@@ -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),
|
||||
},
|
||||
},
|
||||
@@ -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(),
|
||||
|
||||
@@ -117,8 +117,8 @@ 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
|
||||
@@ -126,8 +126,8 @@ func (d MessageDispatcher) DispatchSubmessages(ctx sdk.Context, contractAddr sdk
|
||||
if len(data) > 0 {
|
||||
responseData = data[0]
|
||||
}
|
||||
result = wasmvmtypes.SubcallResult{
|
||||
Ok: &wasmvmtypes.SubcallResponse{
|
||||
result = wasmvmtypes.SubMsgResult{
|
||||
Ok: &wasmvmtypes.SubMsgResponse{
|
||||
Events: sdkEventsToWasmVMEvents(filteredEvents),
|
||||
Data: responseData,
|
||||
},
|
||||
@@ -135,7 +135,7 @@ func (d MessageDispatcher) DispatchSubmessages(ctx sdk.Context, contractAddr sdk
|
||||
} 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(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,16 +196,16 @@ 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)
|
||||
@@ -213,12 +213,12 @@ func TestDispatchSubMsgErrorHandling(t *testing.T) {
|
||||
}
|
||||
|
||||
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")
|
||||
|
||||
Reference in New Issue
Block a user