diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 887e7a38fd1..1d802ca6693 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -24,7 +24,7 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: "1.21" check-latest: true diff --git a/.github/workflows/docker-push.yml b/.github/workflows/docker-push.yml index 71ecf62e0af..23af715ba43 100644 --- a/.github/workflows/docker-push.yml +++ b/.github/workflows/docker-push.yml @@ -29,7 +29,7 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v5.2.0 + uses: docker/metadata-action@v5.3.0 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index bac5c0f5b51..7e75883bcd2 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: "1.21" check-latest: true diff --git a/.github/workflows/nightly-tests.yml b/.github/workflows/nightly-tests.yml index dd78d4a10e3..3ed127567f4 100644 --- a/.github/workflows/nightly-tests.yml +++ b/.github/workflows/nightly-tests.yml @@ -19,7 +19,7 @@ jobs: timeout-minutes: 5 steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: "1.21" check-latest: true diff --git a/.github/workflows/release-sims.yml b/.github/workflows/release-sims.yml index 7ef80a89515..337e18c7a35 100644 --- a/.github/workflows/release-sims.yml +++ b/.github/workflows/release-sims.yml @@ -24,7 +24,7 @@ jobs: newbuild: runs-on: ubuntu-latest steps: - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: 1.21.x - name: Install runsim @@ -63,7 +63,7 @@ jobs: needs: newbuild steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: 1.21.x - uses: technote-space/get-diff-action@v6.0.1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2b3d862591c..205994bfa10 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: fetch-depth: 0 - run: git fetch --force --tags - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: "1.21" diff --git a/.github/workflows/sim-label.yml b/.github/workflows/sim-label.yml index 80a2cae87db..6a09fa18288 100644 --- a/.github/workflows/sim-label.yml +++ b/.github/workflows/sim-label.yml @@ -15,7 +15,7 @@ jobs: newbuild: runs-on: ubuntu-latest steps: - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: 1.21.x - name: Install runsim @@ -31,7 +31,7 @@ jobs: needs: newbuild steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: 1.21.x - uses: actions/cache@v3.3.2 diff --git a/.github/workflows/sims.yml b/.github/workflows/sims.yml index 4813c555255..bb4e39de5ce 100644 --- a/.github/workflows/sims.yml +++ b/.github/workflows/sims.yml @@ -19,7 +19,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: 1.21.x - name: Install runsim @@ -34,7 +34,7 @@ jobs: needs: newbuild steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: 1.21.x - uses: technote-space/get-diff-action@v6.0.1 @@ -58,7 +58,7 @@ jobs: needs: build steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: 1.21.x - uses: technote-space/get-diff-action@v6 @@ -80,7 +80,7 @@ jobs: newbuild: runs-on: ubuntu-latest steps: - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: 1.21.x - name: Install runsim @@ -105,7 +105,7 @@ jobs: runs-on: ubuntu-latest needs: [build, install-runsim] steps: - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: 1.21.x - uses: actions/checkout@v4 diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 7c5e51b18ac..b1e4597e967 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -7,7 +7,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v8.0.0 + - uses: actions/stale@v9.0.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} stale-pr-message: "This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions." diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0d4653439b5..037c917e346 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: "1.21" check-latest: true @@ -63,7 +63,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 45 steps: - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: 1.21.x - uses: actions/checkout@v4 @@ -110,7 +110,7 @@ jobs: timeout-minutes: 10 steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: 1.21.x - uses: technote-space/get-diff-action@v6.0.1 @@ -145,16 +145,11 @@ jobs: **/**.go go.mod go.sum - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: -<<<<<<< HEAD - go-version: 1.21.x - - name: Install GaiaV10 -======= go-version: 1.20.x # the old gaiad binary version is hardcoded, need to be updated each major release. - name: Install Old Gaiad ->>>>>>> main run: | git checkout v14.0.0 make build diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 97ee84b16ac..29a022482c2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -197,7 +197,7 @@ Pull requests are merged automatically using [`A:automerge` action](https://merg ### Pull Request Templates -There are three PR templates. The [default template](./.github/PULL_REQUEST_TEMPLATE.md) contains links to the three templates. Please go the the `Preview` tab and select the appropriate sub-template: +There are three PR templates. The [default template](./.github/PULL_REQUEST_TEMPLATE.md) contains links to the three templates. Please go to the `Preview` tab and select the appropriate sub-template: - The [production template](./.github/PULL_REQUEST_TEMPLATE/production.md) is for types `fix`, `feat`, `deps`, and `refactor`. - The [docs template](./.github/PULL_REQUEST_TEMPLATE/docs.md) is for documentation changes. diff --git a/Makefile b/Makefile index 6fe80985728..74f0f25bbf5 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ BUILDDIR ?= $(CURDIR)/build TEST_DOCKER_REPO=cosmos/contrib-gaiatest GO_SYSTEM_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1-2) -REQUIRE_GO_VERSION = 1.21 +REQUIRE_MINIMUM_GO_VERSION = 1.20 export GO111MODULE = on @@ -95,9 +95,10 @@ include contrib/devtools/Makefile ### Build ### ############################################################################### +IS_VERSION_SUPPORTED = $(shell echo "$(GO_SYSTEM_VERSION) >= $(REQUIRE_MINIMUM_GO_VERSION)" | bc -l) check_version: -ifneq ($(GO_SYSTEM_VERSION), $(REQUIRE_GO_VERSION)) - @echo "ERROR: Go version 1.21 is required for $(VERSION) of Gaia." +ifneq ($(IS_VERSION_SUPPORTED), 1) + @echo "ERROR: Minimal go version required for Gaia: $(VERSION) is $(REQUIRE_MINIMUM_GO_VERSION). You are using $(GO_SYSTEM_VERSION)." exit 1 endif diff --git a/RELEASE_PROCESS.md b/RELEASE_PROCESS.md index 499cc6132f6..760cb7fdedd 100644 --- a/RELEASE_PROCESS.md +++ b/RELEASE_PROCESS.md @@ -142,7 +142,7 @@ Once the **final release** is cut, the new changelog section must be added to ma ### Release Notes Release notes will be created using the `RELEASE_NOTES.md` from the release branch. -Once the automated releases process is completed, please add any missing information the the release notes using Github UI. +Once the automated releases process is completed, please add any missing information the release notes using Github UI. With every release, the `goreleaser` tool will create a file with all the build artifact checksums and upload it alongside the artifacts. The file is called `SHA256SUMS-{{.version}}.txt` and contains the following: diff --git a/ante/ante.go b/ante/ante.go index e7eb2257451..bfe9dde49a0 100644 --- a/ante/ante.go +++ b/ante/ante.go @@ -1,6 +1,9 @@ package ante import ( + ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante" + ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + errorsmod "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/codec" @@ -9,8 +12,6 @@ import ( govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" gaiaerrors "github.com/cosmos/gaia/v15/types/errors" gaiafeeante "github.com/cosmos/gaia/v15/x/globalfee/ante" diff --git a/ante/gov_ante.go b/ante/gov_ante.go index 4f39379747f..ba91100fc7e 100644 --- a/ante/gov_ante.go +++ b/ante/gov_ante.go @@ -51,7 +51,7 @@ func (g GovPreventSpamDecorator) ValidateGovMsgs(ctx sdk.Context, msgs []sdk.Msg // prevent messages with insufficient initial deposit amount params := g.govKeeper.GetParams(ctx) minInitialDeposit := g.calcMinInitialDeposit(params.MinDeposit) - if msg.InitialDeposit.IsAllLT(minInitialDeposit) { + if !msg.InitialDeposit.IsAllGTE(minInitialDeposit) { return errorsmod.Wrapf(gaiaerrors.ErrInsufficientFunds, "insufficient initial deposit amount - required: %v", minInitialDeposit) } } diff --git a/ante/gov_ante_test.go b/ante/gov_ante_test.go index 2564bdc77cd..6bd386d2a9f 100644 --- a/ante/gov_ante_test.go +++ b/ante/gov_ante_test.go @@ -4,14 +4,14 @@ import ( "fmt" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" tmrand "github.com/cometbft/cometbft/libs/rand" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/testutil/testdata" - + sdk "github.com/cosmos/cosmos-sdk/types" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/gaia/v15/ante" diff --git a/app/app.go b/app/app.go index 3619dad6543..744e9987a5f 100644 --- a/app/app.go +++ b/app/app.go @@ -7,31 +7,39 @@ import ( "os" "path/filepath" - "github.com/cosmos/gaia/v15/app/params" - - autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" + "github.com/gorilla/mux" + "github.com/rakyll/statik/fs" + "github.com/spf13/cast" - "github.com/cosmos/cosmos-sdk/runtime" - "github.com/cosmos/cosmos-sdk/server" - "github.com/cosmos/cosmos-sdk/testutil/testdata" + // unnamed import of statik for swagger UI support + _ "github.com/cosmos/cosmos-sdk/client/docs/statik" - errorsmod "cosmossdk.io/errors" dbm "github.com/cometbft/cometbft-db" abci "github.com/cometbft/cometbft/abci/types" tmjson "github.com/cometbft/cometbft/libs/json" "github.com/cometbft/cometbft/libs/log" tmos "github.com/cometbft/cometbft/libs/os" + + ibctesting "github.com/cosmos/ibc-go/v7/testing" + providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" + + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" + errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node" "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/runtime" runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services" + "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/server/api" "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" + "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/module" @@ -42,20 +50,13 @@ import ( "github.com/cosmos/cosmos-sdk/x/crisis" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - ibctesting "github.com/cosmos/ibc-go/v7/testing" - providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" - "github.com/gorilla/mux" - "github.com/rakyll/statik/fs" - "github.com/spf13/cast" gaiaante "github.com/cosmos/gaia/v15/ante" "github.com/cosmos/gaia/v15/app/keepers" + "github.com/cosmos/gaia/v15/app/params" "github.com/cosmos/gaia/v15/app/upgrades" v15 "github.com/cosmos/gaia/v15/app/upgrades/v15" "github.com/cosmos/gaia/v15/x/globalfee" - - // unnamed import of statik for swagger UI support - _ "github.com/cosmos/cosmos-sdk/client/docs/statik" ) var ( diff --git a/app/app_helpers.go b/app/app_helpers.go index 6948db79faf..093b3db0b38 100644 --- a/app/app_helpers.go +++ b/app/app_helpers.go @@ -2,11 +2,12 @@ package gaia // TODO: Enable with ICS import ( - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" ibctestingtypes "github.com/cosmos/ibc-go/v7/testing/types" icstest "github.com/cosmos/interchain-security/v3/testutil/integration" ibcproviderkeeper "github.com/cosmos/interchain-security/v3/x/ccv/provider/keeper" + + capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" ) // ProviderApp interface implementations for icstest tests diff --git a/app/app_test.go b/app/app_test.go index 592613731fb..846d2493500 100644 --- a/app/app_test.go +++ b/app/app_test.go @@ -3,9 +3,10 @@ package gaia_test import ( "testing" + "github.com/stretchr/testify/require" + db "github.com/cometbft/cometbft-db" "github.com/cometbft/cometbft/libs/log" - "github.com/stretchr/testify/require" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" diff --git a/app/export.go b/app/export.go index 05706980574..e8423cdd707 100644 --- a/app/export.go +++ b/app/export.go @@ -4,6 +4,7 @@ import ( "encoding/json" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" diff --git a/app/helpers/test_helpers.go b/app/helpers/test_helpers.go index dcab4eb3b12..9ac54fcc775 100644 --- a/app/helpers/test_helpers.go +++ b/app/helpers/test_helpers.go @@ -5,23 +5,24 @@ import ( "testing" "time" - "github.com/cosmos/cosmos-sdk/server" - "github.com/cosmos/cosmos-sdk/testutil/mock" - simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + "github.com/stretchr/testify/require" dbm "github.com/cometbft/cometbft-db" abci "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/libs/log" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" tmtypes "github.com/cometbft/cometbft/types" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/cosmos/cosmos-sdk/server" + "github.com/cosmos/cosmos-sdk/testutil/mock" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/stretchr/testify/require" gaiaapp "github.com/cosmos/gaia/v15/app" ) diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index eb490400d7d..b7b2ffb5337 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -3,7 +3,30 @@ package keepers import ( "os" + // unnamed import of statik for swagger UI support + _ "github.com/cosmos/cosmos-sdk/client/docs/statik" + "github.com/cometbft/cometbft/libs/log" + + pfmrouter "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward" + pfmrouterkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/keeper" + pfmroutertypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types" + ica "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts" + icahost "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host" + icahostkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/keeper" + icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" + "github.com/cosmos/ibc-go/v7/modules/apps/transfer" + ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" + ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + ibcclient "github.com/cosmos/ibc-go/v7/modules/core/02-client" + ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" + ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" + ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + ibcprovider "github.com/cosmos/interchain-security/v3/x/ccv/provider" + ibcproviderkeeper "github.com/cosmos/interchain-security/v3/x/ccv/provider/keeper" + providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" servertypes "github.com/cosmos/cosmos-sdk/server/types" @@ -27,16 +50,10 @@ import ( evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" "github.com/cosmos/cosmos-sdk/x/feegrant" feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" - govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" - - "github.com/cosmos/gaia/v15/x/globalfee" - - providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" - govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/cosmos/cosmos-sdk/x/params" @@ -50,25 +67,8 @@ import ( "github.com/cosmos/cosmos-sdk/x/upgrade" upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - pfmrouter "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward" - pfmrouterkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/keeper" - pfmroutertypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types" - ica "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts" - icahost "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host" - icahostkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/keeper" - icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" - "github.com/cosmos/ibc-go/v7/modules/apps/transfer" - ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - ibcclient "github.com/cosmos/ibc-go/v7/modules/core/02-client" - ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" - ibcprovider "github.com/cosmos/interchain-security/v3/x/ccv/provider" - ibcproviderkeeper "github.com/cosmos/interchain-security/v3/x/ccv/provider/keeper" - // unnamed import of statik for swagger UI support - _ "github.com/cosmos/cosmos-sdk/client/docs/statik" + "github.com/cosmos/gaia/v15/x/globalfee" ) type AppKeepers struct { @@ -439,8 +439,8 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino //nolint: staticcheck // SA1019: moduletypes.ParamKeyTable is deprecated paramsKeeper.Subspace(authtypes.ModuleName).WithKeyTable(authtypes.ParamKeyTable()) - paramsKeeper.Subspace(banktypes.ModuleName).WithKeyTable(banktypes.ParamKeyTable()) //nolint: staticcheck // SA1019 paramsKeeper.Subspace(stakingtypes.ModuleName).WithKeyTable(stakingtypes.ParamKeyTable()) + paramsKeeper.Subspace(banktypes.ModuleName).WithKeyTable(banktypes.ParamKeyTable()) //nolint: staticcheck // SA1019 paramsKeeper.Subspace(minttypes.ModuleName).WithKeyTable(minttypes.ParamKeyTable()) //nolint: staticcheck // SA1019 paramsKeeper.Subspace(distrtypes.ModuleName).WithKeyTable(distrtypes.ParamKeyTable()) //nolint: staticcheck // SA1019 paramsKeeper.Subspace(slashingtypes.ModuleName).WithKeyTable(slashingtypes.ParamKeyTable()) //nolint: staticcheck // SA1019 diff --git a/app/keepers/keys.go b/app/keepers/keys.go index 26e967a7230..5996f2437c4 100644 --- a/app/keepers/keys.go +++ b/app/keepers/keys.go @@ -2,6 +2,10 @@ package keepers import ( routertypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types" + icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" + ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" + providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -20,10 +24,6 @@ import ( slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" - providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ) func (appKeepers *AppKeepers) GenerateKeys() { diff --git a/app/modules.go b/app/modules.go index cee101d5ea5..f53e5c99c4f 100644 --- a/app/modules.go +++ b/app/modules.go @@ -3,6 +3,17 @@ package gaia import ( pfmrouter "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward" pfmroutertypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types" + ica "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts" + icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" + "github.com/cosmos/ibc-go/v7/modules/apps/transfer" + ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/v7/modules/core" + ibcclientclient "github.com/cosmos/ibc-go/v7/modules/core/02-client/client" + ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" + ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + icsprovider "github.com/cosmos/interchain-security/v3/x/ccv/provider" + icsproviderclient "github.com/cosmos/interchain-security/v3/x/ccv/provider/client" + providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/auth" @@ -43,17 +54,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/upgrade" upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - ica "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts" - icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" - "github.com/cosmos/ibc-go/v7/modules/apps/transfer" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/v7/modules/core" - ibcclientclient "github.com/cosmos/ibc-go/v7/modules/core/02-client/client" - ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" - ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" - icsprovider "github.com/cosmos/interchain-security/v3/x/ccv/provider" - icsproviderclient "github.com/cosmos/interchain-security/v3/x/ccv/provider/client" - providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" gaiaappparams "github.com/cosmos/gaia/v15/app/params" "github.com/cosmos/gaia/v15/x/globalfee" diff --git a/app/sim/sim_state.go b/app/sim/sim_state.go index f622569cb04..31a52668b6e 100644 --- a/app/sim/sim_state.go +++ b/app/sim/sim_state.go @@ -8,13 +8,11 @@ import ( "os" "time" - "github.com/cosmos/gaia/v15/app/params" - - "cosmossdk.io/math" - tmjson "github.com/cometbft/cometbft/libs/json" tmtypes "github.com/cometbft/cometbft/types" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" @@ -25,6 +23,7 @@ import ( stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" gaia "github.com/cosmos/gaia/v15/app" + "github.com/cosmos/gaia/v15/app/params" ) // Simulation parameter constants diff --git a/app/sim/sim_utils.go b/app/sim/sim_utils.go index 35472831d7f..6499ca82a2c 100644 --- a/app/sim/sim_utils.go +++ b/app/sim/sim_utils.go @@ -5,11 +5,10 @@ import ( "fmt" "os" - "github.com/cosmos/cosmos-sdk/runtime" - dbm "github.com/cometbft/cometbft-db" "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" diff --git a/app/sim_bench_test.go b/app/sim_bench_test.go index c6e1f2e083d..eb0aad65bb5 100644 --- a/app/sim_bench_test.go +++ b/app/sim_bench_test.go @@ -4,17 +4,16 @@ import ( "os" "testing" + "github.com/stretchr/testify/require" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/server" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" - simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli" - "github.com/stretchr/testify/require" - - gaia "github.com/cosmos/gaia/v15/app" - simulation2 "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" + simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli" + gaia "github.com/cosmos/gaia/v15/app" "github.com/cosmos/gaia/v15/app/sim" ) diff --git a/app/sim_test.go b/app/sim_test.go index 5547c5811f6..8f7eb3299f6 100644 --- a/app/sim_test.go +++ b/app/sim_test.go @@ -7,18 +7,19 @@ import ( "os" "testing" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/server" - simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + "github.com/stretchr/testify/require" dbm "github.com/cometbft/cometbft-db" "github.com/cometbft/cometbft/libs/log" + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/store" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" simulation2 "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli" - "github.com/stretchr/testify/require" gaia "github.com/cosmos/gaia/v15/app" // "github.com/cosmos/gaia/v11/app/helpers" diff --git a/app/upgrades/v12/upgrades.go b/app/upgrades/v12/upgrades.go index a30204a0ab8..f108d819217 100644 --- a/app/upgrades/v12/upgrades.go +++ b/app/upgrades/v12/upgrades.go @@ -27,9 +27,12 @@ func CreateUpgradeHandler( params.ValidatorLiquidStakingCap = ValidatorLiquidStakingCap params.GlobalLiquidStakingCap = GlobalLiquidStakingCap - keepers.StakingKeeper.SetParams(ctx, params) + err = keepers.StakingKeeper.SetParams(ctx, params) + if err != nil { + return vm, err + } ctx.Logger().Info("Upgrade complete") - return vm, err + return vm, nil } } diff --git a/app/upgrades/v8/upgrades.go b/app/upgrades/v8/upgrades.go index 850ede2be56..f65a97c7ef8 100644 --- a/app/upgrades/v8/upgrades.go +++ b/app/upgrades/v8/upgrades.go @@ -93,10 +93,10 @@ func QuicksilverFix(ctx sdk.Context, keepers *keepers.AppKeepers) error { } func closeChannel(keepers *keepers.AppKeepers, ctx sdk.Context, channelID string) { - channel, found := keepers.IBCKeeper.ChannelKeeper.GetChannel(ctx, icatypes.PortID, channelID) + channel, found := keepers.IBCKeeper.ChannelKeeper.GetChannel(ctx, icatypes.HostPortID, channelID) if found { channel.State = ibcchanneltypes.CLOSED - keepers.IBCKeeper.ChannelKeeper.SetChannel(ctx, icatypes.PortID, channelID, channel) + keepers.IBCKeeper.ChannelKeeper.SetChannel(ctx, icatypes.HostPortID, channelID, channel) } } diff --git a/cmd/gaiad/cmd/genaccounts.go b/cmd/gaiad/cmd/genaccounts.go new file mode 100644 index 00000000000..02c9c8405ba --- /dev/null +++ b/cmd/gaiad/cmd/genaccounts.go @@ -0,0 +1,197 @@ +package cmd + +import ( + "bufio" + "encoding/json" + "errors" + "fmt" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/crypto/keyring" + "github.com/cosmos/cosmos-sdk/server" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + authvesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/cosmos/cosmos-sdk/x/genutil" + genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" +) + +const ( + flagVestingStart = "vesting-start-time" + flagVestingEnd = "vesting-end-time" + flagVestingAmt = "vesting-amount" +) + +// AddGenesisAccountCmd returns add-genesis-account cobra Command. +func AddGenesisAccountCmd(defaultNodeHome string) *cobra.Command { + cmd := &cobra.Command{ + Use: "add-genesis-account [address_or_key_name] [coin][,[coin]]", + Short: "Add a genesis account to genesis.json", + Long: `Add a genesis account to genesis.json. The provided account must specify +the account address or key name and a list of initial coins. If a key name is given, +the address will be looked up in the local Keybase. The list of initial tokens must +contain valid denominations. Accounts may optionally be supplied with vesting parameters. +`, + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + serverCtx := server.GetServerContextFromCmd(cmd) + config := serverCtx.Config + + config.SetRoot(clientCtx.HomeDir) + + var kr keyring.Keyring + addr, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + inBuf := bufio.NewReader(cmd.InOrStdin()) + keyringBackend, err := cmd.Flags().GetString(flags.FlagKeyringBackend) + if err != nil { + return err + } + + if keyringBackend != "" && clientCtx.Keyring == nil { + var err error + kr, err = keyring.New(sdk.KeyringServiceName(), keyringBackend, clientCtx.HomeDir, inBuf, clientCtx.Codec) + if err != nil { + return err + } + } else { + kr = clientCtx.Keyring + } + + k, err := kr.Key(args[0]) + if err != nil { + return fmt.Errorf("failed to get address from Keyring: %w", err) + } + + addr, err = k.GetAddress() + if err != nil { + return fmt.Errorf("failed to GetAddress() from Keyring: %w", err) + } + } + + coins, err := sdk.ParseCoinsNormalized(args[1]) + if err != nil { + return fmt.Errorf("failed to parse coins: %w", err) + } + + vestingStart, err := cmd.Flags().GetInt64(flagVestingStart) + if err != nil { + return err + } + vestingEnd, err := cmd.Flags().GetInt64(flagVestingEnd) + if err != nil { + return err + } + vestingAmtStr, err := cmd.Flags().GetString(flagVestingAmt) + if err != nil { + return err + } + + vestingAmt, err := sdk.ParseCoinsNormalized(vestingAmtStr) + if err != nil { + return fmt.Errorf("failed to parse vesting amount: %w", err) + } + + // create concrete account type based on input parameters + var genAccount authtypes.GenesisAccount + + balances := banktypes.Balance{Address: addr.String(), Coins: coins.Sort()} + baseAccount := authtypes.NewBaseAccount(addr, nil, 0, 0) + + if !vestingAmt.IsZero() { + baseVestingAccount := authvesting.NewBaseVestingAccount(baseAccount, vestingAmt.Sort(), vestingEnd) + + if (balances.Coins.IsZero() && !baseVestingAccount.OriginalVesting.IsZero()) || + baseVestingAccount.OriginalVesting.IsAnyGT(balances.Coins) { + return errors.New("vesting amount cannot be greater than total amount") + } + + switch { + case vestingStart != 0 && vestingEnd != 0: + genAccount = authvesting.NewContinuousVestingAccountRaw(baseVestingAccount, vestingStart) + + case vestingEnd != 0: + genAccount = authvesting.NewDelayedVestingAccountRaw(baseVestingAccount) + + default: + return errors.New("invalid vesting parameters; must supply start and end time or end time") + } + } else { + genAccount = baseAccount + } + + if err := genAccount.Validate(); err != nil { + return fmt.Errorf("failed to validate new genesis account: %w", err) + } + + genFile := config.GenesisFile() + appState, genDoc, err := genutiltypes.GenesisStateFromGenFile(genFile) + if err != nil { + return fmt.Errorf("failed to unmarshal genesis state: %w", err) + } + + authGenState := authtypes.GetGenesisStateFromAppState(clientCtx.Codec, appState) + + accs, err := authtypes.UnpackAccounts(authGenState.Accounts) + if err != nil { + return fmt.Errorf("failed to get accounts from any: %w", err) + } + + if accs.Contains(addr) { + return fmt.Errorf("cannot add account at existing address %s", addr) + } + + // Add the new account to the set of genesis accounts and sanitize the + // accounts afterwards. + accs = append(accs, genAccount) + accs = authtypes.SanitizeGenesisAccounts(accs) + + genAccs, err := authtypes.PackAccounts(accs) + if err != nil { + return fmt.Errorf("failed to convert accounts into any's: %w", err) + } + authGenState.Accounts = genAccs + + authGenStateBz, err := clientCtx.Codec.MarshalJSON(&authGenState) + if err != nil { + return fmt.Errorf("failed to marshal auth genesis state: %w", err) + } + + appState[authtypes.ModuleName] = authGenStateBz + + bankGenState := banktypes.GetGenesisStateFromAppState(clientCtx.Codec, appState) + bankGenState.Balances = append(bankGenState.Balances, balances) + bankGenState.Balances = banktypes.SanitizeGenesisBalances(bankGenState.Balances) + bankGenState.Supply = bankGenState.Supply.Add(balances.Coins...) + + bankGenStateBz, err := clientCtx.Codec.MarshalJSON(bankGenState) + if err != nil { + return fmt.Errorf("failed to marshal bank genesis state: %w", err) + } + + appState[banktypes.ModuleName] = bankGenStateBz + + appStateJSON, err := json.Marshal(appState) + if err != nil { + return fmt.Errorf("failed to marshal application genesis state: %w", err) + } + + genDoc.AppState = appStateJSON + return genutil.ExportGenesisFile(genDoc, genFile) + }, + } + + cmd.Flags().String(flags.FlagHome, defaultNodeHome, "The application home directory") + cmd.Flags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|kwallet|pass|test)") + cmd.Flags().String(flagVestingAmt, "", "amount of coins for vesting accounts") + cmd.Flags().Int64(flagVestingStart, 0, "schedule start time (unix epoch) for vesting accounts") + cmd.Flags().Int64(flagVestingEnd, 0, "schedule end time (unix epoch) for vesting accounts") + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/cmd/gaiad/cmd/root.go b/cmd/gaiad/cmd/root.go index 7c0e243cbec..a1cc62eb428 100644 --- a/cmd/gaiad/cmd/root.go +++ b/cmd/gaiad/cmd/root.go @@ -6,22 +6,25 @@ import ( "os" "path/filepath" - tmcfg "github.com/cometbft/cometbft/config" - tmtypes "github.com/cometbft/cometbft/types" - "github.com/cosmos/cosmos-sdk/client/pruning" + "github.com/spf13/cast" + "github.com/spf13/cobra" "github.com/spf13/viper" - rosettaCmd "cosmossdk.io/tools/rosetta/cmd" - dbm "github.com/cometbft/cometbft-db" + tmcfg "github.com/cometbft/cometbft/config" tmcli "github.com/cometbft/cometbft/libs/cli" "github.com/cometbft/cometbft/libs/log" + tmtypes "github.com/cometbft/cometbft/types" + + rosettaCmd "cosmossdk.io/tools/rosetta/cmd" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/config" "github.com/cosmos/cosmos-sdk/client/debug" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/keys" + "github.com/cosmos/cosmos-sdk/client/pruning" "github.com/cosmos/cosmos-sdk/client/rpc" "github.com/cosmos/cosmos-sdk/server" serverconfig "github.com/cosmos/cosmos-sdk/server/config" @@ -29,15 +32,12 @@ import ( "github.com/cosmos/cosmos-sdk/snapshots" snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" "github.com/cosmos/cosmos-sdk/store" - sdk "github.com/cosmos/cosmos-sdk/types" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/crisis" genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" - "github.com/spf13/cast" - "github.com/spf13/cobra" gaia "github.com/cosmos/gaia/v15/app" "github.com/cosmos/gaia/v15/app/params" diff --git a/cmd/gaiad/cmd/testnet.go b/cmd/gaiad/cmd/testnet.go index bfa61125001..f0ae3f725b6 100644 --- a/cmd/gaiad/cmd/testnet.go +++ b/cmd/gaiad/cmd/testnet.go @@ -8,16 +8,17 @@ import ( "os" "path/filepath" - "cosmossdk.io/math" - "cosmossdk.io/simapp" - - "github.com/cosmos/cosmos-sdk/testutil/network" + "github.com/spf13/cobra" "github.com/spf13/pflag" tmconfig "github.com/cometbft/cometbft/config" tmrand "github.com/cometbft/cometbft/libs/rand" "github.com/cometbft/cometbft/types" tmtime "github.com/cometbft/cometbft/types/time" + + "cosmossdk.io/math" + "cosmossdk.io/simapp" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" @@ -27,6 +28,7 @@ import ( "github.com/cosmos/cosmos-sdk/server" srvconfig "github.com/cosmos/cosmos-sdk/server/config" "github.com/cosmos/cosmos-sdk/testutil" + "github.com/cosmos/cosmos-sdk/testutil/network" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -34,7 +36,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/spf13/cobra" ) var ( diff --git a/docs/governance/formatting.md b/docs/governance/formatting.md index 0d11e8ce854..4ab6e7ab03d 100644 --- a/docs/governance/formatting.md +++ b/docs/governance/formatting.md @@ -10,7 +10,7 @@ Many proposals allow for long form text to be included, usually under the key `d Beware, however, that if you are using the CLI to create a proposal, and setting `description` using a flag, the text will be [escaped](https://en.wikipedia.org/wiki/Escape_sequences_in_C) which may have undesired effects. -Formating a proposal can be a trial-and-error process, which is why first submitting to the [testnet](submitting.md#submitting-your-proposal-to-the-testnet) is recommended. +Formatting a proposal can be a trial-and-error process, which is why first submitting to the [testnet](submitting.md#submitting-your-proposal-to-the-testnet) is recommended. The examples shown below are of the text in a `json` file packaged into a `submit-proposal` transaction sent on-chain. More details about how to submit a proposal are in the [Submitting a Governance Proposal](./submitting.md) section, but for now just be aware that the examples are the contents of a file separate from the transaction. As a general rule, any flags specific to a proposal (e.g., Title, description, deposit, parameters, recipient) can be placed in a `json` file, while flags general to a transaction of any kind (e.g., chain-id, node-id, gas, fees) can remain in the CLI. @@ -48,7 +48,7 @@ There are five (5) components: 4. **Amount** - the amount of funding that the recipient will receive in micro-ATOMs (uatom) 5. **Deposit** - the amount that will be contributed to the deposit (in micro-ATOMs "uatom") from the account submitting the proposal -If the description says that a certain address will receive a certain number of ATOMs, it should also be programmed to do that, but it's possible that that's not the case (accidentally or otherwise). Check that the description aligns with teh 'recipient' address. +If the description says that a certain address will receive a certain number of ATOMs, it should also be programmed to do that, but it's possible that that's not the case (accidentally or otherwise). Check that the description aligns with the 'recipient' address. ### Real example The `amount` is `1000000000uatom`. 1,000,000 micro-ATOM is equal to 1 ATOM, so `recipient` address `cosmos1xf2qwf6g6xvuttpf37xwrgp08qq984244952ze` will receive 1000 ATOM if this proposal is passed. diff --git a/docs/gtm-interchain.md b/docs/gtm-interchain.md index ddc3bc094ed..2c52ecfc44b 100644 --- a/docs/gtm-interchain.md +++ b/docs/gtm-interchain.md @@ -36,7 +36,7 @@ The user is paramount. For Gaia and IBC, we see the users being: - Nodes on hub and zones - Other service providers on hubs and zones (wallets, explorers, exchanges, etc.) -We will also want to be tracking outreach to the relevant users per phase to ensure that Hub utility (and IBC where appropriate) are being validated. Spotlights on experiments will continue to validate the utility of the Hub and IBC (i.e. bridge to Ethereum, AMM, etc). We will also be conducting continous outbound outreach to look for partners that are aligned with the interchain mission. +We will also want to be tracking outreach to the relevant users per phase to ensure that Hub utility (and IBC where appropriate) are being validated. Spotlights on experiments will continue to validate the utility of the Hub and IBC (i.e. bridge to Ethereum, AMM, etc). We will also be conducting continuous outbound outreach to look for partners that are aligned with the interchain mission. 3. **Communications** diff --git a/docs/hub-tutorials/gaiad.md b/docs/hub-tutorials/gaiad.md index 91013984d59..961fb12cc66 100644 --- a/docs/hub-tutorials/gaiad.md +++ b/docs/hub-tutorials/gaiad.md @@ -464,7 +464,7 @@ Once you begin an unbonding-delegation, you can see it's information by using th gaiad query staking unbonding-delegation ``` -Or if you want to check all your current unbonding-delegations with disctinct validators: +Or if you want to check all your current unbonding-delegations with distinct validators: ```bash gaiad query staking unbonding-delegations diff --git a/docs/hub-tutorials/join-mainnet.md b/docs/hub-tutorials/join-mainnet.md index 6136fa153fe..4513e47790c 100644 --- a/docs/hub-tutorials/join-mainnet.md +++ b/docs/hub-tutorials/join-mainnet.md @@ -26,7 +26,7 @@ For more details, see the [history of upgrades](https://github.com/cosmos/gaia/t **This guide includes full instructions for joining the mainnet either as an archive/full node or a pruned node.** -For instructions to boostrap a node via Quicksync or State Sync, see the [Quickstart Guide](https://hub.cosmos.network/main/getting-started/quickstart.html) +For instructions to bootstrap a node via Quicksync or State Sync, see the [Quickstart Guide](https://hub.cosmos.network/main/getting-started/quickstart.html) For instructions to join as a validator, please also see the [Validator Guide](https://hub.cosmos.network/main/validators/overview.html#). diff --git a/docs/modules/globalfee.md b/docs/modules/globalfee.md index 688d77cb05e..a5ff569f685 100644 --- a/docs/modules/globalfee.md +++ b/docs/modules/globalfee.md @@ -10,7 +10,7 @@ global fees `MinimumGasPricesParam` is established at the network level through 2. `minimum-gas-prices` in `app.toml`\ - By adjusting the `minimum-gas-prices` parameter in `app.toml`, nodes can enforce a fee that is higher than the globally defined `MinimumGasPricesParam`. However, it's importantht to note that this configuration solely determines whether transactions are eligible to enter this specific node's mempool. + By adjusting the `minimum-gas-prices` parameter in `app.toml`, nodes can enforce a fee that is higher than the globally defined `MinimumGasPricesParam`. However, it's important to note that this configuration solely determines whether transactions are eligible to enter this specific node's mempool. *Please note: in this context, `minimum-gas-prices` are used to refer to the local fee requirement that nodes can set in their `app.toml`, while `MinimumGasPricesParam` is a parameter in the globalfee module, which is the fee requirement at network level.* @@ -32,7 +32,7 @@ Every transaction must pay per unit of gas, **at least**, in one of the denomina Requirements for the fees include: - fees have to be alphabetically sorted by denom -- fees must have non-negative amount, with a valid and unique denom (i.e. no duplicate denoms are allowed) +- fees must have a non-negative amount, with a valid and unique denom (i.e. no duplicate denoms are allowed) There are **two exceptions** from the global fees rules that allow zero fee transactions: @@ -62,7 +62,7 @@ Before gaiad `v11.0.0`, `bypass-min-fee-msg-types` can be set by each node in `a - Nodes created using Gaiad `v7.0.2` - `v10.0.x` use `["/ibc.core.channel.v1.MsgRecvPacket", "/ibc.core.channel.v1.MsgAcknowledgement","/ibc.applications.transfer.v1.MsgTransfer"]` as defaults. - Nodes created using Gaiad `v11.0.x` or later use `["/ibc.core.channel.v1.MsgRecvPacket", "/ibc.core.channel.v1.MsgAcknowledgement","/ibc.applications.transfer.v1.MsgTransfer", "/ibc.core.channel.v1.MsgTimeout", "/ibc.core.channel.v1.MsgTimeoutOnClose"]` as defaults. -- Node Nodes with `bypass-min-fee-msg-types = []` or missing this field in `app.toml` also use default bypass message types. +- Nodes with `bypass-min-fee-msg-types = []` or missing this field in `app.toml` also use default bypass message types. - Nodes created using gaiad `v7.0.1` and `v7.0.0` do not have `bypass-min-fee-msg-types` configured in `config/app.toml` - they are also using same default values as in `v7.0.2`. The `bypass-min-fee-msg-types` config option can be added to `config/app.toml` before the `[telemetry]` field. An example of `bypass-min-fee-msg-types` in `app.toml` **before** gaiad v11.0.0: @@ -274,7 +274,7 @@ Note that the required amount of `uatom` in globalfee is overwritten by the amou Also, the `1stake` in minimum-gas-prices is ignored. - msgs=["/ibc.core.channel.v1.MsgRecvPacket", "/ibc.core.client.v1.MsgUpdateClient"] with paidfee="", `pass` - - msgs=["/ibc.core.channel.v1.MsgRecvPacket", "/ibc.core.client.v1.MsgUpdateClient"] with with paidfee="600000 * 0.05uatom", `pass` + - msgs=["/ibc.core.channel.v1.MsgRecvPacket", "/ibc.core.client.v1.MsgUpdateClient"] with paidfee="600000 * 0.05uatom", `pass` - msgs= ["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward"] with paidfee="", `fail` - msgs=["/ibc.core.channel.v1.MsgRecvPacket", "/ibc.core.client.v1.MsgUpdateClient", "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward] with paidfee="", `fail` (transaction contains non-bypass messages) - msgs=["/ibc.core.channel.v1.MsgRecvPacket", "/ibc.core.client.v1.MsgUpdateClient", "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward] with paidfee="600000 * 0.2uatom", `pass` diff --git a/docs/resources/archives.md b/docs/resources/archives.md index 21afa71d5cc..b86cafcf4af 100644 --- a/docs/resources/archives.md +++ b/docs/resources/archives.md @@ -19,4 +19,4 @@ If you would like to search explorers for previous hub data, these are some link - [Cosmos Hub 2](https://cosmoshub-2.bigdipper.live/) - [Cosmos Hub 3](https://cosmoshub-3.bigdipper.live/) -If you want to makes archives available to the community, feel free to open a PR to this file and add them. +If you want to make archives available to the community, feel free to open a PR to this file and add them. diff --git a/docs/resources/genesis.md b/docs/resources/genesis.md index 5f74ec2aa52..59ebfa16c14 100644 --- a/docs/resources/genesis.md +++ b/docs/resources/genesis.md @@ -19,11 +19,11 @@ The genesis file is stored in `~/.gaia/config/genesis.toml`. A genesis file is a JSON file which defines the initial state of your blockchain. It can be seen as height `0` of your blockchain. The first block, at height `1`, will reference the genesis file as its parent. -The state defined in the genesis file contains all the necessary information, like initial token allocation, genesis time, default parameters, and more. Let us break down these information. +The state defined in the genesis file contains all the necessary information, like initial token allocation, genesis time, default parameters, and more. Let us break down this information. ## Genesis Time and Chain_id -The `genesis_time` is defined at the top of the genesis file. It is a `UTC` timestamps which specifies when the blockchain is due to start. At this time, genesis validators are supposed to come online and start participating in the consensus process. The blockchain starts when more than 2/3rd of the genesis validators (weighted by voting power) are online. +The `genesis_time` is defined at the top of the genesis file. It is a `UTC` timestamp that specifies when the blockchain is due to start. At this time, genesis validators are supposed to come online and start participating in the consensus process. The blockchain starts when more than 2/3rd of the genesis validators (weighted by voting power) are online. ```json "genesis_time": "2019-03-13T17:00:00.000000000Z", @@ -70,7 +70,7 @@ The application state defines the initial state of the state-machine. ### Genesis Accounts -In this section, initial allocation of tokens is defined. It is possible to add accounts manually by directly editing the genesis file, but it is also possible to use the following command: +In this section, the initial allocation of tokens is defined. It is possible to add accounts manually by directly editing the genesis file, but it is also possible to use the following command: ```bash // Example: gaiad add-genesis-account cosmos1qs8tnw2t8l6amtzvdemnnsq9dzk0ag0z37gh3h 10000000uatom @@ -295,7 +295,7 @@ Let us break down the parameters: ### Slashing -The `slashing` module handles the logic to slash delegators if their validator misbehave. The `slashing` section in genesis looks as follows: +The `slashing` module handles the logic to slash delegators if their validator misbehaves. The `slashing` section in genesis looks as follows: ```json "slashing": { diff --git a/docs/resources/ledger.md b/docs/resources/ledger.md index 0950153fa28..8fc45401e91 100644 --- a/docs/resources/ledger.md +++ b/docs/resources/ledger.md @@ -64,7 +64,7 @@ You can also have a look at the [Ledger support page](https://support.ledger.com ## Gaia CLI + Ledger Nano -**Note: You need to [install the Cosmos app](#install-the-cosmos-ledger-application) on your Ledger Nano before using following this section** +**Note: You need to [install the Cosmos app](#install-the-cosmos-ledger-application) on your Ledger Nano before following this section** The tool used to generate addresses and transactions on the Cosmos Hub network is `gaiad`. Here is how to get started. If using a CLI tool is unfamiliar to you, scroll down and follow instructions for using the Keplr wallet instead. diff --git a/docs/roadmap/README.md b/docs/roadmap/README.md index e1048332664..0a10067c98e 100644 --- a/docs/roadmap/README.md +++ b/docs/roadmap/README.md @@ -7,7 +7,7 @@ parent: # Previous Releases -The following table below, shows the the versions of the main dependencies. +The following table below, shows the versions of the main dependencies. | Upgrade Name | Date | Height | Chain Identifier | Tm | Cosmos SDK | Gaia | IBC | |---------------------|---------------|-----------|---------------|------------|------------|--------------------------|--------------------------| @@ -26,4 +26,4 @@ The following table below, shows the the versions of the main dependencies. | [v11](https://github.com/cosmos/gaia/releases/tag/v11.0.0) | 16/08/23 | 16596000 | `cosmoshub-4` | [v0.34.x](https://github.com/cometbft/cometbft/releases/tag/v0.34.29) | [v0.45.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.16-ics) | [v11.x](https://github.com/cosmos/gaia/releases/tag/v11.0.0) | [v4.4.x](https://github.com/cosmos/ibc-go/releases/tag/v4.4.2) | | [v12](https://github.com/cosmos/gaia/releases/tag/v12.0.0) | 13/09/23 | 16985500 | `cosmoshub-4` | [v0.34.x](https://github.com/cometbft/cometbft/releases/tag/v0.34.29) | [v0.45.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.16-ics) | [v12.x](https://github.com/cosmos/gaia/releases/tag/v12.0.0) | [v4.4.x](https://github.com/cosmos/ibc-go/releases/tag/v4.4.2) | | [v13](https://github.com/cosmos/gaia/releases/tag/v13.0.0) | 11/10/23 | 17380000 | `cosmoshub-4` | [v0.34.x](https://github.com/cometbft/cometbft/releases/tag/v0.34.29) | [v0.45.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.16-ics-lsm) | [v13.x](https://github.com/cosmos/gaia/releases/tag/v13.0.0) | [v4.4.x](https://github.com/cosmos/ibc-go/releases/tag/v4.4.2) | -| [v14](https://github.com/cosmos/gaia/releases/tag/v14.1.0) | 11/10/23 | 18262000 | `cosmoshub-4` | [v0.34.x](https://github.com/cometbft/cometbft/releases/tag/v0.34.29) | [v0.45.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.16-ics-lsm) | [v14.x](https://github.com/cosmos/gaia/releases/tag/v14.0.0) | [v4.4.x](https://github.com/cosmos/ibc-go/releases/tag/v4.4.2) | \ No newline at end of file +| [v14](https://github.com/cosmos/gaia/releases/tag/v14.1.0) | 11/10/23 | 18262000 | `cosmoshub-4` | [v0.34.x](https://github.com/cometbft/cometbft/releases/tag/v0.34.29) | [v0.45.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.16-ics-lsm) | [v14.x](https://github.com/cosmos/gaia/releases/tag/v14.0.0) | [v4.4.x](https://github.com/cosmos/ibc-go/releases/tag/v4.4.2) | diff --git a/docs/validators/security.md b/docs/validators/security.md index 05b62889bcc..5feaac7bb6d 100644 --- a/docs/validators/security.md +++ b/docs/validators/security.md @@ -25,7 +25,7 @@ One recommended way to mitigate these risks is for validators to carefully struc Validator nodes should only connect to full-nodes they trust because they operate them themselves or are run by other validators they know socially. A validator node will typically run in a data center. Most data centers provide direct links the networks of major cloud providers. The validator can use those links to connect to sentry nodes in the cloud. This shifts the burden of denial-of-service from the validator's node directly to its sentry nodes, and may require new sentry nodes be spun up or activated to mitigate attacks on existing ones. -Sentry nodes can be quickly spun up or change their IP addresses. Because the links to the sentry nodes are in private IP space, an internet based attacked cannot disturb them directly. This will ensure validator block proposals and votes always make it to the rest of the network. +Sentry nodes can be quickly spun up or change their IP addresses. Because the links to the sentry nodes are in private IP space, an internet based attack cannot disturb them directly. This will ensure validator block proposals and votes always make it to the rest of the network. To setup your sentry node architecture you can follow the instructions below: @@ -58,4 +58,4 @@ By default, uppercase environment variables with the following prefixes will rep - `BC` (for democli or basecli flags) For example, the environment variable `GA_CHAIN_ID` will map to the command line flag `--chain-id`. Note that while explicit command-line flags will take precedence over environment variables, environment variables will take precedence over any of your configuration files. For this reason, it's imperative that you lock down your environment such that any critical parameters are defined as flags on the CLI or prevent modification of any environment variables. - \ No newline at end of file + diff --git a/docs/validators/validator-faq.md b/docs/validators/validator-faq.md index 42c6fc266f4..be2c026fa2e 100644 --- a/docs/validators/validator-faq.md +++ b/docs/validators/validator-faq.md @@ -242,7 +242,52 @@ Note however that it's possible that some validators decide to self-delegate via ### How to prevent concentration of stake in the hands of a few top validators? -The community is expected to behave in a smart and self-preserving way. When a mining pool in Bitcoin gets too much mining power the community usually stops contributing to that pool. The Cosmos Hub relies on the same effect. Additionally, when delegaters switch to another validator, they are not subject to the unbonding period, which removes any barrier to quickly redelegating tokens in service of improving decentralization. +The community is expected to behave in a smart and self-preserving way. When a mining pool in Bitcoin gets too much mining power the community usually stops contributing to that pool. The Cosmos Hub relies on the same effect. Additionally, when delegators switch to another validator, they are not subject to the unbonding period, which removes any barrier to quickly redelegating tokens in service of improving decentralization. + +## Liquid Staking Module + +### What is the liquid staking module? + +The Liquid Staking Module is a set of safety features that mitigate liquid staking risks by: +- limiting the total amount of tokens that can be liquid staked to X% of all staked tokens. +- introducing a requirement that validators validator-bond tokens to be eligible for delegations from liquid staking providers. +- limiting the portion of validators's shares that can be liquid staked to X% of their total shares. + +The Liquid Staking Module also improves liquid staking UX by making delegations transferable under limited scenarios, to allow delegators to convert their delegations into liquid staking positions without having to wait the unbonding period. + +For a detailed and technical description, please see ADR-061 in the Cosmos SDK or the Liquid Staking Module Cosmos Hub [forum post](https://forum.cosmos.network/t/signaling-proposal-draft-add-liquid-staking-module-to-the-cosmos-hub/10368). + +### Who can validator bond? +The validator themselves, but also any other address delegated to the validator. + +### How can I validator bond? +Once delegated to a validator, a delegator (or validator operator) can convert their delegation to a validator into Validator Bond by signing a ValidatorBond message. + +The ValidatorBond message is exposed by the staking module and can be executed as follows: +``` +gaiad tx staking validator-bond cosmosvaloper13h5xdxhsdaugwdrkusf8lkgu406h8t62jkqv3h --from mykey +``` +There are no partial Validator Bonds: when a delegator or validator converts their shares to a particular validator into Validator Bond, their entire delegation to that validator is converted to Validator Bond. If a validator or delegator wishes to convert only some of their delegation to Validator Bond, they should transfer those funds to a separate address and Validator Bond from that address, or redelegate the funds that they do not wish to validator bond to another validator before converting their delegation to validator bond. + +To convert Validator Bond back into a standard delegation, simply unbond the shares. + +### How does a delegator or validator mark their delegation as a validator bond? +Once delegated to a validator, sign a `ValidatorBond` message. + +### Are validator bonds subject to additional slashing conditions? +No, in the event of a slash, a validator bond is slashed at the same rate as a regular bond. + +### Can I unbond my validator bond? +If all the liquid staking capacity made available by a validator’s validator bond is utilized, validator bond delegated to that validator cannot be unbonded. If new capacity becomes available (either by redemption of liquid staking tokens or addition or new validator bond), then existing validator bond can be undelegated. + +Example: Suppose the validator bond factor is 250 and Validator V bonds 2 ATOM, then liquid staking providers delegate 500 ATOM to Validator V. Now Validator V cannot remove any of their validator bond because the full liquid staking capacity made available by Validator V’s validator bond is consumed. + +If liquid staking providers undelegate 250 ATOM from Validator V, Validator V can now remove 1 ATOM of validator bond. + +If, instead, the ICF or a community member validator bonds 1 additional ATOM to Validator V, Validator V can now remove 1 ATOM of validator bond. + +### Can I validator bond some of my tokens and delegate the remaining portion normally? +The `ValidatorBond` message converts the full balance delegated to a validator into validator bond. To validator bond some tokens and delegate the remaining portion normally, use two addresses: the first will delegate + ValidatorBond, and the second will just delegate. ## Liquid Staking Module diff --git a/docs/validators/validator-setup.md b/docs/validators/validator-setup.md index 76c73bd35d6..b76d3b689a5 100644 --- a/docs/validators/validator-setup.md +++ b/docs/validators/validator-setup.md @@ -21,7 +21,7 @@ If you plan to use a KMS (key management system), you should go through these st If you want to become a validator for the Hub's `mainnet`, you should learn more about [security](./security.md). ::: -The following instructions assume you have already [set up a full-node](../hub-tutorials/join-mainnet.md) and are synchonised to the latest blockheight. +The following instructions assume you have already [set up a full-node](../hub-tutorials/join-mainnet.md) and are synchronised to the latest blockheight. ## Create Your Validator diff --git a/go.mod b/go.mod index d4a96c78b01..bc4e577648e 100644 --- a/go.mod +++ b/go.mod @@ -228,7 +228,7 @@ replace ( // following versions might cause unexpected behavior github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - // latest grpc doesn't work with with our modified proto compiler, so we need to enforce + // latest grpc doesn't work with our modified proto compiler, so we need to enforce // the following version across all dependencies. google.golang.org/grpc => google.golang.org/grpc v1.54.0 ) diff --git a/tests/e2e/chain.go b/tests/e2e/chain.go index 48df1341546..774784694e6 100644 --- a/tests/e2e/chain.go +++ b/tests/e2e/chain.go @@ -4,14 +4,15 @@ import ( "fmt" "os" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - tmrand "github.com/cometbft/cometbft/libs/rand" + + providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" authvesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" distribtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" @@ -19,7 +20,7 @@ import ( govv1beta1types "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" paramsproptypes "github.com/cosmos/cosmos-sdk/x/params/types/proposal" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" gaiaparams "github.com/cosmos/gaia/v15/app/params" ) diff --git a/tests/e2e/e2e_bypassminfee_test.go b/tests/e2e/e2e_bypassminfee_test.go index 0913b1a8f08..8652cdf0c2c 100644 --- a/tests/e2e/e2e_bypassminfee_test.go +++ b/tests/e2e/e2e_bypassminfee_test.go @@ -7,6 +7,7 @@ import ( ibcchanneltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" ) diff --git a/tests/e2e/e2e_exec_test.go b/tests/e2e/e2e_exec_test.go index e84a8f04f9e..85ac056959e 100644 --- a/tests/e2e/e2e_exec_test.go +++ b/tests/e2e/e2e_exec_test.go @@ -9,18 +9,17 @@ import ( "strings" "time" - vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" - "github.com/cosmos/cosmos-sdk/x/feegrant" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/ory/dockertest/v3/docker" "github.com/cosmos/cosmos-sdk/client/flags" sdk "github.com/cosmos/cosmos-sdk/types" + vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + "github.com/cosmos/cosmos-sdk/x/feegrant" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - - "github.com/ory/dockertest/v3/docker" ) const ( diff --git a/tests/e2e/e2e_gov_test.go b/tests/e2e/e2e_gov_test.go index 0756f8277f1..316590e8e3f 100644 --- a/tests/e2e/e2e_gov_test.go +++ b/tests/e2e/e2e_gov_test.go @@ -6,7 +6,6 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" - govtypesv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) diff --git a/tests/e2e/e2e_setup_test.go b/tests/e2e/e2e_setup_test.go index 09ac4822227..63026cd92f4 100644 --- a/tests/e2e/e2e_setup_test.go +++ b/tests/e2e/e2e_setup_test.go @@ -16,14 +16,18 @@ import ( "testing" "time" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + "github.com/ory/dockertest/v3" + // "github.com/cosmos/cosmos-sdk/crypto/hd" + // "github.com/cosmos/cosmos-sdk/crypto/keyring" + "github.com/ory/dockertest/v3/docker" + "github.com/spf13/viper" + "github.com/stretchr/testify/suite" tmconfig "github.com/cometbft/cometbft/config" "github.com/cometbft/cometbft/crypto/ed25519" tmjson "github.com/cometbft/cometbft/libs/json" rpchttp "github.com/cometbft/cometbft/rpc/client/http" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keyring" @@ -36,14 +40,10 @@ import ( distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/ory/dockertest/v3" - "github.com/stretchr/testify/suite" - - // "github.com/cosmos/cosmos-sdk/crypto/hd" - // "github.com/cosmos/cosmos-sdk/crypto/keyring" - "github.com/ory/dockertest/v3/docker" - "github.com/spf13/viper" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) const ( diff --git a/tests/e2e/e2e_staking_test.go b/tests/e2e/e2e_staking_test.go index f9ffe4f438b..483d522d646 100644 --- a/tests/e2e/e2e_staking_test.go +++ b/tests/e2e/e2e_staking_test.go @@ -6,6 +6,7 @@ import ( "time" "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/types" ) diff --git a/tests/e2e/genesis.go b/tests/e2e/genesis.go index 7e449009f71..acaf2127ca5 100644 --- a/tests/e2e/genesis.go +++ b/tests/e2e/genesis.go @@ -7,20 +7,21 @@ import ( "time" tmtypes "github.com/cometbft/cometbft/types" + + icagen "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/genesis/types" + icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" + "github.com/cosmos/cosmos-sdk/server" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/genutil" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" govmigrv3 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v3" govmigrv4 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v4" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" govlegacytypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - icagen "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/genesis/types" - icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" globfeetypes "github.com/cosmos/gaia/v15/x/globalfee/types" ) @@ -49,7 +50,7 @@ func getGenDoc(path string) (*tmtypes.GenesisDoc, error) { return doc, nil } -func modifyGenesis(path, moniker, amountStr string, addrAll []sdk.AccAddress, globfees string, denom string) error { //nolint:unparam +func modifyGenesis(path, moniker, amountStr string, addrAll []sdk.AccAddress, globfees string, denom string) error { serverCtx := server.NewDefaultContext() config := serverCtx.Config config.SetRoot(path) diff --git a/tests/e2e/query.go b/tests/e2e/query.go index b1f03ae968e..4696154cea8 100644 --- a/tests/e2e/query.go +++ b/tests/e2e/query.go @@ -12,13 +12,11 @@ import ( authvesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" govtypesv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/cosmos/gaia/v15/x/globalfee/types" - - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" - - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) func queryGaiaTx(endpoint, txHash string) error { diff --git a/tests/e2e/validator.go b/tests/e2e/validator.go index 59690509838..c4fe4af6944 100644 --- a/tests/e2e/validator.go +++ b/tests/e2e/validator.go @@ -18,13 +18,11 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keyring" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/server" - "github.com/cosmos/cosmos-sdk/x/genutil" - sdk "github.com/cosmos/cosmos-sdk/types" sdktx "github.com/cosmos/cosmos-sdk/types/tx" txsigning "github.com/cosmos/cosmos-sdk/types/tx/signing" - authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" + "github.com/cosmos/cosmos-sdk/x/genutil" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" gaia "github.com/cosmos/gaia/v15/app" diff --git a/tests/ics/interchain_security_test.go b/tests/ics/interchain_security_test.go index e063a290a91..debaf008426 100644 --- a/tests/ics/interchain_security_test.go +++ b/tests/ics/interchain_security_test.go @@ -4,14 +4,15 @@ import ( "encoding/json" "testing" - appConsumer "github.com/cosmos/interchain-security/v3/app/consumer" - "github.com/cosmos/interchain-security/v3/tests/integration" - icstestingutils "github.com/cosmos/interchain-security/v3/testutil/ibc_testing" "github.com/stretchr/testify/suite" tmdb "github.com/cometbft/cometbft-db" "github.com/cometbft/cometbft/libs/log" + ibctesting "github.com/cosmos/ibc-go/v7/testing" + appConsumer "github.com/cosmos/interchain-security/v3/app/consumer" + "github.com/cosmos/interchain-security/v3/tests/integration" + icstestingutils "github.com/cosmos/interchain-security/v3/testutil/ibc_testing" gaiaApp "github.com/cosmos/gaia/v15/app" ) diff --git a/third_party/proto/cosmos/staking/v1beta1/query.proto b/third_party/proto/cosmos/staking/v1beta1/query.proto new file mode 100644 index 00000000000..01b88cbb06f --- /dev/null +++ b/third_party/proto/cosmos/staking/v1beta1/query.proto @@ -0,0 +1,348 @@ +syntax = "proto3"; +package cosmos.staking.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/staking/v1beta1/staking.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; + +// Query defines the gRPC querier service. +service Query { + // Validators queries all validators that match the given status. + rpc Validators(QueryValidatorsRequest) returns (QueryValidatorsResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/validators"; + } + + // Validator queries validator info for given validator address. + rpc Validator(QueryValidatorRequest) returns (QueryValidatorResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}"; + } + + // ValidatorDelegations queries delegate info for given validator. + rpc ValidatorDelegations(QueryValidatorDelegationsRequest) returns (QueryValidatorDelegationsResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations"; + } + + // ValidatorUnbondingDelegations queries unbonding delegations of a validator. + rpc ValidatorUnbondingDelegations(QueryValidatorUnbondingDelegationsRequest) + returns (QueryValidatorUnbondingDelegationsResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/" + "{validator_addr}/unbonding_delegations"; + } + + // Delegation queries delegate info for given validator delegator pair. + rpc Delegation(QueryDelegationRequest) returns (QueryDelegationResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/" + "{delegator_addr}"; + } + + // UnbondingDelegation queries unbonding info for given validator delegator + // pair. + rpc UnbondingDelegation(QueryUnbondingDelegationRequest) returns (QueryUnbondingDelegationResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/" + "{delegator_addr}/unbonding_delegation"; + } + + // DelegatorDelegations queries all delegations of a given delegator address. + rpc DelegatorDelegations(QueryDelegatorDelegationsRequest) returns (QueryDelegatorDelegationsResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/delegations/{delegator_addr}"; + } + + // DelegatorUnbondingDelegations queries all unbonding delegations of a given + // delegator address. + rpc DelegatorUnbondingDelegations(QueryDelegatorUnbondingDelegationsRequest) + returns (QueryDelegatorUnbondingDelegationsResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/" + "{delegator_addr}/unbonding_delegations"; + } + + // Redelegations queries redelegations of given address. + rpc Redelegations(QueryRedelegationsRequest) returns (QueryRedelegationsResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations"; + } + + // DelegatorValidators queries all validators info for given delegator + // address. + rpc DelegatorValidators(QueryDelegatorValidatorsRequest) returns (QueryDelegatorValidatorsResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators"; + } + + // DelegatorValidator queries validator info for given delegator validator + // pair. + rpc DelegatorValidator(QueryDelegatorValidatorRequest) returns (QueryDelegatorValidatorResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/" + "{validator_addr}"; + } + + // HistoricalInfo queries the historical info for given height. + rpc HistoricalInfo(QueryHistoricalInfoRequest) returns (QueryHistoricalInfoResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/historical_info/{height}"; + } + + // Pool queries the pool info. + rpc Pool(QueryPoolRequest) returns (QueryPoolResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/pool"; + } + + // Parameters queries the staking parameters. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/staking/v1beta1/params"; + } +} + +// QueryValidatorsRequest is request type for Query/Validators RPC method. +message QueryValidatorsRequest { + // status enables to query for validators matching a given status. + string status = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryValidatorsResponse is response type for the Query/Validators RPC method +message QueryValidatorsResponse { + // validators contains all the queried validators. + repeated Validator validators = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryValidatorRequest is response type for the Query/Validator RPC method +message QueryValidatorRequest { + // validator_addr defines the validator address to query for. + string validator_addr = 1; +} + +// QueryValidatorResponse is response type for the Query/Validator RPC method +message QueryValidatorResponse { + // validator defines the validator info. + Validator validator = 1 [(gogoproto.nullable) = false]; +} + +// QueryValidatorDelegationsRequest is request type for the +// Query/ValidatorDelegations RPC method +message QueryValidatorDelegationsRequest { + // validator_addr defines the validator address to query for. + string validator_addr = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryValidatorDelegationsResponse is response type for the +// Query/ValidatorDelegations RPC method +message QueryValidatorDelegationsResponse { + repeated DelegationResponse delegation_responses = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "DelegationResponses"]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryValidatorUnbondingDelegationsRequest is required type for the +// Query/ValidatorUnbondingDelegations RPC method +message QueryValidatorUnbondingDelegationsRequest { + // validator_addr defines the validator address to query for. + string validator_addr = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryValidatorUnbondingDelegationsResponse is response type for the +// Query/ValidatorUnbondingDelegations RPC method. +message QueryValidatorUnbondingDelegationsResponse { + repeated UnbondingDelegation unbonding_responses = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDelegationRequest is request type for the Query/Delegation RPC method. +message QueryDelegationRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1; + + // validator_addr defines the validator address to query for. + string validator_addr = 2; +} + +// QueryDelegationResponse is response type for the Query/Delegation RPC method. +message QueryDelegationResponse { + // delegation_responses defines the delegation info of a delegation. + DelegationResponse delegation_response = 1; +} + +// QueryUnbondingDelegationRequest is request type for the +// Query/UnbondingDelegation RPC method. +message QueryUnbondingDelegationRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1; + + // validator_addr defines the validator address to query for. + string validator_addr = 2; +} + +// QueryDelegationResponse is response type for the Query/UnbondingDelegation +// RPC method. +message QueryUnbondingDelegationResponse { + // unbond defines the unbonding information of a delegation. + UnbondingDelegation unbond = 1 [(gogoproto.nullable) = false]; +} + +// QueryDelegatorDelegationsRequest is request type for the +// Query/DelegatorDelegations RPC method. +message QueryDelegatorDelegationsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryDelegatorDelegationsResponse is response type for the +// Query/DelegatorDelegations RPC method. +message QueryDelegatorDelegationsResponse { + // delegation_responses defines all the delegations' info of a delegator. + repeated DelegationResponse delegation_responses = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDelegatorUnbondingDelegationsRequest is request type for the +// Query/DelegatorUnbondingDelegations RPC method. +message QueryDelegatorUnbondingDelegationsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryUnbondingDelegatorDelegationsResponse is response type for the +// Query/UnbondingDelegatorDelegations RPC method. +message QueryDelegatorUnbondingDelegationsResponse { + repeated UnbondingDelegation unbonding_responses = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryRedelegationsRequest is request type for the Query/Redelegations RPC +// method. +message QueryRedelegationsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1; + + // src_validator_addr defines the validator address to redelegate from. + string src_validator_addr = 2; + + // dst_validator_addr defines the validator address to redelegate to. + string dst_validator_addr = 3; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 4; +} + +// QueryRedelegationsResponse is response type for the Query/Redelegations RPC +// method. +message QueryRedelegationsResponse { + repeated RedelegationResponse redelegation_responses = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDelegatorValidatorsRequest is request type for the +// Query/DelegatorValidators RPC method. +message QueryDelegatorValidatorsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryDelegatorValidatorsResponse is response type for the +// Query/DelegatorValidators RPC method. +message QueryDelegatorValidatorsResponse { + // validators defines the validators' info of a delegator. + repeated Validator validators = 1 [(gogoproto.nullable) = false]; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDelegatorValidatorRequest is request type for the +// Query/DelegatorValidator RPC method. +message QueryDelegatorValidatorRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // delegator_addr defines the delegator address to query for. + string delegator_addr = 1; + + // validator_addr defines the validator address to query for. + string validator_addr = 2; +} + +// QueryDelegatorValidatorResponse response type for the +// Query/DelegatorValidator RPC method. +message QueryDelegatorValidatorResponse { + // validator defines the validator info. + Validator validator = 1 [(gogoproto.nullable) = false]; +} + +// QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC +// method. +message QueryHistoricalInfoRequest { + // height defines at which height to query the historical info. + int64 height = 1; +} + +// QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC +// method. +message QueryHistoricalInfoResponse { + // hist defines the historical info at the given height. + HistoricalInfo hist = 1; +} + +// QueryPoolRequest is request type for the Query/Pool RPC method. +message QueryPoolRequest {} + +// QueryPoolResponse is response type for the Query/Pool RPC method. +message QueryPoolResponse { + // pool defines the pool info. + Pool pool = 1 [(gogoproto.nullable) = false]; +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + // params holds all the parameters of this module. + Params params = 1 [(gogoproto.nullable) = false]; +} diff --git a/x/globalfee/ante/antetest/fee_test.go b/x/globalfee/ante/antetest/fee_test.go index dee698f5b54..bf754369bd3 100644 --- a/x/globalfee/ante/antetest/fee_test.go +++ b/x/globalfee/ante/antetest/fee_test.go @@ -5,12 +5,13 @@ import ( "github.com/stretchr/testify/suite" + ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + ibcchanneltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - ibcchanneltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" gaiafeeante "github.com/cosmos/gaia/v15/x/globalfee/ante" globfeetypes "github.com/cosmos/gaia/v15/x/globalfee/types" diff --git a/x/globalfee/ante/antetest/fee_test_setup.go b/x/globalfee/ante/antetest/fee_test_setup.go index 63513162c22..254c555f422 100644 --- a/x/globalfee/ante/antetest/fee_test_setup.go +++ b/x/globalfee/ante/antetest/fee_test_setup.go @@ -3,8 +3,11 @@ package antetest import ( "fmt" + "github.com/stretchr/testify/suite" + tmrand "github.com/cometbft/cometbft/libs/rand" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" @@ -12,14 +15,12 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/tx/signing" xauthsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" - "github.com/stretchr/testify/suite" + gaiaapp "github.com/cosmos/gaia/v15/app" gaiahelpers "github.com/cosmos/gaia/v15/app/helpers" gaiaparams "github.com/cosmos/gaia/v15/app/params" - gaiafeeante "github.com/cosmos/gaia/v15/x/globalfee/ante" - - gaiaapp "github.com/cosmos/gaia/v15/app" "github.com/cosmos/gaia/v15/x/globalfee" + gaiafeeante "github.com/cosmos/gaia/v15/x/globalfee/ante" globfeetypes "github.com/cosmos/gaia/v15/x/globalfee/types" ) diff --git a/x/globalfee/ante/fee.go b/x/globalfee/ante/fee.go index aed5203d4c6..0679b0aa317 100644 --- a/x/globalfee/ante/fee.go +++ b/x/globalfee/ante/fee.go @@ -4,11 +4,12 @@ import ( "errors" "fmt" - errorsmod "cosmossdk.io/errors" tmstrings "github.com/cometbft/cometbft/libs/strings" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" gaiaerrors "github.com/cosmos/gaia/v15/types/errors" diff --git a/x/globalfee/genesis_test.go b/x/globalfee/genesis_test.go index f9f3be2e850..6daa4411ca7 100644 --- a/x/globalfee/genesis_test.go +++ b/x/globalfee/genesis_test.go @@ -4,21 +4,20 @@ import ( "testing" "time" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" dbm "github.com/cometbft/cometbft-db" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/cometbft/cometbft/libs/log" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/store" + storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" gaiaparams "github.com/cosmos/gaia/v15/app/params" "github.com/cosmos/gaia/v15/x/globalfee/types" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) func TestDefaultGenesis(t *testing.T) { diff --git a/x/globalfee/migrations/v2/v2_test/migration_test.go b/x/globalfee/migrations/v2/v2_test/migration_test.go index cd56078fe1d..9aa03a3fabd 100644 --- a/x/globalfee/migrations/v2/v2_test/migration_test.go +++ b/x/globalfee/migrations/v2/v2_test/migration_test.go @@ -3,16 +3,18 @@ package v2_test import ( "testing" + "github.com/stretchr/testify/require" + cmdb "github.com/cometbft/cometbft-db" "github.com/cometbft/cometbft/libs/log" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/store" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/stretchr/testify/require" v2 "github.com/cosmos/gaia/v15/x/globalfee/migrations/v2" globalfeetypes "github.com/cosmos/gaia/v15/x/globalfee/types" diff --git a/x/globalfee/module.go b/x/globalfee/module.go index 917ba8e7493..909cd36f158 100644 --- a/x/globalfee/module.go +++ b/x/globalfee/module.go @@ -9,8 +9,10 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" - errorsmod "cosmossdk.io/errors" abci "github.com/cometbft/cometbft/abci/types" + + errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" diff --git a/x/globalfee/querier_test.go b/x/globalfee/querier_test.go index 58db62280d5..9081595b9f0 100644 --- a/x/globalfee/querier_test.go +++ b/x/globalfee/querier_test.go @@ -11,6 +11,15 @@ package globalfee // "github.com/cosmos/gaia/v11/x/globalfee/types" // ) +// "github.com/stretchr/testify/assert" +// "github.com/stretchr/testify/require" + +// sdk "github.com/cosmos/cosmos-sdk/types" +// paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + +// "github.com/cosmos/gaia/v15/x/globalfee/types" +// ) + // func TestQueryMinimumGasPrices(t *testing.T) { // specs := map[string]struct { // setupStore func(ctx sdk.Context, s paramtypes.Subspace) diff --git a/x/globalfee/types/params.go b/x/globalfee/types/params.go index 0a7cab846e9..a7eaed4ab6d 100644 --- a/x/globalfee/types/params.go +++ b/x/globalfee/types/params.go @@ -4,11 +4,13 @@ import ( "fmt" "strings" + ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + ibcchanneltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - ibcchanneltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" gaiaerrors "github.com/cosmos/gaia/v15/types/errors" )