diff --git a/.changelog/unreleased/dependencies/3366-bump-wasmvm-version.md b/.changelog/unreleased/dependencies/3366-bump-wasmvm-version.md new file mode 100644 index 00000000000..24fe96abd5e --- /dev/null +++ b/.changelog/unreleased/dependencies/3366-bump-wasmvm-version.md @@ -0,0 +1,2 @@ +- Update wasmvm to v2.1.3 - security patch + ([\#3366](https://github.com/cosmos/gaia/pull/3366)) diff --git a/.dockerignore b/.dockerignore index 4a11244b79b..faa1f90c538 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,6 @@ node_modules build .github -.vscode \ No newline at end of file +.vscode +docs +.changelog diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 7cead4c66c6..f23552186a3 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -21,7 +21,7 @@ updates: directory: "/" schedule: interval: daily - target-branch: "release/v19.2.x" + target-branch: "release/v21.x" # Only allow automated security-related dependency updates on release branches. open-pull-requests-limit: 0 labels: diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 43c3f65f28f..c556ad45010 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -40,7 +40,7 @@ jobs: make build-docs - name: Deploy 🚀 - uses: JamesIves/github-pages-deploy-action@v4.6.4 + uses: JamesIves/github-pages-deploy-action@v4.6.8 with: branch: gh-pages folder: ~/output diff --git a/.github/workflows/docker-push.yml b/.github/workflows/docker-push.yml index bfd427afc56..66e913a023d 100644 --- a/.github/workflows/docker-push.yml +++ b/.github/workflows/docker-push.yml @@ -46,7 +46,7 @@ jobs: flavor: "latest=false" - name: Build and push docker image - uses: docker/build-push-action@v6.7.0 + uses: docker/build-push-action@v6.9.0 with: context: . file: Dockerfile diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dd889406d21..a7deed99220 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -163,15 +163,15 @@ jobs: # the old gaiad binary version is hardcoded, need to be updated each major release. - name: Install Old Gaiad run: | - curl -LO https://github.com/cosmos/gaia/releases/download/v19.1.0/gaiad-v19.1.0-linux-amd64 - chmod a+x gaiad-v19.1.0-linux-amd64 + curl -LO https://github.com/cosmos/gaia/releases/download/v20.0.0/gaiad-v20.0.0-linux-amd64 + chmod a+x gaiad-v20.0.0-linux-amd64 mkdir build - mv ./gaiad-v19.1.0-linux-amd64 ./build/gaiadold + mv ./gaiad-v20.0.0-linux-amd64 ./build/gaiadold if: env.GIT_DIFF - name: Install New Gaiad run: | - curl -LO https://github.com/CosmWasm/wasmvm/releases/download/v2.1.2/libwasmvm.x86_64.so - curl -LO https://github.com/CosmWasm/wasmvm/releases/download/v2.1.2/libwasmvm.aarch64.so + curl -LO https://github.com/CosmWasm/wasmvm/releases/download/v2.1.3/libwasmvm.x86_64.so + curl -LO https://github.com/CosmWasm/wasmvm/releases/download/v2.1.3/libwasmvm.aarch64.so uname -m sudo cp "./libwasmvm.$(uname -m).so" /usr/lib/ make build diff --git a/.mergify.yml b/.mergify.yml index 2a0004c821c..7eb29f16060 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -24,14 +24,14 @@ pull_request_rules: {{ title }} (#{{ number }}) {{ body }} - - name: Backport patches to the release/v19.2.x branch + - name: Backport patches to the release/v21.x branch conditions: - base=main - - label=A:backport/v19.2.x + - label=A:backport/v21.x actions: backport: branches: - - release/v19.2.x + - release/v21.x - name: Backport patches to the release/v20.x branch conditions: diff --git a/Dockerfile b/Dockerfile index ee5ef73d792..26c334bc930 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,11 +8,11 @@ ENV PACKAGES="curl make git libc-dev bash file gcc linux-headers eudev-dev" RUN apk add --no-cache $PACKAGES # See https://github.com/CosmWasm/wasmvm/releases -ARG WASMVM_VERSION=v2.1.2 +ARG WASMVM_VERSION=v2.1.3 ADD https://github.com/CosmWasm/wasmvm/releases/download/${WASMVM_VERSION}/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a ADD https://github.com/CosmWasm/wasmvm/releases/download/${WASMVM_VERSION}/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a -RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 0881c5b463e89e229b06370e9e2961aec0a5c636772d5142c68d351564464a66 -RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep 58e1f6bfa89ee390cb9abc69a5bc126029a497fe09dd399f38a82d0d86fe95ef +RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep faea4e15390e046d2ca8441c21a88dba56f9a0363f92c5d94015df0ac6da1f2d +RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep 8dab08434a5fe57a6fbbcb8041794bc3c31846d31f8ff5fb353ee74e0fcd3093 RUN cp "/lib/libwasmvm_muslc.$(uname -m).a" /lib/libwasmvm_muslc.a COPY go.mod go.sum* ./ diff --git a/ante/ante.go b/ante/ante.go index c6dd21f7b0b..536abf05356 100644 --- a/ante/ante.go +++ b/ante/ante.go @@ -22,7 +22,7 @@ import ( wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" - gaiaerrors "github.com/cosmos/gaia/v20/types/errors" + gaiaerrors "github.com/cosmos/gaia/v21/types/errors" ) // UseFeeMarketDecorator to make the integration testing easier: we can switch off its ante and post decorators with this flag diff --git a/ante/gov_expedited_ante.go b/ante/gov_expedited_ante.go index dc7191779f3..d9924a0e0f9 100644 --- a/ante/gov_expedited_ante.go +++ b/ante/gov_expedited_ante.go @@ -7,7 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - gaiaerrors "github.com/cosmos/gaia/v20/types/errors" + gaiaerrors "github.com/cosmos/gaia/v21/types/errors" ) var expeditedPropDecoratorEnabled = true diff --git a/ante/gov_expedited_ante_test.go b/ante/gov_expedited_ante_test.go index 2e531f1fe4f..124a5d9ccc7 100644 --- a/ante/gov_expedited_ante_test.go +++ b/ante/gov_expedited_ante_test.go @@ -14,8 +14,8 @@ import ( govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "github.com/cosmos/gaia/v20/ante" - "github.com/cosmos/gaia/v20/app/helpers" + "github.com/cosmos/gaia/v21/ante" + "github.com/cosmos/gaia/v21/app/helpers" ) func TestGovExpeditedProposalsDecorator(t *testing.T) { diff --git a/ante/gov_vote_ante.go b/ante/gov_vote_ante.go index b29a84fa6ab..c00ca8ac624 100644 --- a/ante/gov_vote_ante.go +++ b/ante/gov_vote_ante.go @@ -12,7 +12,7 @@ import ( stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - gaiaerrors "github.com/cosmos/gaia/v20/types/errors" + gaiaerrors "github.com/cosmos/gaia/v21/types/errors" ) var ( diff --git a/ante/gov_vote_ante_test.go b/ante/gov_vote_ante_test.go index c2866abaec0..66a2b1fb6b7 100644 --- a/ante/gov_vote_ante_test.go +++ b/ante/gov_vote_ante_test.go @@ -15,8 +15,8 @@ import ( govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/cosmos/gaia/v20/ante" - "github.com/cosmos/gaia/v20/app/helpers" + "github.com/cosmos/gaia/v21/ante" + "github.com/cosmos/gaia/v21/app/helpers" ) // Test that the GovVoteDecorator rejects v1beta1 vote messages from accounts with less than 1 atom staked diff --git a/app/app.go b/app/app.go index 330488b080a..1f660e665ec 100644 --- a/app/app.go +++ b/app/app.go @@ -66,17 +66,17 @@ import ( wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" - gaiaante "github.com/cosmos/gaia/v20/ante" - "github.com/cosmos/gaia/v20/app/keepers" - "github.com/cosmos/gaia/v20/app/upgrades" - v20 "github.com/cosmos/gaia/v20/app/upgrades/v20" + gaiaante "github.com/cosmos/gaia/v21/ante" + "github.com/cosmos/gaia/v21/app/keepers" + "github.com/cosmos/gaia/v21/app/upgrades" + v21 "github.com/cosmos/gaia/v21/app/upgrades/v21" ) var ( // DefaultNodeHome default home directories for the application daemon DefaultNodeHome string - Upgrades = []upgrades.Upgrade{v20.Upgrade} + Upgrades = []upgrades.Upgrade{v21.Upgrade} ) var ( diff --git a/app/app_test.go b/app/app_test.go index 2e87646f0b9..bd300ac0dde 100644 --- a/app/app_test.go +++ b/app/app_test.go @@ -14,8 +14,8 @@ import ( wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" - gaia "github.com/cosmos/gaia/v20/app" - gaiahelpers "github.com/cosmos/gaia/v20/app/helpers" + gaia "github.com/cosmos/gaia/v21/app" + gaiahelpers "github.com/cosmos/gaia/v21/app/helpers" ) type EmptyAppOptions struct{} diff --git a/app/helpers/test_helpers.go b/app/helpers/test_helpers.go index ecd38f2b85d..be59014284d 100644 --- a/app/helpers/test_helpers.go +++ b/app/helpers/test_helpers.go @@ -30,7 +30,7 @@ import ( wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" - gaiaapp "github.com/cosmos/gaia/v20/app" + gaiaapp "github.com/cosmos/gaia/v21/app" ) // SimAppChainID hardcoded chainID for simulation diff --git a/app/modules.go b/app/modules.go index 8afebc13489..a5aa6b7c69d 100644 --- a/app/modules.go +++ b/app/modules.go @@ -62,8 +62,8 @@ import ( wasm "github.com/CosmWasm/wasmd/x/wasm" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" - "github.com/cosmos/gaia/v20/x/metaprotocols" - metaprotocolstypes "github.com/cosmos/gaia/v20/x/metaprotocols/types" + "github.com/cosmos/gaia/v21/x/metaprotocols" + metaprotocolstypes "github.com/cosmos/gaia/v21/x/metaprotocols/types" ) var maccPerms = map[string][]string{ diff --git a/app/post.go b/app/post.go index 47f439101ef..543ec95d0f3 100644 --- a/app/post.go +++ b/app/post.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/gaia/v20/ante" + "github.com/cosmos/gaia/v21/ante" ) // PostHandlerOptions are the options required for constructing a FeeMarket PostHandler. diff --git a/app/sim/sim_state.go b/app/sim/sim_state.go index 9bd3f118559..e393d733efd 100644 --- a/app/sim/sim_state.go +++ b/app/sim/sim_state.go @@ -22,7 +22,7 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - gaia "github.com/cosmos/gaia/v20/app" + gaia "github.com/cosmos/gaia/v21/app" ) // Simulation parameter constants diff --git a/app/sim/sim_utils.go b/app/sim/sim_utils.go index 521a1293124..d57f9a96772 100644 --- a/app/sim/sim_utils.go +++ b/app/sim/sim_utils.go @@ -12,7 +12,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - gaia "github.com/cosmos/gaia/v20/app" + gaia "github.com/cosmos/gaia/v21/app" ) // SimulationOperations retrieves the simulation params from the provided file path diff --git a/app/sim_bench_test.go b/app/sim_bench_test.go index 746679adff2..96dedb81d8d 100644 --- a/app/sim_bench_test.go +++ b/app/sim_bench_test.go @@ -13,8 +13,8 @@ import ( "github.com/cosmos/cosmos-sdk/x/simulation" simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli" - gaia "github.com/cosmos/gaia/v20/app" - "github.com/cosmos/gaia/v20/app/sim" + gaia "github.com/cosmos/gaia/v21/app" + "github.com/cosmos/gaia/v21/app/sim" ) // Profile with: diff --git a/app/sim_test.go b/app/sim_test.go index f4de591f576..007d53e9cd5 100644 --- a/app/sim_test.go +++ b/app/sim_test.go @@ -23,11 +23,11 @@ import ( "github.com/cosmos/cosmos-sdk/x/simulation" simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli" - "github.com/cosmos/gaia/v20/ante" - gaia "github.com/cosmos/gaia/v20/app" + "github.com/cosmos/gaia/v21/ante" + gaia "github.com/cosmos/gaia/v21/app" // "github.com/cosmos/gaia/v11/app/helpers" // "github.com/cosmos/gaia/v11/app/params" - "github.com/cosmos/gaia/v20/app/sim" + "github.com/cosmos/gaia/v21/app/sim" ) // AppChainID hardcoded chainID for simulation diff --git a/app/upgrades/types.go b/app/upgrades/types.go index eacfa0e2364..a2a1e50c93d 100644 --- a/app/upgrades/types.go +++ b/app/upgrades/types.go @@ -7,7 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/gaia/v20/app/keepers" + "github.com/cosmos/gaia/v21/app/keepers" ) // Upgrade defines a struct containing necessary fields that a SoftwareUpgradeProposal diff --git a/app/upgrades/v19/constants.go b/app/upgrades/v19/constants.go index baec135063d..85c4e043390 100644 --- a/app/upgrades/v19/constants.go +++ b/app/upgrades/v19/constants.go @@ -1,7 +1,7 @@ package v19 import ( - "github.com/cosmos/gaia/v20/app/upgrades" + "github.com/cosmos/gaia/v21/app/upgrades" ) const ( diff --git a/app/upgrades/v19/upgrades.go b/app/upgrades/v19/upgrades.go index cb9215d772d..7042b8ebd98 100644 --- a/app/upgrades/v19/upgrades.go +++ b/app/upgrades/v19/upgrades.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/gaia/v20/app/keepers" + "github.com/cosmos/gaia/v21/app/keepers" ) func CreateUpgradeHandler( diff --git a/app/upgrades/v20/constants.go b/app/upgrades/v20/constants.go index d91171e99c9..3c362c6ec63 100644 --- a/app/upgrades/v20/constants.go +++ b/app/upgrades/v20/constants.go @@ -1,7 +1,7 @@ package v20 import ( - "github.com/cosmos/gaia/v20/app/upgrades" + "github.com/cosmos/gaia/v21/app/upgrades" ) const ( diff --git a/app/upgrades/v20/upgrades.go b/app/upgrades/v20/upgrades.go index 6969cd00cbe..70a303828d2 100644 --- a/app/upgrades/v20/upgrades.go +++ b/app/upgrades/v20/upgrades.go @@ -23,7 +23,7 @@ import ( govtypesv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - "github.com/cosmos/gaia/v20/app/keepers" + "github.com/cosmos/gaia/v21/app/keepers" ) // Constants for the new parameters in the v20 upgrade. diff --git a/app/upgrades/v20/upgrades_test.go b/app/upgrades/v20/upgrades_test.go index c42afb9716a..a5d52890319 100644 --- a/app/upgrades/v20/upgrades_test.go +++ b/app/upgrades/v20/upgrades_test.go @@ -21,8 +21,8 @@ import ( govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - "github.com/cosmos/gaia/v20/app/helpers" - v20 "github.com/cosmos/gaia/v20/app/upgrades/v20" + "github.com/cosmos/gaia/v21/app/helpers" + v20 "github.com/cosmos/gaia/v21/app/upgrades/v20" ) func GetTestMsgConsumerAddition() providertypes.MsgConsumerAddition { //nolint:staticcheck diff --git a/app/upgrades/v21/constants.go b/app/upgrades/v21/constants.go index ca58423d985..022e20ff366 100644 --- a/app/upgrades/v21/constants.go +++ b/app/upgrades/v21/constants.go @@ -1,7 +1,7 @@ package v21 import ( - "github.com/cosmos/gaia/v20/app/upgrades" + "github.com/cosmos/gaia/v21/app/upgrades" ) const ( diff --git a/app/upgrades/v21/upgrades.go b/app/upgrades/v21/upgrades.go index 356c6d83b45..071207a3fd2 100644 --- a/app/upgrades/v21/upgrades.go +++ b/app/upgrades/v21/upgrades.go @@ -2,15 +2,16 @@ package v21 import ( "context" + "fmt" + errorsmod "cosmossdk.io/errors" "cosmossdk.io/math" upgradetypes "cosmossdk.io/x/upgrade/types" - "fmt" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - "github.com/cosmos/gaia/v20/app/keepers" + "github.com/cosmos/gaia/v21/app/keepers" providerkeeper "github.com/cosmos/interchain-security/v6/x/ccv/provider/keeper" types2 "github.com/cosmos/interchain-security/v6/x/ccv/provider/types" ) diff --git a/cmd/gaiad/cmd/bech32_convert.go b/cmd/gaiad/cmd/bech32_convert.go index d0b05017250..63170133aff 100644 --- a/cmd/gaiad/cmd/bech32_convert.go +++ b/cmd/gaiad/cmd/bech32_convert.go @@ -5,7 +5,7 @@ import ( "github.com/spf13/cobra" - addressutil "github.com/cosmos/gaia/v20/pkg/address" + addressutil "github.com/cosmos/gaia/v21/pkg/address" ) var flagBech32Prefix = "prefix" diff --git a/cmd/gaiad/cmd/root.go b/cmd/gaiad/cmd/root.go index ee172e10359..fce0ccb2e7b 100644 --- a/cmd/gaiad/cmd/root.go +++ b/cmd/gaiad/cmd/root.go @@ -57,7 +57,7 @@ import ( wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" - gaia "github.com/cosmos/gaia/v20/app" + gaia "github.com/cosmos/gaia/v21/app" ) // NewRootCmd creates a new root command for simd. It is called once in the diff --git a/cmd/gaiad/cmd/root_test.go b/cmd/gaiad/cmd/root_test.go index 53daf7b4568..f715564ba0c 100644 --- a/cmd/gaiad/cmd/root_test.go +++ b/cmd/gaiad/cmd/root_test.go @@ -7,8 +7,8 @@ import ( svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" - app "github.com/cosmos/gaia/v20/app" - "github.com/cosmos/gaia/v20/cmd/gaiad/cmd" + app "github.com/cosmos/gaia/v21/app" + "github.com/cosmos/gaia/v21/cmd/gaiad/cmd" ) func TestRootCmdConfig(t *testing.T) { diff --git a/cmd/gaiad/cmd/testnet_set_local_validator.go b/cmd/gaiad/cmd/testnet_set_local_validator.go index c83c073e31d..427b43454ac 100644 --- a/cmd/gaiad/cmd/testnet_set_local_validator.go +++ b/cmd/gaiad/cmd/testnet_set_local_validator.go @@ -19,7 +19,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" "github.com/cosmos/cosmos-sdk/server" servertypes "github.com/cosmos/cosmos-sdk/server/types" - gaia "github.com/cosmos/gaia/v20/app" + gaia "github.com/cosmos/gaia/v21/app" "github.com/spf13/cast" "github.com/spf13/cobra" diff --git a/cmd/gaiad/main.go b/cmd/gaiad/main.go index 056b65d6f1e..b0dcfc74bca 100644 --- a/cmd/gaiad/main.go +++ b/cmd/gaiad/main.go @@ -5,8 +5,8 @@ import ( svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" - app "github.com/cosmos/gaia/v20/app" - "github.com/cosmos/gaia/v20/cmd/gaiad/cmd" + app "github.com/cosmos/gaia/v21/app" + "github.com/cosmos/gaia/v21/cmd/gaiad/cmd" ) func main() { diff --git a/docs/docs/index.md b/docs/docs/index.md index c05a0f4918b..1f96ef2e3d7 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -18,45 +18,44 @@ Learn more about [being a delegator](./delegators/delegator-faq.md), learn about ## Cosmos Hub Wallets -:::warning +:::tip Do your own research and take precautions in regards to wallet security. Maintaining proper security practices is solely your responsibility when using third party wallets. ::: These community-maintained web and mobile wallets allow you to store & transfer ATOM, delegate ATOM to validators, and vote on on-chain governance proposals. Note that we do not endorse any of the wallets, they are listed for your convenience. -* [Keplr](https://wallet.keplr.app) - Web -* [Ledger](https://www.ledger.com/cosmos-wallet) - Hardware -* [Cosmostation](https://www.cosmostation.io/) - Android, iOS -* [Leap Wallet](https://www.leapwallet.io/) - Android, iOS, Web -* [Atomic Wallet](https://atomicwallet.io/) - Android, Linux, macOS, Windows -* [Citadel.One](https://citadel.one/#mobile) - Android, iOS -* [Cobo](https://cobo.com/) - Android, iOS -* [Crypto.com](https://crypto.com/) - Android, iOS -* [Huobi Wallet](https://www.huobiwallet.com/) - Android, iOS -* [ShapeShift](https://app.shapeshift.com/) - Android, iOS, Web -* [imToken](https://token.im/) - Android, iOS -* [Math Wallet](https://www.mathwallet.org/en/) - Android, iOS, Web -* [Rainbow Wallet](https://www.rainbow.one) - Android, iOS -* [Trust Wallet](https://trustwallet.com/) Android, iOS -* [Komodo Wallet](https://atomicdex.io/en/) - +- [Keplr](https://wallet.keplr.app) - Web +- [Ledger](https://www.ledger.com/cosmos-wallet) - Hardware +- [Cosmostation](https://www.cosmostation.io/) - Android, iOS +- [Leap Wallet](https://www.leapwallet.io/) - Android, iOS, Web +- [Atomic Wallet](https://atomicwallet.io/) - Android, Linux, macOS, Windows +- [Citadel.One](https://citadel.one/#mobile) - Android, iOS +- [Cobo](https://cobo.com/) - Android, iOS +- [Crypto.com](https://crypto.com/) - Android, iOS +- [Huobi Wallet](https://www.huobiwallet.com/) - Android, iOS +- [ShapeShift](https://app.shapeshift.com/) - Android, iOS, Web +- [imToken](https://token.im/) - Android, iOS +- [Math Wallet](https://www.mathwallet.org/en/) - Android, iOS, Web +- [Rainbow Wallet](https://www.rainbow.one) - Android, iOS +- [Trust Wallet](https://trustwallet.com/) Android, iOS +- [Komodo Wallet](https://atomicdex.io/en/) ## Metamask Snaps -* [Leap Wallet](https://www.leapwallet.io/snaps) -* [Mystic Lab](https://metamask.mysticlabs.xyz/) +- [Leap Wallet](https://www.leapwallet.io/snaps) +- [Mystic Lab](https://metamask.mysticlabs.xyz/) ## Cosmos Hub Explorers These block explorers allow you to search, view and analyze Cosmos Hub data—like blocks, transactions, validators, etc. -* [Mintscan](https://mintscan.io) -* [Numia](https://www.datalenses.zone/chain/cosmos) -* [ATOMScan](https://atomscan.com) -* [IOBScan](https://cosmoshub.iobscan.io/) -* [Ping.Pub](https://ping.pub/cosmos) -* [BronBro](https://monitor.bronbro.io/d/cosmos-stats/cosmos) -* [SmartStake](https://cosmos.smartstake.io/stats) +- [Mintscan](https://mintscan.io) +- [Numia](https://www.datalenses.zone/chain/cosmos) +- [ATOMScan](https://atomscan.com) +- [IOBScan](https://cosmoshub.iobscan.io/) +- [Ping.Pub](https://ping.pub/cosmos) +- [BronBro](https://monitor.bronbro.io/d/cosmos-stats/cosmos) +- [SmartStake](https://cosmos.smartstake.io/stats) ## Cosmos Hub CLI @@ -72,8 +71,8 @@ ator-setup). Have questions, comments, or new ideas? Participate in the Cosmos community through one of the following channels. -* [Discord](https://discord.gg/interchain) -* [Cosmos Forum](https://forum.cosmos.network) -* [Cosmos on Reddit](https://reddit.com/r/cosmosnetwork) +- [Discord](https://discord.gg/interchain) +- [Cosmos Forum](https://forum.cosmos.network) +- [Cosmos on Reddit](https://reddit.com/r/cosmosnetwork) To learn more about the Cosmos Hub and how it fits within the Cosmos Network, visit [cosmos.network](https://cosmos.network). diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 9181df2ec03..9120b8419cd 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -53,16 +53,10 @@ const config = { docs: { routeBasePath: "/", sidebarPath: require.resolve("./sidebars.js"), - lastVersion: "v19.2.0", versions: { current: { path: "main", - label: "Unreleased (main)", - banner: "unreleased", - }, - "v19.2.0": { - path: "v19.2.0", - label: "On chain (v19.2.0)", + label: "Latest", banner: "none", }, }, diff --git a/docs/versions.json b/docs/versions.json index 29c46b000ad..fe51488c706 100644 --- a/docs/versions.json +++ b/docs/versions.json @@ -1,3 +1 @@ -[ - "v19.2.0" -] \ No newline at end of file +[] diff --git a/go.mod b/go.mod index d6a752696a8..b3c34fd48ab 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/cosmos/gaia/v20 +module github.com/cosmos/gaia/v21 go 1.22.6 @@ -65,7 +65,7 @@ require ( github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect - github.com/CosmWasm/wasmvm/v2 v2.1.2 // indirect + github.com/CosmWasm/wasmvm/v2 v2.1.3 // indirect github.com/DataDog/datadog-go v3.2.0+incompatible // indirect github.com/DataDog/zstd v1.5.5 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect diff --git a/go.sum b/go.sum index 7253c99afcf..f9c11417d68 100644 --- a/go.sum +++ b/go.sum @@ -243,8 +243,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/CosmWasm/wasmd v0.53.0 h1:kdaoAi20bIb4VCsxw9pRaT2g5PpIp82Wqrr9DRVN9ao= github.com/CosmWasm/wasmd v0.53.0/go.mod h1:FJl/aWjdpGof3usAMFQpDe07Rkx77PUzp0cygFMOvtw= -github.com/CosmWasm/wasmvm/v2 v2.1.2 h1:GkJ5bAsRlLHfIQVg/FY1VHwLyBwlCjAhDea0B8L+e20= -github.com/CosmWasm/wasmvm/v2 v2.1.2/go.mod h1:bMhLQL4Yp9CzJi9A83aR7VO9wockOsSlZbT4ztOl6bg= +github.com/CosmWasm/wasmvm/v2 v2.1.3 h1:CSJTauZqkHyb9yic6JVYCjiGUgxI2MJV2QzfSu8m49c= +github.com/CosmWasm/wasmvm/v2 v2.1.3/go.mod h1:bMhLQL4Yp9CzJi9A83aR7VO9wockOsSlZbT4ztOl6bg= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= 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= diff --git a/tests/e2e/chain.go b/tests/e2e/chain.go index c2ab65ec2be..88e9fbae469 100644 --- a/tests/e2e/chain.go +++ b/tests/e2e/chain.go @@ -27,9 +27,9 @@ import ( paramsproptypes "github.com/cosmos/cosmos-sdk/x/params/types/proposal" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - gaia "github.com/cosmos/gaia/v20/app" - gaiaparams "github.com/cosmos/gaia/v20/app/params" - metaprotocoltypes "github.com/cosmos/gaia/v20/x/metaprotocols/types" + gaia "github.com/cosmos/gaia/v21/app" + gaiaparams "github.com/cosmos/gaia/v21/app/params" + metaprotocoltypes "github.com/cosmos/gaia/v21/x/metaprotocols/types" ) const ( diff --git a/tests/e2e/e2e_bank_test.go b/tests/e2e/e2e_bank_test.go index 7eb7109299e..6f064722c4f 100644 --- a/tests/e2e/e2e_bank_test.go +++ b/tests/e2e/e2e_bank_test.go @@ -12,7 +12,7 @@ import ( authTx "github.com/cosmos/cosmos-sdk/x/auth/tx" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - extensiontypes "github.com/cosmos/gaia/v20/x/metaprotocols/types" + extensiontypes "github.com/cosmos/gaia/v21/x/metaprotocols/types" ) func (s *IntegrationTestSuite) testBankTokenTransfer() { diff --git a/tests/e2e/e2e_setup_test.go b/tests/e2e/e2e_setup_test.go index c41f2823514..e2dd2307fe4 100644 --- a/tests/e2e/e2e_setup_test.go +++ b/tests/e2e/e2e_setup_test.go @@ -43,7 +43,7 @@ import ( govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/cosmos/gaia/v20/types" + "github.com/cosmos/gaia/v21/types" ) const ( diff --git a/tests/integration/feemarket_test.go b/tests/integration/feemarket_test.go index e693aa316c6..f90aa48a8b9 100644 --- a/tests/integration/feemarket_test.go +++ b/tests/integration/feemarket_test.go @@ -14,8 +14,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/cosmos/gaia/v20/ante" - gaiaApp "github.com/cosmos/gaia/v20/app" + "github.com/cosmos/gaia/v21/ante" + gaiaApp "github.com/cosmos/gaia/v21/app" ) const ( diff --git a/tests/integration/ibcfee_test.go b/tests/integration/ibcfee_test.go index c1dfd1a0014..61766a96ebc 100644 --- a/tests/integration/ibcfee_test.go +++ b/tests/integration/ibcfee_test.go @@ -14,8 +14,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/gaia/v20/ante" - gaiaApp "github.com/cosmos/gaia/v20/app" + "github.com/cosmos/gaia/v21/ante" + gaiaApp "github.com/cosmos/gaia/v21/app" ) // These integration tests were modified to work with the GaiaApp diff --git a/tests/integration/interchain_security_test.go b/tests/integration/interchain_security_test.go index f835538bda1..d4d1ae7abf6 100644 --- a/tests/integration/interchain_security_test.go +++ b/tests/integration/interchain_security_test.go @@ -17,8 +17,8 @@ import ( crysistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/cosmos/gaia/v20/ante" - gaiaApp "github.com/cosmos/gaia/v20/app" + "github.com/cosmos/gaia/v21/ante" + gaiaApp "github.com/cosmos/gaia/v21/app" ) var ccvSuite *integration.CCVTestSuite diff --git a/tests/integration/test_utils.go b/tests/integration/test_utils.go index 399608f7d1a..ce0573f2b64 100644 --- a/tests/integration/test_utils.go +++ b/tests/integration/test_utils.go @@ -23,7 +23,7 @@ import ( simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" - gaiaApp "github.com/cosmos/gaia/v20/app" + gaiaApp "github.com/cosmos/gaia/v21/app" ) var app *gaiaApp.GaiaApp diff --git a/tests/interchain/chainsuite/chain_ics.go b/tests/interchain/chainsuite/chain_ics.go index 4d1f5fcb764..0124af7773b 100644 --- a/tests/interchain/chainsuite/chain_ics.go +++ b/tests/interchain/chainsuite/chain_ics.go @@ -38,6 +38,8 @@ type ConsumerConfig struct { ValidatorPowerCap int AllowInactiveVals bool MinStake uint64 + Allowlist []string + Denylist []string spec *interchaintest.ChainSpec DuringDepositPeriod ConsumerBootstrapCb @@ -227,6 +229,8 @@ func (p *Chain) CreateConsumerPermissionless(ctx context.Context, chainID string ValidatorsPowerCap: uint32(config.ValidatorPowerCap), AllowInactiveVals: config.AllowInactiveVals, MinStake: config.MinStake, + Allowlist: config.Allowlist, + Denylist: config.Denylist, } params := providertypes.MsgCreateConsumer{ ChainId: chainID, @@ -344,6 +348,9 @@ func (p *Chain) DefaultConsumerChainSpec(ctx context.Context, chainID string, co } genesisOverrides := []cosmos.GenesisKV{ cosmos.NewGenesisKV("app_state.slashing.params.signed_blocks_window", strconv.Itoa(SlashingWindowConsumer)), + cosmos.NewGenesisKV("app_state.ccvconsumer.params.reward_denoms", []string{denom}), + cosmos.NewGenesisKV("app_state.ccvconsumer.params.provider_reward_denoms", []string{p.Config().Denom}), + cosmos.NewGenesisKV("app_state.ccvconsumer.params.blocks_per_distribution_transmission", BlocksPerDistribution), } if config.TopN >= 0 { genesisOverrides = append(genesisOverrides, cosmos.NewGenesisKV("app_state.ccvconsumer.params.soft_opt_out_threshold", "0.0")) diff --git a/tests/interchain/chainsuite/config.go b/tests/interchain/chainsuite/config.go index 7a4d4dfdd88..f67bd2a272f 100644 --- a/tests/interchain/chainsuite/config.go +++ b/tests/interchain/chainsuite/config.go @@ -48,6 +48,7 @@ const ( ValidatorFunds = 11_000_000_000 ChainSpawnWait = 155 * time.Second SlashingWindowConsumer = 20 + BlocksPerDistribution = 10 ) func (c SuiteConfig) Merge(other SuiteConfig) SuiteConfig { diff --git a/tests/interchain/chainsuite/utils.go b/tests/interchain/chainsuite/utils.go new file mode 100644 index 00000000000..a7222820f60 --- /dev/null +++ b/tests/interchain/chainsuite/utils.go @@ -0,0 +1,17 @@ +package chainsuite + +import ( + "fmt" + "strings" + + sdkmath "cosmossdk.io/math" +) + +func StrToSDKInt(s string) (sdkmath.Int, error) { + s, _, _ = strings.Cut(s, ".") + i, ok := sdkmath.NewIntFromString(s) + if !ok { + return sdkmath.Int{}, fmt.Errorf("s: %s", s) + } + return i, nil +} diff --git a/tests/interchain/consensus_test.go b/tests/interchain/consensus_test.go index 67ef37e815e..8f09f9f09e4 100644 --- a/tests/interchain/consensus_test.go +++ b/tests/interchain/consensus_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/cosmos/gaia/v20/tests/interchain/chainsuite" + "github.com/cosmos/gaia/v21/tests/interchain/chainsuite" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" "github.com/tidwall/gjson" diff --git a/tests/interchain/consumer_launch_test.go b/tests/interchain/consumer_launch_test.go index 0c942099665..8cf9204f9ab 100644 --- a/tests/interchain/consumer_launch_test.go +++ b/tests/interchain/consumer_launch_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/suite" - "github.com/cosmos/gaia/v20/tests/interchain/chainsuite" + "github.com/cosmos/gaia/v21/tests/interchain/chainsuite" ) type ConsumerLaunchSuite struct { diff --git a/tests/interchain/cosmwasm_test.go b/tests/interchain/cosmwasm_test.go index c0c15592c5a..9d3bbb76af7 100644 --- a/tests/interchain/cosmwasm_test.go +++ b/tests/interchain/cosmwasm_test.go @@ -6,7 +6,7 @@ import ( "path" "testing" - "github.com/cosmos/gaia/v20/tests/interchain/chainsuite" + "github.com/cosmos/gaia/v21/tests/interchain/chainsuite" "github.com/strangelove-ventures/interchaintest/v8" "github.com/stretchr/testify/suite" ) diff --git a/tests/interchain/endpoints_test.go b/tests/interchain/endpoints_test.go index 25f2e75d92c..c888cef6ddf 100644 --- a/tests/interchain/endpoints_test.go +++ b/tests/interchain/endpoints_test.go @@ -5,7 +5,7 @@ import ( "net/http" "testing" - "github.com/cosmos/gaia/v20/tests/interchain/chainsuite" + "github.com/cosmos/gaia/v21/tests/interchain/chainsuite" "github.com/stretchr/testify/suite" "golang.org/x/mod/semver" ) diff --git a/tests/interchain/go.mod b/tests/interchain/go.mod index 55eb527d3f8..b5355dc503d 100644 --- a/tests/interchain/go.mod +++ b/tests/interchain/go.mod @@ -1,4 +1,4 @@ -module github.com/cosmos/gaia/v20/tests/interchain +module github.com/cosmos/gaia/v21/tests/interchain go 1.22.5 diff --git a/tests/interchain/permissionless_test.go b/tests/interchain/permissionless_test.go index 47b888c2755..4087cfcd361 100644 --- a/tests/interchain/permissionless_test.go +++ b/tests/interchain/permissionless_test.go @@ -10,8 +10,9 @@ import ( "testing" "time" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - "github.com/cosmos/gaia/v20/tests/interchain/chainsuite" + sdkmath "cosmossdk.io/math" + govtypes "github.cogaia/v21/cosmos-sdk/x/gov/types/v1" + "github.com/cosmos/gaia/v21/tests/interchain/chainsuite" transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" ccvclient "github.com/cosmos/interchain-security/v5/x/ccv/provider/client" providertypes "github.com/cosmos/interchain-security/v5/x/ccv/provider/types" @@ -21,6 +22,7 @@ import ( "github.com/strangelove-ventures/interchaintest/v8/testutil" "github.com/stretchr/testify/suite" "github.com/tidwall/sjson" + "golang.org/x/mod/semver" "golang.org/x/sync/errgroup" ) @@ -28,19 +30,26 @@ const ( permissionlessDepositPeriod = 7 * time.Minute ) -type ConsumerPropMigrationSuite struct { +type PermissionlessConsumersSuite struct { *chainsuite.Suite consumerCfg chainsuite.ConsumerConfig } -func (s *ConsumerPropMigrationSuite) addConsumer() *chainsuite.Chain { +func (s *PermissionlessConsumersSuite) addConsumer() *chainsuite.Chain { consumer, err := s.Chain.AddConsumerChain(s.GetContext(), s.Relayer, s.consumerCfg) s.Require().NoError(err) s.Require().NoError(s.Chain.CheckCCV(s.GetContext(), consumer, s.Relayer, 1_000_000, 0, 1)) return consumer } -func (s *ConsumerPropMigrationSuite) TestConsumerAddition() { +func (s *PermissionlessConsumersSuite) isOverV19() bool { + return semver.Compare(s.Env.OldGaiaImageVersion, "v19.0.0") > 0 +} + +func (s *PermissionlessConsumersSuite) TestConsumerAdditionMigration() { + if s.isOverV19() { + s.T().Skip("Migration test for v19 -> v20") + } consumer := s.addConsumer() json, _, err := s.Chain.GetNode().ExecQuery(s.GetContext(), "gov", "proposals") s.Require().NoError(err) @@ -93,7 +102,11 @@ func (s *ConsumerPropMigrationSuite) TestConsumerAddition() { s.Require().Equal(uint64(100), chain2.Get("top_N").Uint()) } -func (s *ConsumerPropMigrationSuite) TestConsumerRemoval() { +func (s *PermissionlessConsumersSuite) TestConsumerRemovalMigration() { + if s.isOverV19() { + s.T().Skip("Migration test for v19 -> v20") + } + consumer := s.addConsumer() stopTime := time.Now().Add(permissionlessDepositPeriod + 2*time.Minute) @@ -124,7 +137,11 @@ func (s *ConsumerPropMigrationSuite) TestConsumerRemoval() { s.Require().Equal("CONSUMER_PHASE_STOPPED", chain.Get("phase").String()) } -func (s *ConsumerPropMigrationSuite) TestConsumerModification() { +func (s *PermissionlessConsumersSuite) TestConsumerModificationMigration() { + if s.isOverV19() { + s.T().Skip("Migration test for v19 -> v20") + } + consumer := s.addConsumer() propID := s.submitConsumerModification(consumer) @@ -145,7 +162,11 @@ func (s *ConsumerPropMigrationSuite) TestConsumerModification() { s.Require().Equal(uint64(80), chain.Get("top_N").Uint()) } -func (s *ConsumerPropMigrationSuite) TestChangeRewardDenom() { +func (s *PermissionlessConsumersSuite) TestChangeRewardDenomMigration() { + if s.isOverV19() { + s.T().Skip("Migration test for v19 -> v20") + } + consumer := s.addConsumer() denom, propID := s.submitChangeRewardDenoms(consumer) @@ -165,14 +186,17 @@ func (s *ConsumerPropMigrationSuite) TestChangeRewardDenom() { s.Require().Contains(denoms.String(), denom) } -func (s *ConsumerPropMigrationSuite) depositAndPass(propID string) { +func (s *PermissionlessConsumersSuite) depositAndPass(propID string) { _, err := s.Chain.GetNode().ExecTx(s.GetContext(), s.Chain.ValidatorWallets[0].Moniker, "gov", "deposit", propID, chainsuite.GovDepositAmount) s.Require().NoError(err) s.Require().NoError(s.Chain.PassProposal(s.GetContext(), propID)) s.Require().NoError(testutil.WaitForBlocks(s.GetContext(), 2, s.Chain)) } -func (s *ConsumerPropMigrationSuite) TestPassedProposalsDontChange() { +func (s *PermissionlessConsumersSuite) TestPassedProposalsDontChange() { + if s.isOverV19() { + s.T().Skip("Migration test for v19 -> v20") + } consumer := s.addConsumer() _, denomPropID := s.submitChangeRewardDenoms(consumer) @@ -223,7 +247,7 @@ func (s *ConsumerPropMigrationSuite) TestPassedProposalsDontChange() { s.Require().Equal("CONSUMER_PHASE_STOPPED", chain.Get("phase").String()) } -func (s *ConsumerPropMigrationSuite) TestChangeOwner() { +func (s *PermissionlessConsumersSuite) TestChangeOwner() { s.UpgradeChain() cfg := s.consumerCfg @@ -279,7 +303,7 @@ func (s *ConsumerPropMigrationSuite) TestChangeOwner() { s.Require().NoError(s.Chain.PassProposal(s.GetContext(), propID)) } -func (s *ConsumerPropMigrationSuite) TestChangePowerShaping() { +func (s *PermissionlessConsumersSuite) TestChangePowerShaping() { s.UpgradeChain() cfg := s.consumerCfg @@ -338,13 +362,220 @@ func (s *ConsumerPropMigrationSuite) TestChangePowerShaping() { } } +func (s *PermissionlessConsumersSuite) TestConsumerCommissionRate() { + s.UpgradeChain() + cfg := s.consumerCfg + + cfg.TopN = 0 + cfg.BeforeSpawnTime = func(ctx context.Context, consumer *cosmos.CosmosChain) { + consumerID, err := s.Chain.GetConsumerID(s.GetContext(), consumer.Config().ChainID) + s.Require().NoError(err) + _, err = s.Chain.Validators[0].ExecTx(s.GetContext(), s.Chain.ValidatorWallets[0].Moniker, "provider", "opt-in", consumerID) + s.Require().NoError(err) + } + consumer1, err := s.Chain.AddConsumerChain(s.GetContext(), s.Relayer, cfg) + s.Require().NoError(err) + s.Require().NoError(s.Chain.CheckCCV(s.GetContext(), consumer1, s.Relayer, 1_000_000, 0, 1)) + + consumer2, err := s.Chain.AddConsumerChain(s.GetContext(), s.Relayer, cfg) + s.Require().NoError(err) + s.Require().NoError(s.Chain.CheckCCV(s.GetContext(), consumer2, s.Relayer, 1_000_000, 0, 1)) + + for i := 1; i < chainsuite.ValidatorCount; i++ { + s.Require().NoError(consumer1.Validators[i].StopContainer(s.GetContext())) + s.Require().NoError(consumer2.Validators[i].StopContainer(s.GetContext())) + } + + consumer1Ch, err := s.Relayer.GetTransferChannel(s.GetContext(), s.Chain, consumer1) + s.Require().NoError(err) + consumer2Ch, err := s.Relayer.GetTransferChannel(s.GetContext(), s.Chain, consumer2) + s.Require().NoError(err) + denom1 := transfertypes.ParseDenomTrace(transfertypes.GetPrefixedDenom("transfer", consumer1Ch.ChannelID, consumer1.Config().Denom)).IBCDenom() + denom2 := transfertypes.ParseDenomTrace(transfertypes.GetPrefixedDenom("transfer", consumer2Ch.ChannelID, consumer2.Config().Denom)).IBCDenom() + + s.Require().NotEqual(denom1, denom2, "denom1: %s, denom2: %s; channel1: %s, channel2: %s", denom1, denom2, consumer1Ch.Counterparty.ChannelID, consumer2Ch.Counterparty.ChannelID) + + govAuthority, err := s.Chain.GetGovernanceAddress(s.GetContext()) + s.Require().NoError(err) + rewardDenomsProp := providertypes.MsgChangeRewardDenoms{ + DenomsToAdd: []string{denom1, denom2}, + Authority: govAuthority, + } + prop, err := s.Chain.BuildProposal([]cosmos.ProtoMessage{&rewardDenomsProp}, + "add denoms to list of registered reward denoms", + "add denoms to list of registered reward denoms", + "", chainsuite.GovDepositAmount, "", false) + s.Require().NoError(err) + propResult, err := s.Chain.SubmitProposal(s.GetContext(), s.Chain.ValidatorWallets[0].Moniker, prop) + s.Require().NoError(err) + s.Require().NoError(s.Chain.PassProposal(s.GetContext(), propResult.ProposalID)) + + eg := errgroup.Group{} + + _, err = s.Chain.Validators[0].ExecTx(s.GetContext(), s.Chain.ValidatorWallets[0].Moniker, "distribution", "withdraw-all-rewards") + s.Require().NoError(err) + + _, err = s.Chain.GetNode().ExecTx(s.GetContext(), s.Chain.ValidatorWallets[0].Moniker, "distribution", "withdraw-rewards", s.Chain.ValidatorWallets[0].ValoperAddress, "--commission") + s.Require().NoError(err) + + consumerID1, err := s.Chain.GetConsumerID(s.GetContext(), consumer1.Config().ChainID) + s.Require().NoError(err) + consumerID2, err := s.Chain.GetConsumerID(s.GetContext(), consumer2.Config().ChainID) + s.Require().NoError(err) + + eg.Go(func() error { + _, err := s.Chain.GetNode().ExecTx(s.GetContext(), s.Chain.ValidatorWallets[0].Moniker, "provider", "set-consumer-commission-rate", consumerID1, "0.5") + return err + }) + eg.Go(func() error { + _, err := s.Chain.GetNode().ExecTx(s.GetContext(), s.Chain.ValidatorWallets[0].Moniker, "provider", "set-consumer-commission-rate", consumerID2, "0.5") + return err + }) + s.Require().NoError(eg.Wait()) + + _, err = s.Chain.Validators[0].ExecTx(s.GetContext(), s.Chain.ValidatorWallets[0].Moniker, "distribution", "withdraw-rewards", s.Chain.ValidatorWallets[0].ValoperAddress, "--commission") + s.Require().NoError(err) + + s.Require().NoError(testutil.WaitForBlocks(s.GetContext(), 1, consumer1, consumer2)) + + eg.Go(func() error { + _, err := consumer1.Validators[0].ExecTx(s.GetContext(), consumer1.ValidatorWallets[0].Moniker, "bank", "send", consumer1.ValidatorWallets[0].Address, consumer1.ValidatorWallets[1].Address, "1"+consumer1.Config().Denom, "--fees", "100000000"+consumer1.Config().Denom) + return err + }) + eg.Go(func() error { + _, err := consumer2.Validators[0].ExecTx(s.GetContext(), consumer2.ValidatorWallets[0].Moniker, "bank", "send", consumer2.ValidatorWallets[0].Address, consumer2.ValidatorWallets[1].Address, "1"+consumer2.Config().Denom, "--fees", "100000000"+consumer2.Config().Denom) + return err + }) + s.Require().NoError(eg.Wait()) + + s.Require().NoError(testutil.WaitForBlocks(s.GetContext(), chainsuite.BlocksPerDistribution+3, s.Chain, consumer1, consumer2)) + + rewardStr, err := s.Chain.QueryJSON(s.GetContext(), fmt.Sprintf("total.#(%%\"*%s\")", denom1), "distribution", "rewards", s.Chain.ValidatorWallets[0].Address) + s.Require().NoError(err) + rewardsDenom1, err := chainsuite.StrToSDKInt(rewardStr.String()) + s.Require().NoError(err) + rewardStr, err = s.Chain.QueryJSON(s.GetContext(), fmt.Sprintf("total.#(%%\"*%s\")", denom2), "distribution", "rewards", s.Chain.ValidatorWallets[0].Address) + s.Require().NoError(err) + rewardsDenom2, err := chainsuite.StrToSDKInt(rewardStr.String()) + s.Require().NoError(err) + + s.Require().NotEmpty(rewardsDenom1) + s.Require().NotEmpty(rewardsDenom2) + s.Require().True(rewardsDenom1.Sub(rewardsDenom2).Abs().LT(sdkmath.NewInt(1000)), "rewards1Int: %s, rewards2Int: %s", rewardsDenom1.String(), rewardsDenom2.String()) + + _, err = s.Chain.Validators[0].ExecTx(s.GetContext(), s.Chain.ValidatorWallets[0].Moniker, "distribution", "withdraw-rewards", s.Chain.ValidatorWallets[0].ValoperAddress, "--commission") + s.Require().NoError(err) + + eg.Go(func() error { + _, err := s.Chain.GetNode().ExecTx(s.GetContext(), s.Chain.ValidatorWallets[0].Moniker, "provider", "set-consumer-commission-rate", consumerID1, "0.25") + return err + }) + eg.Go(func() error { + _, err := s.Chain.GetNode().ExecTx(s.GetContext(), s.Chain.ValidatorWallets[0].Moniker, "provider", "set-consumer-commission-rate", consumerID2, "0.5") + return err + }) + s.Require().NoError(eg.Wait()) + + _, err = s.Chain.GetNode().ExecTx(s.GetContext(), s.Chain.ValidatorWallets[0].Moniker, "distribution", "withdraw-rewards", s.Chain.ValidatorWallets[0].ValoperAddress, "--commission") + s.Require().NoError(err) + + s.Require().NoError(testutil.WaitForBlocks(s.GetContext(), 1, consumer1, consumer2)) + + eg.Go(func() error { + _, err := consumer1.Validators[0].ExecTx(s.GetContext(), consumer1.ValidatorWallets[0].Moniker, "bank", "send", consumer1.ValidatorWallets[0].Address, consumer1.ValidatorWallets[1].Address, "1"+consumer1.Config().Denom, "--fees", "100000000"+consumer1.Config().Denom) + return err + }) + eg.Go(func() error { + _, err := consumer2.Validators[0].ExecTx(s.GetContext(), consumer2.ValidatorWallets[0].Moniker, "bank", "send", consumer2.ValidatorWallets[0].Address, consumer2.ValidatorWallets[1].Address, "1"+consumer2.Config().Denom, "--fees", "100000000"+consumer2.Config().Denom) + return err + }) + s.Require().NoError(eg.Wait()) + + s.Require().NoError(testutil.WaitForBlocks(s.GetContext(), chainsuite.BlocksPerDistribution+3, s.Chain, consumer1, consumer2)) + + rewardStr, err = s.Chain.QueryJSON(s.GetContext(), fmt.Sprintf("total.#(%%\"*%s\")", denom1), "distribution", "rewards", s.Chain.ValidatorWallets[0].Address) + s.Require().NoError(err) + rewardsDenom1, err = chainsuite.StrToSDKInt(rewardStr.String()) + s.Require().NoError(err) + rewardStr, err = s.Chain.QueryJSON(s.GetContext(), fmt.Sprintf("total.#(%%\"*%s\")", denom2), "distribution", "rewards", s.Chain.ValidatorWallets[0].Address) + s.Require().NoError(err) + rewardsDenom2, err = chainsuite.StrToSDKInt(rewardStr.String()) + s.Require().NoError(err) + + s.Require().True(rewardsDenom1.GT(rewardsDenom2), "rewards1Int: %s, rewards2Int: %s", rewardsDenom1.String(), rewardsDenom2.String()) + s.Require().False(rewardsDenom1.Sub(rewardsDenom2).Abs().LT(sdkmath.NewInt(1000)), "rewards1Int: %s, rewards2Int: %s", rewardsDenom1.String(), rewardsDenom2.String()) +} + +func (s *PermissionlessConsumersSuite) TestLaunchWithAllowListThenModify() { + s.UpgradeChain() + + consumerConfig := s.consumerCfg + consumerConfig.Allowlist = []string{ + s.Chain.ValidatorWallets[0].ValConsAddress, + s.Chain.ValidatorWallets[1].ValConsAddress, + s.Chain.ValidatorWallets[2].ValConsAddress, + } + consumerConfig.TopN = 0 + consumerConfig.BeforeSpawnTime = func(ctx context.Context, consumer *cosmos.CosmosChain) { + consumerID, err := s.Chain.GetConsumerID(s.GetContext(), consumer.Config().ChainID) + s.Require().NoError(err) + eg := errgroup.Group{} + for i := 0; i < 3; i++ { + i := i + eg.Go(func() error { + _, err := s.Chain.Validators[i].ExecTx(s.GetContext(), s.Chain.ValidatorWallets[i].Moniker, "provider", "opt-in", consumerID) + return err + }) + } + s.Require().NoError(eg.Wait()) + } + + consumer, err := s.Chain.AddConsumerChain(s.GetContext(), s.Relayer, consumerConfig) + s.Require().NoError(err) + + s.Require().NoError(s.Chain.CheckCCV(s.GetContext(), consumer, s.Relayer, 1_000_000, 0, 1)) + + consumerID, err := s.Chain.GetConsumerID(s.GetContext(), consumer.Config().ChainID) + s.Require().NoError(err) + + // ensure we can't opt in a non-allowlisted validator + _, err = s.Chain.Validators[3].ExecTx(s.GetContext(), s.Chain.ValidatorWallets[3].Moniker, + "provider", "opt-in", consumerID) + s.Require().NoError(err) + + validators, err := consumer.QueryJSON(s.GetContext(), "validators", "tendermint-validator-set") + s.Require().NoError(err) + s.Require().Equal(3, len(validators.Array())) + + update := &providertypes.MsgUpdateConsumer{ + ConsumerId: consumerID, + PowerShapingParameters: &providertypes.PowerShapingParameters{ + Allowlist: []string{}, + }, + } + updateBz, err := json.Marshal(update) + s.Require().NoError(err) + err = s.Chain.GetNode().WriteFile(s.GetContext(), updateBz, "consumer-update.json") + s.Require().NoError(err) + _, err = s.Chain.GetNode().ExecTx(s.GetContext(), interchaintest.FaucetAccountKeyName, + "provider", "update-consumer", path.Join(s.Chain.GetNode().HomeDir(), "consumer-update.json")) + s.Require().NoError(err) + + // // ensure we can opt in a non-allowlisted validator after the modification + _, err = s.Chain.Validators[3].ExecTx(s.GetContext(), s.Chain.ValidatorWallets[3].Moniker, + "provider", "opt-in", consumerID) + s.Require().NoError(err) + validators, err = consumer.QueryJSON(s.GetContext(), "validators", "tendermint-validator-set") + s.Require().NoError(err) + s.Require().Equal(4, len(validators.Array())) +} -func TestConsumerPropMigration(t *testing.T) { +func TestPermissionlessConsumers(t *testing.T) { genesis := chainsuite.DefaultGenesis() genesis = append(genesis, cosmos.NewGenesisKV("app_state.gov.params.max_deposit_period", permissionlessDepositPeriod.String()), ) - s := &ConsumerPropMigrationSuite{ + s := &PermissionlessConsumersSuite{ Suite: chainsuite.NewSuite(chainsuite.SuiteConfig{ CreateRelayer: true, Scope: chainsuite.ChainScopeTest, @@ -367,7 +598,7 @@ func TestConsumerPropMigration(t *testing.T) { suite.Run(t, s) } -func (s *ConsumerPropMigrationSuite) submitChangeRewardDenoms(consumer *chainsuite.Chain) (string, string) { +func (s *PermissionlessConsumersSuite) submitChangeRewardDenoms(consumer *chainsuite.Chain) (string, string) { consumerCh, err := s.Relayer.GetTransferChannel(s.GetContext(), s.Chain, consumer) s.Require().NoError(err) denom := transfertypes.ParseDenomTrace(transfertypes.GetPrefixedDenom("transfer", consumerCh.ChannelID, consumer.Config().Denom)).IBCDenom() @@ -402,7 +633,7 @@ func (s *ConsumerPropMigrationSuite) submitChangeRewardDenoms(consumer *chainsui return denom, propID } -func (s *ConsumerPropMigrationSuite) submitConsumerModification(consumer *chainsuite.Chain) string { +func (s *PermissionlessConsumersSuite) submitConsumerModification(consumer *chainsuite.Chain) string { modifyProp := &ccvclient.ConsumerModificationProposalJSON{ Title: "modify consumer", Summary: "modify consumer", @@ -436,7 +667,7 @@ func (s *ConsumerPropMigrationSuite) submitConsumerModification(consumer *chains return propID } -func (s *ConsumerPropMigrationSuite) submitConsumerRemoval(consumer *chainsuite.Chain, stopTime time.Time) string { +func (s *PermissionlessConsumersSuite) submitConsumerRemoval(consumer *chainsuite.Chain, stopTime time.Time) string { removalProp := &ccvclient.ConsumerRemovalProposalJSON{ Title: "remove consumer", Summary: "remove consumer", diff --git a/tests/interchain/txs_test.go b/tests/interchain/txs_test.go index 28ab6e30c99..85d2b40df27 100644 --- a/tests/interchain/txs_test.go +++ b/tests/interchain/txs_test.go @@ -15,7 +15,7 @@ import ( sdkmath "cosmossdk.io/math" - "github.com/cosmos/gaia/v20/tests/interchain/chainsuite" + "github.com/cosmos/gaia/v21/tests/interchain/chainsuite" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) diff --git a/tests/interchain/unbonding_test.go b/tests/interchain/unbonding_test.go index b74cf3dac75..86c7656b333 100644 --- a/tests/interchain/unbonding_test.go +++ b/tests/interchain/unbonding_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/cosmos/gaia/v20/tests/interchain/chainsuite" + "github.com/cosmos/gaia/v21/tests/interchain/chainsuite" "github.com/strangelove-ventures/interchaintest/v8" "github.com/strangelove-ventures/interchaintest/v8/chain/cosmos" "github.com/strangelove-ventures/interchaintest/v8/ibc" diff --git a/x/metaprotocols/module.go b/x/metaprotocols/module.go index 832ccbf284d..ebdab3b03b4 100644 --- a/x/metaprotocols/module.go +++ b/x/metaprotocols/module.go @@ -15,7 +15,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/gaia/v20/x/metaprotocols/types" + "github.com/cosmos/gaia/v21/x/metaprotocols/types" ) const consensusVersion uint64 = 1