Skip to content

Commit

Permalink
Merge pull request cosmos#447 from CosmWasm/wasmvm_upgrade
Browse files Browse the repository at this point in the history
Upgrade wasmvm to v0.14.0-beta1
  • Loading branch information
ethanfrey authored Mar 10, 2021
2 parents 810c05b + 200a2e9 commit bd3cae0
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 26 deletions.
11 changes: 2 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,17 @@ WORKDIR /code
COPY . /code/

# See https://github.com/CosmWasm/wasmvm/releases
ADD https://github.com/CosmWasm/wasmvm/releases/download/v0.13.0/libwasmvm_muslc.a /lib/libwasmvm_muslc.a
RUN sha256sum /lib/libwasmvm_muslc.a | grep 39dc389cc6b556280cbeaebeda2b62cf884993137b83f90d1398ac47d09d3900
ADD https://github.com/CosmWasm/wasmvm/releases/download/v0.14.0-beta1/libwasmvm_muslc.a /lib/libwasmvm_muslc.a
RUN sha256sum /lib/libwasmvm_muslc.a | grep b69cf9ffbdfb2f1bd1e6f730ecee1eb0d06a1473840a24709aec7a7df5907d45

# force it to use static lib (from above) not standard libgo_cosmwasm.so file
RUN LEDGER_ENABLED=false BUILD_TAGS=muslc make build
# we also (temporarily?) build the testnet binaries here
RUN LEDGER_ENABLED=false BUILD_TAGS=muslc make build-coral
RUN LEDGER_ENABLED=false BUILD_TAGS=muslc make build-gaiaflex

# --------------------------------------------------------
FROM alpine:3.12

COPY --from=go-builder /code/build/wasmd /usr/bin/wasmd

# testnet
COPY --from=go-builder /code/build/corald /usr/bin/corald
COPY --from=go-builder /code/build/gaiaflexd /usr/bin/gaiaflexd

