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

update wasmd to v0.51.0 #2045

Merged
merged 18 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from 9 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
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ linters-settings:
- github.com/cosmos/ibc-go

- github.com/CosmWasm/wasmd
- github.com/CosmWasm/wasmvm
- github.com/CosmWasm/wasmvm/v2

- github.com/cosmos/gogoproto

Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ Ref: https://keepachangelog.com/en/1.0.0/
- Bump `github.com/spf13/cobra` from 1.8.0 to 1.8.1 ([#2038](https://github.com/provenance-io/provenance/pull/2038))
- Bump `docker/build-push-action` from 5 to 6 ([#2039](https://github.com/provenance-io/provenance/pull/2039))
- Bump `github.com/cosmos/ibc-go/v8` from 8.2.1 to 8.3.2 ([#2043](https://github.com/provenance-io/provenance/pull/2043))
- Bump wasmd to `v0.51.0` [#2045](https://github.com/provenance-io/provenance/pull/2045).
- Bump wasmvm to `v2.0.1` [#2045](https://github.com/provenance-io/provenance/pull/2045).

---

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ build-release-libwasm: $(RELEASE_WASM)

$(RELEASE_WASM): $(RELEASE_BIN)
go mod vendor && \
cp vendor/github.com/CosmWasm/wasmvm/internal/api/$(LIBWASMVM) $(RELEASE_BIN)
cp vendor/github.com/CosmWasm/wasmvm/v2/internal/api/$(LIBWASMVM) $(RELEASE_BIN)

.PHONY: build-release-bin
build-release-bin: $(RELEASE_PIO)
Expand Down
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ func New(

// Add the capabilities and indicate that provwasm contracts can be run on this chain.
// Capabilities defined here: https://github.com/CosmWasm/cosmwasm/blob/main/docs/CAPABILITIES-BUILT-IN.md
supportedFeatures := "staking,provenance,stargate,iterator,cosmwasm_1_1, cosmwasm_1_2, cosmwasm_1_3, cosmwasm_1_4"
supportedFeatures := []string{"staking", "provenance", "stargate", "iterator", "cosmwasm_1_1", "cosmwasm_1_2", "cosmwasm_1_3", "cosmwasm_1_4", "cosmwasm_2_0"}

// The last arguments contain custom message handlers, and custom query handlers,
// to allow smart contracts to use provenance modules.
Expand Down
2 changes: 1 addition & 1 deletion docker/blockchain/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ RUN apt-get update && \
rm -rf /var/lib/apt/lists/


COPY --from=build /go/src/github.com/provenance-io/provenance/vendor/github.com/CosmWasm/wasmvm/internal/api/libwasmvm.*.so /tmp
COPY --from=build /go/src/github.com/provenance-io/provenance/vendor/github.com/CosmWasm/wasmvm/v2/internal/api/libwasmvm.*.so /tmp
kwtalley marked this conversation as resolved.
Show resolved Hide resolved
COPY --from=build /go/bin/provenanced /usr/bin/provenanced

RUN ARCH=$(uname -m) && \
kwtalley marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ require (
cosmossdk.io/x/feegrant v0.1.1
cosmossdk.io/x/tx v0.13.3
cosmossdk.io/x/upgrade v0.1.3
github.com/CosmWasm/wasmd v0.50.0
github.com/CosmWasm/wasmvm v1.5.0
github.com/CosmWasm/wasmd v0.51.0
github.com/CosmWasm/wasmvm/v2 v2.0.1
github.com/cometbft/cometbft v0.38.7
github.com/cometbft/cometbft-db v0.9.1
github.com/cosmos/cosmos-db v1.0.2
Expand Down Expand Up @@ -211,7 +211,7 @@ replace (
// Use cosmos fork of keyring (because the SDK does).
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0
// This is required for https://github.com/provenance-io/provenance/issues/1414
github.com/CosmWasm/wasmd => github.com/provenance-io/wasmd v0.50.0-pio-2
github.com/CosmWasm/wasmd => github.com/provenance-io/wasmd v0.51.0-pio-1
github.com/cosmos/cosmos-sdk => github.com/provenance-io/cosmos-sdk v0.50.7-pio-1

// TODO: Update once async-icq creates tag with our changes https://github.com/cosmos/ibc-apps/pull/168
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/CosmWasm/wasmvm v1.5.0 h1:3hKeT9SfwfLhxTGKH3vXaKFzBz1yuvP8SlfwfQXbQfw=
github.com/CosmWasm/wasmvm v1.5.0/go.mod h1:fXB+m2gyh4v9839zlIXdMZGeLAxqUdYdFQqYsTha2hc=
github.com/CosmWasm/wasmvm/v2 v2.0.1 h1:0YCQ7MKGNri7NFeRp75erPJXrqyCtH4gdc9jMstyMzk=
github.com/CosmWasm/wasmvm/v2 v2.0.1/go.mod h1:su9lg5qLr7adV95eOfzjZWkGiky8WNaNIHDr7Fpu7Ck=
github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4=
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ=
Expand Down Expand Up @@ -912,8 +912,8 @@ github.com/provenance-io/ibc-apps/modules/async-icq/v8 v8.0.0-prov-1 h1:p+7pxHB0
github.com/provenance-io/ibc-apps/modules/async-icq/v8 v8.0.0-prov-1/go.mod h1:tObW9uxibh5Z22CtOaHVeTDotCSMyc/2B4MrYdaViBo=
github.com/provenance-io/ibc-go/v8 v8.3.2-pio-1 h1:NOybWs/qIj0gGsOUs8xXwiAlEgtZwOtkhf0/yD0dZYA=
github.com/provenance-io/ibc-go/v8 v8.3.2-pio-1/go.mod h1:izwHZvn9lKrBn8xWj0aXWut6HKcwHMPD3uyuvOJoPSA=
github.com/provenance-io/wasmd v0.50.0-pio-2 h1:vuRXQ7NvqEk0TZ/dDFEfojMTwCn/ItVDjMe3/jiCDbY=
github.com/provenance-io/wasmd v0.50.0-pio-2/go.mod h1:UjmShW4l9YxaMytwJZ7IB7MWzHiynSZP3DdWrG0FRtk=
github.com/provenance-io/wasmd v0.51.0-pio-1 h1:qKCK6PMRVayoZ6mFEvq1Z8wPKX4OtYZ0i+e2CrkVdQY=
github.com/provenance-io/wasmd v0.51.0-pio-1/go.mod h1:7TSaj5HoolghujuVWeExqmcUKgpcYWEySGLSODbnnwY=
github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ=
github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
Expand Down
2 changes: 1 addition & 1 deletion internal/provwasm/query_plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"

wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmvmtypes "github.com/CosmWasm/wasmvm/types"
wasmvmtypes "github.com/CosmWasm/wasmvm/v2/types"

abci "github.com/cometbft/cometbft/abci/types"

Expand Down
2 changes: 1 addition & 1 deletion internal/provwasm/stargate_whitelist.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"sync"

wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
wasmvmtypes "github.com/CosmWasm/wasmvm/types"
wasmvmtypes "github.com/CosmWasm/wasmvm/v2/types"

circuittypes "cosmossdk.io/x/circuit/types"
evidencetypes "cosmossdk.io/x/evidence/types"
Expand Down
4 changes: 2 additions & 2 deletions networks/dev/blockchain-dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ WORKDIR /provenance
EXPOSE 26656 26657 1317 9090

# Source binaries from the build above
COPY --from=build-x86_64 /go/src/github.com/provenance-io/provenance/vendor/github.com/CosmWasm/wasmvm/internal/api/libwasmvm.x86_64.so /usr/local/lib/
COPY --from=build-x86_64 /go/src/github.com/provenance-io/provenance/vendor/github.com/CosmWasm/wasmvm/v2/internal/api/libwasmvm.x86_64.so /usr/local/lib/
kwtalley marked this conversation as resolved.
Show resolved Hide resolved
COPY --from=build-x86_64 /go/bin/provenanced /usr/bin/provenanced

COPY networks/dev/mnemonics/ /mnemonics/
Expand Down Expand Up @@ -81,7 +81,7 @@ WORKDIR /provenance
EXPOSE 26656 26657 1317 9090

# Source binaries from the build above
COPY --from=build-arm64 /go/src/github.com/provenance-io/provenance/vendor/github.com/CosmWasm/wasmvm/internal/api/libwasmvm.aarch64.so /usr/local/lib/
COPY --from=build-arm64 /go/src/github.com/provenance-io/provenance/vendor/github.com/CosmWasm/wasmvm/v2/internal/api/libwasmvm.aarch64.so /usr/local/lib/

COPY --from=build-arm64 /go/bin/provenanced /usr/bin/provenanced

Expand Down
4 changes: 2 additions & 2 deletions networks/ibc/blockchain-ibc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ WORKDIR /provenance
EXPOSE 26656 26657 1317 9090

# Source binaries from the build above
COPY --from=build-x86_64 /go/src/github.com/provenance-io/provenance/vendor/github.com/CosmWasm/wasmvm/internal/api/libwasmvm.x86_64.so /usr/local/lib/
COPY --from=build-x86_64 /go/src/github.com/provenance-io/provenance/vendor/github.com/CosmWasm/wasmvm/v2/internal/api/libwasmvm.x86_64.so /usr/local/lib/
kwtalley marked this conversation as resolved.
Show resolved Hide resolved
COPY --from=build-x86_64 /go/bin/provenanced /usr/bin/provenanced

COPY networks/ibc/blockchain-ibc/entrypoint.sh /usr/bin/entrypoint.sh
Expand Down Expand Up @@ -85,7 +85,7 @@ WORKDIR /provenance
EXPOSE 26656 26657 1317 9090

# Source binaries from the build above
COPY --from=build-arm64 /go/src/github.com/provenance-io/provenance/vendor/github.com/CosmWasm/wasmvm/internal/api/libwasmvm.aarch64.so /usr/local/lib/
COPY --from=build-arm64 /go/src/github.com/provenance-io/provenance/vendor/github.com/CosmWasm/wasmvm/v2/internal/api/libwasmvm.aarch64.so /usr/local/lib/

COPY --from=build-arm64 /go/bin/provenanced /usr/bin/provenanced

Expand Down
4 changes: 2 additions & 2 deletions networks/local/blockchain-local/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ WORKDIR /provenance
EXPOSE 26656 26657 1317 9090

# Source binaries from the build above
COPY --from=build-x86_64 /go/src/github.com/provenance-io/provenance/vendor/github.com/CosmWasm/wasmvm/internal/api/libwasmvm.x86_64.so /usr/local/lib/
COPY --from=build-x86_64 /go/src/github.com/provenance-io/provenance/vendor/github.com/CosmWasm/wasmvm/v2/internal/api/libwasmvm.x86_64.so /usr/local/lib/
kwtalley marked this conversation as resolved.
Show resolved Hide resolved
COPY --from=build-x86_64 /go/bin/provenanced /usr/bin/provenanced

COPY networks/local/blockchain-local/entrypoint.sh /usr/bin/entrypoint.sh
Expand Down Expand Up @@ -85,7 +85,7 @@ WORKDIR /provenance
EXPOSE 26656 26657 1317 9090

# Source binaries from the build above
COPY --from=build-arm64 /go/src/github.com/provenance-io/provenance/vendor/github.com/CosmWasm/wasmvm/internal/api/libwasmvm.aarch64.so /usr/local/lib/
COPY --from=build-arm64 /go/src/github.com/provenance-io/provenance/vendor/github.com/CosmWasm/wasmvm/v2/internal/api/libwasmvm.aarch64.so /usr/local/lib/

COPY --from=build-arm64 /go/bin/provenanced /usr/bin/provenanced

Expand Down
11 changes: 8 additions & 3 deletions third_party/proto/cosmwasm/wasm/v1/authz.proto
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ message MaxFundsLimit {
repeated cosmos.base.v1beta1.Coin amounts = 1 [
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
(amino.encoding) = "legacy_coins"
];
}

Expand All @@ -118,7 +119,8 @@ message CombinedLimit {
repeated cosmos.base.v1beta1.Coin amounts = 2 [
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
(amino.encoding) = "legacy_coins"
];
}

Expand Down Expand Up @@ -152,5 +154,8 @@ message AcceptedMessagesFilter {
"cosmwasm.wasm.v1.ContractAuthzFilterX";

// Messages is the list of raw contract messages
repeated bytes messages = 1 [ (gogoproto.casttype) = "RawContractMessage" ];
repeated bytes messages = 1 [
(gogoproto.casttype) = "RawContractMessage",
(amino.encoding) = "inline_json"
];
}
42 changes: 32 additions & 10 deletions third_party/proto/cosmwasm/wasm/v1/proposal_legacy.proto
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,16 @@ message InstantiateContractProposal {
// Label is optional metadata to be stored with a constract instance.
string label = 6;
// Msg json encoded message to be passed to the contract on instantiation
bytes msg = 7 [ (gogoproto.casttype) = "RawContractMessage" ];
bytes msg = 7 [
(gogoproto.casttype) = "RawContractMessage",
(amino.encoding) = "inline_json"
];
// Funds coins that are transferred to the contract on instantiation
repeated cosmos.base.v1beta1.Coin funds = 8 [
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
(amino.encoding) = "legacy_coins"
];
}

Expand All @@ -98,12 +102,16 @@ message InstantiateContract2Proposal {
// Label is optional metadata to be stored with a constract instance.
string label = 6;
// Msg json encode message to be passed to the contract on instantiation
bytes msg = 7 [ (gogoproto.casttype) = "RawContractMessage" ];
bytes msg = 7 [
(gogoproto.casttype) = "RawContractMessage",
(amino.encoding) = "inline_json"
];
// Funds coins that are transferred to the contract on instantiation
repeated cosmos.base.v1beta1.Coin funds = 8 [
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
(amino.encoding) = "legacy_coins"
];
// Salt is an arbitrary value provided by the sender. Size can be 1 to 64.
bytes salt = 9;
Expand Down Expand Up @@ -132,7 +140,10 @@ message MigrateContractProposal {
// CodeID references the new WASM code
uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ];
// Msg json encoded message to be passed to the contract on migration
bytes msg = 6 [ (gogoproto.casttype) = "RawContractMessage" ];
bytes msg = 6 [
(gogoproto.casttype) = "RawContractMessage",
(amino.encoding) = "inline_json"
];
}

// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for
Expand All @@ -151,7 +162,10 @@ message SudoContractProposal {
// Contract is the address of the smart contract
string contract = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
// Msg json encoded message to be passed to the contract as sudo
bytes msg = 4 [ (gogoproto.casttype) = "RawContractMessage" ];
bytes msg = 4 [
(gogoproto.casttype) = "RawContractMessage",
(amino.encoding) = "inline_json"
];
}

// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for
Expand All @@ -172,12 +186,16 @@ message ExecuteContractProposal {
// Contract is the address of the smart contract
string contract = 4 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
// Msg json encoded message to be passed to the contract as execute
bytes msg = 5 [ (gogoproto.casttype) = "RawContractMessage" ];
bytes msg = 5 [
(gogoproto.casttype) = "RawContractMessage",
(amino.encoding) = "inline_json"
];
// Funds coins that are transferred to the contract on instantiation
repeated cosmos.base.v1beta1.Coin funds = 6 [
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
(amino.encoding) = "legacy_coins"
];
}

Expand Down Expand Up @@ -315,12 +333,16 @@ message StoreAndInstantiateContractProposal {
// Label is optional metadata to be stored with a constract instance.
string label = 8;
// Msg json encoded message to be passed to the contract on instantiation
bytes msg = 9 [ (gogoproto.casttype) = "RawContractMessage" ];
bytes msg = 9 [
(gogoproto.casttype) = "RawContractMessage",
(amino.encoding) = "inline_json"
];
// Funds coins that are transferred to the contract on instantiation
repeated cosmos.base.v1beta1.Coin funds = 10 [
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
(amino.encoding) = "legacy_coins"
];
// Source is the URL where the code is hosted
string source = 11;
Expand Down
37 changes: 35 additions & 2 deletions third_party/proto/cosmwasm/wasm/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ service Query {
option (google.api.http).get =
"/cosmwasm/wasm/v1/contracts/creator/{creator_address}";
}

// BuildAddress builds a contract address
rpc BuildAddress(QueryBuildAddressRequest)
returns (QueryBuildAddressResponse) {
option (google.api.http).get = "/cosmwasm/wasm/v1/contract/build_address";
}
}

// QueryContractInfoRequest is the request type for the Query/ContractInfo RPC
Expand Down Expand Up @@ -171,14 +177,20 @@ message QuerySmartContractStateRequest {
// address is the address of the contract
string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
// QueryData contains the query data passed to the contract
bytes query_data = 2 [ (gogoproto.casttype) = "RawContractMessage" ];
bytes query_data = 2 [
(gogoproto.casttype) = "RawContractMessage",
(amino.encoding) = "inline_json"
];
}

// QuerySmartContractStateResponse is the response type for the
// Query/SmartContractState RPC method
message QuerySmartContractStateResponse {
// Data contains the json data returned from the smart contract
bytes data = 1 [ (gogoproto.casttype) = "RawContractMessage" ];
bytes data = 1 [
(gogoproto.casttype) = "RawContractMessage",
(amino.encoding) = "inline_json"
];
}

// QueryCodeRequest is the request type for the Query/Code RPC method
Expand Down Expand Up @@ -268,4 +280,25 @@ message QueryContractsByCreatorResponse {
[ (cosmos_proto.scalar) = "cosmos.AddressString" ];
// Pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

// QueryBuildAddressRequest is the request type for the Query/BuildAddress RPC
// method.
message QueryBuildAddressRequest {
// CodeHash is the hash of the code
string code_hash = 1;
// CreatorAddress is the address of the contract instantiator
string creator_address = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
// Salt is a hex encoded salt
string salt = 3;
// InitArgs are optional json encoded init args to be used in contract address
// building if provided
bytes init_args = 4;
}

// QueryBuildAddressResponse is the response type for the Query/BuildAddress RPC
// method.
message QueryBuildAddressResponse {
// Address is the contract address
string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
}
Loading
Loading