COPY docker/* /opt/
RUN chmod +x /opt/*.sh

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.15

require (
github.com/CosmWasm/wasmvm v0.14.0-alpha2
github.com/CosmWasm/wasmvm v0.14.0-beta1
github.com/cosmos/cosmos-sdk v0.41.4
github.com/cosmos/iavl v0.15.3
github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
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 v0.14.0-alpha2 h1:IF+ZNYe6XxKmAZaAzX/Y2dXB1v3l+J0+Vyz69CtojOQ=
github.com/CosmWasm/wasmvm v0.14.0-alpha2/go.mod h1:Id107qllDJyJjVQQsKMOy2YYF98sqPJ2t+jX1QES40A=
github.com/CosmWasm/wasmvm v0.14.0-beta1 h1:ASqXB/2D8CEBmAI/uljRw6eEMbeKXPQtL/wZzKXZGGA=
github.com/CosmWasm/wasmvm v0.14.0-beta1/go.mod h1:Id107qllDJyJjVQQsKMOy2YYF98sqPJ2t+jX1QES40A=
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=
github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ=
Expand Down
17 changes: 13 additions & 4 deletions x/wasm/internal/keeper/query_plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,21 @@ func IBCQuerier(wasm *Keeper, channelKeeper types.ChannelKeeper) func(ctx sdk.Co
}
if request.ListChannels != nil {
portID := request.ListChannels.PortID
var channels wasmvmtypes.IBCEndpoints
channels := make(wasmvmtypes.IBCChannels, 0)
channelKeeper.IterateChannels(ctx, func(ch channeltypes.IdentifiedChannel) bool {
if portID == "" || portID == ch.PortId {
newChan := wasmvmtypes.IBCEndpoint{
PortID: ch.PortId,
ChannelID: ch.ChannelId,
newChan := wasmvmtypes.IBCChannel{
Endpoint: wasmvmtypes.IBCEndpoint{
PortID: ch.PortId,
ChannelID: ch.ChannelId,
},
CounterpartyEndpoint: wasmvmtypes.IBCEndpoint{
PortID: ch.Counterparty.PortId,
ChannelID: ch.Counterparty.ChannelId,
},
Order: ch.Ordering.String(),
Version: ch.Version,
ConnectionID: ch.ConnectionHops[0],
}
channels = append(channels, newChan)
}
Expand Down
15 changes: 5 additions & 10 deletions x/wasm/internal/keeper/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ func (k Keeper) OnConnectChannel(
events := types.ParseEvents(res.Attributes, contractAddr)
ctx.EventManager().EmitEvents(events)

// TODO: add submessages support here (and everywhere else) once https://github.com/CosmWasm/cosmwasm/issues/822 is merged
if err := k.dispatchAll(ctx, contractAddr, contractInfo.IBCPortID, nil, res.Messages); err != nil {
if err := k.dispatchAll(ctx, contractAddr, contractInfo.IBCPortID, res.Submessages, res.Messages); err != nil {
return err
}
return nil
Expand Down Expand Up @@ -103,8 +102,7 @@ func (k Keeper) OnCloseChannel(
events := types.ParseEvents(res.Attributes, contractAddr)
ctx.EventManager().EmitEvents(events)

// TODO: add submessages support here (and everywhere else) once https://github.com/CosmWasm/cosmwasm/issues/822 is merged
if err := k.dispatchAll(ctx, contractAddr, contractInfo.IBCPortID, nil, res.Messages); err != nil {
if err := k.dispatchAll(ctx, contractAddr, contractInfo.IBCPortID, res.Submessages, res.Messages); err != nil {
return err
}
return nil
Expand Down Expand Up @@ -140,8 +138,7 @@ func (k Keeper) OnRecvPacket(
events := types.ParseEvents(res.Attributes, contractAddr)
ctx.EventManager().EmitEvents(events)

// TODO: add submessages support here (and everywhere else) once https://github.com/CosmWasm/cosmwasm/issues/822 is merged
if err := k.dispatchAll(ctx, contractAddr, contractInfo.IBCPortID, nil, res.Messages); err != nil {
if err := k.dispatchAll(ctx, contractAddr, contractInfo.IBCPortID, res.Submessages, res.Messages); err != nil {
return nil, err
}
return res.Acknowledgement, nil
Expand Down Expand Up @@ -178,8 +175,7 @@ func (k Keeper) OnAckPacket(
events := types.ParseEvents(res.Attributes, contractAddr)
ctx.EventManager().EmitEvents(events)

// TODO: add submessages support here (and everywhere else) once https://github.com/CosmWasm/cosmwasm/issues/822 is merged
if err := k.dispatchAll(ctx, contractAddr, contractInfo.IBCPortID, nil, res.Messages); err != nil {
if err := k.dispatchAll(ctx, contractAddr, contractInfo.IBCPortID, res.Submessages, res.Messages); err != nil {
return err
}
return nil
Expand Down Expand Up @@ -212,8 +208,7 @@ func (k Keeper) OnTimeoutPacket(
events := types.ParseEvents(res.Attributes, contractAddr)
ctx.EventManager().EmitEvents(events)

// TODO: add submessages support here (and everywhere else) once https://github.com/CosmWasm/cosmwasm/issues/822 is merged
if err := k.dispatchAll(ctx, contractAddr, contractInfo.IBCPortID, nil, res.Messages); err != nil {
if err := k.dispatchAll(ctx, contractAddr, contractInfo.IBCPortID, res.Submessages, res.Messages); err != nil {
return err
}
return nil
Expand Down
Binary file modified x/wasm/internal/keeper/testdata/burner.wasm
Binary file not shown.
Binary file modified x/wasm/internal/keeper/testdata/hackatom.wasm
Binary file not shown.
Binary file modified x/wasm/internal/keeper/testdata/hackatom.wasm.gzip
Binary file not shown.
Binary file modified x/wasm/internal/keeper/testdata/ibc_reflect.wasm
Binary file not shown.
Binary file modified x/wasm/internal/keeper/testdata/ibc_reflect_send.wasm
Binary file not shown.
Binary file modified x/wasm/internal/keeper/testdata/reflect.wasm
Binary file not shown.
Binary file modified x/wasm/internal/keeper/testdata/staking.wasm
Binary file not shown.

0 comments on commit bd3cae0

Please sign in to comment.