From e085b40b95443b8794bbd700fba639b727162f79 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Fri, 23 Jun 2023 15:49:34 +0200 Subject: [PATCH 01/43] chore: merge main into feat/sdk-47-ibc-7 branch (#2625) * fix: subspace (#2524) * chore(deps): bump cosmossdk.io/math from 1.0.0 to 1.0.1 (#2513) Bumps [cosmossdk.io/math](https://github.com/cosmos/cosmos-sdk) from 1.0.0 to 1.0.1. - [Release notes](https://github.com/cosmos/cosmos-sdk/releases) - [Changelog](https://github.com/cosmos/cosmos-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/cosmos/cosmos-sdk/compare/log/v1.0.0...math/v1.0.1) --- updated-dependencies: - dependency-name: cosmossdk.io/math dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump github.com/stretchr/testify from 1.8.2 to 1.8.3 (#2512) Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.2 to 1.8.3. - [Release notes](https://github.com/stretchr/testify/releases) - [Commits](https://github.com/stretchr/testify/compare/v1.8.2...v1.8.3) --- updated-dependencies: - dependency-name: github.com/stretchr/testify dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump codecov/codecov-action from 3.1.2 to 3.1.4 (#2510) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.1.2 to 3.1.4. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v3.1.2...v3.1.4) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Milan Mulji <98309852+mmulji-ic@users.noreply.github.com> * update changelog (#2517) * chore: update release note generation (#2528) * Update mergify config with rules for feature branch * chore: rm extra .mergify rule --------- Co-authored-by: MSalopek * chore: fix typo in PR template (#2521) * deps: bump IBC to v4.4.1 (#2543) * bump IBC to v4.4.1 * update changelog * fix: debug upgrade tests in gh actions (#2531) * Fix upgrade test in gh actions * update testnet link * fix links * docs: update changelog for v9.1.1 (#2546) * run link checker once per day (#2525) * run lint only on diff (#2526) Co-authored-by: Simon Noetzlin * chore: update module to gaia v11 (#2515) * update module to gaia v11 * update go.mod * update globalfee.md * fix: provider keeper * fix: upgrade test in CI * revert to ics v1.1.1 * tidy CI upgrade test scripts * chore: add v10 upgrades * fix: lint * fix: version in app.go * test: improve test * fix: upgrade test (#2550) * ci: bump go to latest 1.20.x for vulncheck (#2520) * bump go to 1.20.4 for vulncheck * use latest version of go * run at 3am UTC * Updated go version * Revert "Updated go version" This reverts commit effe7b745ffbbfef9b808b0542ea492a2d287eb4. --------- Co-authored-by: Yaru Wang Co-authored-by: Milan Mulji <98309852+mmulji-ic@users.noreply.github.com> Co-authored-by: yaruwangway <69694322+yaruwangway@users.noreply.github.com> * chore(deps): bump github.com/cosmos/ibc-go/v4 from 4.4.1 to 4.4.2 (#2554) * chore(deps): bump github.com/cosmos/ibc-go/v4 from 4.4.1 to 4.4.2 Bumps [github.com/cosmos/ibc-go/v4](https://github.com/cosmos/ibc-go) from 4.4.1 to 4.4.2. - [Release notes](https://github.com/cosmos/ibc-go/releases) - [Changelog](https://github.com/cosmos/ibc-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/cosmos/ibc-go/compare/v4.4.1...v4.4.2) --- updated-dependencies: - dependency-name: github.com/cosmos/ibc-go/v4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * update changelog --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mpoke Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * ci: improve codeql (#2523) * improve codeql * update release/v* pattern --------- Co-authored-by: yaruwangway <69694322+yaruwangway@users.noreply.github.com> * fix!: revert to ICS v1.1.0-multiden (#2559) * use ICS v1.1.0-multiden * multisig + distribution fix * chore(deps): bump JamesIves/github-pages-deploy-action (#2551) Bumps [JamesIves/github-pages-deploy-action](https://github.com/JamesIves/github-pages-deploy-action) from 4.4.0 to 4.4.2. - [Release notes](https://github.com/JamesIves/github-pages-deploy-action/releases) - [Commits](https://github.com/JamesIves/github-pages-deploy-action/compare/v4.4.0...v4.4.2) --- updated-dependencies: - dependency-name: JamesIves/github-pages-deploy-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump slackapi/slack-github-action from 1.23.0 to 1.24.0 (#2511) Bumps [slackapi/slack-github-action](https://github.com/slackapi/slack-github-action) from 1.23.0 to 1.24.0. - [Release notes](https://github.com/slackapi/slack-github-action/releases) - [Commits](https://github.com/slackapi/slack-github-action/compare/v1.23.0...v1.24.0) --- updated-dependencies: - dependency-name: slackapi/slack-github-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * refactor: update comments on globalfee, genutil module init order (#2494) * docs: update comments on globalfee, genutil module init order * rename GlobalMinFee GlobalMinFeeParamSource in FeeDecorator * fix: deadlink * test: add e2e test for ibc bypass msg (#2532) * test: setup a new hermes instance * test: add executeHermesCommand * test: add hermesTransfer * test: add ibc-bypass-msg test * test: add hermes config * test: enable all e2e test * fix: tearDownSuite in e2e test * Apply suggestions from code review Co-authored-by: Simon Noetzlin * update according to comments * chore: add comments to code * chore: correct typo * refactor bypass msg test * fix: parse query pending packet result * fix: format print error * fix: pending packets parsing * Apply suggestions from code review Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * docs: fix dead link * chore: fix lint * chore: lint fix * chore: lint fix1 * chore: remove nolint * Update tests/e2e/e2e_ibc_test.go --------- Co-authored-by: Simon Noetzlin Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * docs: Updated atoms amount in governance process (#2566) * Updated atoms amount in governance process * Missed some references * Updated Discord link (#2567) * chore: add goreleaser, cleanup release process (#2549) * chore: add goreleaser, cleanup release process * chore: update RELEASING.md * chore: add RELEASE_NOTES.md; add make create-release * chore: rm old release file * update release process * fix: apply review comments * chore: update RELEASE_PROCESS.md with PR comments * chore: add install step for goreleaser dry-run --------- Co-authored-by: mpoke * test: parsing result of query hermes pending packets (#2571) * fix: e2e test * fix: parsing hermes pending packet query result * fix: rename response RelayerPacketsOutput * chore: update workflow re. issues and PRs (#2573) * update PR workflow * update issue workflow * docs: Increase the validator set of cosmos hub to 180 from 175 (#2572) * Updated references 175 validators * Updated some missing references * chore(deps): bump docker/login-action from 2.1.0 to 2.2.0 (#2576) Bumps [docker/login-action](https://github.com/docker/login-action) from 2.1.0 to 2.2.0. - [Release notes](https://github.com/docker/login-action/releases) - [Commits](https://github.com/docker/login-action/compare/v2.1.0...v2.2.0) --- updated-dependencies: - dependency-name: docker/login-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump docker/metadata-action from 4.4.0 to 4.5.0 (#2577) Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 4.4.0 to 4.5.0. - [Release notes](https://github.com/docker/metadata-action/releases) - [Commits](https://github.com/docker/metadata-action/compare/v4.4.0...v4.5.0) --- updated-dependencies: - dependency-name: docker/metadata-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump docker/build-push-action from 4.0.0 to 4.1.0 (#2578) Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4.0.0 to 4.1.0. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v4.0.0...v4.1.0) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump github.com/spf13/viper from 1.15.0 to 1.16.0 (#2563) Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.15.0 to 1.16.0. - [Release notes](https://github.com/spf13/viper/releases) - [Commits](https://github.com/spf13/viper/compare/v1.15.0...v1.16.0) --- updated-dependencies: - dependency-name: github.com/spf13/viper dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Milan Mulji <98309852+mmulji-ic@users.noreply.github.com> * chore(deps): bump github.com/stretchr/testify from 1.8.3 to 1.8.4 (#2564) Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.3 to 1.8.4. - [Release notes](https://github.com/stretchr/testify/releases) - [Commits](https://github.com/stretchr/testify/compare/v1.8.3...v1.8.4) --- updated-dependencies: - dependency-name: github.com/stretchr/testify dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Milan Mulji <98309852+mmulji-ic@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * chore: update version for mergify and dependabot (#2582) * update mergify * update dependabot * Update CONTRIBUTING.md (#2580) * docs: Updates for v9.1.1 and re-arranging roadmap docs (#2560) * Updates for v9.1.1 and re-arranging roadmap docs * Updated SDK release for Lambda as being an ICS variant * Added living roadmap link to google docs * Updated changelog * bump ICS to v2.0.0-rc2 (#2589) * refactor: errors module (#2471) * use the errors module to ease 47 transition * golangci-lint run ./... --fix --------- Co-authored-by: Marius Poke * go mod tidy (#2592) * Feat : Removed SDK general error types (#2496) * Feat : Removed SDK general error types * Changed unnecessary wrapf to wrap * made some required changes * changed version 10 to 11 * ran go mod tidy --------- Co-authored-by: Marius Poke * ci: migrate code quality tooling from Codecov to Sonar Cloud (#2598) * remove codecov and add sonarcloud * remove /tools folder * add sonarcloud properties * update README.md * docs: Updating the quickstart, joining mainnet & upgrade docs for v10 (#2599) * Updating the quickstart, joining & upgrade docs * Updated the changelog * Updated halt-heights * Updated the banner for the upgrade, on the initial page * Updates for pr comments * Added upgrade doc * Updated incorrect version number * Apply suggestions from code review Co-authored-by: Dante Sanchez --------- Co-authored-by: Dante Sanchez * Update README.md (#2602) * fix broken link (#2585) * docs: update globalfee.md according to the `bypass-msg-types` migration (#2463) * update globalfee.md according to the bypass-msg-types migration * update test cases in globalfee.md * update test cases * improve the docs: globalfee.md * docs: formatting * docs: update globalfee.md * Apply suggestions from code review Co-authored-by: Simon Noetzlin * docs: update globalfee.md * docs: improve globalfee.md * Update docs/modules/globalfee.md Co-authored-by: Simon Noetzlin * Apply suggestions from code review Co-authored-by: Simon Noetzlin * docs: update globalfee.md according to comments * docs: tidy globalfee or global fees * docs: update globalfee.md * docs: update globalfee.md * docs: update docs --------- Co-authored-by: Simon Noetzlin * chore(deps): bump docker/build-push-action from 4.1.0 to 4.1.1 (#2609) Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4.1.0 to 4.1.1. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v4.1.0...v4.1.1) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump docker/metadata-action from 4.5.0 to 4.6.0 (#2610) Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 4.5.0 to 4.6.0. - [Release notes](https://github.com/docker/metadata-action/releases) - [Commits](https://github.com/docker/metadata-action/compare/v4.5.0...v4.6.0) --- updated-dependencies: - dependency-name: docker/metadata-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: update meaning of type-prefix! in production PRs (#2597) * update meaning of type-prefix! in PRs * apply review suggestions * Update test.yml (#2615) * chore(deps): bump github.com/cosmos/interchain-security/v2 (#2612) Bumps [github.com/cosmos/interchain-security/v2](https://github.com/cosmos/interchain-security) from 2.0.0-rc2 to 2.0.0-rc3. - [Release notes](https://github.com/cosmos/interchain-security/releases) - [Changelog](https://github.com/cosmos/interchain-security/blob/main/CHANGELOG.md) - [Commits](https://github.com/cosmos/interchain-security/compare/v2.0.0-rc2...v2.0.0-rc3) --- updated-dependencies: - dependency-name: github.com/cosmos/interchain-security/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * docs: Update docs for Comet BFT (#2493) * initial pass-thru replace of tendermint for cometbft * Updated comet links * Updated vuepress-theme package * Updated based on comments * Update docs/zh/validators/security.md Co-authored-by: yaruwangway <69694322+yaruwangway@users.noreply.github.com> * Updated CometBFT reference * Updated CometBFT references --------- Co-authored-by: yaruwangway <69694322+yaruwangway@users.noreply.github.com> * chore: Update CODEOWNERS (#2614) * Update CODEOWNERS * update codeowners * Updated release notes with v10.0.1 (#2618) * chore: start using unclog (#2605) * add unrelease changelog entries to .changelog * run unclog build -a * rename changelog categories * add tests as a component * update workflow doc * docs: update changelog for unreleased (#2584) * docs: update changelog for v11 * unclog build --------- Co-authored-by: mpoke * deps: bump comet to v0.34.29 (#2594) * bump comet to v0.34.29 * update changelog * add entry to .changelog --------- Signed-off-by: dependabot[bot] Co-authored-by: yaruwangway <69694322+yaruwangway@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Milan Mulji <98309852+mmulji-ic@users.noreply.github.com> Co-authored-by: Marius Poke Co-authored-by: lg <8335464+glnro@users.noreply.github.com> Co-authored-by: MSalopek Co-authored-by: Yaru Wang Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> Co-authored-by: Jacob Gadikian Co-authored-by: ruthishvitwit <122080147+ruthishvitwit@users.noreply.github.com> Co-authored-by: Dante Sanchez --- .changelog/config.toml | 20 + .changelog/epilogue.md | 556 ++++++++++++++++++ .changelog/unreleased/.gitkeep | 0 .../api-breaking/globalfee/2424-params.md | 3 + .../unreleased/dependencies/2554-bump-ibc.md | 3 + .../dependencies/2594-bump-cometbft.md | 3 + .../globalfee/2352-migration.md | 3 + .../state-breaking/globalfee/2424-params.md | 2 + .../globalfee/2447-delivertx.md | 2 + .github/CODEOWNERS | 5 +- .github/ISSUE_TEMPLATE/epic-template.md | 8 +- .github/ISSUE_TEMPLATE/feature-request.md | 15 +- .github/ISSUE_TEMPLATE/issue-template.md | 2 +- .github/ISSUE_TEMPLATE/upgrade-checklist.md | 2 +- .github/PULL_REQUEST_TEMPLATE.md | 54 +- .github/PULL_REQUEST_TEMPLATE/production.md | 48 ++ .github/dependabot.yml | 4 +- .github/workflows/codeql-analysis.yml | 47 +- .github/workflows/docker-push.yml | 8 +- .github/workflows/docs.yml | 2 +- .github/workflows/lint.yml | 31 +- .../{linkchecker.yml => md-link-checker.yml} | 10 +- .github/workflows/nightly-tests.yml | 16 +- .github/workflows/release.yml | 126 +--- .github/workflows/test.yml | 109 ++-- .goreleaser.yml | 32 +- .mergify.yml | 18 +- CHANGELOG.md | 73 +-- CONTRIBUTING.md | 74 ++- Makefile | 49 +- README.md | 72 +-- RELEASE_NOTES.md | 32 + RELEASE_PROCESS.md | 189 ++++++ RELEASING.md | 2 +- UPGRADING.md | 5 + ante/ante.go | 19 +- ante/gov_ante.go | 8 +- ante/gov_ante_test.go | 6 +- app/app.go | 23 +- app/app_helpers.go | 28 +- app/app_test.go | 4 +- app/encoding.go | 2 +- app/helpers/test_helpers.go | 2 +- app/keepers/keepers.go | 12 +- app/keepers/keys.go | 2 +- app/modules.go | 37 +- app/sim/sim_state.go | 2 +- app/sim/sim_utils.go | 2 +- app/sim_test.go | 8 +- app/upgrades/types.go | 2 +- app/upgrades/v10/constants.go | 2 +- app/upgrades/v10/upgrades.go | 2 +- app/upgrades/v11/constants.go | 15 + app/upgrades/v11/upgrades.go | 27 + app/upgrades/v7/constants.go | 2 +- app/upgrades/v7/upgrades.go | 2 +- app/upgrades/v8/constants.go | 4 +- app/upgrades/v8/upgrades.go | 2 +- app/upgrades/v9/constants.go | 4 +- app/upgrades/v9/upgrades.go | 2 +- cmd/gaiad/cmd/bech32_convert.go | 2 +- cmd/gaiad/cmd/root.go | 4 +- cmd/gaiad/cmd/root_test.go | 4 +- cmd/gaiad/main.go | 4 +- contrib/generate_release_note/main.go | 2 +- .../test_upgrade.sh | 0 .../v10/run_gaia_v9.sh} | 1 - .../v10/run_upgrade_commands_v10.sh | 76 +++ .../upgrade_test_scripts/v11/run_gaia_v10.sh | 74 +++ .../v11/run_upgrade_commands_v11.sh} | 8 +- .../v11/test_migration_v11.sh} | 0 .../v8}/run-gaia-v7.sh | 0 .../v8}/run-upgrade-commands-v8-rho.sh | 0 .../v9}/run-gaia-v8.sh | 0 .../v9}/run-upgrade-commands.sh | 0 .../testnets/test_platform/templates/app.toml | 14 +- docs/.vuepress/config.js | 27 +- docs/DOCS_README.md | 5 - docs/README.md | 2 +- docs/delegators/delegator-faq.md | 2 +- docs/es/gaia-tutorials/installation.md | 2 +- docs/es/gaia-tutorials/join-mainnet.md | 3 +- docs/getting-started/quickstart.md | 2 +- docs/governance/README.md | 2 +- docs/governance/best-practices.md | 2 +- docs/governance/process.md | 10 +- .../governance/proposal-types/param-change.md | 4 +- .../2021-01-stargate-upgrade-b/README.md | 2 +- .../2021-01-stargate-upgrade/README.md | 2 +- .../state-of-cosmos-governance-2021.md | 2 +- docs/governance/submitting.md | 2 +- docs/hub-overview/overview.md | 6 +- docs/hub-tutorials/gaiad.md | 2 +- docs/hub-tutorials/join-mainnet.md | 17 +- docs/hub-tutorials/join-testnet.md | 4 +- docs/interchain-security.md | 4 +- docs/ko/gaia-tutorials/join-mainnet.md | 2 +- docs/ko/gaia-tutorials/join-testnet.md | 2 +- docs/ko/keys.md | 4 +- docs/ko/launch/blog-2-kr.md | 4 +- docs/migration/cosmoshub-4-v10-upgrade.md | 297 ++++++++++ .../migration/cosmoshub-4-v7-Theta-upgrade.md | 2 +- docs/modules/globalfee.md | 199 +++++-- docs/package-lock.json | 14 +- docs/package.json | 2 +- docs/readiness/README.md | 2 +- docs/roadmap/README.md | 85 ++- docs/roadmap/cosmos-hub-roadmap-2.0.md | 65 +- docs/validators/overview.md | 4 +- docs/validators/security.md | 4 +- docs/validators/validator-faq.md | 16 +- docs/validators/validator-setup.md | 2 +- docs/zh/delegator/delegator-guide-cli.md | 2 +- docs/zh/gaia-tutorials/join-mainnet.md | 2 +- docs/zh/resources/gaiad.md | 4 +- docs/zh/resources/genesis.md | 2 +- docs/zh/validators/overview.md | 4 +- docs/zh/validators/security.md | 4 +- docs/zh/validators/validator-faq.md | 8 +- go.mod | 176 +----- go.sum | 422 ++----------- sonar-project.properties | 19 + tests/e2e/chain.go | 4 +- tests/e2e/e2e_bypassminfee_test.go | 87 +++ tests/e2e/e2e_exec_test.go | 29 + tests/e2e/e2e_gov_test.go | 2 +- tests/e2e/e2e_ibc_test.go | 211 +++---- tests/e2e/e2e_query_exec_test.go | 2 +- tests/e2e/e2e_setup_test.go | 223 ++++++- tests/e2e/e2e_test.go | 5 + tests/e2e/e2e_vesting_test.go | 2 +- tests/e2e/genesis.go | 2 +- tests/e2e/query.go | 2 +- tests/e2e/scripts/hermes1_bootstrap.sh | 152 +++++ tests/e2e/validator.go | 2 +- tests/ics/interchain_security_test.go | 14 +- tools/tools.go | 14 - types/errors/errors.go | 34 ++ x/globalfee/alias.go | 2 +- x/globalfee/ante/antetest/fee_test.go | 4 +- x/globalfee/ante/antetest/fee_test_setup.go | 10 +- x/globalfee/ante/fee.go | 38 +- x/globalfee/ante/fee_utils.go | 5 +- x/globalfee/client/cli/query.go | 2 +- x/globalfee/genesis_test.go | 2 +- x/globalfee/keeper/migrations.go | 2 +- x/globalfee/migrations/v2/migration.go | 4 +- .../migrations/v2/v2_test/migration_test.go | 9 +- x/globalfee/module.go | 10 +- x/globalfee/querier.go | 2 +- x/globalfee/querier_test.go | 2 +- x/globalfee/types/genesis.go | 4 +- x/globalfee/types/params.go | 9 +- 153 files changed, 2898 insertions(+), 1474 deletions(-) create mode 100644 .changelog/config.toml create mode 100644 .changelog/epilogue.md create mode 100644 .changelog/unreleased/.gitkeep create mode 100644 .changelog/unreleased/api-breaking/globalfee/2424-params.md create mode 100644 .changelog/unreleased/dependencies/2554-bump-ibc.md create mode 100644 .changelog/unreleased/dependencies/2594-bump-cometbft.md create mode 100644 .changelog/unreleased/state-breaking/globalfee/2352-migration.md create mode 100644 .changelog/unreleased/state-breaking/globalfee/2424-params.md create mode 100644 .changelog/unreleased/state-breaking/globalfee/2447-delivertx.md create mode 100644 .github/PULL_REQUEST_TEMPLATE/production.md rename .github/workflows/{linkchecker.yml => md-link-checker.yml} (60%) create mode 100644 RELEASE_NOTES.md create mode 100644 RELEASE_PROCESS.md create mode 100644 UPGRADING.md create mode 100644 app/upgrades/v11/constants.go create mode 100644 app/upgrades/v11/upgrades.go rename contrib/scripts/{ => upgrade_test_scripts}/test_upgrade.sh (100%) rename contrib/scripts/{run-gaia-v9.sh => upgrade_test_scripts/v10/run_gaia_v9.sh} (99%) mode change 100755 => 100644 create mode 100644 contrib/scripts/upgrade_test_scripts/v10/run_upgrade_commands_v10.sh create mode 100755 contrib/scripts/upgrade_test_scripts/v11/run_gaia_v10.sh rename contrib/scripts/{run-upgrade-commands-v10.sh => upgrade_test_scripts/v11/run_upgrade_commands_v11.sh} (91%) rename contrib/scripts/{test_migration.sh => upgrade_test_scripts/v11/test_migration_v11.sh} (100%) rename contrib/scripts/{ => upgrade_test_scripts/v8}/run-gaia-v7.sh (100%) rename contrib/scripts/{ => upgrade_test_scripts/v8}/run-upgrade-commands-v8-rho.sh (100%) rename contrib/scripts/{ => upgrade_test_scripts/v9}/run-gaia-v8.sh (100%) rename contrib/scripts/{ => upgrade_test_scripts/v9}/run-upgrade-commands.sh (100%) create mode 100644 docs/migration/cosmoshub-4-v10-upgrade.md create mode 100644 sonar-project.properties create mode 100755 tests/e2e/scripts/hermes1_bootstrap.sh delete mode 100644 tools/tools.go create mode 100644 types/errors/errors.go diff --git a/.changelog/config.toml b/.changelog/config.toml new file mode 100644 index 0000000000..818370b9cc --- /dev/null +++ b/.changelog/config.toml @@ -0,0 +1,20 @@ +project_url = "https://github.com/cosmos/gaia" + +# Settings related to components/sub-modules. Only relevant if you make use of +# components/sub-modules. +[components] + +# The title to use for the section of entries not relating to a specific +# component. +general_entries_title = "General" + +# The number of spaces to inject before each component-related entry. +entry_indent = 2 + + # The components themselves. Each component has a name (used when rendered + # to Markdown) and a path relative to the project folder (i.e. relative to + # the parent of the `.changelog` folder). + [components.all] + globalfee = { name = "GlobalFee", path = "x/globalfee" } + tests = { name = "Tests", path = "tests" } + docs = { name = "Documentation", path = "docs" } \ No newline at end of file diff --git a/.changelog/epilogue.md b/.changelog/epilogue.md new file mode 100644 index 0000000000..e3d494a442 --- /dev/null +++ b/.changelog/epilogue.md @@ -0,0 +1,556 @@ +## [v10.0.1] 2023-05-25 + +* (deps) [#2543](https://github.com/cosmos/gaia/pull/2543) Bump [ibc-go](https://github.com/cosmos/ibc-go) to [v4.4.1](https://github.com/cosmos/ibc-go/releases/tag/v4.4.1). + +## [v10.0.0] 2023-05-19 + +* (deps) [#2498](https://github.com/cosmos/gaia/pull/2498) Bump multiple dependencies. + * Bump [cosmos-sdk](https://github.com/cosmos/cosmos-sdk) to [v0.45.16-ics](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.16-ics). See the [v0.45.16 release notes](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.16) for details. + * Bump [ibc-go](https://github.com/cosmos/ibc-go) to [v4.4.0](https://github.com/cosmos/ibc-go/releases/tag/v4.4.0). + * Bump [CometBFT](https://github.com/cometbft/cometbft) to [v0.34.28](https://github.com/cometbft/cometbft/releases/tag/v0.34.28). +* (gaia) Bump Golang prerequisite from 1.18 to 1.20. See (https://go.dev/blog/go1.20) for details. + +## [v9.1.1] - 2023-05-25 + +* (deps) [#2542](https://github.com/cosmos/gaia/pull/2542) Bump [ibc-go](https://github.com/cosmos/ibc-go) to [v4.2.1](https://github.com/cosmos/ibc-go/releases/tag/v4.2.1). + +## [v9.1.0] - 2023-05-08 + +* (fix) [#2474](https://github.com/cosmos/gaia/pull/2474) Multisig and distribution fix in [Interchain-Security](https://github.com/cosmos/interchain-security). Bump Interchain-Security to [v1.1.0-multiden](https://github.com/cosmos/interchain-security/tree/v1.1.0-multiden). + +This release combines two fixes that we judged were urgent to get onto the Cosmos Hub before the launch of the first ICS consumer chain. _Please note that user funds were not at risk and these fixes pertain to the liveness of the Hub and consumer chains_. + +The first fix is to enable the use of multisigs and Ledger devices when assigning keys for consumer chains. The second is to prevent a possible DOS vector involving the reward distribution system. + +### Multisig fix + +On April 25th (a week and a half ago), we began receiving reports that validators using multisigs and Ledger devices were getting errors reading Error: unable to resolve type URL /interchain_security.ccv.provider.v1.MsgAssignConsumerKey: tx parse error when attempting to assign consensus keys for consumer chains. + +This was surprising because we had never seen this error before, even though we have done many testnets. The reason for this is probably because people don’t bother to use high security key management techniques in testnets. + +We quickly narrowed the problem down to issues having to do with using the PubKey type directly in the MsgAssignConsumerKey transaction, and Amino (a deprecated serialization library still used in Ledger devices and multisigs) not being able to handle this. We attempted to fix this with the assistance of the Cosmos-SDK team, but after making no headway for a few days, we decided to simply use a JSON representation of the PubKey in the transaction. This is how it is usually represented anyway. We have verified that this fixes the problem. + +### Distribution fix + +The ICS distribution system works by allowing consumer chains to send rewards to a module address on the Hub called the FeePoolAddress. From here they are automatically distributed to all validators and delegators through the distribution system that already exists to distribute Atom staking rewards. The FeePoolAddress is usually blocked so that no tokens can be sent to it, but to enable ICS distribution we had to unblock it. + +We recently realized that unblocking the FeePoolAddress could enable an attacker to send a huge number of different denoms into the distribution system. The distribution system would then attempt to distribute them all, leading to out of memory errors. Fixing a similar attack vector that existed in the distribution system before ICS led us to this realization. + +To fix this problem, we have re-blocked the FeePoolAddress and created a new address called the ConsumerRewardsPool. Consumer chains now send rewards to this new address. There is also a new transaction type called RegisterConsumerRewardDenom. This transaction allows people to register denoms to be used as rewards from consumer chains. It costs 10 Atoms to run this transaction.The Atoms are transferred to the community pool. Only denoms registered with this command are then transferred to the FeePoolAddress and distributed out to delegators and validators. + +Note: The fee of 10 Atoms was originally intended to be a parameter that could be changed by governance (10 Atoms might cost too much in the future). However, we ran into some problems creating a new parameter as part of an emergency upgrade. After consulting with the Cosmos-SDK team, we learned that creating new parameters is only supported as part of a scheduled upgrade. So in the current code, the number of Atoms is hardcoded. It will turn into a parameter in the next scheduled upgrade. + +## [v9.0.3] - 2023-04-19 +* (deps) [#2399](https://github.com/cosmos/gaia/pull/2399) Bump [cosmos-sdk](https://github.com/cosmos/cosmos-sdk) to [v0.45.15-ics](https://github.com/cosmos/cosmos +sdk/releases/tag/v0.45.15-ics) and migrate to [CometBFT](https://github.com/cometbft/cometbft). + +## [v9.0.2] - 2023-04-03 +* (feat) Bump [Interchain-Security](https://github.com/cosmos/interchain-security) [v1.1.0](https://github.com/cosmos/interchain-security/releases/tag/v1.1.0) provider module. See the [release notes](https://github.com/cosmos/interchain-security/releases/tag/v1.1.0) for details. +* (feat) Add two more msg types `/ibc.core.channel.v1.MsgTimeout` and `/ibc.core.channel.v1.MsgTimeoutOnClose` to default `bypass-min-fee-msg-types`. +* (feat) Change the bypassing gas usage criteria. Instead of requiring 200,000 gas per `bypass-min-fee-msg`, we will now allow a maximum total usage of 1,000,000 gas for all bypassed messages in a transaction. Note that all messages in the transaction must be the `bypass-min-fee-msg-types` for the bypass min fee to take effect, otherwise, fee payment will still apply. +* (fix) [#2087](https://github.com/cosmos/gaia/issues/2087) Fix `bypass-min-fee-msg-types` parsing in `app.toml`. Parsing of `bypass-min-fee-types` is changed to allow node operators to use empty bypass list. Removing the `bypass-min-fee-types` from `app.toml` applies the default message types. See [#2092](https://github.com/cosmos/gaia/pull/2092) for details. + +## [v9.0.1] - 2023-03-09 + +* (feat) [Add spam prevention antehandler](https://github.com/cosmos/gaia/pull/2262) to alleviate recent governance spam issues. + +## [v9.0.0] - 2023-02-21 + +* (feat) Add [Interchain-Security](https://github.com/cosmos/interchain-security) [v1.0.0](https://github.com/cosmos/interchain-security/releases/tag/v1.0.0) provider module. See the [ICS Spec](https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/README.md) for more details. +* (gaia) Bump [cosmos-sdk](https://github.com/cosmos/cosmos-sdk) to [v0.45.13-ics](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.13-ics). See [CHANGELOG.md](https://github.com/cosmos/cosmos-sdk/blob/releases/tag/v0.45.13-ics) for details. +* (gaia) Bump [ibc-go](https://github.com/cosmos/ibc-go) to [v4.2.0](https://github.com/cosmos/ibc-go/blob/release/v4.2.x/CHANGELOG.md). See [v4.2 Release Notes](https://github.com/cosmos/ibc-go/releases/tag/v4.2.0) for details. +* (gaia) Bump [tendermint](https://github.com/informalsystems/tendermint) to [0.34.26](https://github.com/informalsystems/tendermint/tree/v0.34.26). See [CHANGELOG.md](https://github.com/informalsystems/tendermint/blob/v0.34.26/CHANGELOG.md#v03426) for details. +* (gaia) Bump [packet-forward-middleware](https://github.com/strangelove-ventures/packet-forward-middleware) to [v4.0.4](https://github.com/strangelove-ventures/packet-forward-middleware/releases/tag/v4.0.4). +* (tests) Add [E2E ccv tests](https://github.com/cosmos/gaia/blob/main/tests/e2e/e2e_gov_test.go#L138). Tests covering new functionality introduced by the provider module to add and remove a consumer chain via governance proposal. +* (tests) Add [integration ccv tests](https://github.com/cosmos/gaia/blob/main/tests/ics/interchain_security_test.go). Imports Interchain-Security's `TestCCVTestSuite` and implements Gaia as the provider chain. +* (fix) [#2017](https://github.com/cosmos/gaia/issues/2017) Fix Gaiad binary build tag for ubuntu system. See [#2018](https://github.com/cosmos/gaia/pull/2018) for details. + +## [v8.0.1] - 2023-02-17 + +* (gaia) Bump [cosmos-sdk](https://github.com/cosmos/cosmos-sdk) to [v0.45.14](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.14). See [CHANGELOG.md](https://github.com/cosmos/cosmos-sdk/blob/release/v0.45.x/CHANGELOG.md) for details. +* (gaia) Bump [tendermint](https://github.com/informalsystems/tendermint) to [0.34.26](https://github.com/informalsystems/tendermint/tree/v0.34.26). See [CHANGELOG.md](https://github.com/informalsystems/tendermint/blob/v0.34.26/CHANGELOG.md) for details. + +## [v8.0.0] - 2023-01-31 + +* (gaia) Bump [ibc-go](https://github.com/cosmos/ibc-go) to [v3.4.0](https://github.com/cosmos/ibc-go/blob/v3.4.0/CHANGELOG.md) to fix a vulnerability in ICA. See [v3.4.0 CHANGELOG.md](https://github.com/cosmos/cosmos-sdk/blob/v0.45.9/CHANGELOG.md) and [v3.2.1 Release Notes](https://github.com/cosmos/ibc-go/releases/tag/v3.2.1) for details. +* (gaia) Bump [cosmos-sdk](https://github.com/cosmos/cosmos-sdk) to [v0.45.12](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.12). See [CHANGELOG.md](https://github.com/cosmos/cosmos-sdk/blob/release/v0.45.x/CHANGELOG.md) for details. +* (gaia) Bump [tendermint](https://github.com/informalsystems/tendermint) to [0.34.24](https://github.com/informalsystems/tendermint/tree/v0.34.24). See [CHANGELOG.md](https://github.com/informalsystems/tendermint/blob/v0.34.24/CHANGELOG.md) for details. +* (gaia) Bump [liquidity](https://github.com/Gravity-Devs/liquidity) to [v1.5.3](https://github.com/Gravity-Devs/liquidity/releases/tag/v1.5.3). +* (gaia) Bump [packet-forward-middleware](https://github.com/strangelove-ventures/packet-forward-middleware) to [v3.1.1](https://github.com/strangelove-ventures/packet-forward-middleware/releases/tag/v3.1.1). +* (feat) Add [globalfee](https://github.com/cosmos/gaia/tree/main/x/globalfee) module. See [globalfee docs](https://github.com/cosmos/gaia/blob/main/docs/modules/globalfee.md) for more details. +* (feat) [#1845](https://github.com/cosmos/gaia/pull/1845) Add bech32-convert command to gaiad. +* (fix) [#2080](https://github.com/cosmos/gaia/issues/2074) Reintroduce deleted configuration for client rpc endpoints, transaction routes, and module REST routes in app.go. +* (fix) [Add new fee decorator](https://github.com/cosmos/gaia/pull/1961) to change `MaxBypassMinFeeMsgGasUsage` so importers of x/globalfee can change `MaxGas`. +* (fix) [#1870](https://github.com/cosmos/gaia/issues/1870) Fix bank denom metadata in migration. See [#1892](https://github.com/cosmos/gaia/pull/1892) for more details. +* (fix) [#1976](https://github.com/cosmos/gaia/pull/1976) Fix Quicksilver ICA exploit in migration. See [the bug fix forum post](https://forum.cosmos.network/t/upcoming-interchain-accounts-bugfix-release/8911) for more details. +* (tests) Add [E2E tests](https://github.com/cosmos/gaia/tree/main/tests/e2e). The tests cover transactions/queries tests of different modules, including Bank, Distribution, Encode, Evidence, FeeGrant, Global Fee, Gov, IBC, packet forwarding middleware, Slashing, Staking, and Vesting module. +* (tests) [#1941](https://github.com/cosmos/gaia/pull/1941) Fix packet forward configuration for e2e tests. +* (tests) Use gaiad to swap out [Ignite](https://github.com/ignite/cli) in [liveness tests](https://github.com/cosmos/gaia/blob/main/.github/workflows/test.yml). + +## [v7.1.1] - 2023-02-06 + +* (gaia) bump [tendermint](https://github.com/tendermint/tendermint) to [0.34.25](https://github.com/informalsystems/tendermint/releases/tag/v0.34.25) to patch p2p issue. See [CHANGELOG.md](https://github.com/informalsystems/tendermint/blob/v0.34.25/CHANGELOG.md#v03425) for details. + +## [v7.1.0] - 2022-10-14 +* (gaia) bump [cosmos-sdk](https://github.com/cosmos/cosmos-sdk) to [v0.45.9](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.9) to fix the security vulnerability! See [CHANGELOG.md](https://github.com/cosmos/cosmos-sdk/blob/v0.45.9/CHANGELOG.md) for details. + +## [v7.0.3] - 2022-08-03 +* (gaia) update go to 1.18. +* (gaia) bump [cosmos-sdk](https://github.com/cosmos/cosmos-sdk) to [v0.45.6](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.6). See [CHANGELOG.md](https://github.com/cosmos/cosmos-sdk/blob/v0.45.6/CHANGELOG.md) for details. +* (gaia) bump [Liquidity](https://github.com/Gravity-Devs/liquidity) module to [v1.5.1](https://github.com/Gravity-Devs/liquidity/releases/tag/v1.5.1). +* (gaia) bump [cosmos ledger](https://github.com/cosmos/ledger-go) to [v0.9.3](https://github.com/cosmos/ledger-go/releases/tag/v0.9.3) to fix issue [#1573](https://github.com/cosmos/gaia/issues/1573) - Ledger Nano S Plus not detected by gaiad. +* +## [v7.0.2] -2022-05-09 + +* (gaia) bump [cosmos-sdk](https://github.com/cosmos/cosmos-sdk) to [v0.45.4](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.4). See [CHANGELOG.md](https://github.com/cosmos/cosmos-sdk/blob/v0.45.4/CHANGELOG.md#v0454---2022-04-25) for details. +* (gaia) [#1447](https://github.com/cosmos/gaia/pull/1447) Support custom message types to bypass minimum fee checks for. + If a transaction contains only bypassed message types, the transaction will not have minimum fee + checks performed during `CheckTx`. Operators can supply these message types via the `bypass-min-fee-msg-types` + configuration in `app.toml`. Note, by default they include various IBC message types. + +## [v7.0.1] -2022-04-13 + +* (gaia) bump [cosmos-sdk](https://github.com/cosmos/cosmos-sdk) to [v0.45.3](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.3). See [CHANGELOG.md](https://github.com/cosmos/cosmos-sdk/blob/v0.45.3/CHANGELOG.md#v0453---2022-04-12) for details. +* (gaia) bump [tendermint](https://github.com/tendermint/tendermint) to [0.34.19](https://github.com/tendermint/tendermint/tree/v0.34.19). See [CHANGELOG.md](https://github.com/tendermint/tendermint/blob/v0.34.19/CHANGELOG.md#v03419) for details. +* (gaia) bump [tm-db](https://github.com/tendermint/tm-db) to [v0.6.7](https://github.com/tendermint/tm-db/tree/v0.6.7). See [CHANGELOG.md](https://github.com/tendermint/tm-db/blob/v0.6.7/CHANGELOG.md#067) for details. + +## [v7.0.0] - 2022-03-24 + +* (gaia) bump [cosmos-sdk](https://github.com/cosmos/cosmos-sdk) to [v0.45.1](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.1). See [CHANGELOG.md](https://github.com/cosmos/cosmos-sdk/blob/v0.45.1/CHANGELOG.md#v0451---2022-02-03) for details. +* (gaia) bump [ibc-go](https://github.com/cosmos/ibc-go) module to [v3.0.0](https://github.com/cosmos/ibc-go/releases/tag/v3.0.0). See [CHANGELOG.md](https://github.com/cosmos/ibc-go/blob/v3.0.0/CHANGELOG.md#v300---2022-03-15) for details. +* (gaia) add [interchain account](https://github.com/cosmos/ibc-go/tree/main/modules/apps/27-interchain-accounts) module (interhchain-account module is part of ibc-go module). +* (gaia) bump [liquidity](https://github.com/gravity-devs/liquidity) module to [v1.5.0](https://github.com/Gravity-Devs/liquidity/releases/tag/v1.5.0). See [CHANGELOG.md](https://github.com/Gravity-Devs/liquidity/blob/v1.5.0/CHANGELOG.md#v150---20220223) for details. +* (gaia) bump [packet-forward-middleware](https://github.com/strangelove-ventures/packet-forward-middleware) module to [v2.1.1](https://github.com/strangelove-ventures/packet-forward-middleware/releases/tag/v2.1.1). +* (gaia) add migration logs for upgrade process. + +## [v6.0.4] - 2022-03-10 + +* (gaia) Bump [Liquidity](https://github.com/gravity-devs/liquidity) module to [v1.4.6](https://github.com/Gravity-Devs/liquidity/releases/tag/v1.4.6). +* (gaia) Bump [IBC](https://github.com/cosmos/ibc-go) module to [2.0.3](https://github.com/cosmos/ibc-go/releases/tag/v2.0.3). +* (gaia) [#1230](https://github.com/cosmos/gaia/pull/1230) Fix: update gRPC Web Configuration in `contrib/testnets/test_platform`. +* (gaia) [#1135](https://github.com/cosmos/gaia/pull/1135) Fix rocksdb build tag usage. +* (gaia) [#1160](https://github.com/cosmos/gaia/pull/1160) Improvement: update state sync configs. +* (gaia) [#1208](https://github.com/cosmos/gaia/pull/1208) Update statesync.bash. + * * (gaia) Bump [Cosmos-SDK](https://github.com/cosmos/cosmos-sdk) to [v0.44.6](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.44.6) +* (gaia) Bump [Versions](https://github.com/cosmos/gaia/pull/1100) of various smaller dependencies, remove the Cosmos SDK replace statement, update `initiClientCtx` params, ensure `stdout` and `stderr` are handled correctly in the CLI. + +## [v6.0.3] - 2022-02-18 + +* This is a reverted release that is the same as v6.0.0 + +## [v6.0.2] - 2022-02-17 + +* Unusable release + +## [v6.0.1] - 2022-02-10 + +* Unusable release + +## [v6.0.0] - 2021-11-24 + +* (gaia) Add NewSetUpContextDecorator to anteDecorators +* (gaia) Reconfigure SetUpgradeHandler to ensure vesting is configured after auth and new modules have InitGenesis run. +* (golang) Bump golang prerequisite to 1.17. +* (gaia) Bump [Liquidity](https://github.com/gravity-devs/liquidity) module to [v1.4.2](https://github.com/Gravity-Devs/liquidity/releases/tag/v1.4.2). +* (gaia) Bump [Cosmos SDK](https://github.com/cosmos/cosmos-sdk) to [v0.44.3](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.44.3). See the [CHANGELOG.md](https://github.com/cosmos/cosmos-sdk/blob/release/v0.44.x/CHANGELOG.md#v0443---2021-10-21) for details. +* (gaia) Add [IBC](https://github.com/cosmos/ibc-go) as a standalone module from the Cosmos SDK using version [v2.0.0](https://github.com/cosmos/ibc-go/releases/tag/v2.0.0). See the [CHANGELOG.md](https://github.com/cosmos/ibc-go/blob/v2.0.0/CHANGELOG.md) for details. +* (gaia) Add [packet-forward-middleware](https://github.com/strangelove-ventures/packet-forward-middleware) [v1.0.1](https://github.com/strangelove-ventures/packet-forward-middleware/releases/tag/v1.0.1). +* (gaia) [#969](https://github.com/cosmos/gaia/issues/969) Remove legacy migration code. + +## [v5.0.8] - 2021-10-14 + +* (gaia) This release includes a new AnteHandler that rejects redundant IBC transactions to save relayers fees. + +## [v5.0.7] - 2021-09-30 + +* (gaia) Bump Cosmos SDK to 0.42.10 + +## [v5.0.6] - 2021-09-16 + +* (gaia) Bump tendermint to 0.34.13 + +## [v5.0.5] - 2021-08-05 + +* (gaia) Bump SDK to [0.42.9](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.9) to resolve IBC channel restart issue ([9800](https://github.com/cosmos/cosmos-sdk/issues/9800)). + +## [v5.0.4] - 2021-07-31 + +* (chore) Fix release to include intended items from `v5.0.3`. + +## [v5.0.3] - 2021-07-30 + +* (gaia) Bump SDK to [0.42.8](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.8) to resolve tx query issues. +* (gaia) Bump SDK to [0.42.7](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.7) to resolve state sync issues. + +## [v5.0.2] - 2021-07-15 + +* (gaia) Fix misspelling in RELEASE.md +* (gaia) Add releases to .gitignore + +## [v5.0.1] - 2021-07-15 + +* (gaia) Configure gaiad command to add back `config` capabilities. + +## [v5.0.0] - 2021-06-28 + +* (golang) Bump golang prerequisite from 1.15 to 1.16. +* (gaia) Add [Liquidity](https://github.com/gravity-devs/liquidity) module [v1.2.9](https://github.com/Gravity-Devs/liquidity/releases/tag/v1.2.9). +* (sdk) Bump SDK version to [v0.42.6](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.6). +* (tendermint) Bump Tendermint version to [v0.34.11](https://github.com/tendermint/tendermint/releases/tag/v0.34.11). + +## [v4.2.1] - 2021-04-08 + +A critical security vulnerability was identified in Tendermint Core, which impacts Tendermint Lite Client. + +This release fixes the identified security vulnerability. + +### Bug Fixes + +* (sdk) Bump SDK version to [v0.42.4](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.4) +* (tendermint) Bump Tendermint version to [v0.34.9](https://github.com/tendermint/tendermint/releases/tag/v0.34.9). + +## [v4.2.0] - 2021-03-25 + +A critical security vulnerability has been identified in Gaia v4.1.x. +User funds are NOT at risk; however, the vulnerability can result in a chain halt. + +This release fixes the identified security vulnerability. + +If the chain halts before or during the upgrade, validators with sufficient voting power need to upgrade +and come online in order for the chain to resume. + +### Bug Fixes + +* (sdk) Bump SDK version to [v0.42.3](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.3) + +## [v4.1.2] - 2021-03-22 + +This release removes unnecessary dependencies. + +### Bug Fixes + +* (gaia) [\#781](https://github.com/cosmos/gaia/pull/781) Remove unnecessary dependencies + +## [v4.1.1] - 2021-03-19 + +This release bring improvements to keyring UX, tx search results, and multi-sig account migrations. +See the Cosmos SDK [release notes](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.2) for details. + +### Bug Fixes + +* (sdk) Bump SDK version to [v0.42.2](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.2) + +## [v4.1.0] - 2021-03-10 + +### Bug Fixes + +A critical security vulnerability has been identified in Gaia v4.0.x. +User funds are NOT at risk; however, the vulnerability can result in a chain halt. + +This release fixes the identified security vulnerability. + +If the chain halts before or during the upgrade, validators with sufficient voting power need to upgrade +and come online in order for the chain to resume. + +## [v4.0.6] - 2021-03-09 + +### Bug Fixes + +This release bumps the Cosmos SDK, which includes an important security fix for all non +Cosmos Hub chains (e.g. any chain that does not use the default cosmos bech32 prefix), +and a few performance improvements. The SDK also applies a security fix for validator +address conversion in evidence handling, and the full header is now emitted on an +IBC UpdateClient message event. + +* (sdk) Bump SDK version to [v0.42.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.0) + +## [v4.0.5] - 2021-03-02 + +### Bug Fixes + +* (tendermint) Bump Tendermint version to [v0.34.8](https://github.com/tendermint/tendermint/releases/tag/v0.34.8). +* (sdk) Bump SDK version to [v0.41.4](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.41.4), which reduces startup time with the cosmoshub-4 mainnet genesis without invariant checks. + +## [v4.0.4] - 2021-02-19 + +### Bug Fixes + +This release applies a patched version to grpc dependencies in order to resolve some queries; no explicit version bumps are included. + +## [v4.0.3] - 2021-02-18 + +### Bug Fixes + +This release fixes build failures caused by a small API breakage introduced in tendermint v0.34.7. + +* (sdk) Bump SDK version to [v0.41.3](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.41.3). + +## [v4.0.2] - 2021-02-18 + +### Bug Fixes + +This release fixes a downstream security issue which impacts Cosmos SDK users. +See the [Tendermint v0.34.7 SDK changelog](https://github.com/tendermint/tendermint/blob/v0.34.x/CHANGELOG.md#v0347) for details. + +* (sdk) [\#640](https://github.com/cosmos/gaia/pull/640) Bump SDK version to [v0.41.2](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.41.2). +* (tendermint) [\#640](https://github.com/cosmos/gaia/pull/640) Bump Tendermint version to [v0.34.7](https://github.com/tendermint/tendermint/releases/tag/v0.34.7). + +## [v4.0.1] - 2021-02-17 + +### Bug Fixes + +* (sdk) [\#579](https://github.com/cosmos/gaia/pull/635) Bump SDK version to [v0.41.1](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.41.1). +* (tendermint) [\#622](https://github.com/cosmos/gaia/pull/622) Bump Tendermint version to [v0.34.4](https://github.com/tendermint/tendermint/releases/tag/v0.34.4). + +## [v4.0.0] - 2021-01-26 + +### Improvements + +* (app) [\#564](https://github.com/cosmos/gaia/pull/564) Add client denomination metadata for atoms. + +### Bug Fixes + +* (cmd) [\#563](https://github.com/cosmos/gaia/pull/563) Add balance coin to supply when adding a new genesis account +* (sdk) [\#579](https://github.com/cosmos/gaia/pull/579) Bump SDK version to [v0.41.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.41.0). + +## [v3.0.1] - 2021-01-19 + +### Improvements + +* (protobuf) [\#553](https://github.com/cosmos/gaia/pull/553) Bump gogo protobuf deps to v1.3.3 +* (github) [\#543](https://github.com/cosmos/gaia/pull/543) Add docker deployment +* (starport) [\#535](https://github.com/cosmos/gaia/pull/535) Add config.yml +* (docker) [\#534](https://github.com/cosmos/gaia/pull/534) Update to python3 + +### Bug Fixes + +* (sdk) Bump SDK version to [v0.40.1](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.40.1). +* (tendermint) Bump Tendermint version to [v0.34.3](https://github.com/tendermint/tendermint/releases/tag/v0.34.3). +* (github) [\#544](https://github.com/cosmos/gaia/pull/544) Deploy from main not master +* (docs) [\#550](https://github.com/cosmos/gaia/pull/550) Bump vuepress-theme-cosmos to 1.0.180 +* (docker) [\#537](https://github.com/cosmos/gaia/pull/537) Fix single-node.sh setup script + +## [v3.0.0] - 2021-01-09 + +### Improvements + +* (sdk) Bump SDK version to [v0.40.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.40.0). +* (tendermint) Bump Tendermint version to [v0.34.1](https://github.com/tendermint/tendermint/releases/tag/v0.34.1). + +## [v2.0.14] - 2020-12-10 + +* (sdk) Bump SDK version to [v0.37.15](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.37.15). +* (tendermint) Bump Tendermint version to [v0.32.14](https://github.com/tendermint/tendermint/releases/tag/v0.32.14). + +## [v2.0.13] - 2020-08-13 + +* (sdk) Bump SDK version to [v0.37.14](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.37.14). + +## [v2.0.12] - 2020-08-13 + +* This version did not contain the update to [v0.37.14](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.37.14). Please use v2.0.13 + +## [v2.0.11] - 2020-05-06 + +* (sdk) Bump SDK version to [v0.37.13](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.37.13). + +## [v2.0.10] - 2020-05-06 + +* (sdk) Bump SDK version to [v0.37.12](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.37.12). + +## [v2.0.9] - 2020-04-23 + +* (sdk) Bump SDK version to [v0.37.11](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.37.11). + +## [v2.0.8] - 2020-04-09 + +### Improvements + +* (sdk) Bump SDK version to [v0.37.9](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.37.9). + +## [v2.0.7] - 2020-03-11 + +### Improvements + +* (sdk) Bump SDK version to [v0.37.8](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.37.8). + +## [v2.0.6] - 2020-02-10 + +### Improvements + +* (sdk) Bump SDK version to [v0.37.7](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.37.7). + +## [v2.0.5] - 2020-01-21 + +### Improvements + +* (sdk) Bump SDK version to [v0.37.6](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.37.6). +* (tendermint) Bump Tendermint version to [v0.32.9](https://github.com/tendermint/tendermint/releases/tag/v0.32.9). + +## [v2.0.4] - 2020-01-09 + +### Improvements + +* (sdk) Bump SDK version to [v0.37.5](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.37.5). +* (tendermint) Bump Tendermint version to [v0.32.8](https://github.com/tendermint/tendermint/releases/tag/v0.32.8). + +### Bug Fixes + +* (cli) Fixed `gaiacli query txs` to use `events` instead of `tags`. Events take the form of `'{eventType}.{eventAttribute}={value}'`. Please + see the [events doc](https://github.com/cosmos/cosmos-sdk/blob/master/docs/core/events.md#events-1) + for further documentation. + +## [v2.0.3] - 2019-11-04 + +### Improvements + +* (sdk) Bump SDK version to [v0.37.4](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.37.4). +* (tendermint) Bump Tendermint version to [v0.32.7](https://github.com/tendermint/tendermint/releases/tag/v0.32.7). + +## [v2.0.2] - 2019-10-12 + +### Improvements + +* (sdk) Bump SDK version to [v0.37.3](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.37.3). +* (tendermint) Bump Tendermint version to [v0.32.6](https://github.com/tendermint/tendermint/releases/tag/v0.32.6). + +## [v2.0.1] - 2019-09-20 + +### Features + +* (gaiad) [\#119](https://github.com/cosmos/gaia/pull/119) Add support for the `--halt-time` CLI flag and configuration. + +### Improvements + +* [\#119](https://github.com/cosmos/gaia/pull/119) Refactor and upgrade Circle CI + configuration. +* (sdk) Update SDK version to v0.37.1 + +## [v2.0.0] - 2019-08-22 + +### Bug Fixes + +* [\#104](https://github.com/cosmos/gaia/issues/104) Fix `ModuleAccountAddrs` to + not rely on the `x/supply` keeper to get module account addresses for blacklisting. + +### Breaking Changes + +* (sdk) Update SDK version to v0.37.0 + +## [v1.0.0] - 2019-08-13 + +### Bug Fixes + +* (gaiad) [\#4113](https://github.com/cosmos/cosmos-sdk/issues/4113) Fix incorrect `$GOBIN` in `Install Go` +* (gaiacli) [\#3945](https://github.com/cosmos/cosmos-sdk/issues/3945) There's no check for chain-id in TxBuilder.SignStdTx +* (gaiacli) [\#4190](https://github.com/cosmos/cosmos-sdk/issues/4190) Fix redelegations-from by using the correct params and query endpoint. +* (gaiacli) [\#4219](https://github.com/cosmos/cosmos-sdk/issues/4219) Return an error when an empty mnemonic is provided during key recovery. +* (gaiacli) [\#4345](https://github.com/cosmos/cosmos-sdk/issues/4345) Improved Ledger Nano X detection + +### Breaking Changes + +* (sdk) Update SDK version to v0.36.0 +* (gaiad) [\#3985](https://github.com/cosmos/cosmos-sdk/issues/3985) ValidatorPowerRank uses potential consensus power +* (gaiad) [\#4027](https://github.com/cosmos/cosmos-sdk/issues/4027) gaiad version command does not return the checksum of the go.sum file shipped along with the source release tarball. + Go modules feature guarantees dependencies reproducibility and as long as binaries are built via the Makefile shipped with the sources, no dependendencies can break such guarantee. +* (gaiad) [\#4159](https://github.com/cosmos/cosmos-sdk/issues/4159) use module pattern and module manager for initialization +* (gaiad) [\#4272](https://github.com/cosmos/cosmos-sdk/issues/4272) Merge gaiareplay functionality into gaiad replay. + Drop `gaiareplay` in favor of new `gaiad replay` command. +* (gaiacli) [\#3715](https://github.com/cosmos/cosmos-sdk/issues/3715) query distr rewards returns per-validator + rewards along with rewards total amount. +* (gaiacli) [\#40](https://github.com/cosmos/cosmos-sdk/issues/40) rest-server's --cors option is now gone. +* (gaiacli) [\#4027](https://github.com/cosmos/cosmos-sdk/issues/4027) gaiacli version command dooes not return the checksum of the go.sum file anymore. +* (gaiacli) [\#4142](https://github.com/cosmos/cosmos-sdk/issues/4142) Turn gaiacli tx send's --from into a required argument. + New shorter syntax: `gaiacli tx send FROM TO AMOUNT` +* (gaiacli) [\#4228](https://github.com/cosmos/cosmos-sdk/issues/4228) Merge gaiakeyutil functionality into gaiacli keys. + Drop `gaiakeyutil` in favor of new `gaiacli keys parse` command. Syntax and semantic are preserved. +* (rest) [\#3715](https://github.com/cosmos/cosmos-sdk/issues/3715) Update /distribution/delegators/{delegatorAddr}/rewards GET endpoint + as per new specs. For a given delegation, the endpoint now returns the + comprehensive list of validator-reward tuples along with the grand total. +* (rest) [\#3942](https://github.com/cosmos/cosmos-sdk/issues/3942) Update pagination data in txs query. +* (rest) [\#4049](https://github.com/cosmos/cosmos-sdk/issues/4049) update tag MsgWithdrawValidatorCommission to match type +* (rest) The `/auth/accounts/{address}` now returns a `height` in the response. The + account is now nested under `account`. + +### Features + +* (gaiad) Add `migrate` command to `gaiad` to provide the ability to migrate exported + genesis state from one version to another. +* (gaiad) Update Gaia for community pool spend proposals per Cosmos Hub governance proposal [\#7](https://github.com/cosmos/cosmos-sdk/issues/7) "Activate the Community Pool" + +### Improvements + +* (gaiad) [\#4042](https://github.com/cosmos/cosmos-sdk/issues/4042) Update docs and scripts to include the correct `GO111MODULE=on` environment variable. +* (gaiad) [\#4066](https://github.com/cosmos/cosmos-sdk/issues/4066) Fix 'ExportGenesisFile() incorrectly overwrites genesis' +* (gaiad) [\#4064](https://github.com/cosmos/cosmos-sdk/issues/4064) Remove `dep` and `vendor` from `doc` and `version`. +* (gaiad) [\#4080](https://github.com/cosmos/cosmos-sdk/issues/4080) add missing invariants during simulations +* (gaiad) [\#4343](https://github.com/cosmos/cosmos-sdk/issues/4343) Upgrade toolchain to Go 1.12.5. +* (gaiacli) [\#4068](https://github.com/cosmos/cosmos-sdk/issues/4068) Remove redundant account check on `gaiacli` +* (gaiacli) [\#4227](https://github.com/cosmos/cosmos-sdk/issues/4227) Support for Ledger App v1.5 +* (rest) [\#2007](https://github.com/cosmos/cosmos-sdk/issues/2007) Return 200 status code on empty results +* (rest) [\#4123](https://github.com/cosmos/cosmos-sdk/issues/4123) Fix typo, url error and outdated command description of doc clients. +* (rest) [\#4129](https://github.com/cosmos/cosmos-sdk/issues/4129) Translate doc clients to chinese. +* (rest) [\#4141](https://github.com/cosmos/cosmos-sdk/issues/4141) Fix /txs/encode endpoint + + + +[v10.0.1]: https://github.com/cosmos/gaia/releases/tag/v10.0.1 +[v10.0.0]: https://github.com/cosmos/gaia/releases/tag/v10.0.0 +[v9.1.1]: https://github.com/cosmos/gaia/releases/tag/v9.1.1 +[v9.1.0]: https://github.com/cosmos/gaia/releases/tag/v9.1.0 +[v9.0.3]: https://github.com/cosmos/gaia/releases/tag/v9.0.3 +[v9.0.2]: https://github.com/cosmos/gaia/releases/tag/v9.0.2 +[v9.0.1]: https://github.com/cosmos/gaia/releases/tag/v9.0.1 +[v9.0.0]: https://github.com/cosmos/gaia/releases/tag/v9.0.0 +[v8.0.1]: https://github.com/cosmos/gaia/releases/tag/v8.0.1 +[v8.0.0]: https://github.com/cosmos/gaia/releases/tag/v8.0.0 +[v7.1.1]: https://github.com/cosmos/gaia/releases/tag/v7.1.1 +[v7.1.0]: https://github.com/cosmos/gaia/releases/tag/v7.1.0 +[v7.0.3]: https://github.com/cosmos/gaia/releases/tag/v7.0.3 +[v7.0.2]: https://github.com/cosmos/gaia/releases/tag/v7.0.2 +[v7.0.1]: https://github.com/cosmos/gaia/releases/tag/v7.0.1 +[v7.0.0]: https://github.com/cosmos/gaia/releases/tag/v7.0.0 +[v6.0.4]: https://github.com/cosmos/gaia/releases/tag/v6.0.4 +[v6.0.3]: https://github.com/cosmos/gaia/releases/tag/v6.0.3 +[v6.0.2]: https://github.com/cosmos/gaia/releases/tag/v6.0.2 +[v6.0.1]: https://github.com/cosmos/gaia/releases/tag/v6.0.1 +[v6.0.0]: https://github.com/cosmos/gaia/releases/tag/v6.0.0 +[v5.0.8]: https://github.com/cosmos/gaia/releases/tag/v5.0.8 +[v5.0.7]: https://github.com/cosmos/gaia/releases/tag/v5.0.7 +[v5.0.6]: https://github.com/cosmos/gaia/releases/tag/v5.0.6 +[v5.0.5]: https://github.com/cosmos/gaia/releases/tag/v5.0.5 +[v5.0.4]: https://github.com/cosmos/gaia/releases/tag/v5.0.4 +[v5.0.3]: https://github.com/cosmos/gaia/releases/tag/v5.0.3 +[v5.0.2]: https://github.com/cosmos/gaia/releases/tag/v5.0.2 +[v5.0.1]: https://github.com/cosmos/gaia/releases/tag/v5.0.1 +[v5.0.0]: https://github.com/cosmos/gaia/releases/tag/v5.0.0 +[v4.2.1]: https://github.com/cosmos/gaia/releases/tag/v4.2.1 +[v4.2.0]: https://github.com/cosmos/gaia/releases/tag/v4.2.0 +[v4.1.2]: https://github.com/cosmos/gaia/releases/tag/v4.1.2 +[v4.1.1]: https://github.com/cosmos/gaia/releases/tag/v4.1.1 +[v4.1.0]: https://github.com/cosmos/gaia/releases/tag/v4.1.0 +[v4.0.6]: https://github.com/cosmos/gaia/releases/tag/v4.0.6 +[v4.0.5]: https://github.com/cosmos/gaia/releases/tag/v4.0.5 +[v4.0.4]: https://github.com/cosmos/gaia/releases/tag/v4.0.4 +[v4.0.3]: https://github.com/cosmos/gaia/releases/tag/v4.0.3 +[v4.0.2]: https://github.com/cosmos/gaia/releases/tag/v4.0.2 +[v4.0.1]: https://github.com/cosmos/gaia/releases/tag/v4.0.1 +[v4.0.0]: https://github.com/cosmos/gaia/releases/tag/v4.0.0 +[v3.0.1]: https://github.com/cosmos/gaia/releases/tag/v3.0.1 +[v3.0.0]: https://github.com/cosmos/gaia/releases/tag/v3.0.0 +[v2.0.14]: https://github.com/cosmos/gaia/releases/tag/v2.0.14 +[v2.0.13]: https://github.com/cosmos/gaia/releases/tag/v2.0.13 +[v2.0.12]: https://github.com/cosmos/gaia/releases/tag/v2.0.12 +[v2.0.11]: https://github.com/cosmos/gaia/releases/tag/v2.0.11 +[v2.0.10]: https://github.com/cosmos/gaia/releases/tag/v2.0.10 +[v2.0.9]: https://github.com/cosmos/gaia/releases/tag/v2.0.9 +[v2.0.8]: https://github.com/cosmos/gaia/releases/tag/v2.0.8 +[v2.0.7]: https://github.com/cosmos/gaia/releases/tag/v2.0.7 +[v2.0.6]: https://github.com/cosmos/gaia/releases/tag/v2.0.6 +[v2.0.5]: https://github.com/cosmos/gaia/releases/tag/v2.0.5 +[v2.0.4]: https://github.com/cosmos/gaia/releases/tag/v2.0.4 +[v2.0.3]: https://github.com/cosmos/gaia/releases/tag/v2.0.3 +[v2.0.2]: https://github.com/cosmos/gaia/releases/tag/v2.0.2 +[v2.0.1]: https://github.com/cosmos/gaia/releases/tag/v2.0.1 +[v2.0.0]: https://github.com/cosmos/gaia/releases/tag/v2.0.0 +[v1.0.0]: https://github.com/cosmos/gaia/releases/tag/v1.0.0 \ No newline at end of file diff --git a/.changelog/unreleased/.gitkeep b/.changelog/unreleased/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/.changelog/unreleased/api-breaking/globalfee/2424-params.md b/.changelog/unreleased/api-breaking/globalfee/2424-params.md new file mode 100644 index 0000000000..6f17db44ee --- /dev/null +++ b/.changelog/unreleased/api-breaking/globalfee/2424-params.md @@ -0,0 +1,3 @@ +- Add `bypass-min-fee-msg-types` and `maxTotalBypassMinFeeMsgGagUsage` to + globalfee params. `bypass-min-fee-msg-types` in `config/app.toml` is + deprecated ([\#2424](https://github.com/cosmos/gaia/pull/2424)) \ No newline at end of file diff --git a/.changelog/unreleased/dependencies/2554-bump-ibc.md b/.changelog/unreleased/dependencies/2554-bump-ibc.md new file mode 100644 index 0000000000..62c59cfb08 --- /dev/null +++ b/.changelog/unreleased/dependencies/2554-bump-ibc.md @@ -0,0 +1,3 @@ +- Bump [ibc-go](https://github.com/cosmos/ibc-go) to + [v4.4.2](https://github.com/cosmos/ibc-go/releases/tag/v4.4.2) + ([\#2554](https://github.com/cosmos/gaia/pull/2554)) \ No newline at end of file diff --git a/.changelog/unreleased/dependencies/2594-bump-cometbft.md b/.changelog/unreleased/dependencies/2594-bump-cometbft.md new file mode 100644 index 0000000000..719c62dbc5 --- /dev/null +++ b/.changelog/unreleased/dependencies/2594-bump-cometbft.md @@ -0,0 +1,3 @@ +- Bump [CometBFT](https://github.com/cometbft/cometbft) to + [v0.34.29](https://github.com/cometbft/cometbft/releases/tag/v0.34.29) + ([\#2594](https://github.com/cosmos/gaia/pull/2594)) \ No newline at end of file diff --git a/.changelog/unreleased/state-breaking/globalfee/2352-migration.md b/.changelog/unreleased/state-breaking/globalfee/2352-migration.md new file mode 100644 index 0000000000..976a9fe659 --- /dev/null +++ b/.changelog/unreleased/state-breaking/globalfee/2352-migration.md @@ -0,0 +1,3 @@ +- Create the upgrade handler and params migration for the new Gloabal Fee module + parameters introduced in [#2424](https://github.com/cosmos/gaia/pull/2424) + ([\#2352](https://github.com/cosmos/gaia/pull/2352)) \ No newline at end of file diff --git a/.changelog/unreleased/state-breaking/globalfee/2424-params.md b/.changelog/unreleased/state-breaking/globalfee/2424-params.md new file mode 100644 index 0000000000..99a978eed5 --- /dev/null +++ b/.changelog/unreleased/state-breaking/globalfee/2424-params.md @@ -0,0 +1,2 @@ +- Add `bypass-min-fee-msg-types` and `maxTotalBypassMinFeeMsgGagUsage` to + globalfee params ([\#2424](https://github.com/cosmos/gaia/pull/2424)) \ No newline at end of file diff --git a/.changelog/unreleased/state-breaking/globalfee/2447-delivertx.md b/.changelog/unreleased/state-breaking/globalfee/2447-delivertx.md new file mode 100644 index 0000000000..8b2210c916 --- /dev/null +++ b/.changelog/unreleased/state-breaking/globalfee/2447-delivertx.md @@ -0,0 +1,2 @@ +- Update Global Fee's AnteHandler to check tx fees against the network min gas + prices in DeliverTx mode ([\#2447](https://github.com/cosmos/gaia/pull/2447)) \ No newline at end of file diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 278af99075..e13221c5c5 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,8 +1,5 @@ # CODEOWNERS: https://help.github.com/articles/about-codeowners/ # Primary repo maintainers -* @alexanderbez @zmanian @yaruwangway @crodriguezvega @jackzampolin @mmulji-ic @glnro @jtremback @mpoke @sainoe @MSalopek @smarshall-spitzbart - -# Governance Process and Docs maintainers -docs/governance/* @jtremback @mmulji-ic @mpoke +* @alexanderbez @zmanian @crodriguezvega @jackzampolin @cosmos/informal_gaia_maintain diff --git a/.github/ISSUE_TEMPLATE/epic-template.md b/.github/ISSUE_TEMPLATE/epic-template.md index ff49d57323..6738bb12d1 100644 --- a/.github/ISSUE_TEMPLATE/epic-template.md +++ b/.github/ISSUE_TEMPLATE/epic-template.md @@ -4,20 +4,20 @@ about: Basic template for EPICs (used by the team) labels: epic, needs-triage --- -# Problem +## Problem -# Closing criteria +## Closing criteria -# Problem details +## Problem details -# Task list +## Task list ```[tasklist] ### Must have diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md index 80d6faf7c3..84fc09dcff 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.md +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -1,7 +1,7 @@ --- name: Feature Request about: Create a proposal to request a feature -labels: enhancement, needs-triage +labels: enhancement, epic, needs-triage --- +## Task list + +```[tasklist] +### Must have +- [ ] discuss proposal (if proposal rejected, close EPIC) +- [ ] create ADR (if ADR rejected, close EPIC) +- [ ] add sub-tasks needed to implement the proposed feature +``` + +```[tasklist] +### Nice to have +- [ ] add sub-tasks that are nice to have for the proposed feature +``` ____ #### For Admin Use diff --git a/.github/ISSUE_TEMPLATE/issue-template.md b/.github/ISSUE_TEMPLATE/issue-template.md index ebefdec7cc..2ce98fd81b 100644 --- a/.github/ISSUE_TEMPLATE/issue-template.md +++ b/.github/ISSUE_TEMPLATE/issue-template.md @@ -1,7 +1,7 @@ --- name: Issue Template about: Basic template for issues (used by the team) - +labels: needs-triage --- +Please go the the `Preview` tab and select the appropriate sub-template: -## Description - -Closes: #XXXX - - - - - ---- - -### Author Checklist - -*All items are required. Please add a note to the item if the item is not applicable and -please add links to any relevant follow up issues.* - -I have... - -* [ ] Included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title -* [ ] Added `!` to the type prefix if API or client breaking change -* [ ] Targeted the correct branch (see [PR Targeting](https://github.com/cosmos/gaia/blob/main/CONTRIBUTING.md#pr-targeting)) -* [ ] Provided a link to the relevant issue or specification -* [ ] Followed the guidelines for [building SDK modules](https://github.com/cosmos/cosmos-sdk/blob/main/docs/docs/building-modules) -* [ ] Included the necessary unit and integration [tests](https://github.com/cosmos/gaia/blob/main/CONTRIBUTING.md#testing) -* [ ] Added a changelog entry to `CHANGELOG.md` -* [ ] Included comments for [documenting Go code](https://blog.golang.org/godoc) -* [ ] Updated the relevant documentation or specification -* [ ] Reviewed "Files changed" and left comments if necessary -* [ ] Confirmed all CI checks have passed - -### Reviewers Checklist - -*All items are required. Please add a note if the item is not applicable and please add -your handle next to the items reviewed if you only reviewed selected items.* - -I have... - -* [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title -* [ ] confirmed `!` in the type prefix if API or client breaking change -* [ ] confirmed all author checklist items have been addressed -* [ ] reviewed state machine logic -* [ ] reviewed API design and naming -* [ ] reviewed documentation is accurate -* [ ] reviewed tests and test coverage +* [Production code](?expand=1&template=production.md) - for types `fix`, `feat`, and `refactor`. +* [Docs](?expand=1&template=docs.md) - for documentation changes. +* [Others](?expand=1&template=others.md) - for changes that do not affect production code. \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE/production.md b/.github/PULL_REQUEST_TEMPLATE/production.md new file mode 100644 index 0000000000..79b5534fb2 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/production.md @@ -0,0 +1,48 @@ + + +## Description + +Closes: #XXXX + + + + + +--- + +### Author Checklist + +*All items are required. Please add a note to the item if the item is not applicable and +please add links to any relevant follow up issues.* + +I have... + +* [ ] Included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title +* [ ] Added `!` to the type prefix if API, client, or state breaking change (i.e., requires minor or major version bump) +* [ ] Targeted the correct branch (see [PR Targeting](https://github.com/cosmos/gaia/blob/main/CONTRIBUTING.md#pr-targeting)) +* [ ] Provided a link to the relevant issue or specification +* [ ] Followed the guidelines for [building SDK modules](https://github.com/cosmos/cosmos-sdk/blob/main/docs/docs/building-modules) +* [ ] Included the necessary unit and integration [tests](https://github.com/cosmos/gaia/blob/main/CONTRIBUTING.md#testing) +* [ ] Added a changelog entry in `.changelog` (for details, see [contributing guidelines](../../CONTRIBUTING.md#changelog)) +* [ ] Included comments for [documenting Go code](https://blog.golang.org/godoc) +* [ ] Updated the relevant documentation or specification +* [ ] Reviewed "Files changed" and left comments if necessary +* [ ] Confirmed all CI checks have passed + +### Reviewers Checklist + +*All items are required. Please add a note if the item is not applicable and please add +your handle next to the items reviewed if you only reviewed selected items.* + +I have... + +* [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title +* [ ] confirmed `!` in the type prefix if API or client breaking change +* [ ] confirmed all author checklist items have been addressed +* [ ] reviewed state machine logic +* [ ] reviewed API design and naming +* [ ] reviewed documentation is accurate +* [ ] reviewed tests and test coverage diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 426ba83906..576bda07bb 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -21,7 +21,7 @@ updates: directory: "/" schedule: interval: daily - target-branch: "release/v9.0.x" + target-branch: "release/v10.0.x" # Only allow automated security-related dependency updates on release branches. open-pull-requests-limit: 0 labels: @@ -31,7 +31,7 @@ updates: directory: "/" schedule: interval: daily - target-branch: "release/v8.0.x" + target-branch: "release/v9.1.x" # Only allow automated security-related dependency updates on release branches. open-pull-requests-limit: 0 labels: diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index d1d835a74d..6037a95102 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,26 +1,16 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# name: "CodeQL" on: - push: - branches: [ main, rc/v*, release/v* ] pull_request: - # The branches below must be a subset of the branches above - branches: [ main ] - paths-ignore: - - "**/*.md" - schedule: - - cron: '0 * * * *' + paths: + - "**.go" + push: + branches: + - main + - release/v* + - feat/** + paths: + - "**.go" jobs: analyze: @@ -31,26 +21,25 @@ jobs: contents: read security-events: write - strategy: - fail-fast: false - matrix: - language: [ 'go' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Learn more about CodeQL language support at https://git.io/codeql-language-support - steps: - name: Checkout repository uses: actions/checkout@v3.5.2 - - # Initializes the CodeQL tools for scanning. + - uses: actions/setup-go@v4 + with: + go-version: "1.20" + check-latest: true + + # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v2 with: - languages: ${{ matrix.language }} + languages: "go" # If you wish to specify custom queries, you can do so here or in a config file. # By default, queries listed here will override any specified in a config file. # Prefix the list here with "+" to use these queries and those in the config file. # queries: ./path/to/local/query, your-org/your-repo/queries@main + queries: +security-and-quality,github/codeql/go/ql/src/experimental/InconsistentCode/DeferInLoop.ql@main,github/codeql/go/ql/src/experimental/Unsafe/WrongUsageOfUnsafe.ql@main,github/codeql/go/ql/src/experimental/CWE-369/DivideByZero.ql@main + packs: +crypto-com/cosmos-sdk-codeql # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) diff --git a/.github/workflows/docker-push.yml b/.github/workflows/docker-push.yml index 9fe1585fa1..8d277c6924 100644 --- a/.github/workflows/docker-push.yml +++ b/.github/workflows/docker-push.yml @@ -21,7 +21,7 @@ jobs: uses: actions/checkout@v3.5.2 - name: Log in to the Container registry - uses: docker/login-action@v2.1.0 + uses: docker/login-action@v2.2.0 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -29,12 +29,12 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v4.4.0 + uses: docker/metadata-action@v4.6.0 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - name: Build and push Docker image - uses: docker/build-push-action@v4.0.0 + uses: docker/build-push-action@v4.1.1 with: context: . push: true @@ -42,7 +42,7 @@ jobs: labels: ${{ steps.meta.outputs.labels }} - name: Build and push e2e docker image - uses: docker/build-push-action@v4.0.0 + uses: docker/build-push-action@v4.1.1 with: context: . file: Dockerfile.e2e diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 6d592a88a3..8af0369a22 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -24,7 +24,7 @@ jobs: make build-docs LEDGER_ENABLED=false - name: Deploy 🚀 - uses: JamesIves/github-pages-deploy-action@v4.4.0 + uses: JamesIves/github-pages-deploy-action@v4.4.2 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} BRANCH: gh-pages diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5a0bcb75c5..97543a0ddc 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,26 +1,33 @@ -name: golangci-lint +name: Lint on: push: - tags: - - v* branches: - main + - release/** + - feat/** pull_request: permissions: contents: read - # Optional: allow read access to pull request. Use with `only-new-issues` option. - # pull-requests: read jobs: golangci: - name: lint + name: golangci-lint runs-on: ubuntu-latest steps: + - uses: actions/checkout@v3.5.2 - uses: actions/setup-go@v4 with: - go-version: 1.20.x - - uses: actions/checkout@v3.5.2 - - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + go-version: "1.20" + check-latest: true + - uses: technote-space/get-diff-action@v6.1.2 + id: git_diff with: - # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version - version: v1.52.2 + PATTERNS: | + **/*.go + go.mod + go.sum + **/go.mod + **/go.sum + - name: run linting + if: env.GIT_DIFF + run: | + make lint \ No newline at end of file diff --git a/.github/workflows/linkchecker.yml b/.github/workflows/md-link-checker.yml similarity index 60% rename from .github/workflows/linkchecker.yml rename to .github/workflows/md-link-checker.yml index eccadbd560..8a5f8f1277 100644 --- a/.github/workflows/linkchecker.yml +++ b/.github/workflows/md-link-checker.yml @@ -1,10 +1,12 @@ name: Check Markdown links -on: push +on: + schedule: + - cron: '* */24 * * *' jobs: markdown-link-check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.5.2 - - uses: gaurav-nelson/github-action-markdown-link-check@1.0.13 + - uses: actions/checkout@v3 + - uses: gaurav-nelson/github-action-markdown-link-check@1.0.15 with: - folder-path: "docs" + folder-path: "docs" \ No newline at end of file diff --git a/.github/workflows/nightly-tests.yml b/.github/workflows/nightly-tests.yml index a09eba94bc..572ee87d80 100644 --- a/.github/workflows/nightly-tests.yml +++ b/.github/workflows/nightly-tests.yml @@ -4,16 +4,7 @@ on: workflow_dispatch: schedule: # run every day at 03:00 UTC - # ┌───────────── minute (0 - 59) - # │ ┌───────────── hour (0 - 23) - # │ │ ┌───────────── day of the month (1 - 31) - # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) - # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) - # │ │ │ │ │ - # │ │ │ │ │ - # │ │ │ │ │ - # * * * * * - - cron: "0 0 * * *" + - cron: "0 3 * * *" jobs: @@ -30,7 +21,8 @@ jobs: - uses: actions/checkout@v3.5.2 - uses: actions/setup-go@v4 with: - go-version: 1.20.3 + go-version: "1.20" + check-latest: true - name: run-vulncheck id: vulncheck run: make vulncheck @@ -41,7 +33,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Notify Slack on failure - uses: slackapi/slack-github-action@v1.23.0 + uses: slackapi/slack-github-action@v1.24.0 env: SLACK_WEBHOOK_URL: ${{ secrets.NIGHTLY_E2E_SLACK_WEBHOOK_URL }} SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index adf1fd1c4c..9361d207cc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,100 +1,34 @@ -name: create release +name: "Release" on: - push: - tags: - - "v[0-9]+\\.[0-9]+\\.[0-9]+" - - "v[0-9]+\\.[0-9]+\\.[0-9]+-rc[0-9]+" + # can be used to re-release an existing tag + workflow_dispatch: + + push: + tags: + - "v[0-9]+\\.[0-9]+\\.[0-9]+" + - "v[0-9]+\\.[0-9]+\\.[0-9]+-rc[0-9]+" jobs: - build: - name: Create Release - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3.5.2 - - name: set tag env - run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - name: install go - uses: actions/setup-go@v4 - with: - go-version: 1.20.x - check-latest: true - - name: Build Artifacts - run: make distclean build-reproducible - - name: generate release note - run: go run ./contrib/generate_release_note/main.go ${{ env.VERSION }} ./artifacts/build_report ./CHANGELOG.md - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - body_path: ./releasenote - draft: true - prerelease: false - - name: Upload build_report - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ github.token }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./artifacts/build_report - asset_name: build_report - asset_content_type: application/file - - name: Upload darwin-amd64 artifact - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ github.token }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./artifacts/gaiad-${{ env.VERSION }}-darwin-amd64 - asset_name: gaiad-${{ env.VERSION }}-darwin-amd64 - asset_content_type: application/binary - - name: Upload darwin-arm64 artifact - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ github.token }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./artifacts/gaiad-${{ env.VERSION }}-darwin-arm64 - asset_name: gaiad-${{ env.VERSION }}-darwin-arm64 - asset_content_type: application/binary - - name: Upload linux-amd64 artifact - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ github.token }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./artifacts/gaiad-${{ env.VERSION }}-linux-amd64 - asset_name: gaiad-${{ env.VERSION }}-linux-amd64 - asset_content_type: application/binary - - name: Upload linux-arm64 artifact - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ github.token }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./artifacts/gaiad-${{ env.VERSION }}-linux-arm64 - asset_name: gaiad-${{ env.VERSION }}-linux-arm64 - asset_content_type: application/binary - - name: Upload windows-amd64 artifact - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ github.token }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./artifacts/gaiad-${{ env.VERSION }}-windows-amd64.exe - asset_name: gaiad-${{ env.VERSION }}-windows-amd64.exe - asset_content_type: application/binary - - name: Upload compression - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ github.token }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./artifacts/gaiad-${{ env.VERSION }}.tar.gz - asset_name: gaiad-${{ env.RELEASE_VERSION }}.tar.gz - asset_content_type: application/gzip + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - uses: actions/setup-go@v4 + with: + go-version: "1.20" + + - name: Set Env + run: echo "TM_VERSION=$(go list -m github.com/tendermint/tendermint | sed 's:.* ::')" >> $GITHUB_ENV + + - name: Release + uses: goreleaser/goreleaser-action@v4 + with: + version: latest + args: release --clean --release-notes ./RELEASE_NOTES.md + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c1a0e1e798..e480bac1d3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,25 +12,35 @@ on: - "**/*.md" - "docs/**" -jobs: - cleanup-runs: - if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'" - runs-on: ubuntu-latest - steps: - - uses: rokroskar/workflow-run-cleanup-action@master - env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" +permissions: + contents: read + +concurrency: + group: ci-${{ github.ref }}-tests + cancel-in-progress: true - test-coverage-upload: +jobs: + tests: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3.5.2 - - uses: technote-space/get-diff-action@v6.1.1 + - uses: actions/setup-go@v4 + with: + go-version: "1.20" + check-latest: true + cache: true + cache-dependency-path: go.sum + - uses: technote-space/get-diff-action@v6.1.2 + id: git_diff with: PATTERNS: | - **/**.go + **/*.go go.mod go.sum + **/go.mod + **/go.sum + **/Makefile + Makefile - uses: actions/cache@v3.3.1 with: path: | @@ -39,29 +49,15 @@ jobs: key: ${{ runner.os }}-go-${{ hashFiles('**/go.mod') }} restore-keys: | ${{ runner.os }}-go- - - uses: actions/setup-go@v4 - with: - go-version: 1.20.x - name: test & coverage report creation + if: env.GIT_DIFF run: | - go test -v -coverprofile=coverage.txt -covermode=atomic -coverpkg=./... $(go list ./... | grep -v -e '/tests/e2e') - - name: filter non-testable files - run: | - excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')" - excludelist+=" $(find ./ -type f -name '*.pb.go')" - excludelist+=" $(find ./ -type f -name '*.pb.gw.go')" - excludelist+=" $(find ./cmd -type d)" - excludelist+=" $(find ./tests -type d)" - for filename in ${excludelist}; do - filename=${filename#".//"} - echo "Excluding ${filename} from coverage report..." - filename=$(echo "$filename" | sed 's/\//\\\//g') - sed -i.bak "/""$filename""/d" coverage.txt - done - - uses: codecov/codecov-action@v3.1.2 + go test -v -coverprofile=profile.out -covermode=atomic -coverpkg=./... $(go list ./... | grep -v -e '/tests/e2e') + - uses: actions/upload-artifact@v3 + if: env.GIT_DIFF with: - file: ./coverage.txt - fail_ci_if_error: true + name: "${{ github.sha }}-coverage" + path: ./profile.out test-e2e: runs-on: ubuntu-latest @@ -82,6 +78,31 @@ jobs: - name: Test E2E run: make test-e2e + repo-analysis: + runs-on: ubuntu-latest + needs: [tests] + steps: + - uses: actions/checkout@v3 + - uses: technote-space/get-diff-action@v6.1.2 + id: git_diff + with: + PATTERNS: | + **/*.go + go.mod + go.sum + **/go.mod + **/go.sum + - uses: actions/download-artifact@v3 + if: env.GIT_DIFF + with: + name: "${{ github.sha }}-coverage" + - name: sonarcloud + if: ${{ env.SONAR_TOKEN != null && env.GIT_DIFF && !github.event.pull_request.draft }} + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + liveness-test: runs-on: ubuntu-latest timeout-minutes: 10 @@ -124,40 +145,38 @@ jobs: go.sum - uses: actions/setup-go@v4 with: - go-version: 1.18 - - name: Install GaiaV9 + go-version: 1.20.x + - name: Install GaiaV10 run: | - git checkout v9.1.0 + git checkout v10.0.0 make build - cp ./build/gaiad ./build/gaiad9 + cp ./build/gaiad ./build/gaiad10 go clean -modcache if: env.GIT_DIFF - - uses: actions/setup-go@v4 - with: - go-version: 1.20.x - - name: Install GaiaV10 + - name: Install GaiaV11 run: | git checkout - make build - cp ./build/gaiad ./build/gaiad10 + cp ./build/gaiad ./build/gaiad11 if: env.GIT_DIFF - name: Install Cosmovisor run: | go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@latest if: env.GIT_DIFF - - name: Start GaiaV9 + - name: Start GaiaV10 run: | go env GOPATH - ./contrib/scripts/run-gaia-v9.sh + ./contrib/scripts/upgrade_test_scripts/v11/run_gaia_v10.sh if: env.GIT_DIFF - name: Submit Upgrade Commands run: | - ./contrib/scripts/run-upgrade-commands-v10.sh 15 + ./contrib/scripts/upgrade_test_scripts/v11/run_upgrade_commands_v11.sh 15 if: env.GIT_DIFF - name: Check for successful upgrade run: | - ./contrib/scripts/test_upgrade.sh 20 5 16 localhost + ./contrib/scripts/upgrade_test_scripts/test_upgrade.sh 20 5 16 localhost if: env.GIT_DIFF - name: Check for successful migration run: | - ./contrib/scripts/test_migration.sh localhost + ./contrib/scripts/upgrade_test_scripts/v11/test_migration_v11.sh localhost + if: env.GIT_DIFF diff --git a/.goreleaser.yml b/.goreleaser.yml index 6d20495674..16e6b85ed1 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -4,10 +4,6 @@ project_name: gaia env: - GO111MODULE=on -before: - hooks: - - go mod tidy -compat=1.20 - builds: - main: ./cmd/gaiad id: "gaiad" @@ -19,6 +15,7 @@ builds: env: - CGO_ENABLED=0 ldflags: + # .Env.TM_VERSION is provided in the workflow runner environment -> see .github/workflows/release.yml - -s -w -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} -X github.com/cosmos/cosmos-sdk/version.Name=gaia -X github.com/cosmos/cosmos-sdk/version.AppName=gaiad -X github.com/cosmos/cosmos-sdk/version.Version={{ .Version }} -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }} -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger -X github.com/tendermint/tendermint/version.TMCoreSemVer={{ .Env.TM_VERSION }} goos: - darwin @@ -29,20 +26,23 @@ builds: - arm64 archives: - - format: tar.gz - wrap_in_directory: "true" - format_overrides: - - goos: windows - format: zip + # disables archiving; to enable use commented lines below + - format: binary name_template: "{{ .Binary }}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" - files: - - LICENSE - - README.md + + # - format: tar.gz + # wrap_in_directory: "true" + # format_overrides: + # - goos: windows + # format: zip + # name_template: "{{ .Binary }}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" + # files: + # - LICENSE + # - README.md + # rlcp: true release: - github: - owner: cosmos - name: gaia + prerelease: true name_template: "v{{.Version}}" checksum: @@ -53,4 +53,4 @@ snapshot: name_template: SNAPSHOT-{{ .Commit }} changelog: - skip: true + skip: false diff --git a/.mergify.yml b/.mergify.yml index 5ff7b8d56a..5de6010b1f 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -24,24 +24,14 @@ pull_request_rules: {{ title }} (#{{ number }}) {{ body }} - - name: Backport patches to the release/v8.0.x branch + - name: Backport patches to the release/v9.1.x branch conditions: - base=main - - label=A:backport/v8.0.x - - "#commits-unverified>=0" + - label=A:backport/v9.1.x actions: backport: branches: - - release/v8.0.x - - - name: Backport patches to the release/v9.0.x branch - conditions: - - base=main - - label=A:backport/v9.0.x - actions: - backport: - branches: - - release/v9.0.x + - release/v9.1.x - name: Backport patches to the release/v10.0.x branch conditions: @@ -50,4 +40,4 @@ pull_request_rules: actions: backport: branches: - - release/v10.0.x \ No newline at end of file + - release/v10.0.x diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e15a0d13d..9ecc6eb656 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,59 +1,46 @@ - +* (fix) [#2474](https://github.com/cosmos/gaia/pull/2474) Multisig and distribution fix in [Interchain-Security](https://github.com/cosmos/interchain-security). Bump Interchain-Security to [v1.1.0-multiden](https://github.com/cosmos/interchain-security/tree/v1.1.0-multiden). -# Changelog +This release combines two fixes that we judged were urgent to get onto the Cosmos Hub before the launch of the first ICS consumer chain. _Please note that user funds were not at risk and these fixes pertain to the liveness of the Hub and consumer chains_. -## [Unreleased] +The first fix is to enable the use of multisigs and Ledger devices when assigning keys for consumer chains. The second is to prevent a possible DOS vector involving the reward distribution system. -### Improvements -* (test) [#2440](https://github.com/cosmos/gaia/pull/2440) Add vulncheck to nightly builds -* (gaia) [#2442](https://github.com/cosmos/gaia/pull/2442) Bump [Interchain-Security](https://github.com/cosmos/interchain-security) to [v1.1.1](https://github.com/cosmos/interchain-security/tree/v1.1.1). +### Multisig fix + +On April 25th (a week and a half ago), we began receiving reports that validators using multisigs and Ledger devices were getting errors reading Error: unable to resolve type URL /interchain_security.ccv.provider.v1.MsgAssignConsumerKey: tx parse error when attempting to assign consensus keys for consumer chains. + +This was surprising because we had never seen this error before, even though we have done many testnets. The reason for this is probably because people don’t bother to use high security key management techniques in testnets. + +We quickly narrowed the problem down to issues having to do with using the PubKey type directly in the MsgAssignConsumerKey transaction, and Amino (a deprecated serialization library still used in Ledger devices and multisigs) not being able to handle this. We attempted to fix this with the assistance of the Cosmos-SDK team, but after making no headway for a few days, we decided to simply use a JSON representation of the PubKey in the transaction. This is how it is usually represented anyway. We have verified that this fixes the problem. + +### Distribution fix -### State Machine Breaking +The ICS distribution system works by allowing consumer chains to send rewards to a module address on the Hub called the FeePoolAddress. From here they are automatically distributed to all validators and delegators through the distribution system that already exists to distribute Atom staking rewards. The FeePoolAddress is usually blocked so that no tokens can be sent to it, but to enable ICS distribution we had to unblock it. -* (feat!) [#2424](https://github.com/cosmos/gaia/pull/2424) Add `bypass-min-fee-msg-types` and `maxTotalBypassMinFeeMsgGagUsage` to globalfee params. Note that this change is both state breaking and API breaking. The previous API endpoint was "/gaia/globalfee/v1beta1/minimum_gas_prices," and the new API endpoint is "/gaia/globalfee/v1beta1/params." -* (feat!) [#2352](https://github.com/cosmos/gaia/pull/2352) Create the upgrade handler and params migration for the new Gloabal Fee module parameters introduced in [#2424](https://github.com/cosmos/gaia/pull/2424). -Update the CI upgrade tests from v9 to the v10 and check that the parameters are successfully migrated. -* (feat!) [#2447](https://github.com/cosmos/gaia/pull/2447) Update Global Fee's AnteHandler to check tx fees against the network min gas prices in DeliverTx mode. +We recently realized that unblocking the FeePoolAddress could enable an attacker to send a huge number of different denoms into the distribution system. The distribution system would then attempt to distribute them all, leading to out of memory errors. Fixing a similar attack vector that existed in the distribution system before ICS led us to this realization. -## [v10.0.0-rc0] 2023-05-19 +To fix this problem, we have re-blocked the FeePoolAddress and created a new address called the ConsumerRewardsPool. Consumer chains now send rewards to this new address. There is also a new transaction type called RegisterConsumerRewardDenom. This transaction allows people to register denoms to be used as rewards from consumer chains. It costs 10 Atoms to run this transaction.The Atoms are transferred to the community pool. Only denoms registered with this command are then transferred to the FeePoolAddress and distributed out to delegators and validators. -* (chore) Update module version to v10 [#2502](https://github.com/cosmos/gaia/pull/2502). -* (deps) Bump multiple dependencies (sdk, cometbft, ibc-go, btcd), see [#2498](https://github.com/cosmos/gaia/pull/2498) for details. - * (deps) Bump [cosmos-sdk](https://github.com/cosmos/cosmos-sdk) to [v0.45.16-ics](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.16-ics). See [CHANGELOG.md](https://github.com/cosmos/cosmos-sdk/blob/release/v0.45.x/CHANGELOG.md) for details. - * (deps) Bump [ibc-go](https://github.com/cosmos/ibc-go) to [v4.4.0](https://github.com/cosmos/ibc-go/blob/release/v4.4.x/CHANGELOG.md). See [v4.2 Release Notes](https://github.com/cosmos/ibc-go/releases/tag/v4.4.0) for details. -* (gaia) Bump Golang prerequisite from 1.18 to 1.20 see (https://go.dev/blog/go1.20) for details. +Note: The fee of 10 Atoms was originally intended to be a parameter that could be changed by governance (10 Atoms might cost too much in the future). However, we ran into some problems creating a new parameter as part of an emergency upgrade. After consulting with the Cosmos-SDK team, we learned that creating new parameters is only supported as part of a scheduled upgrade. So in the current code, the number of Atoms is hardcoded. It will turn into a parameter in the next scheduled upgrade. ## [v9.0.3] - 2023-04-19 * (deps) [#2399](https://github.com/cosmos/gaia/pull/2399) Bump [cosmos-sdk](https://github.com/cosmos/cosmos-sdk) to [v0.45.15-ics](https://github.com/cosmos/cosmos @@ -509,6 +496,10 @@ See the [Tendermint v0.34.7 SDK changelog](https://github.com/tendermint/tenderm +[v10.0.1]: https://github.com/cosmos/gaia/releases/tag/v10.0.1 +[v10.0.0]: https://github.com/cosmos/gaia/releases/tag/v10.0.0 +[v9.1.1]: https://github.com/cosmos/gaia/releases/tag/v9.1.1 +[v9.1.0]: https://github.com/cosmos/gaia/releases/tag/v9.1.0 [v9.0.3]: https://github.com/cosmos/gaia/releases/tag/v9.0.3 [v9.0.2]: https://github.com/cosmos/gaia/releases/tag/v9.0.2 [v9.0.1]: https://github.com/cosmos/gaia/releases/tag/v9.0.1 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 63a8c2405b..b17ad3bca6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,7 @@ - [Contributing](#contributing) - [Overview](#overview) - - [Stewarding team responsibility](#stewarding-team-responsibility) + - [Responsibilities of the stewarding team](#responsibilities-of-the-stewarding-team) - [Ease of reviewing](#ease-of-reviewing) - [Workflow](#workflow) - [Project Board](#project-board) @@ -12,6 +12,7 @@ - [Pull Request Templates](#pull-request-templates) - [Requesting Reviews](#requesting-reviews) - [Updating Documentation](#updating-documentation) + - [Changelog](#changelog) - [Dependencies](#dependencies) - [Protobuf](#protobuf) - [Branching Model and Release](#branching-model-and-release) @@ -173,11 +174,11 @@ Then: Draft PRs also help the stewarding team provide early feedback and ensure the work is in the right direction. 2. When the code is complete, change your PR from `Draft` to `Ready for Review`. 3. Go through the actions for each checkbox present in the PR template description. The PR actions are automatically provided for each new PR. -4. Be sure to include a relevant changelog entry in the `Unreleased` section of `CHANGELOG.md` (see file for log format). The entry should be on top of all others changes in the section. PRs must have a category prefix that is based on the type of changes being made (for example, `fix`, `feat`, -`refactor`, `docs`, and so on). The *type* must be included in the PR title as a prefix (for example, -`fix: `). This convention ensures that all changes that are committed to the base branch follow the +`refactor`, `docs`, and so on). The [type](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) +must be included in the PR title as a prefix (for example, `fix: `). +This convention ensures that all changes that are committed to the base branch follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification. Additionally, **each PR should only address a single issue**. @@ -187,10 +188,11 @@ 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) is for types `fix`, `feat`, and `refactor`. We also have a [docs template](./.github/PULL_REQUEST_TEMPLATE/docs.md) for documentation changes and an [other template](./.github/PULL_REQUEST_TEMPLATE/other.md) for changes that do not affect production code. When previewing a PR before it has been opened, you can change the template by adding one of the following parameters to the url: +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: -* `template=docs.md` -* `template=other.md` +- 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. +- The [other template](./.github/PULL_REQUEST_TEMPLATE/other.md) is for changes that do not affect production code. ### Requesting Reviews @@ -222,6 +224,58 @@ items. In addition, use the following review explanations: If you open a PR in Gaia, it is mandatory to update the relevant documentation in `/docs`. +### Changelog + +To manage and generate our changelog, we currently use [unclog](https://github.com/informalsystems/unclog). + +Every PR with types `fix`, `feat`, `deps`, and `refactor` should include a file +`.changelog/unreleased/${section}/[${component}/]${pr-number}-${short-description}.md`, +where: + +- `section` is one of + `dependencies`, `improvements`, `features`, `bug-fixes`, `state-breaking`, `api-breaking`, + and _**if multiple apply, create multiple files**_; +- `pr-number` is the PR number; +- `short-description` is a short (4 to 6 word), hyphen separated description of the change; +- `component` is used for changes that affect one of the components defined in the [config](.changelog/config.toml), e.g., `tests`, `globalfee`. + +For examples, see the [.changelog](.changelog) folder. + +Use `unclog` to add a changelog entry in `.changelog` (check the [requirements](https://github.com/informalsystems/unclog#requirements) first): +```bash +# add a general entry +unclog add + -i "${pr-number}-${short-description}" + -p "${pr-number}" + -s "${section}" + -m "${description}" + +# add a entry to a component +unclog add + -i "${pr-number}-${short-description}" + -p "${pr-number}" + -c "${component}" + -s "${section}" + -m "${description}" +``` +where `${description}` is a detailed description of the changelog entry. + +For example, +```bash +# add an entry for bumping IBC to v4.4.2 +unclog add -i "2554-bump-ibc" -p 2554 -s "dependencies" -m "Bump [ibc-go](https://github.com/cosmos/ibc-go) to [v4.4.2](https://github.com/cosmos/ibc-go/releases/tag/v4.4.2)" + +# add an entry for changing the global fee module; +# note that the entry is added to both state-breaking and api-breaking sections +unclog add -i "2424-params" -p 2424 -c globalfee -s "state-breaking" -m "Add \`bypass-min-fee-msg-types\` and \`maxTotalBypassMinFeeMsgGagUsage\` to globalfee params" +unclog add -i "2424-params" -p 2424 -c globalfee -s "api-breaking" -m "Add \`bypass-min-fee-msg-types\` and \`maxTotalBypassMinFeeMsgGagUsage\` to globalfee params" +``` + +**Note:** Changelog entries should answer the question: "what is important about this +change for users to know?" or "what problem does this solve for users?". It +should not simply be a reiteration of the title of the associated PR, unless the +title of the PR _very_ clearly explains the benefit of a change to a user. + ## Dependencies We use [Go Modules](https://github.com/golang/go/wiki/Modules) to manage @@ -249,11 +303,7 @@ To generate the protobuf stubs, you can run `make proto-gen`. User-facing repos should adhere to the trunk based development branching model: https://trunkbaseddevelopment.com. User branches should start with a user name, example: `{moniker}/{issue#}-branch-name`. -Gaia follows [semantic versioning](https://semver.org), but with the following deviations to account for state-machine and API breaking changes: - -- State-machine breaking changes will result in an increase of the major version X (X.y.z). -- API breaking changes will result in an increase of the minor version Y (x.Y.z | x > 0). -- All other changes will result in an increase of the patch version Z (x.y.Z | x > 0). +Gaia follows [semantic versioning](https://semver.org), but with the some deviations to account for state-machine and API breaking changes. See [RELEASE_PROCESS.md](./RELEASE_PROCESS.md) for details. ### PR Targeting diff --git a/Makefile b/Makefile index 010eaf872b..feb7e76418 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ endif PACKAGES_SIMTEST=$(shell go list ./... | grep '/simulation') LEDGER_ENABLED ?= true SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g') -TM_VERSION := $(shell go list -m github.com/tendermint/tendermint | sed 's:.* ::') # grab everything after the space in "github.com/tendermint/tendermint v0.34.7" +TM_VERSION := $(shell go list -m github.com/cometbft/cometbft | sed 's:.* ::') # grab everything after the space in "github.com/cometbft/cometbft v0.34.7" DOCKER := $(shell which docker) BUILDDIR ?= $(CURDIR)/build TEST_DOCKER_REPO=cosmos/contrib-gaiatest @@ -69,7 +69,7 @@ ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=gaia \ -X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \ -X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \ -X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" \ - -X github.com/tendermint/tendermint/version.TMCoreSemVer=$(TM_VERSION) + -X github.com/cometbft/cometbft/version.TMCoreSemVer=$(TM_VERSION) ifeq (cleveldb,$(findstring cleveldb,$(GAIA_BUILD_OPTIONS))) ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=cleveldb @@ -117,17 +117,6 @@ vulncheck: $(BUILDDIR)/ GOBIN=$(BUILDDIR) go install golang.org/x/vuln/cmd/govulncheck@latest $(BUILDDIR)/govulncheck ./... -build-reproducible: go.sum - $(DOCKER) rm latest-build || true - $(DOCKER) run --volume=$(CURDIR):/sources:ro \ - --env TARGET_PLATFORMS='linux/amd64 darwin/amd64 linux/arm64 darwin/arm64 windows/amd64' \ - --env APP=gaiad \ - --env VERSION=$(VERSION) \ - --env COMMIT=$(COMMIT) \ - --env LEDGER_ENABLED=$(LEDGER_ENABLED) \ - --name latest-build majita/rbuilder:latest - $(DOCKER) cp -a latest-build:/home/builder/artifacts/ $(CURDIR)/ - build-linux: go.sum LEDGER_ENABLED=false GOOS=linux GOARCH=amd64 $(MAKE) build @@ -150,6 +139,40 @@ clean: distclean: clean rm -rf vendor/ +############################################################################### +### Release ### +############################################################################### + +# create tag and run goreleaser without publishing +create-release-dry-run: +ifneq ($(strip $(TAG)),) + @echo "--> Dry running release for tag: $(TAG)" + @echo "--> Create tag: $(TAG) dry run" + git tag -s $(TAG) -m $(TAG) + git push origin $(TAG) --dry-run + @echo "--> Delete local tag: $(TAG)" + @git tag -d $(TAG) + @echo "--> Running goreleaser" + @go install github.com/goreleaser/goreleaser@latest + TM_VERSION=$(TM_VERSION) goreleaser release --snapshot --clean + @rm -rf dist/ + @echo "--> Done create-release-dry-run for tag: $(TAG)" +else + @echo "--> No tag specified, skipping tag release" +endif + +# create tag and publish it +create-release: +ifneq ($(strip $(TAG)),) + @echo "--> Running release for tag: $(TAG)" + @echo "--> Create release tag: $(TAG)" + git tag -s $(TAG) -m $(TAG) + git push origin $(TAG) + @echo "--> Done creating release tag: $(TAG)" +else + @echo "--> No tag specified, skipping create-release" +endif + ############################################################################### ### Devdoc ### ############################################################################### diff --git a/README.md b/README.md index 40541d3240..b9cdc47aa1 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,32 @@ -
- - -
- -
- -

Cosmos Hub (Gaia)

-

The Cosmos Hub is the first of an exploding number of interconnected blockchains that comprise the Cosmos Network.

- - Tweet -
-
- -
- -
- -
+# Cosmos Hub (Gaia) + +![Banner!](https://miro.medium.com/max/2000/1*DHtmSfS_Efvuq8n2LAnhkA.png) + +[![Project Status: Active -- The project has reached a stable, usable state and is being actively +developed.](https://img.shields.io/badge/repo%20status-Active-green.svg)](https://www.repostatus.org/#active) +[![License: Apache-2.0](https://img.shields.io/github/license/cosmos/gaia.svg)](https://github.com/cosmos/gaia/blob/main/LICENSE) +[![Version](https://img.shields.io/github/v/release/cosmos/gaia.svg)](https://github.com/cosmos/gaia/releases/latest) +[![Go Report Card](https://goreportcard.com/badge/github.com/cosmos/gaia)](https://goreportcard.com/report/github.com/cosmos/gaia) +[![GoDoc](https://img.shields.io/badge/godoc-reference-blue?logo=go)](https://pkg.go.dev/github.com/cosmos/gaia) +[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=cosmos_gaia&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=cosmos_gaia) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=cosmos_gaia&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=cosmos_gaia) +[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=cosmos_gaia&metric=coverage)](https://sonarcloud.io/summary/new_code?id=cosmos_gaia) +[![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.gg/cosmosnetwork) +[![Twitter](https://badgen.net/badge/icon/twitter?icon=twitter&label)](https://twitter.com/cosmoshub) + +The Cosmos Hub is the first of an exploding number of interconnected blockchains that comprise the Cosmos Network.
-### 🤔 — Why should you be interested in the Cosmos Hub +## 🤔 — Why should you be interested in the Cosmos Hub ___ The Cosmos Hub is built using the [Cosmos SDK](https://github.com/cosmos/cosmos-sdk) and compiled to a binary called `gaiad` (Gaia Daemon). The Cosmos Hub and other fully sovereign Cosmos SDK blockchains interact with one another using a protocol called [IBC](https://github.com/cosmos/ibc) that enables Inter-Blockchain Communication. In order to understand what the Cosmos Hub is you can read this [introductory explanation](https://hub.cosmos.network/main/hub-overview/overview.html). -| | | | | | -| --- | --- | --- | --- | --- | -| [![codecov](https://codecov.io/gh/cosmos/gaia/branch/master/graph/badge.svg)](https://codecov.io/gh/cosmos/gaia) | [![Go Report Card](https://goreportcard.com/badge/github.com/cosmos/gaia)](https://goreportcard.com/report/github.com/cosmos/gaia) | [![license](https://img.shields.io/github/license/cosmos/gaia.svg)](https://github.com/cosmos/gaia/blob/main/LICENSE) | [![LoC](https://tokei.rs/b1/github/cosmos/gaia)](https://github.com/cosmos/gaia) | [![GolangCI](https://golangci.com/badges/github.com/cosmos/gaia.svg)](https://golangci.com/r/github.com/cosmos/gaia) | - -

-### ⚡ — Documentation & Introduction +## ⚡ — Documentation & Introduction ___ @@ -41,54 +34,48 @@ Cosmos Hub is a blockchain network that operates on Proof-of-Stake consensus. Yo Alternatively, whether you're new to blockchain technology or interested in getting involved, the Cosmos Network [Course](https://tutorials.cosmos.network/academy/0-welcome/) will guide you through everything. The course walks you through the basics of blockchain technology, to staking, setting up your own node, and beyond. -

-### 👤 — Node Operators +## 👤 — Node Operators ___ If you're interested in running a node on the current Cosmos Hub, check out the docs to [Join the Cosmos Hub Mainnet](https://github.com/cosmos/gaia/blob/main/docs/hub-tutorials/join-mainnet.md). -

-### 🗣️ — Validators +## 🗣️ — Validators ___ If you want to participate and help secure Cosmos Hub, check out becoming a validator. Information on what a validator is and how to participate as one can be found at the [Validator FAQ](https://hub.cosmos.network/main/validators/validator-faq.html#). If you're running a validator node on the Cosmos Hub, reach out to a Janitor on the [Cosmos Developers Discord](https://discord.gg/cosmosnetwork) to join the `#cosmos-hub-validators-verified` channel. -

-### 👥 — Delegators +## 👥 — Delegators ___ If you still want to participate on the Cosmos Hub, check out becoming a delegator. Information on what a delegator is and how to participate as one can be found at the [Delegator FAQ](https://hub.cosmos.network/main/delegators/delegator-faq.html). -

-### 👥 — Testnet +## 👥 — Testnet ___ To participate in or utilize the current Cosmos Hub testnet, take a look at the [cosmos/testnets](https://github.com/cosmos/testnets) repository. This testnet is for the Theta Upgrade expected in Q1 2022. For future upgrades of the Cosmos Hub take a look at the [roadmap](https://github.com/cosmos/gaia/blob/main/docs/roadmap/cosmos-hub-roadmap-2.0.md). -

-### 🌐 — Roadmap +## 🌐 — Roadmap ___ For an overview of upcoming changes to the Cosmos Hub take a look at the [Roadmap](https://github.com/cosmos/gaia/blob/main/docs/roadmap/cosmos-hub-roadmap-2.0.md). -

-### 🗄️ — Archives & Genesis +## 🗄️ — Archives & Genesis ___ @@ -97,19 +84,17 @@ Mainnet is currently running as `cosmoshub-4`. Archives of the state of `cosmosh If you are looking for historical genesis files and other data [`cosmos/mainnet`](http://github.com/cosmos/mainnet) is an excellent resource. Snapshots are also available at [cosmos.quicksync.io](https://cosmos.quicksync.io). -

-### 🤝 — How to contribute +## 🤝 — How to contribute ___ Check out [contributing.md](CONTRIBUTING.md) for our guidelines & policies for how we develop the Cosmos Hub. Thank you to all those who have contributed! -

-### 💬 — Talk to us +## 💬 — Talk to us ___ @@ -124,10 +109,9 @@ We have active, helpful communities on Twitter, Discord, and Telegram. For updates on the Cosmos Hub team's activities follow us on the [Cosmos Hub Twitter](https://twitter.com/cosmoshub) account. -

-### 👏 — Supporters +## 👏 — Supporters ___ diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md new file mode 100644 index 0000000000..12b4ee9e1f --- /dev/null +++ b/RELEASE_NOTES.md @@ -0,0 +1,32 @@ + + +# Gaia Release Notes + +## 📝 Changelog + +Check out the [changelog](https://github.com/cosmos/gaia/blob//CHANGELOG.md) for a list of relevant changes or [compare all changes](https://github.com/cosmos/cosmos-sdk/compare/release/...) from last release. + + +Refer to the [upgrading guide](https://github.com/cosmos/cosmos-sdk/blob/release//UPGRADING.md) when migrating from `` to ``. + +## 🚀 Highlights + + + +## 🔨 Build from source + +```bash +git clone https://github.com/cosmos/gaia +cd gaia && git checkout +make install +``` + +## ⚡️ Download binaries + +Binaries for linux, darwin, and windows are available below. \ No newline at end of file diff --git a/RELEASE_PROCESS.md b/RELEASE_PROCESS.md new file mode 100644 index 0000000000..c9317343d6 --- /dev/null +++ b/RELEASE_PROCESS.md @@ -0,0 +1,189 @@ +# Release Process + +- [Release Process](#release-process) + - [Major Release Procedure](#major-release-procedure) + - [Changelog](#changelog) + - [Release Notes](#release-notes) + - [Tagging Procedure](#tagging-procedure) + - [Test building artifacts](#test-building-artifacts) + - [Installing goreleaser](#installing-goreleaser) + - [Non-major Release Procedure](#non-major-release-procedure) + - [Major Release Maintenance](#major-release-maintenance) + - [Stable Release Policy](#stable-release-policy) + + +This document outlines the release process for Cosmos Hub (Gaia). + +Gaia follows [semantic versioning](https://semver.org), but with the following deviations to account for state-machine and API breaking changes: + +- State-machine breaking changes will result in an increase of the major version X (X.y.z). +- Emergency releases & API breaking changes (changes in node interactions e.g. queries) will result in an increase of the minor version Y (x.Y.z | x > 0). +- All other changes will result in an increase of the patch version Z (x.y.Z | x > 0). + +**State compatibility**: +It is critical for the patch releases to be state-machine compatible with prior releases in the same minor version. +For example, v9.2.1 must be compatible with v9.2.0. + +Minor releases will be handled on a case-by-case basis, but generally should only arise in case of safety or security issues that require a co-ordinated network upgrade without a governance process. + +This is to ensure determinism, i.e. that given the same input, the nodes will always produce the same output. +State-incompatibility is allowed for major upgrades because all nodes in the network perform it at the same time. +Therefore, after the upgrade, the nodes continue functioning in a deterministic way. + +**Note**: State-machine breaking changes include changes that impact the amount of gas needed to execute a transaction as it results in a different `apphash` after the code is executed. + +## Major Release Procedure + +A _major release_ is an increment of the first number (eg: `v9.1.0` → `v10.0.0`). Each major release opens a _stable release series_ and receives updates outlined in the [Major Release Maintenance](#major-release-maintenance) section. + +**Note**: Generally, PRs should target either `main` or a long-lived feature branch (see [CONTRIBUTING.md](./CONTRIBUTING.md#pull-requests)). +An exception are PRs open via the Github mergify integration (i.e., backported PRs). + +* Once the team feels that `main` is _**feature complete**_, we create a `release/vY` branch (going forward known a release branch), + where `Y` is the version number, with the minor and patch part substituted to `x` (eg: 11.x). + * Update the [GitHub mergify integration](./.mergify.yml) by adding instructions for automatically backporting commits from `main` to the `release/vY` using the `A:backport/vY` label. + * **PRs targeting directly a release branch can be merged _only_ when exceptional circumstances arise**. +* In the release branch + * Create a new version section in the `CHANGELOG.md` + * All links must point to their respective pull request. + * The `CHANGELOG.md` must contain only the changes of that specific released version. + All other changelog entries must be deleted and linked to the `main` branch changelog ([example]([TBA](https://github.com/cosmos/gaia/blob/release/v9.0.x/CHANGELOG.md))). + * Note: `CHANGELOG.md` should not contain release candidate entries. + * Create release notes, in `RELEASE_NOTES.md`, highlighting the new features and changes in the version. + This is needed so the bot knows which entries to add to the release page on GitHub. + * Additionally verify that the `UPGRADING.md` file is up to date and contains all the necessary information for upgrading to the new version. +* We freeze the release branch from receiving any new features and focus on releasing a release candidate. + * Finish audits and reviews. + * Add more tests. + * Fix bugs as they are discovered. +* After the team feels that the release branch works fine (i.e., has `~90%` chance of reaching mainnet), we cut a release candidate. + * Create a new annotated git tag for a release candidate in the release branch (follow the [Tagging Procedure](#tagging-procedure)). + * The release verification on public testnets must pass. + * When bugs are found, create a PR for `main`, and backport fixes to the release branch. + * Create new release candidate tags after bugs are fixed. +* After the team feels the release candidate is mainnet ready, create a full release: + * Update `CHANGELOG.md`. + * Run `make format` to format the code. + * Create a new annotated git tag in the release branch (follow the [Tagging Procedure](#tagging-procedure)). This will trigger the automated release process (which will also create the release artifacts). + * Once the release process completes, modify release notes if needed. + +### Changelog + +You can obtain the changelog by running: +```bash +git log --oneline --decorate .. + +# example +git log --oneline --decorate v9.0.0..v9.1.0 +``` + +### 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. + +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: +``` +098b00ed78ca01456c388d7f1f22d09a93927d7a234429681071b45d94730a05 gaiad_0.0.4_windows_arm64.exe +15b2b9146d99426a64c19d219234cd0fa725589c7dc84e9d4dc4d531ccc58bec gaiad_0.0.4_darwin_amd64 +604912ee7800055b0a1ac36ed31021d2161d7404cea8db8776287eb512cd67a9 gaiad_0.0.4_darwin_arm64 +76e5ff7751d66807ee85bc5301484d0f0bcc5c90582d4ba1692acefc189392be gaiad_0.0.4_linux_arm64 +bcbca82da2cb2387ad6d24c1f6401b229a9b4752156573327250d37e5cc9bb1c gaiad_0.0.4_windows_amd64.exe +f39552cbfcfb2b06f1bd66fd324af54ac9ee06625cfa652b71eba1869efe8670 gaiad_0.0.4_linux_amd64 +``` + +### Tagging Procedure + +**Important**: _**Always create tags from your local machine**_ since all release tags should be signed and annotated. +Using Github UI will create a `lightweight` tag, so it's possible that `gaiad version` returns a commit hash, instead of a tag. +This is important because most operators build from source, and having incorrect information when you run `make install && gaiad version` raises confusion. + +The following steps are the default for tagging a specific branch commit using git on your local machine. Usually, release branches are labeled `release/v*`: + +Ensure you have checked out the commit you wish to tag and then do: +```bash +git pull --tags + +# test tag creation and releasing using goreleaser +make create-release-dry-run TAG=v11.0.0 + +# after successful test push the tag +make create-release TAG=v11.0.0 +``` + +To re-create a tag: +```bash +# delete a tag locally +git tag -d v11.0.0 + +# push the deletion to the remote +git push --delete origin v11.0.0 + +# redo create-release +make create-release-dry-run TAG=v11.0.0 +make create-release TAG=v11.0.0 +``` + +#### Test building artifacts + +Before tagging a new version, please test the building releasing artifacts by running: + +```bash +TM_VERSION=$(go list -m github.com/tendermint/tendermint | sed 's:.* ::') goreleaser release --snapshot --clean --debug +``` + +#### Installing goreleaser +Check the instructions for installing goreleaser locally for your platform +* https://goreleaser.com/install/ + + +## Non-major Release Procedure + +A minor release_ is an increment of the _point number_ (eg: `v9.0.0 → v9.1.0`, also called _point release_). +A _patch release_ is an increment of the patch number (eg: `v10.0.0` → `v10.0.1`). + +**Important**: _**Non-major releases must not break consensus.**_ + +Updates to the release branch should come from `main` by backporting PRs +(usually done by automatic cherry pick followed by a PRs to the release branch). +The backports must be marked using `backport/Y` label in PR for main. +It is the PR author's responsibility to fix merge conflicts, update changelog entries, and +ensure CI passes. If a PR originates from an external contributor, a member of the stewarding team assumes +responsibility to perform this process instead of the original author. +Lastly, it is the stewarding team's responsibility to ensure that the PR meets all the Stable Release Update (SRU) criteria. + +Non-major Release must follow the [Stable Release Policy](#stable-release-policy). + +After the release branch has all commits required for the next patch release: + +* Update the [changelog](#changelog) and the [release notes](#release-notes). +* Create a new annotated git tag in the release branch (follow the [Tagging Procedure](#tagging-procedure)). This will trigger the automated release process (which will also create the release artifacts). +* Once the release process completes, modify release notes if needed. + +## Major Release Maintenance + +Major Release series continue to receive bug fixes (released as either a Minor or a Patch Release) until they reach **End Of Life**. +Major Release series is maintained in compliance with the **Stable Release Policy** as described in this document. + +**Note**: Not every Major Release is denoted as stable releases. + +After two major releases, a supported major release will be transitioned to unsupported and will be deemed EOL with no further updates. +For example, `release/v10.x` is deemed EOL once the network upgrades to `release/v12.x`. + +## Stable Release Policy + +Once a Gaia release has been completed and published, updates for it are released under certain circumstances +and must follow the [Non-major Release Procedure](#non-major-release-procedure). + +The intention of the Stable Release Policy is to ensure that all major release series that are not EOL, +are maintained with the following categories of fixes: + +- Tooling improvements (including code formatting, linting, static analysis and updates to testing frameworks) +- Performance enhancements for running archival and synching nodes +- Test and benchmarking suites, ensuring that fixes are sound and there are no performance regressions +- Library updates including point releases for core libraries such as IBC-Go, Cosmos SDK, Tendermint and other dependencies +- General maintenance improvements, that are deemed necessary by the stewarding team, that help align different releases and reduce the workload on the stewarding team +- Security fixes + +Issues that are likely excluded, are any issues that impact operating a block producing network. diff --git a/RELEASING.md b/RELEASING.md index 6142e34f3f..091c31504f 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -175,7 +175,7 @@ The intention of the Stable Release Policy is to ensure that all major release s - Tooling improvements (including code formatting, linting, static analysis and updates to testing frameworks) - Performance enhancements for running archival and synching nodes - Test and benchmarking suites, ensuring that fixes are sound and there are no performance regressions -- Library updates including point releases for core libraries such as IBC-Go, Cosmos SDK, Tendermint and other dependencies +- Library updates including point releases for core libraries such as IBC-Go, Cosmos SDK, CometBFT and other dependencies - General maintenance improvements, that are deemed necessary by the stewarding team, that help align different releases and reduce the workload on the stewarding team - Security fixes diff --git a/UPGRADING.md b/UPGRADING.md new file mode 100644 index 0000000000..281412b6fc --- /dev/null +++ b/UPGRADING.md @@ -0,0 +1,5 @@ +# Upgrading Gaia + +This guide provides instructions for upgrading to specific versions of Gaia. + +## [Unreleased] \ No newline at end of file diff --git a/ante/ante.go b/ante/ante.go index 1e71613324..b6ae8811aa 100644 --- a/ante/ante.go +++ b/ante/ante.go @@ -1,16 +1,17 @@ package ante import ( + errorsmod "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/auth/ante" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + gaiaerrors "github.com/cosmos/gaia/v11/types/errors" ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante" ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper" - gaiafeeante "github.com/cosmos/gaia/v10/x/globalfee/ante" + gaiafeeante "github.com/cosmos/gaia/v11/x/globalfee/ante" ) // HandlerOptions extend the SDK's AnteHandler options by requiring the IBC @@ -26,25 +27,25 @@ type HandlerOptions struct { func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) { if opts.AccountKeeper == nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler") + return nil, errorsmod.Wrap(gaiaerrors.ErrLogic, "account keeper is required for AnteHandler") } if opts.BankKeeper == nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler") + return nil, errorsmod.Wrap(gaiaerrors.ErrLogic, "bank keeper is required for AnteHandler") } if opts.SignModeHandler == nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for AnteHandler") + return nil, errorsmod.Wrap(gaiaerrors.ErrLogic, "sign mode handler is required for AnteHandler") } if opts.IBCkeeper == nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "IBC keeper is required for AnteHandler") + return nil, errorsmod.Wrap(gaiaerrors.ErrLogic, "IBC keeper is required for AnteHandler") } if opts.GlobalFeeSubspace.Name() == "" { - return nil, sdkerrors.Wrap(sdkerrors.ErrNotFound, "globalfee param store is required for AnteHandler") + return nil, errorsmod.Wrap(gaiaerrors.ErrNotFound, "globalfee param store is required for AnteHandler") } if opts.StakingSubspace.Name() == "" { - return nil, sdkerrors.Wrap(sdkerrors.ErrNotFound, "staking param store is required for AnteHandler") + return nil, errorsmod.Wrap(gaiaerrors.ErrNotFound, "staking param store is required for AnteHandler") } if opts.GovKeeper == nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "gov keeper is required for AnteHandler") + return nil, errorsmod.Wrap(gaiaerrors.ErrLogic, "gov keeper is required for AnteHandler") } sigGasConsumer := opts.SigGasConsumer diff --git a/ante/gov_ante.go b/ante/gov_ante.go index faca639b77..88dbddea15 100644 --- a/ante/gov_ante.go +++ b/ante/gov_ante.go @@ -1,9 +1,11 @@ package ante import ( + errorsmod "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + gaiaerrors "github.com/cosmos/gaia/v11/types/errors" + "github.com/cosmos/cosmos-sdk/x/authz" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -49,7 +51,7 @@ func (g GovPreventSpamDecorator) ValidateGovMsgs(ctx sdk.Context, msgs []sdk.Msg depositParams := g.govKeeper.GetDepositParams(ctx) minInitialDeposit := g.calcMinInitialDeposit(depositParams.MinDeposit) if msg.InitialDeposit.IsAllLT(minInitialDeposit) { - return sdkerrors.Wrapf(sdkerrors.ErrInsufficientFunds, "insufficient initial deposit amount - required: %v", minInitialDeposit) + return errorsmod.Wrapf(gaiaerrors.ErrInsufficientFunds, "insufficient initial deposit amount - required: %v", minInitialDeposit) } } @@ -60,7 +62,7 @@ func (g GovPreventSpamDecorator) ValidateGovMsgs(ctx sdk.Context, msgs []sdk.Msg for _, v := range execMsg.Msgs { var innerMsg sdk.Msg if err := g.cdc.UnpackAny(v, &innerMsg); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "cannot unmarshal authz exec msgs") + return errorsmod.Wrap(gaiaerrors.ErrUnauthorized, "cannot unmarshal authz exec msgs") } if err := validMsg(innerMsg); err != nil { return err diff --git a/ante/gov_ante_test.go b/ante/gov_ante_test.go index bfce1c8980..b4194bdc9b 100644 --- a/ante/gov_ante_test.go +++ b/ante/gov_ante_test.go @@ -13,10 +13,10 @@ import ( tmrand "github.com/tendermint/tendermint/libs/rand" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - "github.com/cosmos/gaia/v10/ante" - gaiahelpers "github.com/cosmos/gaia/v10/app/helpers" + "github.com/cosmos/gaia/v11/ante" + gaiahelpers "github.com/cosmos/gaia/v11/app/helpers" - gaiaapp "github.com/cosmos/gaia/v10/app" + gaiaapp "github.com/cosmos/gaia/v11/app" ) var ( diff --git a/app/app.go b/app/app.go index 111826514f..d43e43de4e 100644 --- a/app/app.go +++ b/app/app.go @@ -28,7 +28,8 @@ import ( govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - ibctesting "github.com/cosmos/interchain-security/legacy_ibc_testing/testing" + ibctesting "github.com/cosmos/interchain-security/v2/legacy_ibc_testing/testing" + providertypes "github.com/cosmos/interchain-security/v2/x/ccv/provider/types" "github.com/gorilla/mux" "github.com/rakyll/statik/fs" "github.com/spf13/cast" @@ -38,12 +39,12 @@ import ( tmos "github.com/tendermint/tendermint/libs/os" dbm "github.com/tendermint/tm-db" - gaiaante "github.com/cosmos/gaia/v10/ante" - "github.com/cosmos/gaia/v10/app/keepers" - gaiaappparams "github.com/cosmos/gaia/v10/app/params" - "github.com/cosmos/gaia/v10/app/upgrades" - v10 "github.com/cosmos/gaia/v10/app/upgrades/v10" - "github.com/cosmos/gaia/v10/x/globalfee" + gaiaante "github.com/cosmos/gaia/v11/ante" + "github.com/cosmos/gaia/v11/app/keepers" + gaiaappparams "github.com/cosmos/gaia/v11/app/params" + "github.com/cosmos/gaia/v11/app/upgrades" + v11 "github.com/cosmos/gaia/v11/app/upgrades/v11" + "github.com/cosmos/gaia/v11/x/globalfee" // unnamed import of statik for swagger UI support _ "github.com/cosmos/cosmos-sdk/client/docs/statik" @@ -53,7 +54,7 @@ var ( // DefaultNodeHome default home directories for the application daemon DefaultNodeHome string - Upgrades = []upgrades.Upgrade{v10.Upgrade} + Upgrades = []upgrades.Upgrade{v11.Upgrade} ) var ( @@ -269,10 +270,8 @@ func (app *GaiaApp) BlockedModuleAccountAddrs(modAccAddrs map[string]bool) map[s // remove module accounts that are ALLOWED to received funds delete(modAccAddrs, authtypes.NewModuleAddress(govtypes.ModuleName).String()) - // Remove the fee-pool from the group of blocked recipient addresses in bank - // this is required for the provider chain to be able to receive tokens from - // the consumer chain - delete(modAccAddrs, authtypes.NewModuleAddress(authtypes.FeeCollectorName).String()) + // Remove the ConsumerRewardsPool from the group of blocked recipient addresses in bank + delete(modAccAddrs, authtypes.NewModuleAddress(providertypes.ConsumerRewardsPool).String()) return modAccAddrs } diff --git a/app/app_helpers.go b/app/app_helpers.go index 2b8fec971e..a4e058a0c8 100644 --- a/app/app_helpers.go +++ b/app/app_helpers.go @@ -3,12 +3,12 @@ package gaia import ( capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper" - ibcstakinginterface "github.com/cosmos/interchain-security/legacy_ibc_testing/core" - "github.com/cosmos/interchain-security/testutil/e2e" - ibcproviderkeeper "github.com/cosmos/interchain-security/x/ccv/provider/keeper" + ibcstakinginterface "github.com/cosmos/interchain-security/v2/legacy_ibc_testing/core" + icstest "github.com/cosmos/interchain-security/v2/testutil/integration" + ibcproviderkeeper "github.com/cosmos/interchain-security/v2/x/ccv/provider/keeper" ) -// ProviderApp interface implementations for e2e tests +// ProviderApp interface implementations for icstest tests // GetProviderKeeper implements the ProviderApp interface. func (app *GaiaApp) GetProviderKeeper() ibcproviderkeeper.Keeper { //nolint:nolintlint @@ -30,22 +30,26 @@ func (app *GaiaApp) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper { //nolin return app.ScopedIBCKeeper } -// GetE2eStakingKeeper implements the ProviderApp interface. -func (app *GaiaApp) GetE2eStakingKeeper() e2e.E2eStakingKeeper { //nolint:nolintlint +// GetTestStakingKeeper implements the ProviderApp interface. +func (app *GaiaApp) GetTestStakingKeeper() icstest.TestStakingKeeper { //nolint:nolintlint return app.StakingKeeper } -// GetE2eBankKeeper implements the ProviderApp interface. -func (app *GaiaApp) GetE2eBankKeeper() e2e.E2eBankKeeper { //nolint:nolintlint +// GetTestBankKeeper implements the ProviderApp interface. +func (app *GaiaApp) GetTestBankKeeper() icstest.TestBankKeeper { //nolint:nolintlint return app.BankKeeper } -// GetE2eSlashingKeeper implements the ProviderApp interface. -func (app *GaiaApp) GetE2eSlashingKeeper() e2e.E2eSlashingKeeper { //nolint:nolintlint +// GetTestSlashingKeeper implements the ProviderApp interface. +func (app *GaiaApp) GetTestSlashingKeeper() icstest.TestSlashingKeeper { //nolint:nolintlint return app.SlashingKeeper } -// GetE2eDistributionKeeper implements the ProviderApp interface. -func (app *GaiaApp) GetE2eDistributionKeeper() e2e.E2eDistributionKeeper { //nolint:nolintlint +// GetTestDistributionKeeper implements the ProviderApp interface. +func (app *GaiaApp) GetTestDistributionKeeper() icstest.TestDistributionKeeper { //nolint:nolintlint return app.DistrKeeper } + +func (app *GaiaApp) GetTestAccountKeeper() icstest.TestAccountKeeper { //nolint:nolintlint + return app.AccountKeeper +} diff --git a/app/app_test.go b/app/app_test.go index 8695eecfc4..a55c5c2cbe 100644 --- a/app/app_test.go +++ b/app/app_test.go @@ -9,8 +9,8 @@ import ( "github.com/tendermint/tendermint/libs/log" db "github.com/tendermint/tm-db" - gaia "github.com/cosmos/gaia/v10/app" - gaiahelpers "github.com/cosmos/gaia/v10/app/helpers" + gaia "github.com/cosmos/gaia/v11/app" + gaiahelpers "github.com/cosmos/gaia/v11/app/helpers" ) type EmptyAppOptions struct{} diff --git a/app/encoding.go b/app/encoding.go index 8a08b629e0..bfb0dbaa17 100644 --- a/app/encoding.go +++ b/app/encoding.go @@ -3,7 +3,7 @@ package gaia import ( "github.com/cosmos/cosmos-sdk/std" - "github.com/cosmos/gaia/v10/app/params" + "github.com/cosmos/gaia/v11/app/params" ) // MakeTestEncodingConfig creates an EncodingConfig for testing. This function diff --git a/app/helpers/test_helpers.go b/app/helpers/test_helpers.go index 5de0f6228f..748927ff4e 100644 --- a/app/helpers/test_helpers.go +++ b/app/helpers/test_helpers.go @@ -22,7 +22,7 @@ import ( tmtypes "github.com/tendermint/tendermint/types" dbm "github.com/tendermint/tm-db" - gaiaapp "github.com/cosmos/gaia/v10/app" + gaiaapp "github.com/cosmos/gaia/v11/app" ) // SimAppChainID hardcoded chainID for simulation diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index adbd254749..70a0f765cc 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -22,7 +22,7 @@ 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" - providertypes "github.com/cosmos/interchain-security/x/ccv/provider/types" + providertypes "github.com/cosmos/interchain-security/v2/x/ccv/provider/types" tmos "github.com/tendermint/tendermint/libs/os" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" @@ -53,15 +53,15 @@ import ( porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types" ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host" ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper" - ibcprovider "github.com/cosmos/interchain-security/x/ccv/provider" - ibcproviderkeeper "github.com/cosmos/interchain-security/x/ccv/provider/keeper" + ibcprovider "github.com/cosmos/interchain-security/v2/x/ccv/provider" + ibcproviderkeeper "github.com/cosmos/interchain-security/v2/x/ccv/provider/keeper" liquiditykeeper "github.com/gravity-devs/liquidity/x/liquidity/keeper" liquiditytypes "github.com/gravity-devs/liquidity/x/liquidity/types" "github.com/strangelove-ventures/packet-forward-middleware/v4/router" routerkeeper "github.com/strangelove-ventures/packet-forward-middleware/v4/router/keeper" routertypes "github.com/strangelove-ventures/packet-forward-middleware/v4/router/types" - "github.com/cosmos/gaia/v10/x/globalfee" + "github.com/cosmos/gaia/v11/x/globalfee" // unnamed import of statik for swagger UI support _ "github.com/cosmos/cosmos-sdk/client/docs/statik" @@ -285,10 +285,12 @@ func NewAppKeeper( appKeepers.SlashingKeeper, appKeepers.AccountKeeper, appKeepers.EvidenceKeeper, + appKeepers.DistrKeeper, + appKeepers.BankKeeper, authtypes.FeeCollectorName, ) - appKeepers.ProviderModule = ibcprovider.NewAppModule(&appKeepers.ProviderKeeper) + appKeepers.ProviderModule = ibcprovider.NewAppModule(&appKeepers.ProviderKeeper, appKeepers.GetSubspace(providertypes.ModuleName)) govRouter := govtypes.NewRouter() govRouter. diff --git a/app/keepers/keys.go b/app/keepers/keys.go index 80e338b532..d3b5d0db1d 100644 --- a/app/keepers/keys.go +++ b/app/keepers/keys.go @@ -19,7 +19,7 @@ import ( icahosttypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types" ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host" - providertypes "github.com/cosmos/interchain-security/x/ccv/provider/types" + providertypes "github.com/cosmos/interchain-security/v2/x/ccv/provider/types" liquiditytypes "github.com/gravity-devs/liquidity/x/liquidity/types" routertypes "github.com/strangelove-ventures/packet-forward-middleware/v4/router/types" ) diff --git a/app/modules.go b/app/modules.go index 38d84bc3fc..024b9c562e 100644 --- a/app/modules.go +++ b/app/modules.go @@ -45,28 +45,29 @@ import ( ibc "github.com/cosmos/ibc-go/v4/modules/core" ibcclientclient "github.com/cosmos/ibc-go/v4/modules/core/02-client/client" ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host" - ibcprovider "github.com/cosmos/interchain-security/x/ccv/provider" - ibcproviderclient "github.com/cosmos/interchain-security/x/ccv/provider/client" - providertypes "github.com/cosmos/interchain-security/x/ccv/provider/types" + ibcprovider "github.com/cosmos/interchain-security/v2/x/ccv/provider" + ibcproviderclient "github.com/cosmos/interchain-security/v2/x/ccv/provider/client" + providertypes "github.com/cosmos/interchain-security/v2/x/ccv/provider/types" "github.com/gravity-devs/liquidity/x/liquidity" liquiditytypes "github.com/gravity-devs/liquidity/x/liquidity/types" "github.com/strangelove-ventures/packet-forward-middleware/v4/router" routertypes "github.com/strangelove-ventures/packet-forward-middleware/v4/router/types" - gaiaappparams "github.com/cosmos/gaia/v10/app/params" - "github.com/cosmos/gaia/v10/x/globalfee" + gaiaappparams "github.com/cosmos/gaia/v11/app/params" + "github.com/cosmos/gaia/v11/x/globalfee" ) var maccPerms = map[string][]string{ - authtypes.FeeCollectorName: nil, - distrtypes.ModuleName: nil, - icatypes.ModuleName: nil, - minttypes.ModuleName: {authtypes.Minter}, - stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, - stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, - govtypes.ModuleName: {authtypes.Burner}, - liquiditytypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + authtypes.FeeCollectorName: nil, + distrtypes.ModuleName: nil, + icatypes.ModuleName: nil, + minttypes.ModuleName: {authtypes.Minter}, + stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, + stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, + govtypes.ModuleName: {authtypes.Burner}, + liquiditytypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + providertypes.ConsumerRewardsPool: nil, } // ModuleBasics defines the module BasicManager is in charge of setting up basic, @@ -284,6 +285,14 @@ func orderInitBlockers() []string { paramstypes.ModuleName, upgradetypes.ModuleName, vestingtypes.ModuleName, + // The globalfee module should ideally be initialized before the genutil module in theory: + // The globalfee antehandler performs checks in DeliverTx, which is called by gentx. + // When the global fee > 0, gentx needs to pay the fee. However, this is not expected, + // (in our case, the global fee is initialized with an empty value, which might not be a problem + // if the globalfee in genesis is not changed.) + // To resolve this issue, we should initialize the globalfee module after genutil, ensuring that the global + // min fee is empty when gentx is called. + // For more details, please refer to the following link: https://github.com/cosmos/gaia/issues/2489 globalfee.ModuleName, providertypes.ModuleName, } diff --git a/app/sim/sim_state.go b/app/sim/sim_state.go index 4b828f03ca..a71a0bf5ed 100644 --- a/app/sim/sim_state.go +++ b/app/sim/sim_state.go @@ -11,7 +11,7 @@ import ( tmjson "github.com/tendermint/tendermint/libs/json" tmtypes "github.com/tendermint/tendermint/types" - gaia "github.com/cosmos/gaia/v10/app" + gaia "github.com/cosmos/gaia/v11/app" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" diff --git a/app/sim/sim_utils.go b/app/sim/sim_utils.go index 3e910a43c5..e672240d97 100644 --- a/app/sim/sim_utils.go +++ b/app/sim/sim_utils.go @@ -8,7 +8,7 @@ import ( "github.com/tendermint/tendermint/libs/log" dbm "github.com/tendermint/tm-db" - gaia "github.com/cosmos/gaia/v10/app" + gaia "github.com/cosmos/gaia/v11/app" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/simapp/helpers" diff --git a/app/sim_test.go b/app/sim_test.go index 240d89cec2..c14195b37b 100644 --- a/app/sim_test.go +++ b/app/sim_test.go @@ -16,10 +16,10 @@ import ( "github.com/tendermint/tendermint/libs/log" dbm "github.com/tendermint/tm-db" - gaia "github.com/cosmos/gaia/v10/app" - "github.com/cosmos/gaia/v10/app/helpers" - "github.com/cosmos/gaia/v10/app/params" - "github.com/cosmos/gaia/v10/app/sim" + gaia "github.com/cosmos/gaia/v11/app" + "github.com/cosmos/gaia/v11/app/helpers" + "github.com/cosmos/gaia/v11/app/params" + "github.com/cosmos/gaia/v11/app/sim" ) func init() { diff --git a/app/upgrades/types.go b/app/upgrades/types.go index adff1558b1..a4b8c3ac3e 100644 --- a/app/upgrades/types.go +++ b/app/upgrades/types.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - "github.com/cosmos/gaia/v10/app/keepers" + "github.com/cosmos/gaia/v11/app/keepers" ) // Upgrade defines a struct containing necessary fields that a SoftwareUpgradeProposal diff --git a/app/upgrades/v10/constants.go b/app/upgrades/v10/constants.go index 2bd6941c96..c5884c1c0d 100644 --- a/app/upgrades/v10/constants.go +++ b/app/upgrades/v10/constants.go @@ -1,7 +1,7 @@ package v10 import ( - "github.com/cosmos/gaia/v10/app/upgrades" + "github.com/cosmos/gaia/v11/app/upgrades" ) const ( diff --git a/app/upgrades/v10/upgrades.go b/app/upgrades/v10/upgrades.go index d4fdb58159..908561bf1e 100644 --- a/app/upgrades/v10/upgrades.go +++ b/app/upgrades/v10/upgrades.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - "github.com/cosmos/gaia/v10/app/keepers" + "github.com/cosmos/gaia/v11/app/keepers" ) func CreateUpgradeHandler( diff --git a/app/upgrades/v11/constants.go b/app/upgrades/v11/constants.go new file mode 100644 index 0000000000..13055c67ee --- /dev/null +++ b/app/upgrades/v11/constants.go @@ -0,0 +1,15 @@ +package v11 + +import ( + "github.com/cosmos/gaia/v11/app/upgrades" +) + +const ( + // UpgradeName defines the on-chain upgrade name. + UpgradeName = "v11" +) + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + CreateUpgradeHandler: CreateUpgradeHandler, +} diff --git a/app/upgrades/v11/upgrades.go b/app/upgrades/v11/upgrades.go new file mode 100644 index 0000000000..f01ba40b2b --- /dev/null +++ b/app/upgrades/v11/upgrades.go @@ -0,0 +1,27 @@ +package v11 + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + + "github.com/cosmos/gaia/v11/app/keepers" +) + +func CreateUpgradeHandler( + mm *module.Manager, + configurator module.Configurator, + keepers *keepers.AppKeepers, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + ctx.Logger().Info("Starting module migrations...") + + vm, err := mm.RunMigrations(ctx, configurator, vm) + if err != nil { + return vm, err + } + + ctx.Logger().Info("Upgrade complete") + return vm, err + } +} diff --git a/app/upgrades/v7/constants.go b/app/upgrades/v7/constants.go index 7cb75e521b..63fbf3619f 100644 --- a/app/upgrades/v7/constants.go +++ b/app/upgrades/v7/constants.go @@ -4,7 +4,7 @@ import ( store "github.com/cosmos/cosmos-sdk/store/types" icahosttypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types" - "github.com/cosmos/gaia/v10/app/upgrades" + "github.com/cosmos/gaia/v11/app/upgrades" ) const ( diff --git a/app/upgrades/v7/upgrades.go b/app/upgrades/v7/upgrades.go index 0481db2450..98df63b913 100644 --- a/app/upgrades/v7/upgrades.go +++ b/app/upgrades/v7/upgrades.go @@ -9,7 +9,7 @@ import ( icahosttypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types" icatypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/types" - "github.com/cosmos/gaia/v10/app/keepers" + "github.com/cosmos/gaia/v11/app/keepers" ) func CreateUpgradeHandler( diff --git a/app/upgrades/v8/constants.go b/app/upgrades/v8/constants.go index 2b9b702eb6..a6c22fa9df 100644 --- a/app/upgrades/v8/constants.go +++ b/app/upgrades/v8/constants.go @@ -3,8 +3,8 @@ package v8 import ( store "github.com/cosmos/cosmos-sdk/store/types" - "github.com/cosmos/gaia/v10/app/upgrades" - "github.com/cosmos/gaia/v10/x/globalfee" + "github.com/cosmos/gaia/v11/app/upgrades" + "github.com/cosmos/gaia/v11/x/globalfee" ) const ( diff --git a/app/upgrades/v8/upgrades.go b/app/upgrades/v8/upgrades.go index f562ce5b41..85627030a3 100644 --- a/app/upgrades/v8/upgrades.go +++ b/app/upgrades/v8/upgrades.go @@ -13,7 +13,7 @@ import ( icatypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/types" ibcchanneltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" - "github.com/cosmos/gaia/v10/app/keepers" + "github.com/cosmos/gaia/v11/app/keepers" ) func FixBankMetadata(ctx sdk.Context, keepers *keepers.AppKeepers) error { diff --git a/app/upgrades/v9/constants.go b/app/upgrades/v9/constants.go index 5f57de4480..544fa0d971 100644 --- a/app/upgrades/v9/constants.go +++ b/app/upgrades/v9/constants.go @@ -2,9 +2,9 @@ package v9 import ( store "github.com/cosmos/cosmos-sdk/store/types" - ccvprovider "github.com/cosmos/interchain-security/x/ccv/provider/types" + ccvprovider "github.com/cosmos/interchain-security/v2/x/ccv/provider/types" - "github.com/cosmos/gaia/v10/app/upgrades" + "github.com/cosmos/gaia/v11/app/upgrades" ) const ( diff --git a/app/upgrades/v9/upgrades.go b/app/upgrades/v9/upgrades.go index 8d4c950c68..420e99678e 100644 --- a/app/upgrades/v9/upgrades.go +++ b/app/upgrades/v9/upgrades.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - "github.com/cosmos/gaia/v10/app/keepers" + "github.com/cosmos/gaia/v11/app/keepers" ) func CreateUpgradeHandler( diff --git a/cmd/gaiad/cmd/bech32_convert.go b/cmd/gaiad/cmd/bech32_convert.go index 3b54ce42c7..ab16076a39 100644 --- a/cmd/gaiad/cmd/bech32_convert.go +++ b/cmd/gaiad/cmd/bech32_convert.go @@ -3,7 +3,7 @@ package cmd import ( "fmt" - addressutil "github.com/cosmos/gaia/v10/pkg/address" + addressutil "github.com/cosmos/gaia/v11/pkg/address" "github.com/spf13/cobra" ) diff --git a/cmd/gaiad/cmd/root.go b/cmd/gaiad/cmd/root.go index f727db37ae..2fe5502a75 100644 --- a/cmd/gaiad/cmd/root.go +++ b/cmd/gaiad/cmd/root.go @@ -30,8 +30,8 @@ import ( "github.com/tendermint/tendermint/libs/log" dbm "github.com/tendermint/tm-db" - gaia "github.com/cosmos/gaia/v10/app" - "github.com/cosmos/gaia/v10/app/params" + gaia "github.com/cosmos/gaia/v11/app" + "github.com/cosmos/gaia/v11/app/params" ) // NewRootCmd creates a new root command for simd. It is called once in the diff --git a/cmd/gaiad/cmd/root_test.go b/cmd/gaiad/cmd/root_test.go index 3bf150175c..0ce64a1b92 100644 --- a/cmd/gaiad/cmd/root_test.go +++ b/cmd/gaiad/cmd/root_test.go @@ -6,8 +6,8 @@ import ( svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" "github.com/stretchr/testify/require" - app "github.com/cosmos/gaia/v10/app" - "github.com/cosmos/gaia/v10/cmd/gaiad/cmd" + app "github.com/cosmos/gaia/v11/app" + "github.com/cosmos/gaia/v11/cmd/gaiad/cmd" ) func TestRootCmdConfig(t *testing.T) { diff --git a/cmd/gaiad/main.go b/cmd/gaiad/main.go index 40fb174d1c..fb48abaf64 100644 --- a/cmd/gaiad/main.go +++ b/cmd/gaiad/main.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" - app "github.com/cosmos/gaia/v10/app" - "github.com/cosmos/gaia/v10/cmd/gaiad/cmd" + app "github.com/cosmos/gaia/v11/app" + "github.com/cosmos/gaia/v11/cmd/gaiad/cmd" ) func main() { diff --git a/contrib/generate_release_note/main.go b/contrib/generate_release_note/main.go index e241f99d75..6bcdfedf67 100644 --- a/contrib/generate_release_note/main.go +++ b/contrib/generate_release_note/main.go @@ -30,7 +30,7 @@ func main() { } note := strings.Builder{} - note.WriteString(fmt.Sprintf("#Gaia %s Release Notes\n", args[1])) + note.WriteString(fmt.Sprintf("# Gaia %s Release Notes\n", args[1])) note.WriteString(changelog) note.WriteString("```\n") note.Write(buildReport) diff --git a/contrib/scripts/test_upgrade.sh b/contrib/scripts/upgrade_test_scripts/test_upgrade.sh similarity index 100% rename from contrib/scripts/test_upgrade.sh rename to contrib/scripts/upgrade_test_scripts/test_upgrade.sh diff --git a/contrib/scripts/run-gaia-v9.sh b/contrib/scripts/upgrade_test_scripts/v10/run_gaia_v9.sh old mode 100755 new mode 100644 similarity index 99% rename from contrib/scripts/run-gaia-v9.sh rename to contrib/scripts/upgrade_test_scripts/v10/run_gaia_v9.sh index 52267a211b..df666d2cd9 --- a/contrib/scripts/run-gaia-v9.sh +++ b/contrib/scripts/upgrade_test_scripts/v10/run_gaia_v9.sh @@ -71,4 +71,3 @@ pwd ls $NODE_HOME $COSMOVISOR run start --home $NODE_HOME --x-crisis-skip-assert-invariants > v9.out 2>&1 & - diff --git a/contrib/scripts/upgrade_test_scripts/v10/run_upgrade_commands_v10.sh b/contrib/scripts/upgrade_test_scripts/v10/run_upgrade_commands_v10.sh new file mode 100644 index 0000000000..ceaa4fd7a0 --- /dev/null +++ b/contrib/scripts/upgrade_test_scripts/v10/run_upgrade_commands_v10.sh @@ -0,0 +1,76 @@ +#!/bin/sh + +set -o errexit -o nounset + +UPGRADE_HEIGHT=$1 + +if [ -z "$1" ]; then +echo "Need to add an upgrade height" +exit 1 +fi + +NODE_HOME=$(realpath ./build/.gaia) + +echo "NODE_HOME = ${NODE_HOME}" + +BINARY=$NODE_HOME/cosmovisor/genesis/bin/gaiad +echo "BINARY = ${BINARY}" + +$BINARY version + +USER_MNEMONIC="abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon art" +CHAINID=cosmoshub-4 + +if test -f "$BINARY"; then + +echo "wait 10 seconds for blockchain to start" +sleep 10 + +$BINARY config chain-id $CHAINID --home $NODE_HOME +$BINARY config output json --home $NODE_HOME +$BINARY config keyring-backend test --home $NODE_HOME +$BINARY config --home $NODE_HOME + + +key=$($BINARY keys show val --home $NODE_HOME) +if [ -z "$key" ]; then +echo $USER_MNEMONIC | $BINARY --home $NODE_HOME keys add val --recover --keyring-backend=test +fi + + +echo "\n" +echo "Submitting proposal... \n" +$BINARY tx gov submit-proposal software-upgrade v10 \ +--title v10 \ +--deposit 10000000uatom \ +--upgrade-height $UPGRADE_HEIGHT \ +--upgrade-info "upgrade to v10" \ +--description "upgrade to v10" \ +--gas auto \ +--fees 400uatom \ +--from val \ +--keyring-backend test \ +--chain-id $CHAINID \ +--home $NODE_HOME \ +--node tcp://localhost:26657 \ +--yes +echo "Done \n" + +sleep 6 +echo "Casting vote... \n" + +$BINARY tx gov vote 1 yes \ +--from val \ +--keyring-backend test \ +--chain-id $CHAINID \ +--home $NODE_HOME \ +--gas auto \ +--fees 400uatom \ +--node tcp://localhost:26657 \ +--yes + +echo "Done \n" + +else +echo "Please build gaia v9 and move to ./build/gaiad9" +fi diff --git a/contrib/scripts/upgrade_test_scripts/v11/run_gaia_v10.sh b/contrib/scripts/upgrade_test_scripts/v11/run_gaia_v10.sh new file mode 100755 index 0000000000..69b183e9cd --- /dev/null +++ b/contrib/scripts/upgrade_test_scripts/v11/run_gaia_v10.sh @@ -0,0 +1,74 @@ +#!/bin/sh + +set -o errexit -o nounset + +NODE_HOME=$(realpath ./build/.gaia) +echo "NODE_HOME = ${NODE_HOME}" +BINARY=$NODE_HOME/cosmovisor/genesis/bin/gaiad +echo "BINARY = ${BINARY}" +CHAINID=cosmoshub-4 + +USER_MNEMONIC="abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon art" + +if ! test -f "./build/gaiad10"; then + echo "gaiad v10 does not exist" + exit +fi + + +rm -rf ./build/.gaia + +mkdir -p "$NODE_HOME"/cosmovisor/genesis/bin +cp ./build/gaiad10 "$NODE_HOME"/cosmovisor/genesis/bin/gaiad +$BINARY init upgrader --chain-id $CHAINID --home "$NODE_HOME" + + +if ! test -f "./build/gaiad11"; then + echo "gaiad v11 does not exist" + exit +fi + +mkdir -p "$NODE_HOME"/cosmovisor/upgrades/v11/bin +cp ./build/gaiad11 "$NODE_HOME"/cosmovisor/upgrades/v11/bin/gaiad + +GOPATH=$(go env GOPATH) + +export DAEMON_NAME=gaiad +export DAEMON_HOME=$NODE_HOME +COSMOVISOR=$GOPATH/bin/cosmovisor + + +$BINARY config chain-id $CHAINID --home $NODE_HOME +$BINARY config keyring-backend test --home $NODE_HOME +tmp=$(mktemp) + +# add bank part of genesis +jq --argjson foo "$(jq -c '.' contrib/denom.json)" '.app_state.bank.denom_metadata = $foo' $NODE_HOME/config/genesis.json > "$tmp" && mv "$tmp" $NODE_HOME/config/genesis.json + +# replace default stake token with uatom +sed -i -e 's/stake/uatom/g' $NODE_HOME/config/genesis.json +# min deposition amount (this one isn't working) +sed -i -e 's%"amount": "10000000",%"amount": "1",%g' $NODE_HOME/config/genesis.json +# min voting power that a proposal requires in order to be a valid proposal +sed -i -e 's%"quorum": "0.334000000000000000",%"quorum": "0.000000000000000001",%g' $NODE_HOME/config/genesis.json +# the minimum proportion of "yes" votes requires for the proposal to pass +sed -i -e 's%"threshold": "0.500000000000000000",%"threshold": "0.000000000000000001",%g' $NODE_HOME/config/genesis.json +# voting period to 30s +sed -i -e 's%"voting_period": "172800s"%"voting_period": "30s"%g' $NODE_HOME/config/genesis.json + +echo $USER_MNEMONIC | $BINARY --home $NODE_HOME keys add val --recover --keyring-backend=test +$BINARY add-genesis-account val 10000000000000000000000000uatom --home $NODE_HOME --keyring-backend test +$BINARY gentx val 1000000000uatom --home $NODE_HOME --chain-id $CHAINID +$BINARY collect-gentxs --home $NODE_HOME + +sed -i.bak'' 's/minimum-gas-prices = ""/minimum-gas-prices = "0uatom"/' $NODE_HOME/config/app.toml + +perl -i~ -0777 -pe 's/# Enable defines if the API server should be enabled. +enable = false/# Enable defines if the API server should be enabled. +enable = true/g' $NODE_HOME/config/app.toml + +pwd +ls $NODE_HOME + +$COSMOVISOR run start --home $NODE_HOME --x-crisis-skip-assert-invariants > v10.out 2>&1 & + diff --git a/contrib/scripts/run-upgrade-commands-v10.sh b/contrib/scripts/upgrade_test_scripts/v11/run_upgrade_commands_v11.sh similarity index 91% rename from contrib/scripts/run-upgrade-commands-v10.sh rename to contrib/scripts/upgrade_test_scripts/v11/run_upgrade_commands_v11.sh index 26fb52b07e..8170378e57 100755 --- a/contrib/scripts/run-upgrade-commands-v10.sh +++ b/contrib/scripts/upgrade_test_scripts/v11/run_upgrade_commands_v11.sh @@ -40,12 +40,12 @@ if test -f "$BINARY"; then echo "\n" echo "Submitting proposal... \n" - $BINARY tx gov submit-proposal software-upgrade v10 \ - --title v10 \ + $BINARY tx gov submit-proposal software-upgrade v11 \ + --title v11 \ --deposit 10000000uatom \ --upgrade-height $UPGRADE_HEIGHT \ - --upgrade-info "upgrade to v10" \ - --description "upgrade to v10" \ + --upgrade-info "upgrade to v11" \ + --description "upgrade to v11" \ --gas auto \ --fees 400uatom \ --from val \ diff --git a/contrib/scripts/test_migration.sh b/contrib/scripts/upgrade_test_scripts/v11/test_migration_v11.sh similarity index 100% rename from contrib/scripts/test_migration.sh rename to contrib/scripts/upgrade_test_scripts/v11/test_migration_v11.sh diff --git a/contrib/scripts/run-gaia-v7.sh b/contrib/scripts/upgrade_test_scripts/v8/run-gaia-v7.sh similarity index 100% rename from contrib/scripts/run-gaia-v7.sh rename to contrib/scripts/upgrade_test_scripts/v8/run-gaia-v7.sh diff --git a/contrib/scripts/run-upgrade-commands-v8-rho.sh b/contrib/scripts/upgrade_test_scripts/v8/run-upgrade-commands-v8-rho.sh similarity index 100% rename from contrib/scripts/run-upgrade-commands-v8-rho.sh rename to contrib/scripts/upgrade_test_scripts/v8/run-upgrade-commands-v8-rho.sh diff --git a/contrib/scripts/run-gaia-v8.sh b/contrib/scripts/upgrade_test_scripts/v9/run-gaia-v8.sh similarity index 100% rename from contrib/scripts/run-gaia-v8.sh rename to contrib/scripts/upgrade_test_scripts/v9/run-gaia-v8.sh diff --git a/contrib/scripts/run-upgrade-commands.sh b/contrib/scripts/upgrade_test_scripts/v9/run-upgrade-commands.sh similarity index 100% rename from contrib/scripts/run-upgrade-commands.sh rename to contrib/scripts/upgrade_test_scripts/v9/run-upgrade-commands.sh diff --git a/contrib/testnets/test_platform/templates/app.toml b/contrib/testnets/test_platform/templates/app.toml index 5537acf053..3005afa73c 100644 --- a/contrib/testnets/test_platform/templates/app.toml +++ b/contrib/testnets/test_platform/templates/app.toml @@ -36,15 +36,15 @@ halt-time = 0 # MinRetainBlocks defines the minimum block height offset from the current # block being committed, such that all blocks past this offset are pruned -# from Tendermint. It is used as part of the process of determining the +# from CometBFT. It is used as part of the process of determining the # ResponseCommit.RetainHeight value during ABCI Commit. A value of 0 indicates # that no blocks should be pruned. # -# This configuration value is only responsible for pruning Tendermint blocks. +# This configuration value is only responsible for pruning CometBFT blocks. # It has no bearing on application state pruning which is determined by the # "pruning-*" configurations. # -# Note: Tendermint block pruning is dependant on this parameter in conunction +# Note: CometBFT block pruning is dependant on this parameter in conunction # with the unbonding (safety threshold) period, state pruning and state sync # snapshot parameters to determine the correct minimum value of # ResponseCommit.RetainHeight. @@ -54,7 +54,7 @@ min-retain-blocks = 0 inter-block-cache = true # IndexEvents defines the set of events in the form {eventType}.{attributeKey}, -# which informs Tendermint what to index. If empty, all events will be indexed. +# which informs CometBFT what to index. If empty, all events will be indexed. # # Example: # ["message.sender", "message.recipient"] @@ -113,13 +113,13 @@ address = ":" # MaxOpenConnections defines the number of maximum open connections. max-open-connections = 1000 -# RPCReadTimeout defines the Tendermint RPC read timeout (in seconds). +# RPCReadTimeout defines the CometBFT RPC read timeout (in seconds). rpc-read-timeout = 10 -# RPCWriteTimeout defines the Tendermint RPC write timeout (in seconds). +# RPCWriteTimeout defines the CometBFT RPC write timeout (in seconds). rpc-write-timeout = 0 -# RPCMaxBodyBytes defines the Tendermint maximum response body (in bytes). +# RPCMaxBodyBytes defines the CometBFT maximum response body (in bytes). rpc-max-body-bytes = 1000000 # EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk). diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 5024eedc2a..7dd794516e 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -52,9 +52,13 @@ module.exports = { { title: "REST API Spec", path: "https://cosmos.network/rpc/" - } + }, + { + title: "REST API Spec ABC", + path: "https://cosmos.network/rpc/" + } ] - } + } ] }, gutter: { @@ -78,10 +82,6 @@ module.exports = { service: "twitter", url: "https://twitter.com/cosmos" }, - { - service: "linkedin", - url: "https://www.linkedin.com/company/tendermint/" - }, { service: "github", url: "https://github.com/cosmos/gaia" @@ -100,23 +100,12 @@ module.exports = { } ], smallprint: - "This website is maintained by Tendermint Inc. The contents and opinions of this website are those of Tendermint Inc.", + "This website is maintained by Interchain Foundation/Informal Systems. The contents and opinions of this website are those of Interchain Foundation/Informal Systems.", links: [ { title: "Documentation", children: [ - { - title: "Cosmos SDK", - url: "https://docs.cosmos.network" - }, - { - title: "Cosmos Hub", - url: "https://hub.cosmos.network/" - }, - { - title: "Tendermint Core", - url: "https://docs.tendermint.com/" - } + ] }, { diff --git a/docs/DOCS_README.md b/docs/DOCS_README.md index 6bc1825788..ef54dc1de8 100644 --- a/docs/DOCS_README.md +++ b/docs/DOCS_README.md @@ -94,11 +94,6 @@ To build documentation as a static website run `npm run build`. You will find th We are using [Algolia](https://www.algolia.com) to power full-text search. This uses a public API search-only key in the `config.js` as well as a [cosmos_network.json](https://github.com/algolia/docsearch-configs/blob/master/configs/cosmos_network.json) configuration file that we can update with PRs. -## Consistency - -Because the build processes are identical (as is the information contained herein), this file should be kept in sync as -much as possible with its [counterpart in the Tendermint Core repo](https://github.com/tendermint/tendermint/blob/master/docs/DOCS_README.md). - ### Update and Build the RPC docs 1. Execute the following command at the root directory to install the swagger-ui generate tool. diff --git a/docs/README.md b/docs/README.md index 19d503ab37..420d6daaa1 100644 --- a/docs/README.md +++ b/docs/README.md @@ -25,7 +25,7 @@ Welcome to the documentation of the **Cosmos Hub application: `gaia`**. ## Setup Your Own `gaia` Testnet -- [Setup your own `gaia` testnet](https://github.com/cosmos/testnets/tree/master/local/previous-local-testnets/theta) +- [Setup your own `gaia` testnet](https://github.com/cosmos/testnets/tree/master/local/previous-local-testnets/v7-theta) ## Additional Resources diff --git a/docs/delegators/delegator-faq.md b/docs/delegators/delegator-faq.md index e5adeff09c..e643b4d716 100644 --- a/docs/delegators/delegator-faq.md +++ b/docs/delegators/delegator-faq.md @@ -7,7 +7,7 @@ title: Delegator FAQ ## What is a delegator? -People that cannot or do not want to operate [validator nodes](../validators/overview.md) can still participate in the staking process as delegators. Indeed, validators are not chosen based on their self-delegated stake but based on their total stake, which is the sum of their self-delegated stake and of the stake that is delegated to them. This is an important property, as it makes delegators a safeguard against validators that exhibit bad behavior. If a validator misbehaves, their delegators will move their Atoms away from them, thereby reducing their stake. Eventually, if a validator's stake falls under the top 175 addresses with highest stake, they will exit the validator set. +People that cannot or do not want to operate [validator nodes](../validators/overview.md) can still participate in the staking process as delegators. Indeed, validators are not chosen based on their self-delegated stake but based on their total stake, which is the sum of their self-delegated stake and of the stake that is delegated to them. This is an important property, as it makes delegators a safeguard against validators that exhibit bad behavior. If a validator misbehaves, their delegators will move their Atoms away from them, thereby reducing their stake. Eventually, if a validator's stake falls under the top 180 addresses with highest stake, they will exit the validator set. **Delegators share the revenue of their validators, but they also share the risks.** In terms of revenue, validators and delegators differ in that validators can apply a commission on the revenue that goes to their delegator before it is distributed. This commission is known to delegators beforehand and can only change according to predefined constraints (see [section](#choosing-a-validator) below). In terms of risk, delegators' Atoms can be slashed if their validator misbehaves. For more, see [Risks](#risks) section. diff --git a/docs/es/gaia-tutorials/installation.md b/docs/es/gaia-tutorials/installation.md index bf9246f360..6cc0a5019a 100644 --- a/docs/es/gaia-tutorials/installation.md +++ b/docs/es/gaia-tutorials/installation.md @@ -83,7 +83,7 @@ Las etiquetas (_tags_) para la construcción indican opciones especiales que deb ## Workflow para el desarrollador -Para probar cualquier cambio hecho en el SDK o Tendermint, se debe agregar una cláusula de `replace` en `go.mod` proporcionando la ruta de entrada correcta. +Para probar cualquier cambio hecho en el SDK o CometBFT, se debe agregar una cláusula de `replace` en `go.mod` proporcionando la ruta de entrada correcta. - Realice los cambios apropiados - Añada `replace github.com/cosmos/cosmos-sdk => /ruta/a/clon/cosmos-sdk` en `go.mod` diff --git a/docs/es/gaia-tutorials/join-mainnet.md b/docs/es/gaia-tutorials/join-mainnet.md index af65e00a3d..a39324561c 100644 --- a/docs/es/gaia-tutorials/join-mainnet.md +++ b/docs/es/gaia-tutorials/join-mainnet.md @@ -82,7 +82,8 @@ Si estas semillas no funcionan, puedes encontrar más _seeds_ y _peers_ persiste También puedes preguntar por _peers_ en el [canal de Validadores de Riot](https://riot.im/app/#/room/#cosmos-validators:matrix.org) -Para más información acerca de seeds y peers, puede leer [este enlace](https://docs.tendermint.com/master/spec/p2p/peer.html) +Para más información acerca de seeds y peers, puede leer [este enlace](https://github.com/cometbft/cometbft/blob/v0.34.x/spec/p2p/peer.md) + ## Nota sobre el Fee y el Gas diff --git a/docs/getting-started/quickstart.md b/docs/getting-started/quickstart.md index d6ce69131a..6d00552608 100644 --- a/docs/getting-started/quickstart.md +++ b/docs/getting-started/quickstart.md @@ -27,7 +27,7 @@ For reference, the list of `rpc_servers` and `persistent` peers can be found in ```bash # Build gaiad binary and initialize chain cd $HOME -git clone -b v9.0.0 https://github.com/cosmos/gaia --depth=1 +git clone -b v10.0.0 https://github.com/cosmos/gaia --depth=1 cd gaiad make install gaiad init CUSTOM_MONIKER --chain-id cosmoshub-4 diff --git a/docs/governance/README.md b/docs/governance/README.md index 0eb0ed0b9b..737f8791c6 100644 --- a/docs/governance/README.md +++ b/docs/governance/README.md @@ -19,7 +19,7 @@ Cosmos governance is driven by the Cosmos community, and much of the documentati Governance discussions happens in a number of places moderated by diverse community members, including: - [Forum](http://forum.cosmos.network/) -- [Discord](https://discord.gg/W8trcGV) +- [Discord](https://discord.com/invite/cosmosnetwork) - [Twitter](https://twitter.com/CosmosGov) - [Reddit](http://reddit.com/r/cosmosnetwork) - anywhere else you might interact with members of the Cosmos community! diff --git a/docs/governance/best-practices.md b/docs/governance/best-practices.md index 6d87c8aec5..29cde5755a 100644 --- a/docs/governance/best-practices.md +++ b/docs/governance/best-practices.md @@ -155,7 +155,7 @@ See the [submitting guide](./submitting.md) for more on submitting proposals. ### The Deposit Period -The deposit period currently lasts 14 days. If you submitted your transaction with the minimum deposit (64 ATOM), your proposal will immediately enter the voting period. If you didn't submit the minimum deposit amount (currently 64 ATOM), then this may be an opportunity for others to show their support by contributing (and risking) their ATOMs as a bond for your proposal. You can request contributions openly and also contact stakeholders directly (particularly stakeholders who are enthusiastic about your proposal). Remember that each contributor is risking their funds, and you can [read more about the conditions for burning deposits here](./process.md#burned-deposits). +The deposit period currently lasts 14 days. If you submitted your transaction with the minimum deposit (250 ATOM), your proposal will immediately enter the voting period. If you didn't submit the minimum deposit amount (currently 250 ATOM), then this may be an opportunity for others to show their support by contributing (and risking) their ATOMs as a bond for your proposal. You can request contributions openly and also contact stakeholders directly (particularly stakeholders who are enthusiastic about your proposal). Remember that each contributor is risking their funds, and you can [read more about the conditions for burning deposits here](./process.md#burned-deposits). This is a stage where proposals may begin to get broader attention. Some block explorers display proposals in the deposit period, while others don't show them until they hit voting period. diff --git a/docs/governance/process.md b/docs/governance/process.md index dfe235e54d..8d9ed993d9 100644 --- a/docs/governance/process.md +++ b/docs/governance/process.md @@ -6,7 +6,7 @@ order: 2 ## Governance Parameters Several of the numbers involved in governance are parameters and can thus be changed by passing a parameter change proposal. -- Minimum deposit: 64 ATOM +- Minimum deposit: 250 ATOM - Maximum deposit period: 14 days - Voting period: 14 days - Quorum: 40% of participating voting power @@ -16,12 +16,12 @@ Several of the numbers involved in governance are parameters and can thus be cha ## 1. Deposit Period -The deposit period lasts either 14 days or until the proposal deposit totals 64 ATOMs, whichever happens first. +The deposit period lasts either 14 days or until the proposal deposit totals 250 ATOMs, whichever happens first. ### Deposits -Prior to a governance proposal entering the voting period (i.e., for the proposal to be voted upon), there must be at least a minimum number of ATOMs deposited (64). Anyone may contribute to this deposit, though it is usually filled by the proposal maker. Deposits of passed and failed proposals are returned to the contributors. +Prior to a governance proposal entering the voting period (i.e., for the proposal to be voted upon), there must be at least a minimum number of ATOMs deposited (250). Anyone may contribute to this deposit, though it is usually filled by the proposal maker. Deposits of passed and failed proposals are returned to the contributors. -In the past, different people have considered contributions amounts differently. There is some consensus that this should be a personal choice. There is also some consensus that this can be an opportunity for supporters to signal their support by adding to the deposit amount, so a proposer may choose to leave contribution room (i.e., a deposit below 64 ATOMs) so that others may participate. It is important to remember that any contributed ATOMs are at risk of being burned. +In the past, different people have considered contributions amounts differently. There is some consensus that this should be a personal choice. There is also some consensus that this can be an opportunity for supporters to signal their support by adding to the deposit amount, so a proposer may choose to leave contribution room (i.e., a deposit below 250 ATOMs) so that others may participate. It is important to remember that any contributed ATOMs are at risk of being burned. ### Burned deposits @@ -46,7 +46,7 @@ Voting 'NoWithVeto' has no immediate additional financial cost to the voter - yo There are four criteria: -1. Deposit is filled: A minimum deposit of 64 ATOM is required for the proposal to enter the voting period +1. Deposit is filled: A minimum deposit of 250 ATOM is required for the proposal to enter the voting period - anyone may contribute to this deposit - the deposit must be reached within 14 days (this is the deposit period) 2. Quorum is reached: A minimum of 40% of the network's total voting power (staked ATOM) is required to participate diff --git a/docs/governance/proposal-types/param-change.md b/docs/governance/proposal-types/param-change.md index 3f45b7a331..a71aff0f05 100644 --- a/docs/governance/proposal-types/param-change.md +++ b/docs/governance/proposal-types/param-change.md @@ -37,7 +37,7 @@ You can begin by using the command `gaia q [module] -h` to get help about the su bond_denom: uatom historical_entries: 10000 max_entries: 7 -max_validators: 175 +max_validators: 180 unbonding_time: 1814400s ``` @@ -48,7 +48,7 @@ If a parameter-change proposal is successful, the change takes effect immediatel ## Why create a parameter change proposal? -Parameters are what govern many aspects of the chain's behaviour. As circumstances and attitudes change, sometimes you might want to change a parameter to bring the chain's behaviour in line with community opinion. For example, the Cosmos Hub launched with 100 active validators and there have been 3 proposals to date that have increased the `MaxValidators` parameter. At the time of writing, the active set contains 175 validators. +Parameters are what govern many aspects of the chain's behaviour. As circumstances and attitudes change, sometimes you might want to change a parameter to bring the chain's behaviour in line with community opinion. For example, the Cosmos Hub launched with 100 active validators and there have been 4 proposals to date that have increased the `MaxValidators` parameter. At the time of writing, the active set contains 180 validators. The Cosmos Hub has been viewed as a slow-moving, highly secure chain and that is reflected in some of its other parameters, such as a 21 day unbonding period and 14 day voting period. These are quite long compared to other chains in the Cosmos Ecosystem diff --git a/docs/governance/proposals/2021-01-stargate-upgrade-b/README.md b/docs/governance/proposals/2021-01-stargate-upgrade-b/README.md index 087977e567..bce20a101e 100644 --- a/docs/governance/proposals/2021-01-stargate-upgrade-b/README.md +++ b/docs/governance/proposals/2021-01-stargate-upgrade-b/README.md @@ -74,7 +74,7 @@ All previous Cosmos Hub upgrades reset the block height. Our interactions with e Documentation was a success for the Cosmos Stargate effort. The upgrades with the most breaking changes such as legacy Amino have a complete audit with documentation on exceptions for blockchain API interfaces. -Most exchanges and wallets have taken self-certification on directly. Our team continues to provide real-time support on multiple partner slack channels and on the Cosmos [#stargate Discord](https://discord.gg/W8trcGV) channel. +Most exchanges and wallets have taken self-certification on directly. Our team continues to provide real-time support on multiple partner slack channels and on the Cosmos [#stargate Discord](https://discord.com/invite/cosmosnetwork) channel. We have conducted numerous testnets with different partners. A particularly important testnet conducted with a significant fraction of the Hub validator set was a simulated upgrade of the cosmoshub on Nov 25th,2020. This tested the full upgrade flow including the prop29 implementation and height preserving upgrade functionality. diff --git a/docs/governance/proposals/2021-01-stargate-upgrade/README.md b/docs/governance/proposals/2021-01-stargate-upgrade/README.md index 89d3c865eb..3be500b008 100644 --- a/docs/governance/proposals/2021-01-stargate-upgrade/README.md +++ b/docs/governance/proposals/2021-01-stargate-upgrade/README.md @@ -67,7 +67,7 @@ All previous Cosmos Hub upgrades reset the block height. Our interactions with e Documentation was a success for the Cosmos Stargate effort. The upgrades with the most breaking changes such as legacy Amino have a complete audit with documentation on exceptions for blockchain API interfaces. -Most exchanges and wallets have taken self-certification on directly. Our team continues to provide real-time support on multiple partner slack channels and on the Cosmos [#stargate Discord](https://discord.gg/W8trcGV) channel. +Most exchanges and wallets have taken self-certification on directly. Our team continues to provide real-time support on multiple partner slack channels and on the Cosmos [#stargate Discord](https://discord.com/invite/cosmosnetwork) channel. We have conducted numerous testnets with different partners. A particularly important testnet conducted with a significant fraction of the Hub validator set was a simulated upgrade of the cosmoshub on Nov 25th,2020. This tested the full upgrade flow including the prop29 implementation and height preserving upgrade functionality. diff --git a/docs/governance/state-of-cosmos-governance-2021.md b/docs/governance/state-of-cosmos-governance-2021.md index d402c143a1..feab561839 100644 --- a/docs/governance/state-of-cosmos-governance-2021.md +++ b/docs/governance/state-of-cosmos-governance-2021.md @@ -61,7 +61,7 @@ Venues involve community members to different degrees and individuals often perf - Venue primarily for ATOM holders to discuss ATOM and other ecosystem coins - Discussion topics mostly about investing in the ecosystem and include: [investment theses](https://www.reddit.com/r/cosmosnetwork/comments/o38psh/i_think_atom_is_undervalued/), where to buy tokens, wallets to use, how to stake, and more recently, how to get involved with DeFi in the ecosystem (e.g., with Osmosis) - Community managers use it for announcements (e.g., catdotfish) -- **[Cosmos Community Discord](https://discord.gg/W8trcGV)** +- **[Cosmos Community Discord](https://discord.com/invite/cosmosnetwork)** - For ecosystem cross-pollination with an active developer presence. Older Riot chats have moved here. - `#validator-verified` channel for example discussing proposals, upgrades etc. - Major ecosystem chains all have a presence here, cross-validator convo, artefacts like: [Citadel.one Validator Constitution](https://drive.google.com/file/d/1wDTqro208y_1q3zF6rt39QjwYkcvVd7P/view) diff --git a/docs/governance/submitting.md b/docs/governance/submitting.md index 8df9892f7b..b7df056c36 100644 --- a/docs/governance/submitting.md +++ b/docs/governance/submitting.md @@ -142,7 +142,7 @@ The `` is written as `500000uatom`, just like the example above. Submitting to the testnet is identical to mainnet submissions aside from a few changes: 1. The chain-id is `theta-testnet-001`. 2. The list of usable endpoints can be found [here](https://github.com/cosmos/testnets/tree/master/public#readme). -3. You will need testnet tokens, not ATOM. There is a faucet available in the Developer [Discord](https://discord.gg/W8trcGV). +3. You will need testnet tokens, not ATOM. There is a faucet available in the Developer [Discord](https://discord.com/invite/cosmosnetwork). You may want to submit your proposal to the testnet chain before the mainnet for a number of reasons: 1. To see what the proposal description will look like. diff --git a/docs/hub-overview/overview.md b/docs/hub-overview/overview.md index 8c67d0e3d1..ce1d31c9c5 100644 --- a/docs/hub-overview/overview.md +++ b/docs/hub-overview/overview.md @@ -4,10 +4,10 @@ title: Introduction --- ::: warning -### **v9-Lambda Upgrade** -Cosmos Hub upgraded at height: **14,470,501** +### **v10 Upgrade** +Cosmos Hub will be upgraded to [v10](https://github.com/cosmos/gaia/releases/tag/v10.0.0) at block height: **15,816,200** -To upgrade from v8-Rho check the [**upgrade guide**](../migration/cosmoshub-4-v9-Lambda-upgrade.md) +To upgrade from v9-Lambda check the [**upgrade guide**](../migration/cosmoshub-4-v10-upgrade.md) ::: ![Welcome to the Cosmos Hub](../images/cosmos-hub-image.jpg) diff --git a/docs/hub-tutorials/gaiad.md b/docs/hub-tutorials/gaiad.md index 3012ab3b7c..13e3cf945d 100644 --- a/docs/hub-tutorials/gaiad.md +++ b/docs/hub-tutorials/gaiad.md @@ -124,7 +124,7 @@ gaiad tendermint show-validator Note that this is the Tendermint signing key, _not_ the operator key you will use in delegation transactions. ::: danger Warning -We strongly recommend _NOT_ using the same passphrase for multiple keys. The Tendermint team and the Interchain Foundation will not be responsible for the loss of funds. +We strongly recommend _NOT_ using the same passphrase for multiple keys. The CometBFT team and the Interchain Foundation will not be responsible for the loss of funds. ::: #### Generate Multisig Public Keys diff --git a/docs/hub-tutorials/join-mainnet.md b/docs/hub-tutorials/join-mainnet.md index 55cf36d049..5fdefcfba5 100644 --- a/docs/hub-tutorials/join-mainnet.md +++ b/docs/hub-tutorials/join-mainnet.md @@ -6,7 +6,16 @@ title: Joining Mainnet # Join the Cosmos Hub Mainnet -The current Cosmos Hub mainnet, `cosmoshub-4`, has been performing in place store migration upgrades as of the [Delta Upgrade](https://github.com/cosmos/gaia/blob/main/docs/migration/cosmoshub-4-delta-upgrade.md) July 2021. The most recent upgrade was [Lambda](https://github.com/cosmos/gaia/blob/main/docs/migration/cosmoshub-4-v9-Lambda-upgrade.md) March 2023. This type of upgrade preserves the same chain-id but state before the upgrade height is only accessible by corresponding versions of the binary (ie. queries of state between height `6,910,000` and `8,695,000` should use `gaia v5.0.x` (Delta), between `8,695,000` and `10,085,397` use `gaia v6.0.x` (Vega), between `10,085,397` and `14,099,412` use `gaia v7.0.x` (Theta), between `14,099,412` and `14,470,501` use `gaia v8.0.x` (Rho), after `14,470,501` use `gaia v9.0.x` (Lambda) to guarantee correctly encoded responses. The roadmap documentation contains a [history of upgrades](https://github.com/cosmos/gaia/tree/main/docs/roadmap).). Visit the [migration section](https://github.com/cosmos/gaia/tree/main/docs/migration) of the Hub's docs for more information on previous chain migrations. +The current Cosmos Hub mainnet, `cosmoshub-4`, has been performing in place store migration upgrades as of the [Delta Upgrade](https://github.com/cosmos/gaia/blob/main/docs/migration/cosmoshub-4-delta-upgrade.md) July 2021. The most recent upgrade was [Lambda](https://github.com/cosmos/gaia/blob/main/docs/migration/cosmoshub-4-v9-Lambda-upgrade.md) March 2023. This type of upgrade preserves the same chain-id but state before the upgrade height is only accessible by corresponding versions of the binary: +- use `gaia v5.0.x` (Delta) for queries of state between height `6,910,000` and `8,695,000` +- use `gaia v6.0.x` (Vega) between `8,695,000` and `10,085,397` +- use `gaia v7.0.x` (Theta) between `10,085,397` and `14,099,412` +- use `gaia v8.0.x` (Rho) between `14,099,412` and `14,470,501` +- use `gaia v9.0.x` (Lambda) between `14470501` and `15213800` +- use `gaia v9.1.x` between `15213800` and `15816200` +- use `gaia v10.0.x` from `15816200` + +(ie. queries of state between height `6,910,000` and `8,695,000` should use `gaia v5.0.x` (Delta), between `8,695,000` and `10,085,397` use `gaia v6.0.x` (Vega), between `10,085,397` and `14,099,412` use `gaia v7.0.x` (Theta), between `14,099,412` and `14,470,501` use `gaia v8.0.x` (Rho), after `14,470,501` use `gaia v9.0.x` (Lambda) to guarantee correctly encoded responses. The roadmap documentation contains a [history of upgrades](https://github.com/cosmos/gaia/tree/main/docs/roadmap).). Visit the [migration section](https://github.com/cosmos/gaia/tree/main/docs/migration) of the Hub's docs for more information on previous chain migrations. **This guide includes full instructions for joining the mainnet either as an archive/full node or a pruned node.** @@ -249,7 +258,7 @@ Make sure to consult the [hardware](#Hardware) section for guidance on the best ### Blocksync -Blocksync is faster than traditional consensus and syncs the chain from genesis by downloading blocks and verifying against the merkle tree of validators. For more information see [Tendermint's Fastsync Docs](https://docs.tendermint.com/v0.34/tendermint-core/fast-sync.html) +Blocksync is faster than traditional consensus and syncs the chain from genesis by downloading blocks and verifying against the merkle tree of validators. For more information see [CometBFT's Fastsync Docs](https://docs.cometbft.com/v0.34/core/fast-sync) When syncing via Blocksync, node operators will either need to manually upgrade the chain or set up [Cosmovisor](#Cosmovisor) to upgrade automatically. @@ -280,7 +289,7 @@ The node will begin rebuilding state until it hits the first upgrade height at b ### State Sync -State Sync is an efficient and fast way to bootstrap a new node, and it works by replaying larger chunks of application state directly rather than replaying individual blocks or consensus rounds. For more information, see [Tendermint's State Sync docs](https://github.com/tendermint/tendermint/blob/v0.34.x/spec/p2p/messages/state-sync.md). +State Sync is an efficient and fast way to bootstrap a new node, and it works by replaying larger chunks of application state directly rather than replaying individual blocks or consensus rounds. For more information, see [CometBFT's State Sync docs](https://docs.cometbft.com/v0.34/core/state-sync). To enable state sync, visit an explorer to get a recent block height and corresponding hash. A node operator can choose any height/hash in the current bonding period, but as the recommended snapshot period is `1000` blocks, it is advised to choose something close to `current height - 1000`. @@ -372,7 +381,7 @@ snapshot-keep-recent = 10 **See all [Gaia Releases](https://github.com/cosmos/gaia/releases)** -The most up to date release of Gaia is [`V9.0.1`](https://github.com/cosmos/gaia/releases/tag/v9.0.1). For those that want to use state sync or quicksync to get their node up to speed, starting with the most recent version of Gaia is sufficient. +The most up to date release of Gaia is [`V9.1.1`](https://github.com/cosmos/gaia/releases/tag/v9.1.1). For those that want to use state sync or quicksync to get their node up to speed, starting with the most recent version of Gaia is sufficient. To sync an archive or full node from scratch, it is important to note that you must start with [`V4.2.1`](https://github.com/cosmos/gaia/releases/tag/v4.2.1) and proceed through two different upgrades Delta at block height `6,910,000`, Vega at block height `8,695,000`, Theta at block height `10,085,397`, Rho at block height `14099412` and Lambda at block height `14,470,501`. diff --git a/docs/hub-tutorials/join-testnet.md b/docs/hub-tutorials/join-testnet.md index 3cc21471fd..5d96075c21 100644 --- a/docs/hub-tutorials/join-testnet.md +++ b/docs/hub-tutorials/join-testnet.md @@ -46,8 +46,8 @@ We recommend running public testnet nodes on machines with at least 8 cores, 16G There are two ways to sync a testnet node, Fastsync and State Sync. -* [Fast Sync](https://docs.tendermint.com/v0.34/tendermint-core/fast-sync.html) syncs the chain from genesis by downloading blocks in parallel and then verifying them. -* [State Sync](https://docs.tendermint.com/v0.34/tendermint-core/state-sync.html) will look for snapshots from peers at a trusted height and then verifying a minimal set of snapshot chunks against the network. +* [Fast Sync](https://docs.cometbft.com/v0.34/core/fast-sync) syncs the chain from genesis by downloading blocks in parallel and then verifying them. +* [State Sync](https://docs.cometbft.com/v0.34/core/state-sync) will look for snapshots from peers at a trusted height and then verifying a minimal set of snapshot chunks against the network. State Sync is far faster and more efficient than Fast Sync, but Fast Sync offers higher data integrity and more robust history. For those who are concerned about storage and costs, State Sync can be the better option as it minimizes storage usage when rebuilding initial state. diff --git a/docs/interchain-security.md b/docs/interchain-security.md index 881dbd023b..16954f26c5 100644 --- a/docs/interchain-security.md +++ b/docs/interchain-security.md @@ -61,9 +61,9 @@ To provide the necessary functionality on the Provider Chain, a wrapper module m ### Validator set limits -The current Cosmos Hub has a limit of 175 validators. This limit is imposed on validators who are interested in producing blocks as part of a validator set of the Cosmos Hub itself. This limits the number of eligible validators for Consumer Chains to the same top 175 Cosmos Hub participants. However, just because a validator doesn't have enough staked ATOM to be eligible to validate on the Cosmos Hub, doesn't mean that they shouldn't qualify to validate on another Consumer Chain. +The current Cosmos Hub has a limit of 180 validators. This limit is imposed on validators who are interested in producing blocks as part of a validator set of the Cosmos Hub itself. This limits the number of eligible validators for Consumer Chains to the same top 180 Cosmos Hub participants. However, just because a validator doesn't have enough staked ATOM to be eligible to validate on the Cosmos Hub, doesn't mean that they shouldn't qualify to validate on another Consumer Chain. -Interchain Security should increase the diversity of the validator ecosystem by lowering the barrier to running a profitable validator business. This will go far in creating a healthy ecosystem of diverse validators that will result in anti-fragile and robustly operated networks. In order to make it possible for the top 175 validators to remain eligible as block producers for the Cosmos Hub while increasing the number of eligible validators for Consumer Chains, the Staking Module needs to stop forcing validators to undelegate when they leave the top set of 175 validators. This will result in a longer list of validators with ATOM delegations that are not participating in block production on the Provider Chain (Cosmos Hub). These extra validators will however be eligible to produce blocks on Consumer Chains and use their delegated ATOMs to earn rewards on the Consumer Chains as well as risk their Provider Chain ATOMs to slashable events should they misbehave on Consumer Chains. +Interchain Security should increase the diversity of the validator ecosystem by lowering the barrier to running a profitable validator business. This will go far in creating a healthy ecosystem of diverse validators that will result in anti-fragile and robustly operated networks. In order to make it possible for the top 180 validators to remain eligible as block producers for the Cosmos Hub while increasing the number of eligible validators for Consumer Chains, the Staking Module needs to stop forcing validators to undelegate when they leave the top set of 180 validators. This will result in a longer list of validators with ATOM delegations that are not participating in block production on the Provider Chain (Cosmos Hub). These extra validators will however be eligible to produce blocks on Consumer Chains and use their delegated ATOMs to earn rewards on the Consumer Chains as well as risk their Provider Chain ATOMs to slashable events should they misbehave on Consumer Chains. ### Chain-Specific Delegations diff --git a/docs/ko/gaia-tutorials/join-mainnet.md b/docs/ko/gaia-tutorials/join-mainnet.md index 1c0ebf5ee6..7d65f3ea78 100644 --- a/docs/ko/gaia-tutorials/join-mainnet.md +++ b/docs/ko/gaia-tutorials/join-mainnet.md @@ -78,7 +78,7 @@ gaiad start 이 외에도 [밸리데이터 라이엇 채팅방](https://riot.im/app/#/room/#cosmos-validators:matrix.org)을 통해서 피어 요청을 할 수 있습니다. -시드와 피어에 대한 더 많은 정보를 원하시면 [여기](https://github.com/tendermint/tendermint/blob/develop/docs/tendermint-core/using-tendermint.md#peers)를 확인하세요. +시드와 피어에 대한 더 많은 정보를 원하시면 [여기](https://github.com/cometbft/cometbft/blob/main/docs/core/using-cometbft.md#peers)를 확인하세요. ### 가스와 수수료에 대해서 diff --git a/docs/ko/gaia-tutorials/join-testnet.md b/docs/ko/gaia-tutorials/join-testnet.md index 0cfcb44272..92425ba4e0 100755 --- a/docs/ko/gaia-tutorials/join-testnet.md +++ b/docs/ko/gaia-tutorials/join-testnet.md @@ -111,7 +111,7 @@ gaiad start 이 외에도 [밸리데이터 라이엇 채팅방](https://riot.im/app/#/room/#cosmos-validators:matrix.org)을 통해서 피어 요청을 할 수 있습니다. -시드와 피어에 대한 더 많은 정보를 원하시면 [여기](https://github.com/tendermint/tendermint/blob/develop/docs/tendermint-core/using-tendermint.md#peers)를 확인하세요. +시드와 피어에 대한 더 많은 정보를 원하시면 [여기](https://github.com/cometbft/cometbft/blob/main/docs/core/using-cometbft.md#peers)를 확인하세요. ## 풀노드 운영하기 diff --git a/docs/ko/keys.md b/docs/ko/keys.md index df4bd47d69..5125d4aee6 100755 --- a/docs/ko/keys.md +++ b/docs/ko/keys.md @@ -1,7 +1,7 @@ # 키 -키 관리에 대해서는 [텐더민트 스펙](https://github.com/tendermint/tendermint/blob/master/docs/spec/blockchain/encoding.md#public-key-cryptography)을 확인하세요. +키 관리에 대해서는 [CometBFT](https://docs.cometbft.com/v0.34/spec/core/encoding)을 확인하세요. `gaiad keys --help` 명령어를 통해 추가 정보를 얻으실 수 있습니다. @@ -9,4 +9,4 @@ 참고: 이 문서는 현재 작업중에 있습니다. - \ No newline at end of file + diff --git a/docs/ko/launch/blog-2-kr.md b/docs/ko/launch/blog-2-kr.md index 1a6d62e5b2..d15a4ee168 100644 --- a/docs/ko/launch/blog-2-kr.md +++ b/docs/ko/launch/blog-2-kr.md @@ -31,7 +31,7 @@ 하지만 토큰 전송이 활성화된 뒤라면 블록체인 롤백을 정당화하는 것은 상당히 어렵게 됩니다. -**개발자 참고 사항**: 코스모스 메인넷 런칭은 펀드레이저 참가자들이 협동하여 코스모스 허브 소프트웨어를 운영하는 첫 단계입니다. 생태계 내 대다수의 탈중앙화 애플리케이션 개발자는 [코스모스 SDK](https://cosmos.network/docs/) 또는 [텐더민트 코어](https://tendermint.com/docs/)를 사용하고 있는 것으로 예상됩니다. 각 코스모스 SDK/텐더민트 기반 애플리케이션의 개발 진행은 코스모스 허브와 별도로 진행되어도 무관합니다. 다만, [IBC](https://blog.cosmos.network/developer-deep-dive-cosmos-ibc-5855aaf183fe)(Inter-Blockchain Communication)을 사용하기 위해서는 메인넷 3단계까지 기다리거나 IBC 테스트넷에서 시범운영을 하실 수 있습니다. +**개발자 참고 사항**: 코스모스 메인넷 런칭은 펀드레이저 참가자들이 협동하여 코스모스 허브 소프트웨어를 운영하는 첫 단계입니다. 생태계 내 대다수의 탈중앙화 애플리케이션 개발자는 [코스모스 SDK](https://cosmos.network/docs/) 또는 [Comet BFT](https://github.com/cometbft/cometbft/tree/main/docs)를 사용하고 있는 것으로 예상됩니다. 각 코스모스 SDK/Comet BFT 기반 애플리케이션의 개발 진행은 코스모스 허브와 별도로 진행되어도 무관합니다. 다만, [IBC](https://blog.cosmos.network/developer-deep-dive-cosmos-ibc-5855aaf183fe)(Inter-Blockchain Communication)을 사용하기 위해서는 메인넷 3단계까지 기다리거나 IBC 테스트넷에서 시범운영을 하실 수 있습니다. **유저 참고 사항**: 메인넷 최초 단계에서는 코스모스 아톰을 거래하지 **않는** 것을 강력하게 권고합니다 (예, 법적 계약을 통한 거래). 1단계에서는 제네시스 블록까지 긴급 롤백이 진행될 수 있으므로 트랜잭션이 번복될 수 있는 위험이 존재합니다. @@ -75,4 +75,4 @@ CLI 위임 투토리얼 (영어): [https://www.youtube.com/watch?v=ydZw6o6Mzy0]( 달에 도착하는 그 날까지… 🚀 - \ No newline at end of file + diff --git a/docs/migration/cosmoshub-4-v10-upgrade.md b/docs/migration/cosmoshub-4-v10-upgrade.md new file mode 100644 index 0000000000..ce1bd79b15 --- /dev/null +++ b/docs/migration/cosmoshub-4-v10-upgrade.md @@ -0,0 +1,297 @@ +--- +title: Cosmos Hub 4, v10 Upgrade +order: 1 +--- + +# Cosmos Hub 4, v10 Upgrade, Instructions + +This document describes the steps for validators and full node operators, to upgrade successfully to the v10 release. The v10 upgrade is a mandatory maintenence release which updates the following core libraries: + +- Upgrading Comet BFT to [v0.34.28](https://github.com/cometbft/cometbft/releases/tag/v0.34.28) +- Upgrading Cosmos SDK to [v0.45.16-ics](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.16-ics) +- Upgrading IBC Go to [v4.4.0](https://github.com/cosmos/ibc-go/releases/tag/v4.4.0) +- Upgrading Golang to [Golang 1.20.x](https://go.dev/blog/go1.20), making it mandatory to build Gaia with **Golang v1.20.x** + +❗The **preferred binary** for **Mainnet release** is [v10.0.1](https://github.com/cosmos/gaia/releases/tag/v10.0.1), as that version includes a fix for the [IBC Huckleberry fix](https://forum.cosmos.network/t/ibc-security-advisory-huckleberry/10731). v10.0.0 does **NOT** include this fix. + +## Instructions + +- [On-chain governance proposal attains consensus](#on-chain-governance-proposal-attains-consensus) +- [Upgrade date](#upgrade-date) +- [Chain-id will remain the same](#chain-id-will-remain-the-same) +- [Preparing for the upgrade](#preparing-for-the-upgrade) + - [System requirement](#system-requirement) + - [Backups](#backups) + - [Testing](#testing) + - [Current runtime, cosmoshub-4 (pre-v10 upgrade) is running Gaia v9.1.1](#current-runtime-cosmoshub-4-pre-v10-upgrade-is-running-gaia-v911) + - [Target runtime, cosmoshub-4 (post-v10 upgrade) will run Gaia v10.0.1](#target-runtime-cosmoshub-4-post-v10-upgrade-will-run-gaia-v1000) +- [Upgrade steps](#upgrade-steps) + - [Method I: Manual Upgrade](#method-i-manual-upgrade) + - [Method II: Upgrade using Cosmovisor](#method-ii-upgrade-using-cosmovisor) + - [Manually preparing the binary](#manually-preparing-the-binary) + - [Preparation](#preparation) + - [Expected upgrade result](#expected-upgrade-result) + - [Auto-Downloading the Gaia binary](#auto-downloading-the-gaia-binary) + - [Preparation](#preparation-1) + - [Expected result](#expected-result) +- [Upgrade duration](#upgrade-duration) +- [Rollback plan](#rollback-plan) +- [Communications](#communications) +- [Risks](#risks) +- [Reference](#reference) + +## On-chain governance proposal attains consensus + +[Proposal #798](https://www.mintscan.io/cosmos/proposals/798) is the reference on-chain governance proposal for this upgrade, which is still in its voting period. Neither core developers nor core funding entities control the governance, and this governance proposal has passed in a _fully decentralized_ way. + +## Upgrade date + +The upgrade will take place at a block height of `15816200`. The date/time of the upgrade is subject to change as blocks are not generated at a constant interval. You can stay up-to-date using this [live countdown](https://www.mintscan.io/cosmos/blocks/15816200) page. + +## Chain-id will remain the same + +The chain-id of the network will remain the same, `cosmoshub-4`. This is because an in-place migration of state will take place, i.e., this upgrade does not export any state. + +## Preparing for the upgrade + +### System requirement + +32GB RAM is recommended to ensure a smooth upgrade. + +If you have less than 32GB RAM, you might try creating a swapfile to swap an idle program onto the hard disk to free up memory. This can +allow your machine to run the binary than it could run in RAM alone. + +```shell +sudo fallocate -l 16G /swapfile +sudo chmod 600 /swapfile +sudo mkswap /swapfile +sudo swapon /swapfile +``` + +### Backups + +Prior to the upgrade, validators are encouraged to take a full data snapshot. Snapshotting depends heavily on infrastructure, but generally this can be done by backing up the `.gaia` directory. +If you use Cosmovisor to upgrade, by default, Cosmovisor will backup your data upon upgrade. See below [upgrade by cosmovisor](#method-ii-upgrade-using-cosmovisor-by-manually-preparing-the-gaia-v700-binary) section. + +It is critically important for validator operators to back-up the `.gaia/data/priv_validator_state.json` file after stopping the gaiad process. This file is updated every block as your validator participates in consensus rounds. It is a critical file needed to prevent double-signing, in case the upgrade fails and the previous chain needs to be restarted. + +### Testing + +For those validator and full node operators that are interested in ensuring preparedness for the impending upgrade, you can run a [v10 Local Testnet](https://github.com/cosmos/testnets/tree/master/local) or join in our [Cosmos Hub Public Testnet](https://github.com/cosmos/testnets/tree/master/public). + +### Current runtime, cosmoshub-4 (pre-v10 upgrade) is running Gaia v9.1.1 + +The Cosmos Hub mainnet network, `cosmoshub-4`, is currently running [Gaia v9.1.1](https://github.com/cosmos/gaia/releases/v9.1.1). We anticipate that operators who are running on v9.1.1, will be able to upgrade successfully. Validators are expected to ensure that their systems are up to date and capable of performing the upgrade. This includes running the correct binary, or if building from source, building with go `1.20`. + +### Target runtime, cosmoshub-4 (post-v10 upgrade) will run Gaia v10.0.1 + +The Cosmos Hub mainnet network, `cosmoshub-4`, will run [Gaia v10.0.1](https://github.com/cosmos/gaia/releases/tag/v10.0.1). Operators _MUST_ use this version post-upgrade to remain connected to the network. + +## Upgrade steps + +There are 2 major ways to upgrade a node: + +- Manual upgrade +- Upgrade using [Cosmovisor](https://github.com/cosmos/cosmos-sdk/tree/master/cosmovisor) + - Either by manually preparing the new binary + - Or by using the auto-download functionality (this is not yet recommended) + +If you prefer to use Cosmovisor to upgrade, some preparation work is needed before upgrade. + +### Method I: Manual Upgrade + +Make sure Gaia v10.0.1 is installed by either downloading a [compatible binary](https://github.com/cosmos/gaia/releases/tag/v10.0.1), or building from source. Building from source requires **Golang 1.20**. + +Run Gaia v9.1.1 till upgrade height, the node will panic: + +```shell +ERR UPGRADE "v10" NEEDED at height: 15816200: upgrade to v10 and applying upgrade "v10" at height:15816200 +``` + +Stop the node, and switch the binary to Gaia v10.0.1 and re-start by `gaiad start`. + +It may take several minutes to a few hours until validators with a total sum voting power > 2/3 to complete their node upgrades. After that, the chain can continue to produce blocks. + +### Method II: Upgrade using Cosmovisor + +::: warning +**Please Read Before Proceeding**
+Using Cosmovisor 1.2.0 and higher requires a lowercase naming convention for upgrade version directory. For Cosmovisor 1.1.0 and earlier, the upgrade version is not lowercased. +::: + +> **For Example:**
+> **Cosmovisor =< `1.1.0`: `/upgrades/v9-Lambda/bin/gaiad`**
+> **Cosmovisor >= `1.2.0`: `/upgrades/v9-lambda/bin/gaiad`**
+ +| Cosmovisor Version | Binary Name in Path | +|--------------------|---------------------| +| 1.3 | v10 | +| 1.2 | v10 | +| 1.1 | v10 | +| 1.0 | v10 | + +### Manually preparing the binary + +##### Preparation + +Install the latest version of Cosmovisor (`1.3.0`): + +```shell +go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@latest +``` + +**Verify Cosmovisor Version** +```shell +cosmovisor version +cosmovisor version: v1.3.0 +``` + +Create a cosmovisor folder: + +create a Cosmovisor folder inside `$GAIA_HOME` and move Gaia v9.1.1 into `$GAIA_HOME/cosmovisor/genesis/bin` + +```shell +mkdir -p $GAIA_HOME/cosmovisor/genesis/bin +cp $(which gaiad) $GAIA_HOME/cosmovisor/genesis/bin +```` + +build Gaia v10.0.1, and move gaiad v10.0.1 to `$GAIA_HOME/cosmovisor/upgrades/v10/bin` + +```shell +mkdir -p $GAIA_HOME/cosmovisor/upgrades/v10/bin +cp $(which gaiad) $GAIA_HOME/cosmovisor/upgrades/v10/bin +``` + +Then you should get the following structure: + +```shell +. +├── current -> genesis or upgrades/ +├── genesis +│ └── bin +│ └── gaiad #v9.1.1 +└── upgrades + └── v10 + └── bin + └── gaiad #v10.0.1 +``` + +Export the environmental variables: + +```shell +export DAEMON_NAME=gaiad +# please change to your own gaia home dir +# please note `DAEMON_HOME` has to be absolute path +export DAEMON_HOME=$GAIA_HOME +export DAEMON_RESTART_AFTER_UPGRADE=true +``` + +Start the node: + +```shell +cosmovisor run start --x-crisis-skip-assert-invariants --home $DAEMON_HOME +``` + +Skipping the invariant checks is strongly encouraged since it decreases the upgrade time significantly and since there are some other improvements coming to the crisis module in the next release of the Cosmos SDK. + +#### Expected upgrade result + +When the upgrade block height is reached, Gaia will panic and stop: + +This may take 7 minutes to a few hours. +After upgrade, the chain will continue to produce blocks when validators with a total sum voting power > 2/3 complete their node upgrades. + +### Auto-Downloading the Gaia binary + +**This method is not recommended!** + +#### Preparation + +Install the latest version of Cosmovisor (`1.3.0`): + +```shell +go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@latest +``` + +Create a cosmovisor folder: + +create a cosmovisor folder inside gaia home and move gaiad v9.1.1 into `$GAIA_HOME/cosmovisor/genesis/bin` + +```shell +mkdir -p $GAIA_HOME/cosmovisor/genesis/bin +cp $(which gaiad) $GAIA_HOME/cosmovisor/genesis/bin +``` + +```shell +. +├── current -> genesis or upgrades/ +└── genesis + └── bin + └── gaiad #v9.1.1 +``` + +Export the environmental variables: + +```shell +export DAEMON_NAME=gaiad +# please change to your own gaia home dir +export DAEMON_HOME=$GAIA_HOME +export DAEMON_RESTART_AFTER_UPGRADE=true +export DAEMON_ALLOW_DOWNLOAD_BINARIES=true +``` + +Start the node: + +```shell +cosmovisor run start --x-crisis-skip-assert-invariants --home $DAEMON_HOME +``` + +Skipping the invariant checks can help decrease the upgrade time significantly. + +#### Expected result + +When the upgrade block height is reached, you can find the following information in the log: + +```shell +ERR UPGRADE "v10" NEEDED at height: 15816200: upgrade to v10 and applying upgrade "v10" at height:15816200 +``` + +Then the Cosmovisor will create `$GAIA_HOME/cosmovisor/upgrades/v10/bin` and download the Gaia v10.0.1 binary to this folder according to links in the `--info` field of the upgrade proposal. +This may take 7 minutes to a few hours, afterwards, the chain will continue to produce blocks once validators with a total sum voting power > 2/3 complete their nodes upgrades. + +_Please Note:_ + +- In general, auto-download comes with the risk that the verification of correct download is done automatically. If users want to have the highest guarantee users should confirm the check-sum manually. We hope more node operators will use the auto-download for this release but please be aware this is a risk and users should take at your own discretion. +- Users should run their node on v9.1.1 if they use the cosmovisor v1.3.0 with auto-download enabled for upgrade process. + +## Upgrade duration + +The upgrade may take a few minutes to several hours to complete because cosmoshub-4 participants operate globally with differing operating hours and it may take some time for operators to upgrade their binaries and connect to the network. + +## Rollback plan + +During the network upgrade, core Cosmos teams will be keeping an ever vigilant eye and communicating with operators on the status of their upgrades. During this time, the core teams will listen to operator needs to determine if the upgrade is experiencing unintended challenges. In the event of unexpected challenges, the core teams, after conferring with operators and attaining social consensus, may choose to declare that the upgrade will be skipped. + +Steps to skip this upgrade proposal are simply to resume the cosmoshub-4 network with the (downgraded) v9.1.1 binary using the following command: + +> gaiad start --unsafe-skip-upgrade 15816200 + +Note: There is no particular need to restore a state snapshot prior to the upgrade height, unless specifically directed by core Cosmos teams. + +Important: A social consensus decision to skip the upgrade will be based solely on technical merits, thereby respecting and maintaining the decentralized governance process of the upgrade proposal's successful YES vote. + +## Communications + +Operators are encouraged to join the `#cosmos-hub-validators-verified` channel of the Cosmos Hub Community Discord. This channel is the primary communication tool for operators to ask questions, report upgrade status, report technical issues, and to build social consensus should the need arise. This channel is restricted to known operators and requires verification beforehand. Requests to join the `#cosmos-hub-validators-verified` channel can be sent to the `#general-support` channel. + +## Risks + +As a validator performing the upgrade procedure on your consensus nodes carries a heightened risk of double-signing and being slashed. The most important piece of this procedure is verifying your software version and genesis file hash before starting your validator and signing. + +The riskiest thing a validator can do is discover that they made a mistake and repeat the upgrade procedure again during the network startup. If you discover a mistake in the process, the best thing to do is wait for the network to start before correcting it. + +## Reference + +[Join Cosmos Hub Mainnet](https://github.com/cosmos/mainnet) + + diff --git a/docs/migration/cosmoshub-4-v7-Theta-upgrade.md b/docs/migration/cosmoshub-4-v7-Theta-upgrade.md index f705aa0fc9..21ab16097a 100644 --- a/docs/migration/cosmoshub-4-v7-Theta-upgrade.md +++ b/docs/migration/cosmoshub-4-v7-Theta-upgrade.md @@ -77,7 +77,7 @@ It is critically important for validator operators to back-up the `.gaia/data/pr ### Testing -For those validator and full node operators that are interested in ensuring preparedness for the impending upgrade, you can join in our [v7-Theta public-testnet](https://github.com/cosmos/testnets/tree/master/v7-theta/public-testnet) or run a [v7-Theta local testnet](https://github.com/cosmos/testnets/tree/master/local/previous-local-testnets/theta). +For those validator and full node operators that are interested in ensuring preparedness for the impending upgrade, you can join in our [v7-Theta public-testnet](https://github.com/cosmos/testnets/tree/master/v7-theta/public-testnet) or run a [v7-Theta local testnet](https://github.com/cosmos/testnets/tree/master/local/previous-local-testnets/v7-theta). ### Current runtime, cosmoshub-4 (pre-v7-Theta upgrade) is running Gaia v6.0.x diff --git a/docs/modules/globalfee.md b/docs/modules/globalfee.md index ea72e7f6aa..7d9769258d 100644 --- a/docs/modules/globalfee.md +++ b/docs/modules/globalfee.md @@ -1,69 +1,73 @@ -# Gaia Fees and Fees Checks +# Gaia Fee and Fees Checks ## Fee Parameters -The CosmosHub allows managing fees using 3 parameters: +The CosmosHub allows managing fees using 4 parameters. At the network level, there are three parameters from globalfee modules (`MinimumGasPricesParam`, `BypassMinFeeMsgTypes`, and `MaxTotalBypassMinFeeMsgGasUsage`) that can be set by gov proposal. Additionally, a fourth parameter which enables individual nodes to impose supplementary fee amount. -1. setting global fees (`MinimumGasPricesParam`) -Global fees are defined at the network level by setting `MinimumGasPricesParam`, via [Gov Proposals](https://hub.cosmos.network/main/governance/proposals/) +1. global fees (`MinimumGasPricesParam`).\ +global fees `MinimumGasPricesParam` is established at the network level through globalfee params set via Governance Proposal, it sets a fee requirements that the entire network must adhere to. -2. `minimum-gas-prices` -This parameter is part of the node configuration, it can be set in the `config/app.toml` configuration file. + *Please note: in this context, "globalfee" or "Globalfee" are used to refer to the globalfee module, while "global fees" is referring to the `MinimumGasPricesParam` in the globalfee module's params.* -3. `bypass-min-fee-msg-types` -This parameter is part of the node configuration, it can be set in the `config/app.toml` configuration file. -This represents a list of message types that will be excluded from paying any fees for inclusion in a block. -Both global fees (`MinimumGasPricesParam`) and `minimum-gas-prices` represent a list of coins, each denoted by an amount and domination as defined by [sdk.DecCoins](https://github.com/cosmos/cosmos-sdk/blob/82ce891aa67f635f3b324b7a52386d5405c5abd0/types/dec_coin.go#L158) +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. + *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.* -## Concepts -## Global Fees +3. `BypassMinFeeMsgTypes` and `MaxTotalBypassMinFeeMsgGasUsage`.\ + These two parameters are also part of the globalfee params from gaiad v11.0.0. They can be changed through Gov Proposals. `BypassMinFeeMsgTypes` represents a list of message types that will be excluded from paying any fees for inclusion in a block, `MaxTotalBypassMinFeeMsgGasUsage` is the limit placed on gas usage for `BypassMinFeeMsgTypes`. -Global fees consist of a list of `sdk.DecCoins` e.g., `[1uatom, 2stake]`. -Every transaction must pay per unit of gas **at least** one of the amounts stated in this list in the corresponding denomination (denom). By this notion, global fees allow a network to impose a minimum transaction fee. +## Globalfee module -The paid fees must be paid in at least one denom from the global fees list and the corresponding amount per unit of gas must be greater than or equal to the corresponding amount in the global fees list. +The globalfee module has three parameters that can be set by governance proposal type `param-change`: +- `MinimumGasPricesParam` +- `BypassMinFeeMsgTypes` +- `MaxTotalBypassMinFeeMsgGasUsage` -A global fees list must meet the following properties: -- 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). +### Globalfee Params: `MinimumGasPricesParam` +Network level, global fees consist of a list of [`sdk.DecCoins`](https://github.com/cosmos/cosmos-sdk/blob/82ce891aa67f635f3b324b7a52386d5405c5abd0/types/dec_coin.go#L158). +Every transaction must pay per unit of gas, **at least**, in one of the denominations (denoms) amounts in the list. This allows the globalfee module to impose a minimum transaction fee for all transactions for a network. -There are **two exceptions** from the global fees rules that allow zero fee transactions: - -1. Transactions that contain only [message types that can bypass the minimum fee](#bypass-fees-message-types) may have zero fees. We refer to this as _bypass transactions_. Node operators can choose to define these message types (for each node) via the `bypass-fee-message-types` configuration parameter. +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) -2. One of the entries in the global fees list has a zero amount, e.g., `0uatom`, and the corresponding denom, e.g., `uatom`, is not present in `minimum-gas-prices`. +There are **two exceptions** from the global fees rules that allow zero fee transactions: -Additionally, node operators may set additional minimum gas prices which can be larger than the _global_ minimum gas prices defined on chain. +1. Transactions that contain only message types that can bypass the minimum fee requirement and for which the total gas usage of these bypass messages does not exceed `maxTotalBypassMinFeeMsgGasUsage` may have zero fees. We refer to this as _bypass transactions_. +2. One of the entries in the global fees list has a zero amount, e.g., `0uatom`, and the corresponding denom, e.g., `uatom`, is not present in `minimum-gas-prices` in `app.toml`, or node operators may set additional `minimum-gas-prices` in `app.toml` also zero coins. -### minimum-gas-prices +### Globalfee Params: `BypassMinFeeMsgTypes` and `MaxTotalBypassMinFeeMsgGasUsage` -The `minimum-gas-prices` config parameter allows node operators to impose additional requirements for minimum fees. The following rules apply: +Bypass minimum fee messages are messages that are exempt from paying fees. The above global fees and the below local `minimum-gas-prices` checks do not apply for transactions that satisfy the following conditions: -- The denoms in `min-gas-prices` that are not present in the global fees list are ignored. -- The amounts in `min-gas-prices` are considered only if they are greater than the amounts for the corresponding denoms in the global fees list. +- Transaction contains only bypass message types defined in `BypassMinFeeMsgTypes`. +- The total gas used is less than or equal to `MaxTotalBypassMinFeeMsgGasUsage`. +- In case of non-zero transaction fees, the denom has to be a subset of denoms defined in the global fees list. -## Bypass Fees Message Types +Starting from gaiad `v11.0.0`, `BypassMinFeeMsgTypes` and `MaxTotalBypassMinFeeMsgGasUsage` are part of global fee params and can be proposed at network level. The default values are: `bypass-min-fee-msg-types=[ +"/ibc.core.channel.v1.MsgRecvPacket", +"/ibc.core.channel.v1.MsgAcknowledgement", +"/ibc.core.client.v1.MsgUpdateClient", +"/ibc.core.channel.v1.MsgTimeout", +"/ibc.core.channel.v1.MsgTimeoutOnClose" +]` and default `maxTotalBypassMinFeeMsgGasUsage=1,000,000` -Bypass messages are messages that are exempt from paying fees. The above global fees and `minimum-gas-prices` checks do not apply for transactions that satisfy the following conditions: +From gaiad v11.0.0, nodes that have the `bypass-min-fee-msg-types` field in their `app.toml` configuration are **not utilized**. Therefore, node operators have the option to either leave the field in their configurations or remove it. Node inited by gaiad v11.0.0 or later does not have `bypass-min-fee-msg-types` field in the `app.toml`. -- Contains only bypass message types, i.e., bypass transactions. -- The total gas used is less than or equal to `MaxTotalBypassMinFeeMsgGasUsage`. Note: the current `MaxTotalBypassMinFeeMsgGasUsage` is set to `1,000,000`. -- In case of non-zero transaction fees, the denom has to be a subset of denoms defined in the global fees list. +Before gaiad `v11.0.0`, `bypass-min-fee-msg-types` can be set by each node in `app.toml`, and [the bypass messages gas usage on average should not exceed `maxBypassMinFeeMsgGasUsage`=200,000](https://github.com/cosmos/gaia/blob/682770f2410ab0d33ac7f0c7203519d7a99fa2b6/x/globalfee/ante/fee.go#L69). -Node operators can configure `bypass-min-fee-msg-types` in `config/app.toml`. - -- Nodes created using Gaiad `v7.0.2` or `v9.0.x` use `["/ibc.core.channel.v1.MsgRecvPacket", "/ibc.core.channel.v1.MsgAcknowledgement","/ibc.applications.transfer.v1.MsgTransfer"]` as defaults. -- Nodes created using Gaiad `v10.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. +- 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 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. +- 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`: +An example of `bypass-min-fee-msg-types` in `app.toml` **before** gaiad v11.0.0: -```shell +``` ############################################################################### ### Custom Gaia Configuration ### @@ -77,6 +81,15 @@ bypass-min-fee-msg-types = ["/ibc.core.channel.v1.MsgRecvPacket", "/ibc.core.cha ``` +## `Minimum-gas-prices` (local fee requirement) + +The `minimum-gas-prices` parameter enables node operators to set its minimum fee requirements, and it can be set in the `config/app.toml` file. Please note: if `minimum-gas-prices` is set to include zero coins, the zero coins are sanitized when [`SetMinGasPrices`](https://github.com/cosmos/gaia/blob/76dea00bd6d11bfef043f6062f41e858225820ab/cmd/gaiad/cmd/root.go#L221). +When setting `minimum-gas-prices`, it's important to keep the following rules in mind: + +- The denoms in `min-gas-prices` that are not present in the global fees list are ignored. +- The amounts in `min-gas-prices` that are lower than global fees `MinimumGasPricesParam` are ignored. +- The amounts in `min-gas-prices` are considered as fee requirement only if they are greater than the amounts for the corresponding denoms in the global fees list. + ## Fee AnteHandler Behaviour The denoms in the global fees list and the `minimum-gas-prices` param are merged and de-duplicated while keeping the higher amounts. Denoms that are only in the `minimum-gas-prices` param are discarded. @@ -85,17 +98,32 @@ If the denoms of the transaction fees are a subset of the merged fees and at lea ## Queries -CLI queries can be used to retrieve the global fee value: +CLI queries can be used to retrieve the globalfee params: ```shell -gaiad q globalfee minimum-gas-prices -# or -gaiad q params subspace globalfee MinimumGasPricesParam +gaiad q globalfee params + +{ + "minimum_gas_prices": [ + { + "denom": "uatom", + "amount": "0.002000000000000000" + }, + ], + "bypass_min_fee_msg_types": [ + "/ibc.core.channel.v1.MsgRecvPacket", + "/ibc.core.channel.v1.MsgAcknowledgement", + "/ibc.core.client.v1.MsgUpdateClient", + "/ibc.core.channel.v1.MsgTimeout", + "/ibc.core.channel.v1.MsgTimeoutOnClose" + ], + "max_total_bypass_min_fee_msg_gas_usage": "2000000" +} ``` -If the global fee is not set, the query returns an empty global fees list: `minimum_gas_prices: []`. In this case the Cosmos Hub will use `0uatom` as global fee in this case (the default fee denom). +If the global fees `MinimumGasPricesParam` is not set, the query returns an empty global fees list: `minimum_gas_prices: []`. In this case the Cosmos Hub will use `0uatom` as global fee in this case (the default fee denom). -## Setting Up Global Fees via Gov Proposals +## Setting Up Globalfee Params via Gov Proposals An example of setting up a global fee by a gov proposals is shown below. @@ -103,12 +131,12 @@ An example of setting up a global fee by a gov proposals is shown below. gov submit-proposal param-change proposal.json ```` -A `proposal.json` example: +A `proposal.json` example to change the `MinimumGasPricesParam` in globalfee params: -```json +``` { - "title": "Global fees Param Change", - "description": "Update global fees", + "title": "Global fee Param Change", + "description": "Update global fee", "changes": [ { "subspace": "globalfee", @@ -119,17 +147,48 @@ A `proposal.json` example: "deposit": "1000stake" } ``` - **Note:** in the above "value" field, coins must sorted alphabetically by denom. +A `proposal.json` example to change the `bypassMinFeeMsgTypes` in globalfee params: + +``` +{ + "title": "Globalfee Param Change", + "description": "Update globalfee Params", + "changes": [ + { + "subspace": "Globalfee", + "key": "BypassMinFeeMsgTypes", + "value": ["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", "/ibc.core.channel.v1.MsgRecvPacket", "/ibc.core.client.v1.MsgUpdateClient"] + } + ], + "deposit": "1000000uatom" +} +``` +A `proposal.json` example to change the `maxTotalBypassMinFeeMsgGasUsage` in globalfee params: +``` +{ + "title": "Globalfee Param Change", + "description": "Update globalfee Params", + "changes": [ + { + "subspace": "globalfee", + "key": "MaxTotalBypassMinFeeMsgGasUsage", + "value": 5000 + } + ], + "deposit": "1000000uatom" +} +``` + ## Examples Here are a few examples to clarify the relationship between global fees, minimum-gas-prices and transaction fees. -**Note:** Transactions can include zero-coin fees. However, these fees are removed from the transaction fees during the fee [parsing](https://github.com/cosmos/cosmos-sdk/blob/e716e4103e934344aa7be6dc9b5c453bdec5f225/client/tx/factory.go#L144) / [santitizing](https://github.com/cosmos/cosmos-sdk/blob/e716e4103e934344aa7be6dc9b5c453bdec5f225/types/dec_coin.go#L172) before reaching the fee AnteHandler. +**Note:** Transactions can include zero-coin fees. However, these fees are removed from the transaction fees during the fee [parsing](https://github.com/cosmos/cosmos-sdk/blob/e716e4103e934344aa7be6dc9b5c453bdec5f225/client/tx/factory.go#L144) / [sanitizing](https://github.com/cosmos/cosmos-sdk/blob/e716e4103e934344aa7be6dc9b5c453bdec5f225/types/dec_coin.go#L172) before reaching the fee AnteHandler. This means `paidfee = "1uatom, 0stake"` and `paidfee = "1uatom"` are equivalent, and similarly, `paidfee = "0uatom"` is equivalent to `paidfee = ""`. -In the following examples, zero-coin fees are removed from the transaction fees. +In the following examples, zero-coin fees are removed from the transaction fees, globalfee refers to `MinimumGasPricesParam` in globalfee params, minimum-gas-prices refers to the local `minimum-gas-prices` setup in `app.toml`. ### Case 1 @@ -201,22 +260,40 @@ Note that the required amount of `uatom` in globalfee is overwritten by the amou ### Case 7 -**Setting:** globalfee=[0.1uatom], minimum-gas-prices=[0.2uatom, 1stake], gas=200000, bypass-min-fee-msg-types = ["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward"] +**Setting:** globalfee=[0.1uatom], minimum-gas-prices=[0.2uatom, 1stake], gas=600,000,\ +max-total-bypass-min-fee-msg-gas-usage=1,000,000,\ +bypass-min-fee-msg-types = [\ +"/ibc.core.channel.v1.MsgRecvPacket",\ +"/ibc.core.channel.v1.MsgAcknowledgement",\ +"/ibc.core.client.v1.MsgUpdateClient",\ +"/ibc.core.channel.v1.MsgTimeout",\ +"/ibc.core.channel.v1.MsgTimeoutOnClose"\ +] Note that the required amount of `uatom` in globalfee is overwritten by the amount in minimum-gas-prices. Also, the `1stake` in minimum-gas-prices is ignored. - - msg withdraw-all-rewards with paidfee="", `pass` - - msg withdraw-all-rewards with paidfee="200000 * 0.05uatom", `pass` - - msg withdraw-all-rewards with paidfee="200000 * 1stake", `fail` (unexpected denom) + - 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= ["/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` + - msgs=["/ibc.core.channel.v1.MsgRecvPacket", "/ibc.core.client.v1.MsgUpdateClient"] with paidfee="600000 * 1stake", `fail` (unexpected denom) ### Case 8 -**Setting:** globalfee=[1uatom], minimum-gas-prices="", gas=300000, bypass-min-fee-msg-types = ["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward"] - - - msg withdraw-all-rewards with paidfee="", `fail` (gas limit exceeded for bypass transactions) - - msg withdraw-all-rewards with paidfee="300000 * 0.5uatom", `fail` (gas limit exceeded for bypass transactions, insufficient funds) - - msg withdraw-all-rewards with paidfee="300000 * 1uatom", `pass` +**Setting:** globalfee=[1uatom], minimum-gas-prices="0uatom", gas=1,100,000 or 200,\ +max-total-bypass-min-fee-msg-gas-usage=1,000,000,\ +bypass-min-fee-msg-types = [\ +"/ibc.core.channel.v1.MsgRecvPacket",\ +"/ibc.core.channel.v1.MsgAcknowledgement",\ +"/ibc.core.client.v1.MsgUpdateClient",\ +"/ibc.core.channel.v1.MsgTimeout",\ +"/ibc.core.channel.v1.MsgTimeoutOnClose"\ +] + - msgs=["/ibc.core.channel.v1.MsgRecvPacket", "/ibc.core.client.v1.MsgUpdateClient"] with paidfee="" and gas=1,100,000, `fail` (gas limit exceeded for bypass transactions) + - msgs=["/ibc.core.channel.v1.MsgRecvPacket", "/ibc.core.client.v1.MsgUpdateClient"] with paidfee="200 * 1uatom" and gas=200, `fail` (insufficient funds) + - msgs=["/ibc.core.channel.v1.MsgRecvPacket", "/ibc.core.client.v1.MsgUpdateClient"] with paidfee="1,100,000 * 1uatom", `pass` ## References diff --git a/docs/package-lock.json b/docs/package-lock.json index 84023d52d0..dac336b11f 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -14,7 +14,7 @@ "vue-tabs-component": "^1.5.0", "vue-template-compiler": "^2.6.11", "vuepress-plugin-tabs": "^0.3.0", - "vuepress-theme-cosmos": "^1.0.183" + "vuepress-theme-cosmos": "^1.0.184" }, "devDependencies": { "picocolors": "^1.0.0" @@ -13684,9 +13684,9 @@ "integrity": "sha512-jooDlcMdBqhXgIaF1awFSaOTM56mleP6bbCiGxyQxTZexfvCfDvZhNLGpyXqMQA50ZmNGmvLrK82YYb63k1jfA==" }, "node_modules/vuepress-theme-cosmos": { - "version": "1.0.183", - "resolved": "https://registry.npmjs.org/vuepress-theme-cosmos/-/vuepress-theme-cosmos-1.0.183.tgz", - "integrity": "sha512-nLSL0YF6ar2yhZkDvp6o313xBSu/Zc3O3OxRsgLMZcKyWanNqyyh0jFrUqMZcjz7vylRRDth6C2/E0YeisFCbw==", + "version": "1.0.184", + "resolved": "https://registry.npmjs.org/vuepress-theme-cosmos/-/vuepress-theme-cosmos-1.0.184.tgz", + "integrity": "sha512-BitOXaVTZgx82oGeQomNvbwWOORB95VEJjTPdrj6yAWXwshlaIxK4VPFtljw3PsGnLoNxL5YKfYoDmqtgMmnTg==", "dependencies": { "@cosmos-ui/vue": "^0.35.0", "@vuepress/plugin-google-analytics": "1.8.2", @@ -25322,9 +25322,9 @@ "integrity": "sha512-jooDlcMdBqhXgIaF1awFSaOTM56mleP6bbCiGxyQxTZexfvCfDvZhNLGpyXqMQA50ZmNGmvLrK82YYb63k1jfA==" }, "vuepress-theme-cosmos": { - "version": "1.0.183", - "resolved": "https://registry.npmjs.org/vuepress-theme-cosmos/-/vuepress-theme-cosmos-1.0.183.tgz", - "integrity": "sha512-nLSL0YF6ar2yhZkDvp6o313xBSu/Zc3O3OxRsgLMZcKyWanNqyyh0jFrUqMZcjz7vylRRDth6C2/E0YeisFCbw==", + "version": "1.0.184", + "resolved": "https://registry.npmjs.org/vuepress-theme-cosmos/-/vuepress-theme-cosmos-1.0.184.tgz", + "integrity": "sha512-BitOXaVTZgx82oGeQomNvbwWOORB95VEJjTPdrj6yAWXwshlaIxK4VPFtljw3PsGnLoNxL5YKfYoDmqtgMmnTg==", "requires": { "@cosmos-ui/vue": "^0.35.0", "@vuepress/plugin-google-analytics": "1.8.2", diff --git a/docs/package.json b/docs/package.json index 055e1b744d..71b8e79057 100644 --- a/docs/package.json +++ b/docs/package.json @@ -9,7 +9,7 @@ "vue-tabs-component": "^1.5.0", "vue-template-compiler": "^2.6.11", "vuepress-plugin-tabs": "^0.3.0", - "vuepress-theme-cosmos": "^1.0.183" + "vuepress-theme-cosmos": "^1.0.184" }, "scripts": { "serve": "trap 'exit 0' SIGINT; vuepress dev --no-cache", diff --git a/docs/readiness/README.md b/docs/readiness/README.md index 77fb64c193..98d8e19ac7 100644 --- a/docs/readiness/README.md +++ b/docs/readiness/README.md @@ -41,7 +41,7 @@ If recorded decisions turned out to be lacking, convene a discussion, record the 2. Link the ADR in the related feature epic 3. Create a draft Pull Request if you want to get early feedback. 4. Make sure the context and a solution is clear and well documented. -5. Add an entry to a list in the README file [Table of Contents](#ADR-Table-of-Contents). +5. Add an entry to a list in the README file [Table of Contents](#adr-table-of-contents). 6. Create a Pull Request to publish the ADR proposal. ### Life cycle diff --git a/docs/roadmap/README.md b/docs/roadmap/README.md index 466a67b13d..e2bfd009fc 100644 --- a/docs/roadmap/README.md +++ b/docs/roadmap/README.md @@ -1,17 +1,81 @@ -# Roadmap +# Previous Releases -## Roadmap 2.0 +Please see the table below for libray versions and other dependencies. + + +## Cosmos Hub Release Details -For current roadmap, check out the Cosmos 2.0 [Roadmap](./cosmos-hub-roadmap-2.0.md). +### Delta Upgrade (Completed July 12, 2021) -## Cosmos Hub History +- Gaia v5.0.x +- Gravity DEX: + - A scalable AMM model for token swaps + - Drives liquidity for tokens on the Cosmos Hub + - Delivers price consistency and order execution + +### Vega Upgrade (Completed December 14, 2021) + +- Gaia v6.0.x +- Cosmos SDK v0.44 + - Fee grant module: + - Allows paying fees on behalf of another account + - Authz module: + - Provide governance functions to execute transactions on behalf of another account +- Liquidity Module v1.4.2 + - The Gravity DEX with updates for dependencies +- IBC v2.0.0 +- Tendermint v0.34.14 +- Cosmosvisor v0.1.0 +- IBC packet forward middleware v1.0.1 + - Cosmos Hub as a router + +- External chain launch: Gravity Bridge + - Transfer ATOM, ETH, ERC-20, and other Cosmos tokens between Ethereum and the Gravity Bridge Chain and by extension all IBC connected chains. + - Fee and reward model hosted across Cosmos and Ethereum + +### v7-Theta Upgrade (Completed March 25, 2022) + +- Gaia v7.0.x +- Cosmos SDK v0.45 + - Minimal update with small fixes +- Gravity DEX: Liquidity v1.4.5 + - Adds a circuit breaker governance proposal type to disable adding new liquidity in order to make a migration possible. +- IBC 3.0.0 + - Interchain Account Module + - Allows the creation of accounts on a "Host" blockchain which are controlled by an authentication module on a "Controller" blockchain. + - Arbitrary messages are able to be submitted from the "Controller" blockchain to the "Host" blockchain to be executed on behalf of the Interchain Account. + - Uses ordered IBC channels, one per account. + +### v8-Rho Upgrade (expected Q1 2023) + +- Gaia v8.0.x +- Cosmos SDK v0.45.12 + - Version bump with a number of fixes + - See [changelog](https://github.com/cosmos/cosmos-sdk/blob/v0.45.12/CHANGELOG.md) for details +- IBC v3.4 + - See [changelog](https://github.com/cosmos/ibc-go/blob/v3.4.0/CHANGELOG.md) for details +- IBC Packet Forward Middleware v3.1.1 +- IBC Msg Whitelist to skip MinFee in CheckTX +- Global Fee Module + - Allows denoms and min-fees to be governance parameters so gas can be paid in various denoms. + - Visible on [tgrade](https://github.com/confio/tgrade/tree/main/x/globalfee) already and enabled in [ante.go](https://github.com/confio/tgrade/blob/main/app/ante.go#L72-L92) + +### v9-Lambda Upgrade (expected Q1 2023) + +- Gaia v9.0.x +- Cosmos SDK v0.45-ics +- IBC 4.2 +- Interchain Security - Replicated Security + - The Cosmos solution to shared security that uses IBC Cross Chain Validation (CCV) to relay validator set composition from a Provider Chain (Cosmos Hub) to a Consumer Chain. This validator set is in charge of producing blocks on both networks using separate nodes. Misbehavior on the Consumer Chain results in slashing Provider Chain staking tokens (ATOM). + +## Cosmos Hub Summary | Upgrade Name | Date | Height | Chain Identifier | Tm | Cosmos SDK | Gaia | IBC | |---------------------|---------------|-----------|---------------|------------|------------|--------------------------|--------------------------| @@ -22,7 +86,10 @@ For current roadmap, check out the Cosmos 2.0 [Roadmap](./cosmos-hub-roadmap-2.0 | Stargate | 18/02/21 | 5200791 | `cosmoshub-4` | [v0.34.x](https://github.com/tendermint/tendermint/releases/tag/v0.34.3) | [v0.40.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.40.1) | [v4.0.x](https://github.com/cosmos/gaia/releases/tag/v4.0.6) | _Included in Cosmos SDK_ | | Security Hard Fork | ? | ? | `cosmoshub-4` | [v0.34.x](https://github.com/tendermint/tendermint/releases/tag/v0.34.8) | [v0.41.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.41.4) | [v4.2.x](https://github.com/cosmos/gaia/releases/tag/v4.2.1) | _Included in Cosmos SDK_ | | Delta (Gravity DEX) | 13/07/21 | 6910000 | `cosmoshub-4` | [v0.34.x](https://github.com/tendermint/tendermint/releases/tag/v0.34.13) | [v0.42.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.10) | [v5.0.x](https://github.com/cosmos/gaia/releases/tag/v5.0.8) | _Included in Cosmos SDK_ | -| Vega | 13/12/21 | 8695000 | `cosmoshub-4` | [v0.34.x](https://github.com/tendermint/tendermint/releases/tag/v0.34.14) | [v0.44.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.44.5) | [v6.0.x](https://github.com/cosmos/gaia/releases/tag/v6.0.4) | [v2.0.x](https://github.com/cosmos/ibc-go/releases/tag/v2.0.3) | -| Theta | 12/04/22 | 10085397 | `cosmoshub-4` | [v0.34.x](https://github.com/tendermint/tendermint/releases/tag/v0.34.14) | [v0.45.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.1) | [v7.0.x](https://github.com/cosmos/gaia/releases/tag/v7.0.0) | [v3.0.x](https://github.com/cosmos/ibc-go/releases/tag/v3.0.0) | -| Rho | 16/02/23 | 14099412 | `cosmoshub-4` | [v0.34.x](https://github.com/informalsystems/tendermint/releases/tag/v0.34.24) | [v0.45.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.12) | [v8.0.x](https://github.com/cosmos/gaia/releases/tag/v8.0.0) | [v3.4.x](https://github.com/cosmos/ibc-go/releases/tag/v3.4.0) | -| Lambda | 15/03/23 | 14470501 | `cosmoshub-4` | [v0.34.x](https://github.com/informalsystems/tendermint/releases/tag/v0.34.25) | [v0.45.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.13-ics) | [v9.0.x](https://github.com/cosmos/gaia/releases/tag/v9.0.0) | [v4.2.x](https://github.com/cosmos/ibc-go/releases/tag/v4.2.0) | +| Vega v6 | 13/12/21 | 8695000 | `cosmoshub-4` | [v0.34.x](https://github.com/tendermint/tendermint/releases/tag/v0.34.14) | [v0.44.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.44.5) | [v6.0.x](https://github.com/cosmos/gaia/releases/tag/v6.0.4) | [v2.0.x](https://github.com/cosmos/ibc-go/releases/tag/v2.0.3) | +| Theta v7 | 12/04/22 | 10085397 | `cosmoshub-4` | [v0.34.x](https://github.com/tendermint/tendermint/releases/tag/v0.34.14) | [v0.45.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.1) | [v7.0.x](https://github.com/cosmos/gaia/releases/tag/v7.0.0) | [v3.0.x](https://github.com/cosmos/ibc-go/releases/tag/v3.0.0) | +| Rho v8 | 16/02/23 | 14099412 | `cosmoshub-4` | [v0.34.x](https://github.com/informalsystems/tendermint/releases/tag/v0.34.24) | [v0.45.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.12) | [v8.0.x](https://github.com/cosmos/gaia/releases/tag/v8.0.0) | [v3.4.x](https://github.com/cosmos/ibc-go/releases/tag/v3.4.0) | +| Lambda v9 | 15/03/23 | 14470501 | `cosmoshub-4` | [v0.34.x](https://github.com/informalsystems/tendermint/releases/tag/v0.34.25) | [v0.45.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.13-ics) | [v9.0.x](https://github.com/cosmos/gaia/releases/tag/v9.0.0) | [v4.2.x](https://github.com/cosmos/ibc-go/releases/tag/v4.2.0) | +| Epsilon v10 | 21/06/23 | 15816200 | `cosmoshub-4` | [v0.34.x](https://github.com/cometbft/cometbft/releases/tag/v0.34.28) | [v0.45.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.16-ics) | [v10.0.x](https://github.com/cosmos/gaia/releases/tag/v10.0.0) | [v4.4.x](https://github.com/cosmos/ibc-go/releases/tag/v4.4.0) | + + diff --git a/docs/roadmap/cosmos-hub-roadmap-2.0.md b/docs/roadmap/cosmos-hub-roadmap-2.0.md index 0ef9d9458a..b016c2571e 100644 --- a/docs/roadmap/cosmos-hub-roadmap-2.0.md +++ b/docs/roadmap/cosmos-hub-roadmap-2.0.md @@ -1,66 +1,7 @@ # The Cosmos Hub Roadmap -This Cosmos Hub roadmap serves as a reference for the current planned features of upcoming releases, as well as providing a record of past releases. +This Cosmos Hub roadmap serves as a reference for the current planned features of upcoming releases. For past releases, please see the following [document](./README.md). -## Delta Upgrade (Completed July 12, 2021) +The Cosmos Hub is decentralized and other teams contribute to it as well. -- Gaia v5.0.x -- Gravity DEX: - - A scalable AMM model for token swaps - - Drives liquidity for tokens on the Cosmos Hub - - Delivers price consistency and order execution - -## Vega Upgrade (Completed December 14, 2021) - -- Gaia v6.0.x -- Cosmos SDK v0.44 - - Fee grant module: - - Allows paying fees on behalf of another account - - Authz module: - - Provide governance functions to execute transactions on behalf of another account -- Liquidity Module v1.4.2 - - The Gravity DEX with updates for dependencies -- IBC v2.0.0 -- Tendermint v0.34.14 -- Cosmosvisor v0.1.0 -- IBC packet forward middleware v1.0.1 - - Cosmos Hub as a router - -- External chain launch: Gravity Bridge - - Transfer ATOM, ETH, ERC-20, and other Cosmos tokens between Ethereum and the Gravity Bridge Chain and by extension all IBC connected chains. - - Fee and reward model hosted across Cosmos and Ethereum - -## v7-Theta Upgrade (Completed March 25, 2022) - -- Gaia v7.0.x -- Cosmos SDK v0.45 - - Minimal update with small fixes -- Gravity DEX: Liquidity v1.4.5 - - Adds a circuit breaker governance proposal type to disable adding new liquidity in order to make a migration possible. -- IBC 3.0.0 - - Interchain Account Module - - Allows the creation of accounts on a "Host" blockchain which are controlled by an authentication module on a "Controller" blockchain. - - Arbitrary messages are able to be submitted from the "Controller" blockchain to the "Host" blockchain to be executed on behalf of the Interchain Account. - - Uses ordered IBC channels, one per account. - -## v8-Rho Upgrade (expected Q1 2023) - -- Gaia v8.0.x -- Cosmos SDK v0.45.12 - - Version bump with a number of fixes - - See [changelog](https://github.com/cosmos/cosmos-sdk/blob/v0.45.12/CHANGELOG.md) for details -- IBC v3.4 - - See [changelog](https://github.com/cosmos/ibc-go/blob/v3.4.0/CHANGELOG.md) for details -- IBC Packet Forward Middleware v3.1.1 -- IBC Msg Whitelist to skip MinFee in CheckTX -- Global Fee Module - - Allows denoms and min-fees to be governance parameters so gas can be paid in various denoms. - - Visible on [tgrade](https://github.com/confio/tgrade/tree/main/x/globalfee) already and enabled in [ante.go](https://github.com/confio/tgrade/blob/main/app/ante.go#L72-L92) - -## v9-Lambda Upgrade (expected Q1 2023) - -- Gaia v9.0.x -- Cosmos SDK v0.45 -- IBC 4.2 -- Interchain Security - Replicated Security - - The Cosmos solution to shared security that uses IBC Cross Chain Validation (CCV) to relay validator set composition from a Provider Chain (Cosmos Hub) to a Consumer Chain. This validator set is in charge of producing blocks on both networks using separate nodes. Misbehavior on the Consumer Chain results in slashing Provider Chain staking tokens (ATOM). +The Informal Systems roadmap can be found [here](https://docs.google.com/document/d/1EsA7WstAVz9kHfLeaBAUYo0cFNKcdkwnfDPP3xKzN4I/edit#heading=h.2hlqd6ar7xmu). Other teams also contribute actively to the Hub, but that information lives in other repos or project boards. diff --git a/docs/validators/overview.md b/docs/validators/overview.md index 44691d7c87..f945891337 100644 --- a/docs/validators/overview.md +++ b/docs/validators/overview.md @@ -7,9 +7,9 @@ title: Overview ## Introduction -The [Cosmos Hub](../README.md) is based on [Tendermint](https://github.com/tendermint/tendermint/tree/master/docs/introduction) that relies on a set of validators that are responsible for committing new blocks in the blockchain. These validators participate in the consensus protocol by broadcasting votes that contain cryptographic signatures signed by each validator's private key. +The [Cosmos Hub](../README.md) is based on [CometBFT](https://docs.cometbft.com/v0.34/introduction/what-is-cometbft) that relies on a set of validators that are responsible for committing new blocks in the blockchain. These validators participate in the consensus protocol by broadcasting votes that contain cryptographic signatures signed by each validator's private key. -Validator candidates can bond their own ATOM and have ATOM ["delegated"](../delegators/delegator-guide-cli.md), or staked, to them by token holders. The Cosmos Hub has [175 validators](https://www.mintscan.io/cosmos/proposals/66), but over time the number of validators can be increased with governance proposals. The validators are determined by the total number of ATOM tokens delegated to them — the top 175 validator candidates with the most voting power are the current Cosmos validators. +Validator candidates can bond their own ATOM and have ATOM ["delegated"](../delegators/delegator-guide-cli.md), or staked, to them by token holders. The Cosmos Hub has [180 validators](https://www.mintscan.io/cosmos/proposals/66), but over time the number of validators can be increased with governance proposals. The validators are determined by the total number of ATOM tokens delegated to them — the top 180 validator candidates with the most voting power are the current Cosmos validators. Validators and their delegators earn ATOM as block provisions and tokens as transaction fees through execution of the Tendermint consensus protocol. Note that validators can set a commission percentage on the fees their delegators receive as additional incentive. You can find an overview of all current validators and their voting power on [Mintscan](https://www.mintscan.io/cosmos/validators). diff --git a/docs/validators/security.md b/docs/validators/security.md index d1143f96ef..05b62889bc 100644 --- a/docs/validators/security.md +++ b/docs/validators/security.md @@ -13,7 +13,7 @@ It is mission critical that an attacker cannot steal a validator's key. If this HSM modules must support `ed25519` signatures for the hub. The YubiHSM2 supports `ed25519` and [this yubikey library is available](https://github.com/iqlusioninc/yubihsm.rs). The YubiHSM can protect a private key but cannot ensure in a secure setting that it won't sign the same block twice. -The Tendermint team is also working on extending our Ledger Nano S application to support validator signing. This app can store recent blocks and mitigate double signing attacks. +The CometBFT team is also working on extending our Ledger Nano S application to support validator signing. This app can store recent blocks and mitigate double signing attacks. We will update this page when more key storage solutions become available. @@ -54,7 +54,7 @@ private_peer_ids = "node_ids_of_private_peers" By default, uppercase environment variables with the following prefixes will replace lowercase command-line flags: - `GA` (for Gaia flags) -- `TM` (for Tendermint flags) +- `TM` (for Tendermint/CometBFT flags) - `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. diff --git a/docs/validators/validator-faq.md b/docs/validators/validator-faq.md index 2f962e931d..8ab1c4cdc6 100644 --- a/docs/validators/validator-faq.md +++ b/docs/validators/validator-faq.md @@ -13,7 +13,7 @@ This is work in progress. Mechanisms and values are susceptible to change. ### What is a Cosmos validator? -The [Cosmos Hub](../getting-started/what-is-gaia.md) is based on [Tendermint](https://docs.tendermint.com/v0.34/introduction/what-is-tendermint.html) that relies on a set of validators to secure the network. The role of validators is to run a full node and participate in consensus by broadcasting votes that contain cryptographic signatures signed by the validator's private key. Validators commit new blocks in the blockchain and receive revenue in exchange for their work. Validators must also participate in governance by voting on proposals. Validators are weighted according to their total stake. +The [Cosmos Hub](../getting-started/what-is-gaia.md) is based on [CometBFT](https://docs.cometbft.com/v0.34/introduction/what-is-cometbft) that relies on a set of validators to secure the network. The role of validators is to run a full node and participate in consensus by broadcasting votes that contain cryptographic signatures signed by the validator's private key. Validators commit new blocks in the blockchain and receive revenue in exchange for their work. Validators must also participate in governance by voting on proposals. Validators are weighted according to their total stake. ### What is staking? @@ -45,7 +45,7 @@ Delegators play a critical role in the system, as they are responsible for choos Any participant in the network can signal that they want to become a validator by sending a `create-validator` transaction, where they must fill out the following parameters: -- **Validator's `PubKey`:** The private key associated with this Tendermint `PubKey` is used to sign _prevotes_ and _precommits_. +- **Validator's `PubKey`:** The private key associated with this Tendermint/CometBFT `PubKey` is used to sign _prevotes_ and _precommits_. - **Validator's Address:** Application level address that is used to publicly identify your validator. The private key associated with this address is used to delegate, unbond, claim rewards, and participate in governance. - **Validator's name (moniker)** - **Validator's website (Optional)** @@ -57,7 +57,7 @@ Any participant in the network can signal that they want to become a validator b After a validator is created, ATOM holders can delegate ATOM to them, effectively adding stake to the validator's pool. The total stake of an address is the combination of ATOM bonded by delegators and ATOM self-bonded by the validator. -From all validator candidates that signaled themselves, the 175 validators with the most total stake are the designated **validators**. If a validator's total stake falls below the top 175, then that validator loses its validator privileges. The validator cannot participate in consensus or generate rewards until the stake is high enough to be in the top 175. Over time, the maximum number of validators may be increased via on-chain governance proposal. +From all validator candidates that signaled themselves, the 180 validators with the most total stake are the designated **validators**. If a validator's total stake falls below the top 180, then that validator loses its validator privileges. The validator cannot participate in consensus or generate rewards until the stake is high enough to be in the top 180. Over time, the maximum number of validators may be increased via on-chain governance proposal. ## Testnet @@ -73,12 +73,12 @@ Testnet participation is a great way to signal to the community that you are rea There are two types of keys: -- **Tendermint key**: A unique key that is used to sign consensus votes. +- **Tendermint/CometBFT key**: A unique key that is used to sign consensus votes. - It is associated with a public key `cosmosvalconspub` (To get this value, run `gaiad tendermint show-validator`) - It is generated when the node is created with `gaiad init`. - **Application key**: This key is created from the `gaiad` binary and is used to sign transactions. Application keys are associated with a public key that is prefixed by `cosmospub` and an address that is prefixed by `cosmos`. -The Tendermint key and the application key are derived from account keys that are generated by the `gaiad keys add` command. +The Tendermint/CometBFT key and the application key are derived from account keys that are generated by the `gaiad keys add` command. **Note:** A validator's operator key is directly tied to an application key and uses the `cosmosvaloper` and `cosmosvaloperpub` prefixes that are reserved solely for this purpose. @@ -112,7 +112,7 @@ Delegators are free to choose validators according to their own subjective crite - **Track record:** Delegators review the track record of the validators they plan to delegate to. This track record includes past votes on proposals and historical average uptime. - **Community contributions:** Another (more subjective) criteria is the work that validators have contributed to the community, such as educational content, participation in the community channels, contributions to open source software, etc. -Apart from these criteria, validators send a `create-validator` transaction to signal a website address to complete their resume. Validators must build reputation one way or another to attract delegators. For example, a good practice for validators is to have a third party audit their setup. Note though, that the Tendermint team does not approve or conduct any audits themselves. For more information on due diligence, see the [A Delegator’s Guide to Staking](https://medium.com/@interchain_io/3d0faf10ce6f) blog post. +Apart from these criteria, validators send a `create-validator` transaction to signal a website address to complete their resume. Validators must build reputation one way or another to attract delegators. For example, a good practice for validators is to have a third party audit their setup. Note though, that the CometBFT team does not approve or conduct any audits themselves. For more information on due diligence, see the [A Delegator’s Guide to Staking](https://medium.com/@interchain_io/3d0faf10ce6f) blog post. ## Responsibilities @@ -249,7 +249,7 @@ The community is expected to behave in a smart and self-preserving way. When a m A modest level of hardware specifications is initially required and rises as network use increases. Participating in the testnet is the best way to learn more. You can find the current hardware recommendations in the [Joining Mainnet documentation](../hub-tutorials/join-mainnet.md). -Validators are recommended to set up [sentry nodes](https://docs.tendermint.com/v0.34/tendermint-core/validators.html) to protect your validator node from DDoS attacks. +Validators are recommended to set up [sentry nodes](https://docs.cometbft.com/v0.34/core/validators) to protect your validator node from DDoS attacks. ### What are software requirements? @@ -296,4 +296,4 @@ Validator nodes are expected to connect only to full nodes they trust because th 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 strategy ensures that validator block proposals and votes have a much higher chance to make it to the rest of the network. -For more sentry node details, see the [Tendermint Documentation](https://docs.tendermint.com/v0.34/tendermint-core/validators.html) or the [Sentry Node Architecture Overview](https://forum.cosmos.network/t/sentry-node-architecture-overview/454) on the forum. +For more sentry node details, see the [CometBFT Documentation](https://docs.cometbft.com/v0.34/core/validators) or the [Sentry Node Architecture Overview](https://forum.cosmos.network/t/sentry-node-architecture-overview/454) on the forum. diff --git a/docs/validators/validator-setup.md b/docs/validators/validator-setup.md index bdd0abaa65..548829568a 100644 --- a/docs/validators/validator-setup.md +++ b/docs/validators/validator-setup.md @@ -138,7 +138,7 @@ the block. ## Advanced configuration -You can find more advanced information about running a node or a validator on the [Tendermint Core documentation](https://docs.tendermint.com/v0.34/tendermint-core/validators.html). +You can find more advanced information about running a node or a validator on the [CometBFT Core documentation](https://docs.cometbft.com/v0.34/core/validators). ## Common Problems diff --git a/docs/zh/delegator/delegator-guide-cli.md b/docs/zh/delegator/delegator-guide-cli.md index 998153a2fa..9db6d827c0 100644 --- a/docs/zh/delegator/delegator-guide-cli.md +++ b/docs/zh/delegator/delegator-guide-cli.md @@ -9,7 +9,7 @@ **重要提示**:请务必按照下面的操作步骤谨慎操作,过程中发生任何错误都有可能导致您永远失去所拥有的通证。因此,请在开始操作之前先仔细阅读全文,如果有任何问题可以联系我们获得支持。 -另请注意,您即将要与Cosmos Hub进行交互,Cosmos Hub仍然是一个试验型的区块链技术软件。虽然Cosmos Hub区块链是应用现有最新技术开发并经过审核的,但我们仍然可能会在运行时遇到问题,需要不断更新和修复漏洞。此外,使用区块链技术仍然要求有很高的技术能力,并且有可能遇到我们无法预知和控制的风险。使用Cosmos Hub前,您需要充分了解与加密软件相关的潜在风险(请参考[Cosmos跨链贡献条款](https://github.com/cosmos/cosmos/blob/master/fundraiser/Interchain%20Cosmos%20Contribution%20Terms%20-%20FINAL.pdf)中关于风险的部分条款),并且我们跨链基金会和(或)Tendermint团队对于因为使用本产品而可能产生的损失不承担任何责任。使用Cosmos Hub需要遵守Apache 2.0开源软件授权条款,用户需要自己承担所有责任,所使用的软件按“现状”提供且不提供任何形式的保障或条件。 +另请注意,您即将要与Cosmos Hub进行交互,Cosmos Hub仍然是一个试验型的区块链技术软件。虽然Cosmos Hub区块链是应用现有最新技术开发并经过审核的,但我们仍然可能会在运行时遇到问题,需要不断更新和修复漏洞。此外,使用区块链技术仍然要求有很高的技术能力,并且有可能遇到我们无法预知和控制的风险。使用Cosmos Hub前,您需要充分了解与加密软件相关的潜在风险(请参考[Cosmos跨链贡献条款](https://github.com/cosmos/cosmos/blob/master/fundraiser/Interchain%20Cosmos%20Contribution%20Terms%20-%20FINAL.pdf)中关于风险的部分条款),并且我们跨链基金会和(或)Tendermint/CometBFT团队对于因为使用本产品而可能产生的损失不承担任何责任。使用Cosmos Hub需要遵守Apache 2.0开源软件授权条款,用户需要自己承担所有责任,所使用的软件按“现状”提供且不提供任何形式的保障或条件。 ::: 请务必谨慎行事! diff --git a/docs/zh/gaia-tutorials/join-mainnet.md b/docs/zh/gaia-tutorials/join-mainnet.md index 1d81627ab9..5769f1071e 100644 --- a/docs/zh/gaia-tutorials/join-mainnet.md +++ b/docs/zh/gaia-tutorials/join-mainnet.md @@ -78,7 +78,7 @@ gaiad start 你还可以到[验证人Riot聊天室](https://riot.im/app/#/room/#cosmos-validators:matrix.org)里询问可用节点。 -你可以阅读[这里](https://github.com/tendermint/tendermint/blob/develop/docs/tendermint-core/using-tendermint.md#peers)了解更多伙伴节点和种子节点的信息。 +你可以阅读[这里](https://github.com/cometbft/cometbft/blob/main/docs/core/using-cometbft.md#peers)了解更多伙伴节点和种子节点的信息。 ::: 警告 在Cosmos Hub主网中,可接受的币种是`uatom`,`1atom = 1.000.000uatom` diff --git a/docs/zh/resources/gaiad.md b/docs/zh/resources/gaiad.md index f23a186133..a8e8289ab7 100644 --- a/docs/zh/resources/gaiad.md +++ b/docs/zh/resources/gaiad.md @@ -93,10 +93,10 @@ gaiad keys list gaiad tendermint show-validator ``` -请注意,这是Tendermint的签名密钥,而不是你在委托交易中使用的操作员密钥。 +请注意,这是CometBFT的签名密钥,而不是你在委托交易中使用的操作员密钥。 ::: danger Warning -我们强烈建议不要对多个密钥使用相同的密码。Tendermint 团队和 Interchain Foundation 将不承担资金损失的责任。 +我们强烈建议不要对多个密钥使用相同的密码。CometBFT 团队和 Interchain Foundation 将不承担资金损失的责任。 ::: #### 生成多签公钥 diff --git a/docs/zh/resources/genesis.md b/docs/zh/resources/genesis.md index 76a84d85bb..e02167ad43 100644 --- a/docs/zh/resources/genesis.md +++ b/docs/zh/resources/genesis.md @@ -33,7 +33,7 @@ genesis 文件中定义的状态包含所有必要的信息,如初始令牌分 ## 共识参数 -接下来,创世文件定义共识参数。 共识参数覆盖与共识层相关的所有参数,`gaia` 的共识层是 `Tendermint`。 我们来看看这些参数: +接下来,创世文件定义共识参数。 共识参数覆盖与共识层相关的所有参数,`gaia` 的共识层是 `CometBFT`。 我们来看看这些参数: - `block` - `max_bytes`: 每个块的最大字节数。 diff --git a/docs/zh/validators/overview.md b/docs/zh/validators/overview.md index 1655e51c38..c80f9ff1e4 100644 --- a/docs/zh/validators/overview.md +++ b/docs/zh/validators/overview.md @@ -3,11 +3,11 @@ ## 介绍 -Cosmos Hub基于Tendermint,它依赖于一组负责在区块链中提交新区块的验证人。这些验证人通过广播投票来参与共识协议,投票包含由每个验证人的私钥签名的加密签名。 +Cosmos Hub基于CometBFT,它依赖于一组负责在区块链中提交新区块的验证人。这些验证人通过广播投票来参与共识协议,投票包含由每个验证人的私钥签名的加密签名。 验证人候选者可以绑定他们自己的Atoms=,还能让token持有者将Atoms=“委托”或“抵押”给他们。Cosmos Hub将有100个验证人,但随着时间的推移,将根据预定义的时间表增加到300个验证人。验证人根据谁拥有最多的投票权来确定——拥有最多股权的前100名验证人候选者将成为Cosmos的验证人。 -验证人及其委托人能通过执行Tendermint共识协议赚取Atom作为区块增发奖励和作为交易手续费的其他token。最初,交易费用将以Atom支付,但在将来,Cosmos生态中的任何token如果通过治理加入到白名单中,就能作为有效的交易手续费。请注意,验证人可以设置从他们的委托人身上收取的佣金作为额外奖励。 +验证人及其委托人能通过执行CometBFT共识协议赚取Atom作为区块增发奖励和作为交易手续费的其他token。最初,交易费用将以Atom支付,但在将来,Cosmos生态中的任何token如果通过治理加入到白名单中,就能作为有效的交易手续费。请注意,验证人可以设置从他们的委托人身上收取的佣金作为额外奖励。 如果验证人双签,频繁下线或不参与治理,则可以削减其抵押的Atom(包括那些用户委托给他们的Atom)。处罚取决于违规的严重程度。 diff --git a/docs/zh/validators/security.md b/docs/zh/validators/security.md index d2a0aee75d..bdeb6f07b0 100644 --- a/docs/zh/validators/security.md +++ b/docs/zh/validators/security.md @@ -9,7 +9,7 @@ 为了支持Cosmos Hub,HSM模块必须要支持`ed25519`签名。YubiHSM2支持了`ed25519`,我们期望在2017年12月时,能有一个可以使用的库。YubiHSM可以保护私钥但是不能确保它不会去重复签署一个区块。 -Tendermint团队也在为拓展Ledger Nano S应用以支持验证人签名做贡献。这个应用将会储存最近的区块,并能降低双重签名攻击的风险。 +CometBFT团队也在为拓展Ledger Nano S应用以支持验证人签名做贡献。这个应用将会储存最近的区块,并能降低双重签名攻击的风险。 我们会在有更多关于密钥保存安全的可行的解决方案出现时更新这个文档。 @@ -48,7 +48,7 @@ private_peer_ids = "ipaddress of validator nodes" 默认情况下,具有以下前缀的大写环境变量将替换小写命令行标志: + `GA`(对应Gaia的标识) -+ `TM`(对应Tendermint的标识) ++ `TM`(对应Tendermint, 现在 CometBFT的标识) + `BC`(对应democli或basecli的标识) 例如,环境变量`GA_CHAIN_ID`将映射到命令行标识`--chain-id`。注意,虽然显式命令行标识优先于环境变量,但环境变量优先于任何配置文件。因此,必须锁定环境,以便在CLI上将任何关键参数定义为标识或防止修改任何环境变量。 diff --git a/docs/zh/validators/validator-faq.md b/docs/zh/validators/validator-faq.md index 96f9544aef..492d6c2a80 100644 --- a/docs/zh/validators/validator-faq.md +++ b/docs/zh/validators/validator-faq.md @@ -9,7 +9,7 @@ ### 什么是验证人? -[Cosmos Hub](../what-is-gaia.md)基于[Tendermint](https://tendermint.com/docs/introduction/what-is-tendermint.html),它依靠一组验证人来保障网络的安全。验证人的作用是通过广播包含由验证人的私钥签名的加密签名的投票来运行全节点并参与共识。验证人在区块链中提交新的区块并获得收益作为报酬。他们还必须通过对提案进行投票来参与治理。验证人根据他们的总抵押股权来排位。 +[Cosmos Hub](../what-is-gaia.md)基于[CometBFT](https://docs.cometbft.com/v0.34/introduction/what-is-cometbft),它依靠一组验证人来保障网络的安全。验证人的作用是通过广播包含由验证人的私钥签名的加密签名的投票来运行全节点并参与共识。验证人在区块链中提交新的区块并获得收益作为报酬。他们还必须通过对提案进行投票来参与治理。验证人根据他们的总抵押股权来排位。 ### 什么是'抵押'? @@ -78,7 +78,7 @@ Cosmos Hub是一个权益证明(PoS)区块链,意味着验证人的权重 简而言之有两种密钥: -+ **Tendermint Key** :这是用于对区块哈希进行签名的唯一密钥。它与一个公钥`cosmosvalconspub`相关联。 ++ **CometBFT/Tendermint Key** :这是用于对区块哈希进行签名的唯一密钥。它与一个公钥`cosmosvalconspub`相关联。 + 使用`gaiad init`创建节点时生成。 + 使用`gaiad tendermint show-validator`查看,如`cosmosvalconspub1zcjduc3qcyj09qc03elte23zwshdx92jm6ce88fgc90rtqhjx8v0608qh5ssp0w94c`。 + **Application keys** :这些密钥是由应用程序创建的,用于签名交易。作为验证人,你可能会使用一个密钥来签名与抵押相关的交易,另一个密钥用于签署与治理相关的交易。应用程序私钥和公钥`cosmospub`及地址`cosmos`相关联。两者都来自`gaiad keys add`生成的帐户私钥。 @@ -113,7 +113,7 @@ Cosmos Hub是一个权益证明(PoS)区块链,意味着验证人的权重 + **佣金比率**: 在把奖励分散给委托人之前抽成一部分佣金来奖励验证人。 + **跟踪记录**:委托人很可能去查看他们计划去委托的验证人的行为记录。包括资历,过去对提议的投票,历史的平均运行时长和验证人节点掉线的频率。 -除去这些会展示在Cosmos Voyager上的评判标准,验证人还可能向公众展示一个网站来完善他们的简历。验证人需要通过多种方式去树立良好的声誉来吸引委托人。比如,验证人让第三方来审计他们的设置就是一个很好的实践。注意,Tendermint团队将不会批准和引导任何对自身的审计。有关尽职调查的更多信息,请参阅此[博客](https://medium.com/@interchain_io/3d0faf10ce6f) +除去这些会展示在Cosmos Voyager上的评判标准,验证人还可能向公众展示一个网站来完善他们的简历。验证人需要通过多种方式去树立良好的声誉来吸引委托人。比如,验证人让第三方来审计他们的设置就是一个很好的实践。注意,CometBFT团队将不会批准和引导任何对自身的审计。有关尽职调查的更多信息,请参阅此[博客](https://medium.com/@interchain_io/3d0faf10ce6f) ## 责任 @@ -278,7 +278,7 @@ Cosmos Hub中的验证人员和委托人可以就改变运行参数(例如区 + Ledger BOLOS SGX enclave + Thales nShield support -Tendermint团队不会推荐上面的其中之一。鼓励社区最好加强改进HSM和密钥管理的安全性。 +CometBFT团队不会推荐上面的其中之一。鼓励社区最好加强改进HSM和密钥管理的安全性。 ### 在操作上我们期望验证人可以做到哪些? diff --git a/go.mod b/go.mod index d861b1e33a..3759067a67 100644 --- a/go.mod +++ b/go.mod @@ -1,16 +1,16 @@ -module github.com/cosmos/gaia/v10 +module github.com/cosmos/gaia/v11 go 1.20 require ( - cosmossdk.io/math v1.0.0 + cosmossdk.io/errors v1.0.0-beta.7 + cosmossdk.io/math v1.0.1 github.com/cosmos/cosmos-sdk v0.45.16-ics github.com/cosmos/go-bip39 v1.0.0 - github.com/cosmos/ibc-go/v4 v4.4.0 - github.com/cosmos/interchain-security v1.1.1 + github.com/cosmos/ibc-go/v4 v4.4.2 + github.com/cosmos/interchain-security/v2 v2.0.0-rc3 github.com/gogo/protobuf v1.3.3 github.com/golang/protobuf v1.5.3 - github.com/golangci/golangci-lint v1.52.2 github.com/gorilla/mux v1.8.0 github.com/gravity-devs/liquidity v1.5.3 github.com/grpc-ecosystem/grpc-gateway v1.16.0 @@ -18,59 +18,36 @@ require ( github.com/rakyll/statik v0.1.7 github.com/spf13/cast v1.5.1 github.com/spf13/cobra v1.7.0 - github.com/spf13/viper v1.15.0 + github.com/spf13/viper v1.16.0 github.com/strangelove-ventures/packet-forward-middleware/v4 v4.0.5 - github.com/stretchr/testify v1.8.2 + github.com/stretchr/testify v1.8.4 github.com/tendermint/tendermint v0.34.27 github.com/tendermint/tm-db v0.6.7 - google.golang.org/genproto v0.0.0-20230125152338-dcaf20b6aeaa - google.golang.org/grpc v1.52.3 + google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 + google.golang.org/grpc v1.55.0 ) require ( - 4d63.com/gocheckcompilerdirectives v1.2.1 // indirect - 4d63.com/gochecknoglobals v0.2.1 // indirect cosmossdk.io/api v0.2.6 // indirect cosmossdk.io/core v0.5.1 // indirect cosmossdk.io/depinject v1.0.0-alpha.3 // indirect filippo.io/edwards25519 v1.0.0-rc.1 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect - github.com/Abirdcfly/dupword v0.0.11 // indirect - github.com/Antonboom/errname v0.1.9 // indirect - github.com/Antonboom/nilnil v0.1.3 // indirect github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect - github.com/BurntSushi/toml v1.2.1 // indirect github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect github.com/DataDog/zstd v1.5.0 // indirect - github.com/Djarvur/go-err113 v0.1.0 // indirect - github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0 // indirect github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect - github.com/Masterminds/semver v1.5.0 // indirect github.com/Microsoft/go-winio v0.6.0 // indirect github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect - github.com/OpenPeeDeeP/depguard v1.1.1 // indirect github.com/Workiva/go-datastructures v1.0.53 // indirect - github.com/alexkohler/prealloc v1.0.0 // indirect - github.com/alingse/asasalint v0.0.11 // indirect github.com/armon/go-metrics v0.4.1 // indirect - github.com/ashanbrown/forbidigo v1.5.1 // indirect - github.com/ashanbrown/makezero v1.1.1 // indirect - github.com/benbjohnson/clock v1.3.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect - github.com/bkielbasa/cyclop v1.2.0 // indirect - github.com/blizzy78/varnamelen v0.8.0 // indirect - github.com/bombsimon/wsl/v3 v3.4.0 // indirect - github.com/breml/bidichk v0.2.4 // indirect - github.com/breml/errchkjson v0.3.1 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect - github.com/butuzov/ireturn v0.1.1 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect - github.com/charithe/durationcheck v0.0.10 // indirect - github.com/chavacava/garif v0.0.0-20230227094218-b8c73b2037b8 // indirect github.com/cockroachdb/errors v1.9.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/pebble v0.0.0-20220817183557-09c6e030a677 // indirect @@ -86,12 +63,9 @@ require ( github.com/cosmos/iavl v0.19.5 // indirect github.com/cosmos/ledger-cosmos-go v0.12.2 // indirect github.com/creachadair/taskgroup v0.3.2 // indirect - github.com/curioswitch/go-reassign v0.2.0 // indirect - github.com/daixiang0/gci v0.10.1 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect - github.com/denis-tingaikin/go-header v0.4.3 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.0 // indirect @@ -102,208 +76,100 @@ require ( github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.0 // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect - github.com/esimonov/ifshort v1.0.4 // indirect - github.com/ettle/strcase v0.1.1 // indirect - github.com/fatih/color v1.15.0 // indirect - github.com/fatih/structtag v1.2.0 // indirect github.com/felixge/httpsnoop v1.0.2 // indirect - github.com/firefart/nonamedreturns v1.0.4 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/fzipp/gocyclo v0.6.0 // indirect github.com/getsentry/sentry-go v0.17.0 // indirect - github.com/go-critic/go-critic v0.7.0 // indirect github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.5.1 // indirect - github.com/go-toolsmith/astcast v1.1.0 // indirect - github.com/go-toolsmith/astcopy v1.1.0 // indirect - github.com/go-toolsmith/astequal v1.1.0 // indirect - github.com/go-toolsmith/astfmt v1.1.0 // indirect - github.com/go-toolsmith/astp v1.1.0 // indirect - github.com/go-toolsmith/strparse v1.1.0 // indirect - github.com/go-toolsmith/typep v1.1.0 // indirect - github.com/go-xmlfmt/xmlfmt v1.1.2 // indirect - github.com/gobwas/glob v0.2.3 // indirect - github.com/gobwas/httphead v0.1.0 // indirect - github.com/gobwas/pool v0.2.1 // indirect + github.com/go-sql-driver/mysql v1.7.0 // indirect + github.com/gobwas/ws v1.1.0 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect - github.com/gofrs/flock v0.8.1 // indirect github.com/gogo/gateway v1.1.0 // indirect github.com/golang/glog v1.0.0 // indirect github.com/golang/mock v1.6.0 // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 // indirect - github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect - github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe // indirect - github.com/golangci/gofmt v0.0.0-20220901101216-f2edd75033f2 // indirect - github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 // indirect - github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca // indirect - github.com/golangci/misspell v0.4.0 // indirect - github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6 // indirect - github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 // indirect github.com/google/btree v1.1.2 // indirect - github.com/google/go-cmp v0.5.9 // indirect github.com/google/orderedcode v0.0.1 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect - github.com/gordonklaus/ineffassign v0.0.0-20230107090616-13ace0543b28 // indirect github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect - github.com/gostaticanalysis/analysisutil v0.7.1 // indirect - github.com/gostaticanalysis/comment v1.4.2 // indirect - github.com/gostaticanalysis/forcetypeassert v0.1.0 // indirect - github.com/gostaticanalysis/nilerr v0.1.1 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.2 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect - github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-version v1.6.0 // indirect github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 // indirect - github.com/hexops/gotextdiff v1.0.3 // indirect github.com/iancoleman/orderedmap v0.2.0 // indirect github.com/imdario/mergo v0.3.15 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/jgautheron/goconst v1.5.1 // indirect - github.com/jingyugao/rowserrcheck v1.1.1 // indirect - github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/julz/importas v0.1.0 // indirect - github.com/junk1tm/musttag v0.5.0 // indirect - github.com/kisielk/errcheck v1.6.3 // indirect - github.com/kisielk/gotool v1.0.0 // indirect - github.com/kkHAIKE/contextcheck v1.1.4 // indirect github.com/klauspost/compress v1.15.11 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/kulti/thelper v0.6.3 // indirect - github.com/kunwardeep/paralleltest v1.0.6 // indirect - github.com/kyoh86/exportloopref v0.1.11 // indirect - github.com/ldez/gomoddirectives v0.2.3 // indirect - github.com/ldez/tagliatelle v0.4.0 // indirect - github.com/leonklingele/grouper v1.1.1 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/linxGnu/grocksdb v1.7.10 // indirect - github.com/lufeee/execinquery v1.2.1 // indirect github.com/magiconair/properties v1.8.7 // indirect - github.com/maratori/testableexamples v1.0.0 // indirect - github.com/maratori/testpackage v1.1.1 // indirect - github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.17 // indirect - github.com/mattn/go-runewidth v0.0.9 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect - github.com/mbilski/exhaustivestruct v1.2.0 // indirect - github.com/mgechev/revive v1.3.1 // indirect github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/minio/highwayhash v1.0.2 // indirect - github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae // indirect - github.com/moricho/tparallel v0.3.1 // indirect github.com/mtibben/percent v0.2.1 // indirect - github.com/nakabonne/nestif v0.3.1 // indirect - github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 // indirect - github.com/nishanths/exhaustive v0.9.5 // indirect - github.com/nishanths/predeclared v0.2.2 // indirect - github.com/nunnatsa/ginkgolinter v0.9.0 // indirect - github.com/nxadm/tail v1.4.8 // indirect - github.com/olekukonko/tablewriter v0.0.5 // indirect + github.com/onsi/ginkgo v1.16.5 // indirect + github.com/onsi/gomega v1.26.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0-rc2 // indirect github.com/opencontainers/runc v1.1.5 // indirect github.com/oxyno-zeta/gomock-extra-matcher v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.0.6 // indirect + github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/polyfloyd/go-errorlint v1.4.0 // indirect github.com/prometheus/client_golang v1.14.0 // indirect github.com/prometheus/client_model v0.3.0 // indirect github.com/prometheus/common v0.37.0 // indirect github.com/prometheus/procfs v0.8.0 // indirect - github.com/quasilyte/go-ruleguard v0.3.19 // indirect - github.com/quasilyte/gogrep v0.5.0 // indirect - github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect - github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/regen-network/cosmos-proto v0.3.1 // indirect github.com/rogpeppe/go-internal v1.9.0 // indirect github.com/rs/cors v1.8.2 // indirect github.com/rs/zerolog v1.27.0 // indirect - github.com/ryancurrah/gomodguard v1.3.0 // indirect - github.com/ryanrolds/sqlclosecheck v0.4.0 // indirect - github.com/sanposhiho/wastedassign/v2 v2.0.7 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect - github.com/sashamelentyev/interfacebloat v1.1.0 // indirect - github.com/sashamelentyev/usestdlibvars v1.23.0 // indirect - github.com/securego/gosec/v2 v2.15.0 // indirect - github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect github.com/sirupsen/logrus v1.9.0 // indirect - github.com/sivchari/containedctx v1.0.2 // indirect - github.com/sivchari/nosnakecase v1.7.0 // indirect - github.com/sivchari/tenv v1.7.1 // indirect - github.com/sonatard/noctx v0.0.2 // indirect - github.com/sourcegraph/go-diff v0.7.0 // indirect - github.com/spf13/afero v1.9.3 // indirect + github.com/spf13/afero v1.9.5 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect - github.com/stbenjam/no-sprintf-host-port v0.1.1 // indirect - github.com/stretchr/objx v0.5.0 // indirect github.com/subosito/gotenv v1.4.2 // indirect github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect - github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c // indirect - github.com/tdakkota/asciicheck v0.2.0 // indirect github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect github.com/tendermint/go-amino v0.16.0 // indirect - github.com/tetafro/godot v1.4.11 // indirect github.com/tidwall/btree v1.5.0 // indirect - github.com/timakin/bodyclose v0.0.0-20221125081123-e39cf3fc478e // indirect - github.com/timonwong/loggercheck v0.9.4 // indirect - github.com/tomarrell/wrapcheck/v2 v2.8.1 // indirect - github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect - github.com/ultraware/funlen v0.0.3 // indirect - github.com/ultraware/whitespace v0.0.5 // indirect - github.com/uudashr/gocognit v1.0.6 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xeipuuv/gojsonschema v1.2.0 // indirect - github.com/yagipy/maintidx v1.0.0 // indirect - github.com/yeya24/promlinter v0.2.0 // indirect github.com/zondax/hid v0.9.1 // indirect github.com/zondax/ledger-go v0.14.1 // indirect - gitlab.com/bosi/decorder v0.2.3 // indirect go.etcd.io/bbolt v1.3.6 // indirect - go.uber.org/atomic v1.10.0 // indirect - go.uber.org/goleak v1.1.12 // indirect - go.uber.org/multierr v1.8.0 // indirect - go.uber.org/zap v1.24.0 // indirect - golang.org/x/crypto v0.7.0 // indirect + golang.org/x/crypto v0.9.0 // indirect golang.org/x/exp v0.0.0-20221205204356-47842c84f3db // indirect - golang.org/x/exp/typeparams v0.0.0-20230224173230-c95f2b4c22f2 // indirect golang.org/x/mod v0.9.0 // indirect - golang.org/x/net v0.8.0 // indirect - golang.org/x/sync v0.1.0 // indirect - golang.org/x/sys v0.7.0 // indirect - golang.org/x/term v0.6.0 // indirect - golang.org/x/text v0.8.0 // indirect + golang.org/x/net v0.10.0 // indirect + golang.org/x/sys v0.8.0 // indirect + golang.org/x/term v0.8.0 // indirect + golang.org/x/text v0.9.0 // indirect golang.org/x/tools v0.7.0 // indirect google.golang.org/protobuf v1.30.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - honnef.co/go/tools v0.4.3 // indirect - mvdan.cc/gofumpt v0.4.0 // indirect - mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed // indirect - mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect - mvdan.cc/unparam v0.0.0-20221223090309-7455f1af531d // indirect nhooyr.io/websocket v1.8.6 // indirect ) @@ -320,7 +186,7 @@ replace ( github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 // Comet - github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.28 + github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.29 // latest grpc doesn't work with with our modified proto compiler, so we need to enforce // the following version across all dependencies. diff --git a/go.sum b/go.sum index 329b681724..f85f60bdf4 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,3 @@ -4d63.com/gocheckcompilerdirectives v1.2.1 h1:AHcMYuw56NPjq/2y615IGg2kYkBdTvOaojYCBcRE7MA= -4d63.com/gocheckcompilerdirectives v1.2.1/go.mod h1:yjDJSxmDTtIHHCqX0ufRYZDL6vQtMG7tJdKVeWwsqvs= -4d63.com/gochecknoglobals v0.2.1 h1:1eiorGsgHOFOuoOiJDy2psSrQbRdIHrlge0IJIkUgDc= -4d63.com/gochecknoglobals v0.2.1/go.mod h1:KRE8wtJB3CXCsb1xy421JfTHIIbmT3U5ruxw2Qu8fSU= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.43.0/go.mod h1:BOSR3VbTLkk6FDC/TcffxP4NF/FFBGA5ku+jvKOP7pg= @@ -48,8 +44,10 @@ cosmossdk.io/core v0.5.1 h1:vQVtFrIYOQJDV3f7rw4pjjVqc1id4+mE0L9hHP66pyI= cosmossdk.io/core v0.5.1/go.mod h1:KZtwHCLjcFuo0nmDc24Xy6CRNEL9Vl/MeimQ2aC7NLE= cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= -cosmossdk.io/math v1.0.0 h1:ro9w7eKx23om2tZz/VM2Pf+z2WAbGX1yDQQOJ6iGeJw= -cosmossdk.io/math v1.0.0/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= +cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= +cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= +cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= +cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -57,21 +55,13 @@ git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFN git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9/go.mod h1:BVJwbDfVjCjoFiKrhkei6NdGcZYpkDkdyCdg1ukytRA= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= -github.com/Abirdcfly/dupword v0.0.11 h1:z6v8rMETchZXUIuHxYNmlUAuKuB21PeaSymTed16wgU= -github.com/Abirdcfly/dupword v0.0.11/go.mod h1:wH8mVGuf3CP5fsBTkfWwwwKTjDnVVCxtU8d8rgeVYXA= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= -github.com/Antonboom/errname v0.1.9 h1:BZDX4r3l4TBZxZ2o2LNrlGxSHran4d1u4veZdoORTT4= -github.com/Antonboom/errname v0.1.9/go.mod h1:nLTcJzevREuAsgTbG85UsuiWpMpAqbKD1HNZ29OzE58= -github.com/Antonboom/nilnil v0.1.3 h1:6RTbx3d2mcEu3Zwq9TowQpQMVpP75zugwOtqY1RTtcE= -github.com/Antonboom/nilnil v0.1.3/go.mod h1:iOov/7gRcXkeEU+EMGpBu2ORih3iyVEiWjeste1SJm8= github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= -github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= @@ -84,25 +74,17 @@ github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3 github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/DataDog/zstd v1.5.0 h1:+K/VEwIAaPcHiMtQvpLD4lqW7f0Gk3xdYZmI1hD+CXo= github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/Djarvur/go-err113 v0.1.0 h1:uCRZZOdMQ0TZPHYTdYpoC0bLYJKPEHPUJ8MeAa51lNU= -github.com/Djarvur/go-err113 v0.1.0/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= -github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0 h1:+r1rSv4gvYn0wmRjC8X7IAzX8QezqtFV9m0MUHFJgts= -github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0/go.mod h1:b3g59n2Y+T5xmcxJL+UEG2f8cQploZm1mR/v6BW0mU0= github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= github.com/Joker/jade v1.0.1-0.20190614124447-d475f43051e7/go.mod h1:6E6s8o2AE4KhCrqr6GRJjdC/gNfTdxkIXvuGZZda2VM= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= -github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/OpenPeeDeeP/depguard v1.1.1 h1:TSUznLjvp/4IUP+OQ0t/4jF4QUyxIcVX8YnghZdunyA= -github.com/OpenPeeDeeP/depguard v1.1.1/go.mod h1:JtAMzWkmFEzDPyAd+W0NHl1lvpQKTvT9jnRVsohBKpc= github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= @@ -124,10 +106,6 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alexkohler/prealloc v1.0.0 h1:Hbq0/3fJPQhNkN0dR95AVrr6R7tou91y0uHG5pOcUuw= -github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= -github.com/alingse/asasalint v0.0.11 h1:SFwnQXJ49Kx/1GghOFz1XGqHYKp21Kq1nHad/0WQRnw= -github.com/alingse/asasalint v0.0.11/go.mod h1:nCaoMhw7a9kSJObvQyVzNTPBDbNpdocqrSP7t/cW5+I= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= @@ -141,10 +119,6 @@ github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJ github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= -github.com/ashanbrown/forbidigo v1.5.1 h1:WXhzLjOlnuDYPYQo/eFlcFMi8X/kLfvWLYu6CSoebis= -github.com/ashanbrown/forbidigo v1.5.1/go.mod h1:Y8j9jy9ZYAEHXdu723cUlraTqbzjKF1MUyfOKL+AjcU= -github.com/ashanbrown/makezero v1.1.1 h1:iCQ87C0V0vSyO+M9E/FZYbu65auqH0lnsOkf5FcB28s= -github.com/ashanbrown/makezero v1.1.1/go.mod h1:i1bJLCRSCHOcOa9Y6MyF2FTfMZMFdHvxKHxgO5Z1axI= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= @@ -158,8 +132,6 @@ github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbE github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM= github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= -github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= -github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -167,23 +139,13 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bkielbasa/cyclop v1.2.0 h1:7Jmnh0yL2DjKfw28p86YTd/B4lRGcNuu12sKE35sM7A= -github.com/bkielbasa/cyclop v1.2.0/go.mod h1:qOI0yy6A7dYC4Zgsa72Ppm9kONl0RoIlPbzot9mhmeI= -github.com/blizzy78/varnamelen v0.8.0 h1:oqSblyuQvFsW1hbBHh1zfwrKe3kcSj0rnXkKzsQ089M= -github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= -github.com/bombsimon/wsl/v3 v3.4.0 h1:RkSxjT3tmlptwfgEgTgU+KYKLI35p/tviNXNXiL2aNU= -github.com/bombsimon/wsl/v3 v3.4.0/go.mod h1:KkIB+TXkqy6MvK9BDZVbZxKNYsE1/oLRJbIFtf14qqo= -github.com/breml/bidichk v0.2.4 h1:i3yedFWWQ7YzjdZJHnPo9d/xURinSq3OM+gyM43K4/8= -github.com/breml/bidichk v0.2.4/go.mod h1:7Zk0kRFt1LIZxtQdl9W9JwGAcLTTkOs+tN7wuEYGJ3s= -github.com/breml/errchkjson v0.3.1 h1:hlIeXuspTyt8Y/UmP5qy1JocGNR00KQHgfaNtRAjoxQ= -github.com/breml/errchkjson v0.3.1/go.mod h1:XroxrzKjdiutFyW3nWhw34VGg7kiMsDQox73yWCGI2U= github.com/btcsuite/btcd v0.0.0-20190315201642-aa6e0f35703c/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd v0.21.0-beta.0.20201114000516-e9c7a5ac6401/go.mod h1:Sv4JPQ3/M+teHz9Bo5jBpkNcP0x6r7rdihlNL/7tTAs= github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= -github.com/btcsuite/btcd v0.23.0 h1:V2/ZgjfDFIygAX3ZapeigkVBoVUtOJKSwrhZdlpSvaA= +github.com/btcsuite/btcd v0.22.2 h1:vBZ+lGGd1XubpOWO67ITJpAEsICWhA0YzqkcpkgNBfo= github.com/btcsuite/btcd/btcec/v2 v2.1.2/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= @@ -203,8 +165,6 @@ github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= -github.com/butuzov/ireturn v0.1.1 h1:QvrO2QF2+/Cx1WA/vETCIYBKtRjc30vesdoPUNo1EbY= -github.com/butuzov/ireturn v0.1.1/go.mod h1:Wh6Zl3IMtTpaIKbmwzqi6olnM9ptYQxxVacMsOEFPoc= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= @@ -220,10 +180,6 @@ github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghf github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/charithe/durationcheck v0.0.10 h1:wgw73BiocdBDQPik+zcEoBG/ob8uyBHf2iyoHGPf5w4= -github.com/charithe/durationcheck v0.0.10/go.mod h1:bCWXb7gYRysD1CU3C+u4ceO49LoGOY1C1L6uouGNreQ= -github.com/chavacava/garif v0.0.0-20230227094218-b8c73b2037b8 h1:W9o46d2kbNL06lq7UNDPV0zYLzkrde/bjIqO02eoll0= -github.com/chavacava/garif v0.0.0-20230227094218-b8c73b2037b8/go.mod h1:gakxgyXaaPkxvLw1XQxNGK4I37ys9iBRzNUx/B7pUCo= github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= @@ -257,8 +213,8 @@ github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcju github.com/coinbase/kryptology v1.8.0/go.mod h1:RYXOAPdzOGUe3qlSFkMGn58i3xUA8hmxYHksuq+8ciI= github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZr9ZvoCcA= github.com/coinbase/rosetta-sdk-go v0.7.9/go.mod h1:0/knutI7XGVqXmmH4OQD8OckFrbQ8yMsUZTG7FXCR2M= -github.com/cometbft/cometbft v0.34.28 h1:gwryf55P1SWMUP4nOXpRVI2D0yPoYEzN+IBqmRBOsDc= -github.com/cometbft/cometbft v0.34.28/go.mod h1:L9shMfbkZ8B+7JlwANEr+NZbBcn+hBpwdbeYvA5rLCw= +github.com/cometbft/cometbft v0.34.29 h1:Q4FqMevP9du2pOgryZJHpDV2eA6jg/kMYxBj9ZTY6VQ= +github.com/cometbft/cometbft v0.34.29/go.mod h1:L9shMfbkZ8B+7JlwANEr+NZbBcn+hBpwdbeYvA5rLCw= github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= @@ -292,10 +248,10 @@ github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4 github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= github.com/cosmos/iavl v0.19.5 h1:rGA3hOrgNxgRM5wYcSCxgQBap7fW82WZgY78V9po/iY= github.com/cosmos/iavl v0.19.5/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= -github.com/cosmos/ibc-go/v4 v4.4.0 h1:OEsSLBP1yoLzONQ/1Tf44ateEgS2YHyhTkecvuenk7k= -github.com/cosmos/ibc-go/v4 v4.4.0/go.mod h1:FYZ7ublN6jMojaRND1ST0bTfLKfQnlaxqJbUn7WhzvU= -github.com/cosmos/interchain-security v1.1.1 h1:UxtBxMVw0Lj/zye/kiM2Vm6rQiDE00tQ5CHPjbmx2b4= -github.com/cosmos/interchain-security v1.1.1/go.mod h1:nXf1iZoUTU+huyOT0UyNoJ68/tS69bThdOarSDVMlJ8= +github.com/cosmos/ibc-go/v4 v4.4.2 h1:PG4Yy0/bw6Hvmha3RZbc53KYzaCwuB07Ot4GLyzcBvo= +github.com/cosmos/ibc-go/v4 v4.4.2/go.mod h1:j/kD2JCIaV5ozvJvaEkWhLxM2zva7/KTM++EtKFYcB8= +github.com/cosmos/interchain-security/v2 v2.0.0-rc3 h1:6dSViAE77CzMVzQwyiNSJaAkDdcu3xRIPYeCM5oMt40= +github.com/cosmos/interchain-security/v2 v2.0.0-rc3/go.mod h1:3AHbp93smkSJFX6PW9OfYDJtU1i/Ty0yv/FVbF2dO20= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= github.com/cosmos/ledger-cosmos-go v0.12.2 h1:/XYaBlE2BJxtvpkHiBm97gFGSGmYGKunKyF3nNqAXZA= @@ -311,12 +267,8 @@ github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= -github.com/curioswitch/go-reassign v0.2.0 h1:G9UZyOcpk/d7Gd6mqYgd8XYWFMw/znxwGDUstnC9DIo= -github.com/curioswitch/go-reassign v0.2.0/go.mod h1:x6OpXuWvgfQaMGks2BZybTngWjT84hqJfKoO8Tt/Roc= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= -github.com/daixiang0/gci v0.10.1 h1:eheNA3ljF6SxnPD/vE4lCBusVHmV3Rs3dkKvFrJ7MR0= -github.com/daixiang0/gci v0.10.1/go.mod h1:xtHP9N7AHdNvtRNfcx9gwTDfw7FRJx4bZUsiEfiNNAI= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= @@ -332,8 +284,6 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeC github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE9iAUlWl9Al3M= github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= -github.com/denis-tingaikin/go-header v0.4.3 h1:tEaZKAlqql6SKCY++utLmkPLd6K8IBM20Ha7UVm+mtU= -github.com/denis-tingaikin/go-header v0.4.3/go.mod h1:0wOCWuN71D5qIgE2nz9KrKmuYBAC2Mra5RassOIQ2/c= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= @@ -376,28 +326,18 @@ github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaB github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/esimonov/ifshort v1.0.4 h1:6SID4yGWfRae/M7hkVDVVyppy8q/v9OuxNdmjLQStBA= -github.com/esimonov/ifshort v1.0.4/go.mod h1:Pe8zjlRrJ80+q2CxHLfEOfTwxCZ4O+MuhcHcfgNWTk0= github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/ethereum/go-ethereum v1.10.17/go.mod h1:Lt5WzjM07XlXc95YzrhosmR4J9Ahd6X2wyEV2SvGhk0= -github.com/ettle/strcase v0.1.1 h1:htFueZyVeE1XNnMEfbqp5r67qAN/4r6ya1ysq8Q+Zcw= -github.com/ettle/strcase v0.1.1/go.mod h1:hzDLsPC7/lwKyBOywSHEP89nt2pDgdy+No1NBA9o9VY= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= -github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= -github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/firefart/nonamedreturns v1.0.4 h1:abzI1p7mAEPYuR4A+VLKn4eNDOycjYo2phmY9sfv40Y= -github.com/firefart/nonamedreturns v1.0.4/go.mod h1:TDhe/tjI1BXo48CmYbUduTV7BdIga8MAO/xbKdcVsGI= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/flosch/pongo2 v0.0.0-20190707114632-bbf5a6c351f4/go.mod h1:T9YF2M40nIgbVgp3rreNmTged+9HrbNTIQf1PsaIiTA= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= @@ -410,8 +350,6 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo= -github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= @@ -429,8 +367,6 @@ github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= -github.com/go-critic/go-critic v0.7.0 h1:tqbKzB8pqi0NsRZ+1pyU4aweAF7A7QN0Pi4Q02+rYnQ= -github.com/go-critic/go-critic v0.7.0/go.mod h1:moYzd7GdVXE2C2hYTwd7h0CPcqlUeclsyBRwMa38v64= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= @@ -450,7 +386,6 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= @@ -466,44 +401,24 @@ github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5Nq github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc= +github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-toolsmith/astcast v1.1.0 h1:+JN9xZV1A+Re+95pgnMgDboWNVnIMMQXwfBwLRPgSC8= -github.com/go-toolsmith/astcast v1.1.0/go.mod h1:qdcuFWeGGS2xX5bLM/c3U9lewg7+Zu4mr+xPwZIB4ZU= -github.com/go-toolsmith/astcopy v1.1.0 h1:YGwBN0WM+ekI/6SS6+52zLDEf8Yvp3n2seZITCUBt5s= -github.com/go-toolsmith/astcopy v1.1.0/go.mod h1:hXM6gan18VA1T/daUEHCFcYiW8Ai1tIwIzHY6srfEAw= -github.com/go-toolsmith/astequal v1.0.3/go.mod h1:9Ai4UglvtR+4up+bAD4+hCj7iTo4m/OXVTSLnCyTAx4= -github.com/go-toolsmith/astequal v1.1.0 h1:kHKm1AWqClYn15R0K1KKE4RG614D46n+nqUQ06E1dTw= -github.com/go-toolsmith/astequal v1.1.0/go.mod h1:sedf7VIdCL22LD8qIvv7Nn9MuWJruQA/ysswh64lffQ= -github.com/go-toolsmith/astfmt v1.1.0 h1:iJVPDPp6/7AaeLJEruMsBUlOYCmvg0MoCfJprsOmcco= -github.com/go-toolsmith/astfmt v1.1.0/go.mod h1:OrcLlRwu0CuiIBp/8b5PYF9ktGVZUjlNMV634mhwuQ4= -github.com/go-toolsmith/astp v1.1.0 h1:dXPuCl6u2llURjdPLLDxJeZInAeZ0/eZwFJmqZMnpQA= -github.com/go-toolsmith/astp v1.1.0/go.mod h1:0T1xFGz9hicKs8Z5MfAqSUitoUYS30pDMsRVIDHs8CA= -github.com/go-toolsmith/pkgload v1.2.2 h1:0CtmHq/02QhxcF7E9N5LIFcYFsMR5rdovfqTtRKkgIk= -github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8= -github.com/go-toolsmith/strparse v1.1.0 h1:GAioeZUK9TGxnLS+qfdqNbA4z0SSm5zVNtCQiyP2Bvw= -github.com/go-toolsmith/strparse v1.1.0/go.mod h1:7ksGy58fsaQkGQlY8WVoBFNyEPMGuJin1rfoPS4lBSQ= -github.com/go-toolsmith/typep v1.1.0 h1:fIRYDyF+JywLfqzyhdiHzRop/GQDxxNhLGQ6gFUNHus= -github.com/go-toolsmith/typep v1.1.0/go.mod h1:fVIw+7zjdsMxDA3ITWnH1yOiw1rnTQKCsF/sk2H/qig= -github.com/go-xmlfmt/xmlfmt v1.1.2 h1:Nea7b4icn8s57fTx1M5AI4qQT5HEM3rVUO8MuE6g80U= -github.com/go-xmlfmt/xmlfmt v1.1.2/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= -github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= -github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= -github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= +github.com/gobwas/ws v1.1.0 h1:7RFti/xnNkMJnrK7D1yQ/iCIB5OrrY/54/H930kIbHA= +github.com/gobwas/ws v1.1.0/go.mod h1:nzvNcVha5eUziGrbxFCo6qFIojQHjJV5cLYIbezhfL0= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= -github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v4.3.0+incompatible h1:CaSVZxm5B+7o45rtab4jC2G37WGYX1zQfuU2i6DSvnc= github.com/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0= @@ -554,27 +469,7 @@ github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8l github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 h1:23T5iq8rbUYlhpt5DB4XJkc6BU31uODLD1o1gKvZmD0= -github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4= -github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a h1:w8hkcTqaFpzKqonE9uMCefW1WDie15eSP/4MssdenaM= -github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk= -github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe h1:6RGUuS7EGotKx6J5HIP8ZtyMdiDscjMLfRBSPuzVVeo= -github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe/go.mod h1:gjqyPShc/m8pEMpk0a3SeagVb0kaqvhscv+i9jI5ZhQ= -github.com/golangci/gofmt v0.0.0-20220901101216-f2edd75033f2 h1:amWTbTGqOZ71ruzrdA+Nx5WA3tV1N0goTspwmKCQvBY= -github.com/golangci/gofmt v0.0.0-20220901101216-f2edd75033f2/go.mod h1:9wOXstvyDRshQ9LggQuzBCGysxs3b6Uo/1MvYCR2NMs= -github.com/golangci/golangci-lint v1.52.2 h1:FrPElUUI5rrHXg1mQ7KxI1MXPAw5lBVskiz7U7a8a1A= -github.com/golangci/golangci-lint v1.52.2/go.mod h1:S5fhC5sHM5kE22/HcATKd1XLWQxX+y7mHj8B5H91Q/0= github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= -github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 h1:MfyDlzVjl1hoaPzPD4Gpb/QgoRfSBR0jdhwGyAWwMSA= -github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg= -github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca h1:kNY3/svz5T29MYHubXix4aDDuE3RWHkPvopM/EDv/MA= -github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca/go.mod h1:tvlJhZqDe4LMs4ZHD0oMUlt9G2LWuDGoisJTBzLMV9o= -github.com/golangci/misspell v0.4.0 h1:KtVB/hTK4bbL/S6bs64rYyk8adjmh1BygbBiaAiX+a0= -github.com/golangci/misspell v0.4.0/go.mod h1:W6O/bwV6lGDxUCChm2ykw9NQdd5bYd1Xkjo88UcWyJc= -github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6 h1:DIPQnGy2Gv2FSA4B/hh8Q7xx3B7AIDk3DAMeHclH1vQ= -github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6/go.mod h1:0AKcRCkMoKvUvlf89F6O7H2LYdhr1zBh736mBItOdRs= -github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 h1:zwtduBRr5SSWhqsYNgcuWO2kFlpdOZbP0+yRjmvPGys= -github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ= github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -591,10 +486,7 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -626,8 +518,6 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gordonklaus/ineffassign v0.0.0-20230107090616-13ace0543b28 h1:9alfqbrhuD+9fLZ4iaAVwhlp5PEhmnBt7yvK2Oy5C1U= -github.com/gordonklaus/ineffassign v0.0.0-20230107090616-13ace0543b28/go.mod h1:Qcp2HIAYhR7mNUVSIxZww3Guk4it82ghYcEXIAk+QT0= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= @@ -641,17 +531,6 @@ github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/ad github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gostaticanalysis/analysisutil v0.7.1 h1:ZMCjoue3DtDWQ5WyU16YbjbQEQ3VuzwxALrpYd+HeKk= -github.com/gostaticanalysis/analysisutil v0.7.1/go.mod h1:v21E3hY37WKMGSnbsw2S/ojApNWb6C1//mXO48CXbVc= -github.com/gostaticanalysis/comment v1.4.1/go.mod h1:ih6ZxzTHLdadaiSnF5WY3dxUoXfXAlTaRzuaNDlSado= -github.com/gostaticanalysis/comment v1.4.2 h1:hlnx5+S2fY9Zo9ePo4AhgYsYHbM2+eAv8m/s1JiCd6Q= -github.com/gostaticanalysis/comment v1.4.2/go.mod h1:KLUTGDv6HOCotCH8h2erHKmpci2ZoR8VPu34YA2uzdM= -github.com/gostaticanalysis/forcetypeassert v0.1.0 h1:6eUflI3DiGusXGK6X7cCcIgVCpZ2CiZ1Q7jl6ZxNV70= -github.com/gostaticanalysis/forcetypeassert v0.1.0/go.mod h1:qZEedyP/sY1lTGV1uJ3VhWZ2mqag3IkWsDHVbplHXak= -github.com/gostaticanalysis/nilerr v0.1.1 h1:ThE+hJP0fEp4zWLkWHWcRyI2Od0p7DlgYG3Uqrmrcpk= -github.com/gostaticanalysis/nilerr v0.1.1/go.mod h1:wZYb6YI5YAxxq0i1+VJbY0s2YONW0HU0GPE3+5PWN4A= -github.com/gostaticanalysis/testutil v0.3.1-0.20210208050101-bfb5c8eec0e4/go.mod h1:D+FIZ+7OahH3ePw/izIEeH5I06eKs1IKI4Xr64/Am3M= -github.com/gostaticanalysis/testutil v0.4.0 h1:nhdCmubdmDF6VEatUNjgUZBJKWRqugoISdUv3PPQgHY= github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/gravity-devs/liquidity v1.5.3 h1:QbMHk1q+dzlM76Zv3vxaHhq4lBdhaelB0g7NmLbsv2Q= github.com/gravity-devs/liquidity v1.5.3/go.mod h1:ULtNk738lNb1Kh31larCNxZ7IK21TeKZmNzS/OkE0hw= @@ -676,8 +555,6 @@ github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIv github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= -github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= @@ -686,8 +563,6 @@ github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJ github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= -github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= @@ -696,8 +571,6 @@ github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -712,8 +585,6 @@ github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2p github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 h1:aSVUgRRRtOrZOC1fYmY9gV0e9z/Iu+xNVSASWjsuyGU= github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3/go.mod h1:5PC6ZNPde8bBqU/ewGZig35+UIZtw9Ytxez8/q5ZyFE= -github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= -github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -756,13 +627,7 @@ github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+ github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jgautheron/goconst v1.5.1 h1:HxVbL1MhydKs8R8n/HE5NPvzfaYmQJA3o879lE4+WcM= -github.com/jgautheron/goconst v1.5.1/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= github.com/jhump/protoreflect v1.13.1-0.20220928232736-101791cb1b4c h1:XImQJfpJLmGEEd8ll5yPVyL/aEvmgGHW4WYTyNseLOM= -github.com/jingyugao/rowserrcheck v1.1.1 h1:zibz55j/MJtLsjP1OF4bSdgXxwL1b+Vn7Tjzq7gFzUs= -github.com/jingyugao/rowserrcheck v1.1.1/go.mod h1:4yvlZSDb3IyDTUZJUmpZfm2Hwok+Dtp+nu2qOq+er9c= -github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af h1:KA9BjwUk7KlCh6S9EAGWBt1oExIUv9WyNCiRz5amv48= -github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= @@ -788,11 +653,7 @@ github.com/juju/loggo v0.0.0-20180524022052-584905176618/go.mod h1:vgyd7OREkbtVE github.com/juju/testing v0.0.0-20180920084828-472a3e8b2073/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/julz/importas v0.1.0 h1:F78HnrsjY3cR7j0etXy5+TU1Zuy7Xt08X/1aJnH5xXY= -github.com/julz/importas v0.1.0/go.mod h1:oSFU2R4XK/P7kNBrnL/FEQlDGN1/6WoxXEjSSXO0DV0= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/junk1tm/musttag v0.5.0 h1:bV1DTdi38Hi4pG4OVWa7Kap0hi0o7EczuK6wQt9zPOM= -github.com/junk1tm/musttag v0.5.0/go.mod h1:PcR7BA+oREQYvHwgjIDmw3exJeds5JzRcvEJTfjrA0M= github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= @@ -806,12 +667,7 @@ github.com/kataras/pio v0.0.0-20190103105442-ea782b38602d/go.mod h1:NV88laa9UiiD github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/errcheck v1.6.3 h1:dEKh+GLHcWm2oN34nMvDzn1sqI0i0WxPvrgiJA5JuM8= -github.com/kisielk/errcheck v1.6.3/go.mod h1:nXw/i/MfnvRHqXa7XXmQMUB0oNFGuBrNI8d8NLy0LPw= -github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kkHAIKE/contextcheck v1.1.4 h1:B6zAaLhOEEcjvUgIYEqystmnFk1Oemn8bvJhbt0GMb8= -github.com/kkHAIKE/contextcheck v1.1.4/go.mod h1:1+i/gWqokIa+dm31mqGLZhZJ7Uh44DJGZVmr6QRBNJg= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= @@ -839,26 +695,14 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kulti/thelper v0.6.3 h1:ElhKf+AlItIu+xGnI990no4cE2+XaSu1ULymV2Yulxs= -github.com/kulti/thelper v0.6.3/go.mod h1:DsqKShOvP40epevkFrvIwkCMNYxMeTNjdWL4dqWHZ6I= -github.com/kunwardeep/paralleltest v1.0.6 h1:FCKYMF1OF2+RveWlABsdnmsvJrei5aoyZoaGS+Ugg8g= -github.com/kunwardeep/paralleltest v1.0.6/go.mod h1:Y0Y0XISdZM5IKm3TREQMZ6iteqn1YuwCsJO/0kL9Zes= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/kyoh86/exportloopref v0.1.11 h1:1Z0bcmTypkL3Q4k+IDHMWTcnCliEZcaPiIe0/ymEyhQ= -github.com/kyoh86/exportloopref v0.1.11/go.mod h1:qkV4UF1zGl6EkF1ox8L5t9SwyeBAZ3qLMd6up458uqA= github.com/labstack/echo/v4 v4.1.11/go.mod h1:i541M3Fj6f76NZtHSj7TXnyM8n2gaodfvfxNnFqi74g= github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= github.com/labstack/echo/v4 v4.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= -github.com/ldez/gomoddirectives v0.2.3 h1:y7MBaisZVDYmKvt9/l1mjNCiSA1BVn34U0ObUcJwlhA= -github.com/ldez/gomoddirectives v0.2.3/go.mod h1:cpgBogWITnCfRq2qGoDkKMEVSaarhdBr6g8G04uz6d0= -github.com/ldez/tagliatelle v0.4.0 h1:sylp7d9kh6AdXN2DpVGHBRb5guTVAgOxqNGhbqc4b1c= -github.com/ldez/tagliatelle v0.4.0/go.mod h1:mNtTfrHy2haaBAw+VT7IBV6VXBThS7TCreYWbBcJ87I= github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= -github.com/leonklingele/grouper v1.1.1 h1:suWXRU57D4/Enn6pXR0QVqqWWrnJ9Osrz+5rjt8ivzU= -github.com/leonklingele/grouper v1.1.1/go.mod h1:uk3I3uDfi9B6PeUjsCKi6ndcf63Uy7snXgR4yDYQVDY= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= @@ -869,21 +713,11 @@ github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0U github.com/linxGnu/grocksdb v1.7.10 h1:dz7RY7GnFUA+GJO6jodyxgkUeGMEkPp3ikt9hAcNGEw= github.com/linxGnu/grocksdb v1.7.10/go.mod h1:0hTf+iA+GOr0jDX4CgIYyJZxqOH9XlBh6KVj8+zmF34= github.com/lucasjones/reggen v0.0.0-20180717132126-cdb49ff09d77/go.mod h1:5ELEyG+X8f+meRWHuqUOewBOhvHkl7M76pdGEansxW4= -github.com/lufeee/execinquery v1.2.1 h1:hf0Ems4SHcUGBxpGN7Jz78z1ppVkP/837ZlETPCEtOM= -github.com/lufeee/execinquery v1.2.1/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xqSxS/dy8SbM= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/maratori/testableexamples v1.0.0 h1:dU5alXRrD8WKSjOUnmJZuzdxWOEQ57+7s93SLMxb2vI= -github.com/maratori/testableexamples v1.0.0/go.mod h1:4rhjL1n20TUTT4vdh3RDqSizKLyXp7K2u6HgraZCGzE= -github.com/maratori/testpackage v1.1.1 h1:S58XVV5AD7HADMmD0fNnziNHqKvSdDuEKdPD1rNTU04= -github.com/maratori/testpackage v1.1.1/go.mod h1:s4gRK/ym6AMrqpOa/kEbQTV4Q4jb7WeLZzVhVVVOQMc= -github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26 h1:gWg6ZQ4JhDfJPqlo2srm/LN17lpybq15AryXIRcWYLE= -github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= -github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE= -github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU= github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= @@ -905,7 +739,6 @@ github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPn github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= @@ -913,13 +746,9 @@ github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpe github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mbilski/exhaustivestruct v1.2.0 h1:wCBmUnSYufAHO6J4AVWY6ff+oxWxsVFrwgOdMUQePUo= -github.com/mbilski/exhaustivestruct v1.2.0/go.mod h1:OeTBVxQWoEmB2J2JCHmXWPJ0aksxSUOUy+nvtVEfzXc= github.com/mediocregopher/mediocre-go-lib v0.0.0-20181029021733-cb65787f37ed/go.mod h1:dSsfyI2zABAdhcbvkXqgxOxrCsbYeHCPgrZkku60dSg= github.com/mediocregopher/radix/v3 v3.3.0/go.mod h1:EmfVyvspXz1uZEyPBMyGK+kjWiKQGvsUt6O3Pj+LDCQ= github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= -github.com/mgechev/revive v1.3.1 h1:OlQkcH40IB2cGuprTPcjB0iIUddgVZgGmDX3IAMR8D4= -github.com/mgechev/revive v1.3.1/go.mod h1:YlD6TTWl2B8A103R9KWJSPVI9DrEf+oqr15q21Ld+5I= github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= @@ -929,7 +758,6 @@ github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= @@ -952,8 +780,6 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= -github.com/moricho/tparallel v0.3.1 h1:fQKD4U1wRMAYNngDonW5XupoB/ZGJHdpzrWqgyg9krA= -github.com/moricho/tparallel v0.3.1/go.mod h1:leENX2cUv7Sv2qDgdi0D0fCftN8fRC67Bcn8pqzeYNI= github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= @@ -963,8 +789,6 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/grpc-proxy v0.0.0-20181017164139-0f1106ef9c76/go.mod h1:x5OoJHDHqxHS801UIuhqGl6QdSAEJvtausosHSdazIo= -github.com/nakabonne/nestif v0.3.1 h1:wm28nZjhQY5HyYPx+weN3Q65k6ilSBxDb8v5S81B81U= -github.com/nakabonne/nestif v0.3.1/go.mod h1:9EtoZochLn5iUprVDmDjqGKPofoUEBL8U4Ngq6aY7OE= github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= @@ -976,16 +800,8 @@ github.com/nats-io/nkeys v0.0.2/go.mod h1:dab7URMsZm6Z/jp9Z5UGa87Uutgc2mVpXLC4B7 github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 h1:4kuARK6Y6FxaNu/BnU2OAaLF86eTVhP2hjTB6iMvItA= -github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354/go.mod h1:KSVJerMDfblTH7p5MZaTt+8zaT2iEk3AkVb9PQdZuE8= github.com/neilotoole/errgroup v0.1.6/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C2S41udRnToE= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nishanths/exhaustive v0.9.5 h1:TzssWan6orBiLYVqewCG8faud9qlFntJE30ACpzmGME= -github.com/nishanths/exhaustive v0.9.5/go.mod h1:IbwrGdVMizvDcIxPYGVdQn5BqWJaOwpCvg4RGb8r/TA= -github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk= -github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= -github.com/nunnatsa/ginkgolinter v0.9.0 h1:Sm0zX5QfjJzkeCjEp+t6d3Ha0jwvoDjleP9XCsrEzOA= -github.com/nunnatsa/ginkgolinter v0.9.0/go.mod h1:FHaMLURXP7qImeH6bvxWJUpyH+2tuqe5j4rW1gxJRmI= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= @@ -993,7 +809,6 @@ github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtb github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -1001,13 +816,14 @@ github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= -github.com/onsi/ginkgo/v2 v2.8.0 h1:pAM+oBNPrpXRs+E/8spkeGx9QgekbRVyr74EUvRVOUI= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= +github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= @@ -1029,12 +845,7 @@ github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnh github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= github.com/ory/dockertest/v3 v3.10.0 h1:4K3z2VMe8Woe++invjaTB7VRyQXQy5UY+loujO4aNE4= github.com/ory/dockertest/v3 v3.10.0/go.mod h1:nr57ZbRWMqfsdGdFNLHz5jjNdDb7VVFnzAeW1n5N1Lg= -github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= github.com/otiai10/copy v1.6.0 h1:IinKAryFFuPONZ7cm6T6E2QX/vcJwSnlaA5lfoaXIiQ= -github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= -github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= -github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= -github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= github.com/oxyno-zeta/gomock-extra-matcher v1.1.0 h1:Yyk5ov0ZPKBXtVEeIWtc4J2XVrHuNoIK+0F2BUJgtsc= github.com/oxyno-zeta/gomock-extra-matcher v1.1.0/go.mod h1:UMGTHYEmJ1dRq8LDZ7VTAYO4nqM3GD1UGC3RJEUxEz0= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= @@ -1045,8 +856,8 @@ github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChl github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= -github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU= -github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= +github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= +github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= @@ -1068,8 +879,6 @@ github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qR github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/polyfloyd/go-errorlint v1.4.0 h1:b+sQ5HibPIAjEZwtuwU8Wz/u0dMZ7YL+bk+9yWyHVJk= -github.com/polyfloyd/go-errorlint v1.4.0/go.mod h1:qJCkPeBn+0EXkdKTrUCcuFStM2xrDKfxI3MGLXPexUs= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= @@ -1112,14 +921,6 @@ github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/quasilyte/go-ruleguard v0.3.19 h1:tfMnabXle/HzOb5Xe9CUZYWXKfkS1KwRmZyPmD9nVcc= -github.com/quasilyte/go-ruleguard v0.3.19/go.mod h1:lHSn69Scl48I7Gt9cX3VrbsZYvYiBYszZOZW4A+oTEw= -github.com/quasilyte/gogrep v0.5.0 h1:eTKODPXbI8ffJMN+W2aE0+oL0z/nh8/5eNdiO34SOAo= -github.com/quasilyte/gogrep v0.5.0/go.mod h1:Cm9lpz9NZjEoL1tgZ2OgeUKPIxL1meE7eo60Z6Sk+Ng= -github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 h1:TCg2WBOl980XxGFEZSS6KlBGIV0diGdySzxATTWoqaU= -github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0= -github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 h1:M8mH9eK4OUR4lu7Gd+PU1fV2/qnDNfzT635KRSObncs= -github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8A4Y+GyBgPuaQJuWiy0XYftx4Xm/y5Jqk9I6VQ= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -1149,37 +950,21 @@ github.com/rs/zerolog v1.27.0/go.mod h1:7frBqO0oezxmnO7GF86FY++uy8I0Tk/If5ni1G9Q github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryancurrah/gomodguard v1.3.0 h1:q15RT/pd6UggBXVBuLps8BXRvl5GPBcwVA7BJHMLuTw= -github.com/ryancurrah/gomodguard v1.3.0/go.mod h1:ggBxb3luypPEzqVtq33ee7YSN35V28XeGnid8dnni50= -github.com/ryanrolds/sqlclosecheck v0.4.0 h1:i8SX60Rppc1wRuyQjMciLqIzV3xnoHB7/tXbr6RGYNI= -github.com/ryanrolds/sqlclosecheck v0.4.0/go.mod h1:TBRRjzL31JONc9i4XMinicuo+s+E8yKZ5FN8X3G6CKQ= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -github.com/sanposhiho/wastedassign/v2 v2.0.7 h1:J+6nrY4VW+gC9xFzUc+XjPD3g3wF3je/NsJFwFK7Uxc= -github.com/sanposhiho/wastedassign/v2 v2.0.7/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dmsbF2ud9pAAGfoLfjhtI= github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= -github.com/sashamelentyev/interfacebloat v1.1.0 h1:xdRdJp0irL086OyW1H/RTZTr1h/tMEOsumirXcOJqAw= -github.com/sashamelentyev/interfacebloat v1.1.0/go.mod h1:+Y9yU5YdTkrNvoX0xHc84dxiN1iBi9+G8zZIhPVoNjQ= -github.com/sashamelentyev/usestdlibvars v1.23.0 h1:01h+/2Kd+NblNItNeux0veSL5cBF1jbEOPrEhDzGYq0= -github.com/sashamelentyev/usestdlibvars v1.23.0/go.mod h1:YPwr/Y1LATzHI93CqoPUN/2BzGQ/6N/cl/KwgR0B/aU= github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= -github.com/securego/gosec/v2 v2.15.0 h1:v4Ym7FF58/jlykYmmhZ7mTm7FQvN/setNm++0fgIAtw= -github.com/securego/gosec/v2 v2.15.0/go.mod h1:VOjTrZOkUtSDt2QLSJmQBMWnvwiQPEjg0l+5juIqGk8= github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c h1:W65qqJCIOVP4jpqPQ0YvHYKwcMEMVWIzWC5iNQQfBTU= -github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= -github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -1188,26 +973,16 @@ github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/sivchari/containedctx v1.0.2 h1:0hLQKpgC53OVF1VT7CeoFHk9YKstur1XOgfYIc1yrHI= -github.com/sivchari/containedctx v1.0.2/go.mod h1:PwZOeqm4/DLoJOqMSIJs3aKqXRX4YO+uXww087KZ7Bw= -github.com/sivchari/nosnakecase v1.7.0 h1:7QkpWIRMe8x25gckkFd2A5Pi6Ymo0qgr4JrhGt95do8= -github.com/sivchari/nosnakecase v1.7.0/go.mod h1:CwDzrzPea40/GB6uynrNLiorAlgFRvRbFSgJx2Gs+QY= -github.com/sivchari/tenv v1.7.1 h1:PSpuD4bu6fSmtWMxSGWcvqUUgIn7k3yOJhOIzVWn8Ak= -github.com/sivchari/tenv v1.7.1/go.mod h1:64yStXKSOxDfX47NlhVwND4dHwfZDdbp2Lyl018Icvg= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/sonatard/noctx v0.0.2 h1:L7Dz4De2zDQhW8S0t+KUjY0MAQJd6SgVwhzNIc4ok00= -github.com/sonatard/noctx v0.0.2/go.mod h1:kzFz+CzWSjQ2OzIm46uJZoXuBpa2+0y3T36U18dWqIo= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= -github.com/sourcegraph/go-diff v0.7.0 h1:9uLlrd5T46OXs5qpp8L/MTltk0zikUGi0sNNyCpA8G0= -github.com/sourcegraph/go-diff v0.7.0/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.9.3 h1:41FoI0fD7OR7mGcKE/aOiLkGreyf8ifIOQmJANWogMk= -github.com/spf13/afero v1.9.3/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= +github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= +github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= @@ -1223,13 +998,9 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= -github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= -github.com/ssgreg/nlreturn/v2 v2.2.1 h1:X4XDI7jstt3ySqGU86YGAURbxw3oTDPK9sPEi6YEwQ0= -github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= +github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= +github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= -github.com/stbenjam/no-sprintf-host-port v0.1.1 h1:tYugd/yrm1O0dV+ThCbaKZh195Dfm07ysF0U6JQXczc= -github.com/stbenjam/no-sprintf-host-port v0.1.1/go.mod h1:TLhvtIvONRzdmkFiio4O8LHsN9N74I+PhRquPsxpL0I= github.com/strangelove-ventures/packet-forward-middleware/v4 v4.0.5 h1:KKUqeGhVBK38+1LwThC8IeIcsJZ6COX5kvhiJroFqCM= github.com/strangelove-ventures/packet-forward-middleware/v4 v4.0.5/go.mod h1:4zAtg449/JISRmf+sbmqolqSLP+QJBh+EtWkWtt/AKE= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -1240,7 +1011,6 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.1.4/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -1250,30 +1020,20 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= -github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c h1:+aPplBwWcHBo6q9xrfWdMrT9o4kltkmmvpemgIjep/8= -github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c/go.mod h1:SbErYREK7xXdsRiigaQiQkI9McGRzYMvlKYaP3Nimdk= -github.com/tdakkota/asciicheck v0.2.0 h1:o8jvnUANo0qXtnslk2d3nMKTFNlOnJjRrNcj0j9qkHM= -github.com/tdakkota/asciicheck v0.2.0/go.mod h1:Qb7Y9EgjCLJGup51gDHFzbI08/gbGhL/UVhYIPWG2rg= github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= github.com/tendermint/tm-db v0.6.7 h1:fE00Cbl0jayAoqlExN6oyQJ7fR/ZtoVOmvPJ//+shu8= github.com/tendermint/tm-db v0.6.7/go.mod h1:byQDzFkZV1syXr/ReXS808NxA2xvyuuVgXOJ/088L6I= -github.com/tenntenn/modver v1.0.1 h1:2klLppGhDgzJrScMpkj9Ujy3rXPUspSjAcev9tSEBgA= -github.com/tenntenn/modver v1.0.1/go.mod h1:bePIyQPb7UeioSRkw3Q0XeMhYZSMx9B8ePqg6SAMGH0= -github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3 h1:f+jULpRQGxTSkNYKJ51yaw6ChIqO+Je8UqsTKN/cDag= -github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY= -github.com/tetafro/godot v1.4.11 h1:BVoBIqAf/2QdbFmSwAWnaIqDivZdOV0ZRwEm6jivLKw= -github.com/tetafro/godot v1.4.11/go.mod h1:LR3CJpxDVGlYOWn3ZZg1PgNZdTUvzsZWu8xaEohUpn8= github.com/tidwall/btree v1.5.0 h1:iV0yVY/frd7r6qGBXfEYs7DH0gTDgrKTrDjS7xt/IyQ= github.com/tidwall/btree v1.5.0/go.mod h1:LGm8L/DZjPLmeWGjv5kFrY8dL4uVhMmzmmLYmsObdKE= github.com/tidwall/gjson v1.12.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= @@ -1281,19 +1041,11 @@ github.com/tidwall/gjson v1.14.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vl github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tidwall/sjson v1.2.4/go.mod h1:098SZ494YoMWPmMO6ct4dcFnqxwj9r/gF0Etp19pSNM= -github.com/timakin/bodyclose v0.0.0-20221125081123-e39cf3fc478e h1:MV6KaVu/hzByHP0UvJ4HcMGE/8a6A4Rggc/0wx2AvJo= -github.com/timakin/bodyclose v0.0.0-20221125081123-e39cf3fc478e/go.mod h1:27bSVNWSBOHm+qRp1T9qzaIpsWEP6TbUnei/43HK+PQ= -github.com/timonwong/loggercheck v0.9.4 h1:HKKhqrjcVj8sxL7K77beXh0adEm6DLjV/QOGeMXEVi4= -github.com/timonwong/loggercheck v0.9.4/go.mod h1:caz4zlPcgvpEkXgVnAJGowHAMW2NwHaNlpS8xDbVhTg= github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tinylib/msgp v1.1.5/go.mod h1:eQsjooMTnV42mHu917E26IogZ2930nFyBQdofk10Udg= github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI= github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZFu0T9wgjM= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tomarrell/wrapcheck/v2 v2.8.1 h1:HxSqDSN0sAt0yJYsrcYVoEeyM4aI9yAm3KQpIXDJRhQ= -github.com/tomarrell/wrapcheck/v2 v2.8.1/go.mod h1:/n2Q3NZ4XFT50ho6Hbxg+RV1uyo2Uow/Vdm9NQcl5SE= -github.com/tommy-muehle/go-mnd/v2 v2.5.1 h1:NowYhSdyE/1zwK9QCLeRb6USWdoif80Ie+v+yU8u1Zw= -github.com/tommy-muehle/go-mnd/v2 v2.5.1/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31/go.mod h1:onvgF043R+lC5RZ8IT9rBXDaEDnpnw/Cl+HFiw+v/7Q= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= @@ -1305,16 +1057,10 @@ github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljT github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= -github.com/ultraware/funlen v0.0.3 h1:5ylVWm8wsNwH5aWo9438pwvsK0QiqVuUrt9bn7S/iLA= -github.com/ultraware/funlen v0.0.3/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= -github.com/ultraware/whitespace v0.0.5 h1:hh+/cpIcopyMYbZNVov9iSxvJU3OYQg78Sfaqzi/CzI= -github.com/ultraware/whitespace v0.0.5/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= -github.com/uudashr/gocognit v1.0.6 h1:2Cgi6MweCsdB6kpcVQp7EW4U23iBFQWfTXiWlyp842Y= -github.com/uudashr/gocognit v1.0.6/go.mod h1:nAIUuVBnYU7pcninia3BHOvQkpQCeO76Uscky5BOwcY= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= @@ -1335,12 +1081,8 @@ github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yagipy/maintidx v1.0.0 h1:h5NvIsCz+nRDapQ0exNv4aJ0yXSI0420omVANTv3GJM= -github.com/yagipy/maintidx v1.0.0/go.mod h1:0qNf/I/CCZXSMhsRsrEPDZ+DkekpKLXAJfsTACwgXLk= github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= github.com/ybbus/jsonrpc v2.1.2+incompatible/go.mod h1:XJrh1eMSzdIYFbM08flv0wp5G35eRniyeGut1z+LSiE= -github.com/yeya24/promlinter v0.2.0 h1:xFKDQ82orCU5jQujdaD8stOHiv8UN68BSdn2a8u8Y3o= -github.com/yeya24/promlinter v0.2.0/go.mod h1:u54lkmBOZrpEbQQ6gox2zWKKLKu2SGe+2KOiextY+IA= github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= @@ -1349,14 +1091,10 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= -gitlab.com/bosi/decorder v0.2.3 h1:gX4/RgK16ijY8V+BRQHAySfQAb354T7/xQpDB2n10P0= -gitlab.com/bosi/decorder v0.2.3/go.mod h1:9K1RB5+VPNQYtXtTDAzd2OEftsZb1oV0IrJrzChSdGE= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= @@ -1372,21 +1110,12 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= -go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= -go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= -go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1410,10 +1139,9 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= -golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= +golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1431,10 +1159,6 @@ golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8H golang.org/x/exp v0.0.0-20200513190911-00229845015e/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= golang.org/x/exp v0.0.0-20221205204356-47842c84f3db h1:D/cFflL63o2KSLJIwjlcIt8PR064j/xsmdEJL/YvY/o= golang.org/x/exp v0.0.0-20221205204356-47842c84f3db/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= -golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= -golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= -golang.org/x/exp/typeparams v0.0.0-20230224173230-c95f2b4c22f2 h1:J74nGeMgeFnYQJN59eFwh06jX/V8g0lB7LWpjSLxtgU= -golang.org/x/exp/typeparams v0.0.0-20230224173230-c95f2b4c22f2/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1460,12 +1184,6 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= -golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1521,16 +1239,11 @@ golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= -golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1553,9 +1266,7 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1615,7 +1326,9 @@ golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201207223542-d4d67f95c62d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1641,34 +1354,20 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211105183446-c75c47738b0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220702020025-31831981b65f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= -golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1678,12 +1377,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1698,7 +1393,6 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190321232350-e250d351ecad/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -1709,12 +1403,10 @@ golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1734,44 +1426,28 @@ golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200324003944-a576cf524670/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200329025819-fd4102a86c65/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200724022722-7017fd6b1305/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200820010801-b793a1359eac/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201001104356-43ebab892c4c/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201023174141-c8cfbd0f21e6/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1-0.20210205202024-ef80cdb6ec6d/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= -golang.org/x/tools v0.1.1-0.20210302220138-2ac05c832e1a/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= -golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= -golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= -golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= -golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= -golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1859,8 +1535,8 @@ google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20230125152338-dcaf20b6aeaa h1:qQPhfbPO23fwm/9lQr91L1u62Zo6cm+zI+slZT+uf+o= -google.golang.org/genproto v0.0.0-20230125152338-dcaf20b6aeaa/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= +google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -1929,16 +1605,6 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= -honnef.co/go/tools v0.4.3 h1:o/n5/K5gXqk8Gozvs2cnL0F2S1/g1vcGCAx2vETjITw= -honnef.co/go/tools v0.4.3/go.mod h1:36ZgoUOrqOk1GxwHhyryEkq8FQWkUO2xGuSMhUCcdvA= -mvdan.cc/gofumpt v0.4.0 h1:JVf4NN1mIpHogBj7ABpgOyZc65/UUOkKQFkoURsz4MM= -mvdan.cc/gofumpt v0.4.0/go.mod h1:PljLOHDeZqgS8opHRKLzp2It2VBuSdteAgqUfzMTxlQ= -mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed h1:WX1yoOaKQfddO/mLzdV4wptyWgoH/6hwLs7QHTixo0I= -mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= -mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b h1:DxJ5nJdkhDlLok9K6qO+5290kphDJbHOQO1DFFFTeBo= -mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= -mvdan.cc/unparam v0.0.0-20221223090309-7455f1af531d h1:3rvTIIM22r9pvXk+q3swxUQAQOxksVMGK7sml4nG57w= -mvdan.cc/unparam v0.0.0-20221223090309-7455f1af531d/go.mod h1:IeHQjmn6TOD+e4Z3RFiZMMsLVL+A96Nvptar8Fj71is= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= pgregory.net/rapid v0.5.3 h1:163N50IHFqr1phZens4FQOdPgfJscR7a562mjQqeo4M= diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000000..e36432b374 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,19 @@ +sonar.projectKey=cosmos_gaia +sonar.organization=cosmos + +sonar.projectName=Gaia + +sonar.sources=. +sonar.exclusions=**/*_test.go,tests/**,**/testutil/**,**/*.pb.go,**/*.pb.gw.go,test_helpers.go,docs/**,client/docs/**,contrib/**, +sonar.tests=. +sonar.test.inclusions=**/*_test.go,tests/**,**/testutil/** +sonar.go.coverage.reportPaths=coverage.out,*profile.out + +sonar.python.version=3 +sonar.sourceEncoding=UTF-8 +sonar.scm.provider=git + +# Exclude C/C++/Objective-C files from analysis +sonar.c.file.suffixes=- +sonar.cpp.file.suffixes=- +sonar.objc.file.suffixes=- \ No newline at end of file diff --git a/tests/e2e/chain.go b/tests/e2e/chain.go index b825a13258..9c931eede8 100644 --- a/tests/e2e/chain.go +++ b/tests/e2e/chain.go @@ -12,8 +12,8 @@ import ( stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" tmrand "github.com/tendermint/tendermint/libs/rand" - gaia "github.com/cosmos/gaia/v10/app" - "github.com/cosmos/gaia/v10/app/params" + gaia "github.com/cosmos/gaia/v11/app" + "github.com/cosmos/gaia/v11/app/params" ) const ( diff --git a/tests/e2e/e2e_bypassminfee_test.go b/tests/e2e/e2e_bypassminfee_test.go index 61be12f0b6..2901c557fe 100644 --- a/tests/e2e/e2e_bypassminfee_test.go +++ b/tests/e2e/e2e_bypassminfee_test.go @@ -1,9 +1,13 @@ package e2e import ( + "time" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + ibcchanneltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" ) func (s *IntegrationTestSuite) testBypassMinFeeWithdrawReward(endpoint string) { @@ -95,3 +99,86 @@ func (s *IntegrationTestSuite) testBypassMinFeeWithdrawReward(endpoint string) { } } } + +func (s *IntegrationTestSuite) testIBCBypassMsg() { + // submit gov proposal to change bypass-msg param to + // ["/ibc.core.channel.v1.MsgRecvPacket", + // "/ibc.core.channel.v1.MsgAcknowledgement", + // "/ibc.core.client.v1.MsgUpdateClient"] + submitterAddr := s.chainA.validators[0].keyInfo.GetAddress() + submitter := submitterAddr.String() + proposalCounter++ + s.govProposeNewBypassMsgs([]string{ + sdk.MsgTypeURL(&ibcchanneltypes.MsgRecvPacket{}), + sdk.MsgTypeURL(&ibcchanneltypes.MsgAcknowledgement{}), + sdk.MsgTypeURL(&ibcclienttypes.MsgUpdateClient{}), + }, proposalCounter, submitter, standardFees.String()) + + // use hermes1 to test default ibc bypass-msg + // + // test 1: transaction only contains bypass-msgs, pass + s.testTxContainsOnlyIBCBypassMsg() + // test 2: test transactions contains both bypass and non-bypass msgs (sdk.MsgTypeURL(&ibcchanneltypes.MsgTimeout{}) + s.testTxContainsMixBypassNonBypassMsg() + // test 3: test bypass-msgs exceed the MaxBypassGasUsage + s.testBypassMsgsExceedMaxBypassGasLimit() + + // set the default bypass-msg back + proposalCounter++ + s.govProposeNewBypassMsgs([]string{ + sdk.MsgTypeURL(&ibcchanneltypes.MsgRecvPacket{}), + sdk.MsgTypeURL(&ibcchanneltypes.MsgAcknowledgement{}), + sdk.MsgTypeURL(&ibcclienttypes.MsgUpdateClient{}), + sdk.MsgTypeURL(&ibcchanneltypes.MsgTimeout{}), + sdk.MsgTypeURL(&ibcchanneltypes.MsgTimeoutOnClose{}), + }, proposalCounter, submitter, standardFees.String()) +} + +func (s *IntegrationTestSuite) testTxContainsOnlyIBCBypassMsg() { + s.T().Logf("testing transaction contains only ibc bypass messages") + ok := s.hermesTransfer(hermesConfigWithGasPrices, s.chainA.id, s.chainB.id, transferChannel, uatomDenom, 100, 1000, 1) + s.Require().True(ok) + + scrRelayerBalanceBefore, dstRelayerBalanceBefore := s.queryRelayerWalletsBalances() + + pass := s.hermesClearPacket(hermesConfigNoGasPrices, s.chainA.id, transferChannel) + s.Require().True(pass) + pendingPacketsExist := s.hermesPendingPackets(hermesConfigNoGasPrices, s.chainA.id, transferChannel) + s.Require().False(pendingPacketsExist) + + // confirm relayer wallets do not pay fees + scrRelayerBalanceAfter, dstRelayerBalanceAfter := s.queryRelayerWalletsBalances() + s.Require().Equal(scrRelayerBalanceBefore.String(), scrRelayerBalanceAfter.String()) + s.Require().Equal(dstRelayerBalanceBefore.String(), dstRelayerBalanceAfter.String()) +} + +func (s *IntegrationTestSuite) testTxContainsMixBypassNonBypassMsg() { + s.T().Logf("testing transaction contains both bypass and non-bypass messages") + // hermesTransfer with --timeout-height-offset=1 + ok := s.hermesTransfer(hermesConfigWithGasPrices, s.chainA.id, s.chainB.id, transferChannel, uatomDenom, 100, 1, 1) + s.Require().True(ok) + // make sure that the transaction is timeout + time.Sleep(3 * time.Second) + pendingPacketsExist := s.hermesPendingPackets(hermesConfigNoGasPrices, s.chainA.id, transferChannel) + s.Require().True(pendingPacketsExist) + + pass := s.hermesClearPacket(hermesConfigNoGasPrices, s.chainA.id, transferChannel) + s.Require().False(pass) + // clear packets with paying fee, to not influence the next transaction + pass = s.hermesClearPacket(hermesConfigWithGasPrices, s.chainA.id, transferChannel) + s.Require().True(pass) +} + +func (s *IntegrationTestSuite) testBypassMsgsExceedMaxBypassGasLimit() { + s.T().Logf("testing bypass messages exceed MaxBypassGasUsage") + ok := s.hermesTransfer(hermesConfigWithGasPrices, s.chainA.id, s.chainB.id, transferChannel, uatomDenom, 100, 1000, 12) + s.Require().True(ok) + pass := s.hermesClearPacket(hermesConfigNoGasPrices, s.chainA.id, transferChannel) + s.Require().False(pass) + + pendingPacketsExist := s.hermesPendingPackets(hermesConfigNoGasPrices, s.chainA.id, transferChannel) + s.Require().True(pendingPacketsExist) + + pass = s.hermesClearPacket(hermesConfigWithGasPrices, s.chainA.id, transferChannel) + s.Require().True(pass) +} diff --git a/tests/e2e/e2e_exec_test.go b/tests/e2e/e2e_exec_test.go index 6b007ef7c0..c85c11d42e 100644 --- a/tests/e2e/e2e_exec_test.go +++ b/tests/e2e/e2e_exec_test.go @@ -617,6 +617,35 @@ func (s *IntegrationTestSuite) executeGaiaTxCommand(ctx context.Context, c *chai } } +func (s *IntegrationTestSuite) executeHermesCommand(ctx context.Context, hermesCmd []string) ([]byte, []byte) { + var ( + outBuf bytes.Buffer + errBuf bytes.Buffer + ) + exec, err := s.dkrPool.Client.CreateExec(docker.CreateExecOptions{ + Context: ctx, + AttachStdout: true, + AttachStderr: true, + Container: s.hermesResource1.Container.ID, + User: "root", + Cmd: hermesCmd, + }) + s.Require().NoError(err) + + err = s.dkrPool.Client.StartExec(exec.ID, docker.StartExecOptions{ + Context: ctx, + Detach: false, + OutputStream: &outBuf, + ErrorStream: &errBuf, + }) + s.Require().NoError(err) + + stdOut := outBuf.Bytes() + stdErr := errBuf.Bytes() + + return stdOut, stdErr +} + func (s *IntegrationTestSuite) expectErrExecValidation(chain *chain, valIdx int, expectErr bool) func([]byte, []byte) bool { return func(stdOut []byte, stdErr []byte) bool { var txResp sdk.TxResponse diff --git a/tests/e2e/e2e_gov_test.go b/tests/e2e/e2e_gov_test.go index fb47d00920..eefdfc0bf2 100644 --- a/tests/e2e/e2e_gov_test.go +++ b/tests/e2e/e2e_gov_test.go @@ -6,7 +6,7 @@ import ( "strings" "time" - ccvtypes "github.com/cosmos/interchain-security/x/ccv/provider/types" + ccvtypes "github.com/cosmos/interchain-security/v2/x/ccv/provider/types" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/tests/e2e/e2e_ibc_test.go b/tests/e2e/e2e_ibc_test.go index 4c9d3c7454..be6a1d2c3f 100644 --- a/tests/e2e/e2e_ibc_test.go +++ b/tests/e2e/e2e_ibc_test.go @@ -5,18 +5,12 @@ import ( "context" "encoding/json" "fmt" - "io" - "net/http" - "os" - "path" - "path/filepath" "strconv" "strings" "time" "github.com/cosmos/cosmos-sdk/client/flags" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/ory/dockertest/v3" "github.com/ory/dockertest/v3/docker" ) @@ -34,102 +28,6 @@ type PacketMetadata struct { Forward *ForwardMetadata `json:"forward"` } -func (s *IntegrationTestSuite) runIBCRelayer() { - s.T().Log("starting Hermes relayer container...") - - tmpDir, err := os.MkdirTemp("", "gaia-e2e-testnet-hermes-") - s.Require().NoError(err) - s.tmpDirs = append(s.tmpDirs, tmpDir) - - gaiaAVal := s.chainA.validators[0] - gaiaBVal := s.chainB.validators[0] - - gaiaARly := s.chainA.genesisAccounts[relayerAccountIndex] - gaiaBRly := s.chainB.genesisAccounts[relayerAccountIndex] - - hermesCfgPath := path.Join(tmpDir, "hermes") - - s.Require().NoError(os.MkdirAll(hermesCfgPath, 0o755)) - _, err = copyFile( - filepath.Join("./scripts/", "hermes_bootstrap.sh"), - filepath.Join(hermesCfgPath, "hermes_bootstrap.sh"), - ) - s.Require().NoError(err) - - s.hermesResource, err = s.dkrPool.RunWithOptions( - &dockertest.RunOptions{ - Name: fmt.Sprintf("%s-%s-relayer", s.chainA.id, s.chainB.id), - Repository: "ghcr.io/cosmos/hermes-e2e", - Tag: "1.0.0", - NetworkID: s.dkrNet.Network.ID, - Mounts: []string{ - fmt.Sprintf("%s/:/root/hermes", hermesCfgPath), - }, - PortBindings: map[docker.Port][]docker.PortBinding{ - "3031/tcp": {{HostIP: "", HostPort: "3031"}}, - }, - Env: []string{ - fmt.Sprintf("GAIA_A_E2E_CHAIN_ID=%s", s.chainA.id), - fmt.Sprintf("GAIA_B_E2E_CHAIN_ID=%s", s.chainB.id), - fmt.Sprintf("GAIA_A_E2E_VAL_MNEMONIC=%s", gaiaAVal.mnemonic), - fmt.Sprintf("GAIA_B_E2E_VAL_MNEMONIC=%s", gaiaBVal.mnemonic), - fmt.Sprintf("GAIA_A_E2E_RLY_MNEMONIC=%s", gaiaARly.mnemonic), - fmt.Sprintf("GAIA_B_E2E_RLY_MNEMONIC=%s", gaiaBRly.mnemonic), - fmt.Sprintf("GAIA_A_E2E_VAL_HOST=%s", s.valResources[s.chainA.id][0].Container.Name[1:]), - fmt.Sprintf("GAIA_B_E2E_VAL_HOST=%s", s.valResources[s.chainB.id][0].Container.Name[1:]), - }, - Entrypoint: []string{ - "sh", - "-c", - "chmod +x /root/hermes/hermes_bootstrap.sh && /root/hermes/hermes_bootstrap.sh", - }, - }, - noRestart, - ) - s.Require().NoError(err) - - endpoint := fmt.Sprintf("http://%s/state", s.hermesResource.GetHostPort("3031/tcp")) - s.Require().Eventually( - func() bool { - resp, err := http.Get(endpoint) //nolint:gosec // this is a test - if err != nil { - return false - } - - defer resp.Body.Close() - - bz, err := io.ReadAll(resp.Body) - if err != nil { - return false - } - - var respBody map[string]interface{} - if err := json.Unmarshal(bz, &respBody); err != nil { - return false - } - - status := respBody["status"].(string) - result := respBody["result"].(map[string]interface{}) - - return status == "success" && len(result["chains"].([]interface{})) == 2 - }, - 5*time.Minute, - time.Second, - "hermes relayer not healthy", - ) - - s.T().Logf("started Hermes relayer container: %s", s.hermesResource.Container.ID) - - // XXX: Give time to both networks to start, otherwise we might see gRPC - // transport errors. - time.Sleep(10 * time.Second) - - // create the client, connection and channel between the two Gaia chains - s.createConnection() - time.Sleep(10 * time.Second) - s.createChannel() -} - func (s *IntegrationTestSuite) sendIBC(c *chain, valIdx int, sender, recipient, token, fees, note string) { ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() @@ -158,6 +56,110 @@ func (s *IntegrationTestSuite) sendIBC(c *chain, valIdx int, sender, recipient, s.T().Log("successfully sent IBC tokens") } +func (s *IntegrationTestSuite) hermesTransfer(configPath, srcChainID, dstChainID, srcChannelID, denom string, sendAmt, timeOutOffset, numMsg int) (success bool) { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + hermesCmd := []string{ + hermesBinary, + fmt.Sprintf("--config=%s", configPath), + "tx", + "ft-transfer", + fmt.Sprintf("--dst-chain=%s", dstChainID), + fmt.Sprintf("--src-chain=%s", srcChainID), + fmt.Sprintf("--src-channel=%s", srcChannelID), + fmt.Sprintf("--src-port=%s", "transfer"), + fmt.Sprintf("--amount=%v", sendAmt), + fmt.Sprintf("--denom=%s", denom), + fmt.Sprintf("--timeout-height-offset=%v", timeOutOffset), + fmt.Sprintf("--number-msgs=%v", numMsg), + } + + stdout, stderr := s.executeHermesCommand(ctx, hermesCmd) + if strings.Contains(string(stdout), "ERROR") || strings.Contains(string(stderr), "ERROR") { + return false + } + + return true +} + +func (s *IntegrationTestSuite) hermesClearPacket(configPath, chainID, channelID string) (success bool) { //nolint:unparam + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + hermesCmd := []string{ + hermesBinary, + fmt.Sprintf("--config=%s", configPath), + "clear", + "packets", + fmt.Sprintf("--chain=%s", chainID), + fmt.Sprintf("--channel=%s", channelID), + fmt.Sprintf("--port=%s", "transfer"), + } + + stdout, stderr := s.executeHermesCommand(ctx, hermesCmd) + if strings.Contains(string(stdout), "ERROR") || strings.Contains(string(stderr), "ERROR") { + return false + } + + return true +} + +type RelayerPacketsOutput struct { + Result struct { + Dst struct { + UnreceivedPackets []interface{} `json:"unreceived_packets"` + } `json:"dst"` + Src struct { + UnreceivedPackets []interface{} `json:"unreceived_packets"` + } `json:"src"` + } `json:"result"` + Status string `json:"status"` +} + +func (s *IntegrationTestSuite) hermesPendingPackets(configPath, chainID, channelID string) (pendingPackets bool) { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + hermesCmd := []string{ + hermesBinary, + "--json", + fmt.Sprintf("--config=%s", configPath), + "query", + "packet", + "pending", + fmt.Sprintf("--chain=%s", chainID), + fmt.Sprintf("--channel=%s", channelID), + fmt.Sprintf("--port=%s", "transfer"), + } + + stdout, _ := s.executeHermesCommand(ctx, hermesCmd) + + var relayerPacketsOutput RelayerPacketsOutput + err := json.Unmarshal(stdout, &relayerPacketsOutput) + s.Require().NoError(err) + + // Check if "unreceived_packets" exists in "src" + return len(relayerPacketsOutput.Result.Src.UnreceivedPackets) != 0 +} + +func (s *IntegrationTestSuite) queryRelayerWalletsBalances() (sdk.Coin, sdk.Coin) { + chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) + scrRelayerBalance, err := getSpecificBalance( + chainAAPIEndpoint, + s.chainA.genesisAccounts[relayerAccountIndexHermes1].keyInfo.GetAddress().String(), + uatomDenom) + s.Require().NoError(err) + + chainBAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainB.id][0].GetHostPort("1317/tcp")) + dstRelayerBalance, err := getSpecificBalance( + chainBAPIEndpoint, + s.chainB.genesisAccounts[relayerAccountIndexHermes1].keyInfo.GetAddress().String(), + uatomDenom) + s.Require().NoError(err) + + return scrRelayerBalance, dstRelayerBalance +} + func (s *IntegrationTestSuite) createConnection() { s.T().Logf("connecting %s and %s chains via IBC", s.chainA.id, s.chainB.id) @@ -168,7 +170,7 @@ func (s *IntegrationTestSuite) createConnection() { Context: ctx, AttachStdout: true, AttachStderr: true, - Container: s.hermesResource.Container.ID, + Container: s.hermesResource0.Container.ID, User: "root", Cmd: []string{ "hermes", @@ -211,7 +213,7 @@ func (s *IntegrationTestSuite) createChannel() { Context: ctx, AttachStdout: true, AttachStderr: true, - Container: s.hermesResource.Container.ID, + Container: s.hermesResource0.Container.ID, User: "root", Cmd: []string{ "hermes", @@ -249,7 +251,6 @@ func (s *IntegrationTestSuite) createChannel() { } func (s *IntegrationTestSuite) testIBCTokenTransfer() { - time.Sleep(30 * time.Second) s.Run("send_uatom_to_chainB", func() { // require the recipient account receives the IBC tokens (IBC packets ACKd) var ( diff --git a/tests/e2e/e2e_query_exec_test.go b/tests/e2e/e2e_query_exec_test.go index 4a99e9bb67..b958a776e8 100644 --- a/tests/e2e/e2e_query_exec_test.go +++ b/tests/e2e/e2e_query_exec_test.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - ccvtypes "github.com/cosmos/interchain-security/x/ccv/provider/types" + ccvtypes "github.com/cosmos/interchain-security/v2/x/ccv/provider/types" "github.com/cosmos/cosmos-sdk/client/flags" ) diff --git a/tests/e2e/e2e_setup_test.go b/tests/e2e/e2e_setup_test.go index b7b46e86ec..37c2b910d8 100644 --- a/tests/e2e/e2e_setup_test.go +++ b/tests/e2e/e2e_setup_test.go @@ -4,15 +4,18 @@ import ( "context" "encoding/json" "fmt" + "io" + "net/http" "os" "os/exec" + "path" "path/filepath" "strconv" "strings" "testing" "time" - ccvprovider "github.com/cosmos/interchain-security/x/ccv/provider/types" + ccvprovider "github.com/cosmos/interchain-security/v2/x/ccv/provider/types" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/hd" @@ -58,7 +61,8 @@ const ( maxTotalBypassMinFeeMsgGasUsage = "1" gas = 200000 govProposalBlockBuffer = 35 - relayerAccountIndex = 0 + relayerAccountIndexHermes0 = 0 + relayerAccountIndexHermes1 = 1 numberOfEvidences = 10 slashingShares int64 = 10000 @@ -68,29 +72,37 @@ const ( proposalCommunitySpendFilename = "proposal_community_spend.json" proposalAddConsumerChainFilename = "proposal_add_consumer.json" proposalRemoveConsumerChainFilename = "proposal_remove_consumer.json" + + hermesBinary = "hermes" + hermesConfigWithGasPrices = "/root/.hermes/config.toml" + hermesConfigNoGasPrices = "/root/.hermes/config-zero.toml" + transferChannel = "channel-0" ) var ( - gaiaConfigPath = filepath.Join(gaiaHomePath, "config") - stakingAmount = sdk.NewInt(100000000000) - stakingAmountCoin = sdk.NewCoin(uatomDenom, stakingAmount) - tokenAmount = sdk.NewCoin(uatomDenom, sdk.NewInt(3300000000)) // 3,300uatom - standardFees = sdk.NewCoin(uatomDenom, sdk.NewInt(330000)) // 0.33uatom - depositAmount = sdk.NewCoin(uatomDenom, sdk.NewInt(330000000)) // 3,300uatom - distModuleAddress = authtypes.NewModuleAddress(distrtypes.ModuleName).String() - proposalCounter = 0 + gaiaConfigPath = filepath.Join(gaiaHomePath, "config") + stakingAmount = sdk.NewInt(100000000000) + stakingAmountCoin = sdk.NewCoin(uatomDenom, stakingAmount) + tokenAmount = sdk.NewCoin(uatomDenom, sdk.NewInt(3300000000)) // 3,300uatom + standardFees = sdk.NewCoin(uatomDenom, sdk.NewInt(330000)) // 0.33uatom + depositAmount = sdk.NewCoin(uatomDenom, sdk.NewInt(330000000)) // 3,300uatom + distModuleAddress = authtypes.NewModuleAddress(distrtypes.ModuleName).String() + proposalCounter = 0 + HermesResource0Purged = false ) type IntegrationTestSuite struct { suite.Suite - tmpDirs []string - chainA *chain - chainB *chain - dkrPool *dockertest.Pool - dkrNet *dockertest.Network - hermesResource *dockertest.Resource - valResources map[string][]*dockertest.Resource + tmpDirs []string + chainA *chain + chainB *chain + dkrPool *dockertest.Pool + dkrNet *dockertest.Network + hermesResource0 *dockertest.Resource + hermesResource1 *dockertest.Resource + + valResources map[string][]*dockertest.Resource } type AddressResponse struct { @@ -148,7 +160,8 @@ func (s *IntegrationTestSuite) SetupSuite() { s.runValidators(s.chainB, 10) time.Sleep(10 * time.Second) - s.runIBCRelayer() + s.runIBCRelayer0() + s.runIBCRelayer1() } func (s *IntegrationTestSuite) TearDownSuite() { @@ -163,8 +176,12 @@ func (s *IntegrationTestSuite) TearDownSuite() { s.T().Log("tearing down e2e integration test suite...") - if runIBCTest { - s.Require().NoError(s.dkrPool.Purge(s.hermesResource)) + s.Require().NoError(s.dkrPool.Purge(s.hermesResource1)) + // if runIBCTest, s.hermesResource0 already purged in TestIBC() + // in GovSoftwareUpgrade test, s.TearDownSuite() then s.SetupSuite() + // if IBCTest runs before GovSoftwareUpgrade, s.hermesResource0 is already purged. + if !HermesResource0Purged { + s.Require().NoError(s.dkrPool.Purge(s.hermesResource0)) } for _, vr := range s.valResources { @@ -186,12 +203,13 @@ func (s *IntegrationTestSuite) TearDownSuite() { func (s *IntegrationTestSuite) initNodes(c *chain) { s.Require().NoError(c.createAndInitValidators(2)) /* Adding 4 accounts to val0 local directory - c.genesisAccounts[0]: Relayer Wallet + c.genesisAccounts[0]: Relayer0 Wallet c.genesisAccounts[1]: ICA Owner c.genesisAccounts[2]: Test Account 1 c.genesisAccounts[3]: Test Account 2 + c.genesisAccounts[4]: Relayer1 Wallet */ - s.Require().NoError(c.addAccountFromMnemonic(4)) + s.Require().NoError(c.addAccountFromMnemonic(5)) // Initialize a genesis file for the first validator val0ConfigDir := c.validators[0].configDir() var addrAll []sdk.AccAddress @@ -583,6 +601,167 @@ func noRestart(config *docker.HostConfig) { } } +// hermes0 is for ibc and packet-forward-middleware(PFM) test, hermes0 is keep running during the ibc and PFM test. +func (s *IntegrationTestSuite) runIBCRelayer0() { + s.T().Log("starting Hermes relayer container 0...") + + tmpDir, err := os.MkdirTemp("", "gaia-e2e-testnet-hermes-") + s.Require().NoError(err) + s.tmpDirs = append(s.tmpDirs, tmpDir) + + gaiaAVal := s.chainA.validators[0] + gaiaBVal := s.chainB.validators[0] + + gaiaARly := s.chainA.genesisAccounts[relayerAccountIndexHermes0] + gaiaBRly := s.chainB.genesisAccounts[relayerAccountIndexHermes0] + + hermesCfgPath := path.Join(tmpDir, "hermes") + + s.Require().NoError(os.MkdirAll(hermesCfgPath, 0o755)) + _, err = copyFile( + filepath.Join("./scripts/", "hermes_bootstrap.sh"), + filepath.Join(hermesCfgPath, "hermes_bootstrap.sh"), + ) + s.Require().NoError(err) + + s.hermesResource0, err = s.dkrPool.RunWithOptions( + &dockertest.RunOptions{ + Name: fmt.Sprintf("%s-%s-relayer-0", s.chainA.id, s.chainB.id), + Repository: "ghcr.io/cosmos/hermes-e2e", + Tag: "1.0.0", + NetworkID: s.dkrNet.Network.ID, + Mounts: []string{ + fmt.Sprintf("%s/:/root/hermes", hermesCfgPath), + }, + PortBindings: map[docker.Port][]docker.PortBinding{ + "3031/tcp": {{HostIP: "", HostPort: "3031"}}, + }, + Env: []string{ + fmt.Sprintf("GAIA_A_E2E_CHAIN_ID=%s", s.chainA.id), + fmt.Sprintf("GAIA_B_E2E_CHAIN_ID=%s", s.chainB.id), + fmt.Sprintf("GAIA_A_E2E_VAL_MNEMONIC=%s", gaiaAVal.mnemonic), + fmt.Sprintf("GAIA_B_E2E_VAL_MNEMONIC=%s", gaiaBVal.mnemonic), + fmt.Sprintf("GAIA_A_E2E_RLY_MNEMONIC=%s", gaiaARly.mnemonic), + fmt.Sprintf("GAIA_B_E2E_RLY_MNEMONIC=%s", gaiaBRly.mnemonic), + fmt.Sprintf("GAIA_A_E2E_VAL_HOST=%s", s.valResources[s.chainA.id][0].Container.Name[1:]), + fmt.Sprintf("GAIA_B_E2E_VAL_HOST=%s", s.valResources[s.chainB.id][0].Container.Name[1:]), + }, + Entrypoint: []string{ + "sh", + "-c", + "chmod +x /root/hermes/hermes_bootstrap.sh && /root/hermes/hermes_bootstrap.sh", + }, + }, + noRestart, + ) + s.Require().NoError(err) + + endpoint := fmt.Sprintf("http://%s/state", s.hermesResource0.GetHostPort("3031/tcp")) + s.Require().Eventually( + func() bool { + resp, err := http.Get(endpoint) //nolint:gosec // this is a test + if err != nil { + return false + } + + defer resp.Body.Close() + + bz, err := io.ReadAll(resp.Body) + if err != nil { + return false + } + + var respBody map[string]interface{} + if err := json.Unmarshal(bz, &respBody); err != nil { + return false + } + + status := respBody["status"].(string) + result := respBody["result"].(map[string]interface{}) + + return status == "success" && len(result["chains"].([]interface{})) == 2 + }, + 5*time.Minute, + time.Second, + "hermes relayer not healthy", + ) + + s.T().Logf("started Hermes relayer 0 container: %s", s.hermesResource0.Container.ID) + + // XXX: Give time to both networks to start, otherwise we might see gRPC + // transport errors. + time.Sleep(10 * time.Second) + + // create the client, connection and channel between the two Gaia chains + s.createConnection() + time.Sleep(10 * time.Second) + s.createChannel() +} + +// hermes1 is for bypass-msg test. Hermes1 is to process asynchronous transactions, +// Hermes1 has access to two Hermes configurations: one configuration allows paying fees, while the other does not. +// With Hermes1, better control can be achieved regarding whether fees are paid when clearing transactions. +func (s *IntegrationTestSuite) runIBCRelayer1() { + s.T().Log("starting Hermes relayer container 1...") + + tmpDir, err := os.MkdirTemp("", "gaia-e2e-testnet-hermes-") + s.Require().NoError(err) + s.tmpDirs = append(s.tmpDirs, tmpDir) + + gaiaAVal := s.chainA.validators[0] + gaiaBVal := s.chainB.validators[0] + + gaiaARly := s.chainA.genesisAccounts[relayerAccountIndexHermes1] + gaiaBRly := s.chainB.genesisAccounts[relayerAccountIndexHermes1] + + hermesCfgPath := path.Join(tmpDir, "hermes") + + s.Require().NoError(os.MkdirAll(hermesCfgPath, 0o755)) + _, err = copyFile( + filepath.Join("./scripts/", "hermes1_bootstrap.sh"), + filepath.Join(hermesCfgPath, "hermes1_bootstrap.sh"), + ) + s.Require().NoError(err) + + s.hermesResource1, err = s.dkrPool.RunWithOptions( + &dockertest.RunOptions{ + Name: fmt.Sprintf("%s-%s-relayer-1", s.chainA.id, s.chainB.id), + Repository: "ghcr.io/cosmos/hermes-e2e", + Tag: "1.0.0", + NetworkID: s.dkrNet.Network.ID, + Mounts: []string{ + fmt.Sprintf("%s/:/root/hermes", hermesCfgPath), + }, + PortBindings: map[docker.Port][]docker.PortBinding{ + "3032/tcp": {{HostIP: "", HostPort: "3032"}}, + }, + Env: []string{ + fmt.Sprintf("GAIA_A_E2E_CHAIN_ID=%s", s.chainA.id), + fmt.Sprintf("GAIA_B_E2E_CHAIN_ID=%s", s.chainB.id), + fmt.Sprintf("GAIA_A_E2E_VAL_MNEMONIC=%s", gaiaAVal.mnemonic), + fmt.Sprintf("GAIA_B_E2E_VAL_MNEMONIC=%s", gaiaBVal.mnemonic), + fmt.Sprintf("GAIA_A_E2E_RLY_MNEMONIC=%s", gaiaARly.mnemonic), + fmt.Sprintf("GAIA_B_E2E_RLY_MNEMONIC=%s", gaiaBRly.mnemonic), + fmt.Sprintf("GAIA_A_E2E_VAL_HOST=%s", s.valResources[s.chainA.id][0].Container.Name[1:]), + fmt.Sprintf("GAIA_B_E2E_VAL_HOST=%s", s.valResources[s.chainB.id][0].Container.Name[1:]), + }, + Entrypoint: []string{ + "sh", + "-c", + "chmod +x /root/hermes/hermes1_bootstrap.sh && /root/hermes/hermes1_bootstrap.sh && tail -f /dev/null", + }, + }, + noRestart, + ) + s.Require().NoError(err) + + s.T().Logf("started Hermes relayer 1 container: %s", s.hermesResource1.Container.ID) + + // XXX: Give time to both networks to start, otherwise we might see gRPC + // transport errors. + time.Sleep(10 * time.Second) +} + func (s *IntegrationTestSuite) writeGovParamChangeProposalGlobalFees(c *chain, coins sdk.DecCoins) { type ParamInfo struct { Subspace string `json:"subspace"` diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go index 58cba8a906..c2edd641fc 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/e2e/e2e_test.go @@ -88,6 +88,11 @@ func (s *IntegrationTestSuite) TestIBC() { s.testIBCTokenTransfer() s.testMultihopIBCTokenTransfer() s.testFailedMultihopIBCTokenTransfer() + + // stop hermes0 to prevent hermes0 relaying transactions + s.Require().NoError(s.dkrPool.Purge(s.hermesResource0)) + HermesResource0Purged = true + s.testIBCBypassMsg() } func (s *IntegrationTestSuite) TestSlashing() { diff --git a/tests/e2e/e2e_vesting_test.go b/tests/e2e/e2e_vesting_test.go index 666ae14628..d2df3476c3 100644 --- a/tests/e2e/e2e_vesting_test.go +++ b/tests/e2e/e2e_vesting_test.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/gaia/v10/x/globalfee/ante" + "github.com/cosmos/gaia/v11/x/globalfee/ante" ) const ( diff --git a/tests/e2e/genesis.go b/tests/e2e/genesis.go index 1c84b8f28a..685e872cb2 100644 --- a/tests/e2e/genesis.go +++ b/tests/e2e/genesis.go @@ -17,7 +17,7 @@ import ( icatypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/types" tmtypes "github.com/tendermint/tendermint/types" - globfeetypes "github.com/cosmos/gaia/v10/x/globalfee/types" + globfeetypes "github.com/cosmos/gaia/v11/x/globalfee/types" ) func getGenDoc(path string) (*tmtypes.GenesisDoc, error) { diff --git a/tests/e2e/query.go b/tests/e2e/query.go index 2edfacd3c7..ccd30a96c8 100644 --- a/tests/e2e/query.go +++ b/tests/e2e/query.go @@ -17,7 +17,7 @@ import ( govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/cosmos/gaia/v10/x/globalfee/types" + "github.com/cosmos/gaia/v11/x/globalfee/types" ) func queryGaiaTx(endpoint, txHash string) error { diff --git a/tests/e2e/scripts/hermes1_bootstrap.sh b/tests/e2e/scripts/hermes1_bootstrap.sh new file mode 100755 index 0000000000..049c61b8ad --- /dev/null +++ b/tests/e2e/scripts/hermes1_bootstrap.sh @@ -0,0 +1,152 @@ +#!/bin/bash + +set -ex + +# initialize Hermes relayer configuration +mkdir -p /root/.hermes/ +touch /root/.hermes/config.toml + +echo $GAIA_B_E2E_RLY_MNEMONIC > /root/.hermes/GAIA_B_E2E_RLY_MNEMONIC.txt +echo $GAIA_A_E2E_RLY_MNEMONIC > /root/.hermes/GAIA_A_E2E_RLY_MNEMONIC.txt + +# setup Hermes relayer configuration with non-zero gas_price +tee /root/.hermes/config.toml < feeRequired.Len() { - return ctx, sdkerrors.Wrapf(sdkerrors.ErrInvalidCoins, "fee is not a subset of required fees; got %s, required: %s", feeTx.GetFee().String(), feeRequired.String()) + return ctx, errorsmod.Wrapf(gaiaerrors.ErrInvalidCoins, "fee is not a subset of required fees; got %s, required: %s", feeTx.GetFee().String(), feeRequired.String()) } // Sort fee tx's coins, zero coins in feeCoins are already removed @@ -92,7 +94,7 @@ func (mfd FeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne // special case: if feeCoinsNonZeroDenom=[], DenomsSubsetOf returns true // special case: if feeCoinsNonZeroDenom is not empty, but nonZeroCoinFeesReq empty, return false if !feeCoinsNonZeroDenom.DenomsSubsetOf(nonZeroCoinFeesReq) { - return ctx, sdkerrors.Wrapf(sdkerrors.ErrInsufficientFee, "fee is not a subset of required fees; got %s, required: %s", feeCoins.String(), feeRequired.String()) + return ctx, errorsmod.Wrapf(gaiaerrors.ErrInsufficientFee, "fee is not a subset of required fees; got %s, required: %s", feeCoins.String(), feeRequired.String()) } // If the feeCoins pass the denoms check, check they are bypass-msg types. @@ -122,7 +124,7 @@ func (mfd FeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne if len(zeroCoinFeesDenomReq) != 0 { return next(ctx, tx, simulate) } - return ctx, sdkerrors.Wrapf(sdkerrors.ErrInsufficientFee, "insufficient fees; got: %s required: %s", feeCoins.String(), feeRequired.String()) + return ctx, errorsmod.Wrapf(gaiaerrors.ErrInsufficientFee, "insufficient fees; got: %s required: %s", feeCoins.String(), feeRequired.String()) } // when feeCoins != [] @@ -144,7 +146,7 @@ func (mfd FeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne errMsg = fmt.Sprintf("Insufficient fees; bypass-min-fee-msg-types with gas consumption %v exceeds the maximum allowed gas value of %v.", gas, maxTotalBypassMinFeeMsgGasUsage) } - return ctx, sdkerrors.Wrap(sdkerrors.ErrInsufficientFee, errMsg) + return ctx, errorsmod.Wrap(gaiaerrors.ErrInsufficientFee, errMsg) } return next(ctx, tx, simulate) @@ -186,8 +188,8 @@ func (mfd FeeDecorator) GetGlobalFee(ctx sdk.Context, feeTx sdk.FeeTx) (sdk.Coin err error ) - if mfd.GlobalMinFee.Has(ctx, types.ParamStoreKeyMinGasPrices) { - mfd.GlobalMinFee.Get(ctx, types.ParamStoreKeyMinGasPrices, &globalMinGasPrices) + if mfd.GlobalMinFeeParamSource.Has(ctx, types.ParamStoreKeyMinGasPrices) { + mfd.GlobalMinFeeParamSource.Get(ctx, types.ParamStoreKeyMinGasPrices, &globalMinGasPrices) } // global fee is empty set, set global fee to 0uatom if len(globalMinGasPrices) == 0 { @@ -239,16 +241,16 @@ func (mfd FeeDecorator) ContainsOnlyBypassMinFeeMsgs(ctx sdk.Context, msgs []sdk } func (mfd FeeDecorator) GetBypassMsgTypes(ctx sdk.Context) (res []string) { - if mfd.GlobalMinFee.Has(ctx, types.ParamStoreKeyBypassMinFeeMsgTypes) { - mfd.GlobalMinFee.Get(ctx, types.ParamStoreKeyBypassMinFeeMsgTypes, &res) + if mfd.GlobalMinFeeParamSource.Has(ctx, types.ParamStoreKeyBypassMinFeeMsgTypes) { + mfd.GlobalMinFeeParamSource.Get(ctx, types.ParamStoreKeyBypassMinFeeMsgTypes, &res) } return } func (mfd FeeDecorator) GetMaxTotalBypassMinFeeMsgGasUsage(ctx sdk.Context) (res uint64) { - if mfd.GlobalMinFee.Has(ctx, types.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage) { - mfd.GlobalMinFee.Get(ctx, types.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage, &res) + if mfd.GlobalMinFeeParamSource.Has(ctx, types.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage) { + mfd.GlobalMinFeeParamSource.Get(ctx, types.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage, &res) } return diff --git a/x/globalfee/ante/fee_utils.go b/x/globalfee/ante/fee_utils.go index 31c44aa3c2..289f45e250 100644 --- a/x/globalfee/ante/fee_utils.go +++ b/x/globalfee/ante/fee_utils.go @@ -1,8 +1,9 @@ package ante import ( + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + gaiaerrors "github.com/cosmos/gaia/v11/types/errors" ) // ContainZeroCoins returns true if the given coins are empty or contain zero coins, @@ -28,7 +29,7 @@ func CombinedFeeRequirement(globalFees, minGasPrices sdk.Coins) (sdk.Coins, erro // global fees should never be empty // since it has a default value using the staking module's bond denom if len(globalFees) == 0 { - return sdk.Coins{}, sdkerrors.Wrapf(sdkerrors.ErrNotFound, "global fee cannot be empty") + return sdk.Coins{}, errorsmod.Wrapf(gaiaerrors.ErrNotFound, "global fee cannot be empty") } // empty min_gas_price diff --git a/x/globalfee/client/cli/query.go b/x/globalfee/client/cli/query.go index 5e6b90acaf..b3b2056fc3 100644 --- a/x/globalfee/client/cli/query.go +++ b/x/globalfee/client/cli/query.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/cosmos/gaia/v10/x/globalfee/types" + "github.com/cosmos/gaia/v11/x/globalfee/types" ) func GetQueryCmd() *cobra.Command { diff --git a/x/globalfee/genesis_test.go b/x/globalfee/genesis_test.go index 07897f090e..30b84962f1 100644 --- a/x/globalfee/genesis_test.go +++ b/x/globalfee/genesis_test.go @@ -17,7 +17,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" - "github.com/cosmos/gaia/v10/x/globalfee/types" + "github.com/cosmos/gaia/v11/x/globalfee/types" ) func TestDefaultGenesis(t *testing.T) { diff --git a/x/globalfee/keeper/migrations.go b/x/globalfee/keeper/migrations.go index cfb1d53e45..64f08edd3b 100644 --- a/x/globalfee/keeper/migrations.go +++ b/x/globalfee/keeper/migrations.go @@ -4,7 +4,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - v2 "github.com/cosmos/gaia/v10/x/globalfee/migrations/v2" + v2 "github.com/cosmos/gaia/v11/x/globalfee/migrations/v2" ) // Migrator is a struct for handling in-place store migrations. diff --git a/x/globalfee/migrations/v2/migration.go b/x/globalfee/migrations/v2/migration.go index 615747d7a1..a6e3ea0b47 100644 --- a/x/globalfee/migrations/v2/migration.go +++ b/x/globalfee/migrations/v2/migration.go @@ -3,7 +3,7 @@ package v2 import ( sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/cosmos/gaia/v10/x/globalfee/types" + "github.com/cosmos/gaia/v11/x/globalfee/types" ) // MigrateStore performs in-place params migrations of @@ -28,7 +28,7 @@ func MigrateStore(ctx sdk.Context, globalfeeSubspace paramtypes.Subspace) error } if !globalfeeSubspace.HasKeyTable() { - globalfeeSubspace.WithKeyTable(types.ParamKeyTable()) + globalfeeSubspace = globalfeeSubspace.WithKeyTable(types.ParamKeyTable()) } globalfeeSubspace.SetParamSet(ctx, ¶ms) diff --git a/x/globalfee/migrations/v2/v2_test/migration_test.go b/x/globalfee/migrations/v2/v2_test/migration_test.go index 93341c77d6..632e578980 100644 --- a/x/globalfee/migrations/v2/v2_test/migration_test.go +++ b/x/globalfee/migrations/v2/v2_test/migration_test.go @@ -9,8 +9,8 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - v2 "github.com/cosmos/gaia/v10/x/globalfee/migrations/v2" - globalfeetypes "github.com/cosmos/gaia/v10/x/globalfee/types" + v2 "github.com/cosmos/gaia/v11/x/globalfee/migrations/v2" + globalfeetypes "github.com/cosmos/gaia/v11/x/globalfee/types" "github.com/stretchr/testify/require" "github.com/tendermint/tendermint/libs/log" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" @@ -41,8 +41,9 @@ func TestMigrateStore(t *testing.T) { memStoreKey, paramtypes.ModuleName, ) - // register the subspace withthe v10 paramKeyTable - newSubspace.WithKeyTable(globalfeetypes.ParamKeyTable()) + + // register the subspace with the v11 paramKeyTable + newSubspace = newSubspace.WithKeyTable(globalfeetypes.ParamKeyTable()) // check MinGasPrices isn't set _, ok := getMinGasPrice(newSubspace, ctx) diff --git a/x/globalfee/module.go b/x/globalfee/module.go index 499c72b608..c49ed71133 100644 --- a/x/globalfee/module.go +++ b/x/globalfee/module.go @@ -5,11 +5,11 @@ import ( "encoding/json" "fmt" + errorsmod "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/module" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/gorilla/mux" @@ -17,9 +17,9 @@ import ( "github.com/spf13/cobra" abci "github.com/tendermint/tendermint/abci/types" - "github.com/cosmos/gaia/v10/x/globalfee/client/cli" - "github.com/cosmos/gaia/v10/x/globalfee/keeper" - "github.com/cosmos/gaia/v10/x/globalfee/types" + "github.com/cosmos/gaia/v11/x/globalfee/client/cli" + "github.com/cosmos/gaia/v11/x/globalfee/keeper" + "github.com/cosmos/gaia/v11/x/globalfee/types" ) var ( @@ -48,7 +48,7 @@ func (a AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, _ client.TxEn return err } if err := data.Params.ValidateBasic(); err != nil { - return sdkerrors.Wrap(err, "params") + return errorsmod.Wrap(err, "params") } return nil } diff --git a/x/globalfee/querier.go b/x/globalfee/querier.go index d621e6f67c..4ddd5ac28f 100644 --- a/x/globalfee/querier.go +++ b/x/globalfee/querier.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/gaia/v10/x/globalfee/types" + "github.com/cosmos/gaia/v11/x/globalfee/types" ) var _ types.QueryServer = &GrpcQuerier{} diff --git a/x/globalfee/querier_test.go b/x/globalfee/querier_test.go index ac9943d59b..5f6c86345c 100644 --- a/x/globalfee/querier_test.go +++ b/x/globalfee/querier_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/cosmos/gaia/v10/x/globalfee/types" + "github.com/cosmos/gaia/v11/x/globalfee/types" ) func TestQueryMinimumGasPrices(t *testing.T) { diff --git a/x/globalfee/types/genesis.go b/x/globalfee/types/genesis.go index a87d8d9891..253df889c6 100644 --- a/x/globalfee/types/genesis.go +++ b/x/globalfee/types/genesis.go @@ -3,8 +3,8 @@ package types import ( "encoding/json" + errorsmod "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/codec" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // NewGenesisState - Create a new genesis state @@ -33,7 +33,7 @@ func GetGenesisStateFromAppState(cdc codec.Codec, appState map[string]json.RawMe func ValidateGenesis(data GenesisState) error { if err := data.Params.ValidateBasic(); err != nil { - return sdkerrors.Wrap(err, "globalfee params") + return errorsmod.Wrap(err, "globalfee params") } return nil diff --git a/x/globalfee/types/params.go b/x/globalfee/types/params.go index 07e67a983f..f3fc120acb 100644 --- a/x/globalfee/types/params.go +++ b/x/globalfee/types/params.go @@ -4,9 +4,10 @@ import ( "fmt" "strings" + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + gaiaerrors "github.com/cosmos/gaia/v11/types/errors" ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" ibcchanneltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" ) @@ -80,7 +81,7 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { func validateMinimumGasPrices(i interface{}) error { v, ok := i.(sdk.DecCoins) if !ok { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "type: %T, expected sdk.DecCoins", i) + return errorsmod.Wrapf(gaiaerrors.ErrInvalidType, "type: %T, expected sdk.DecCoins", i) } dec := DecCoins(v) @@ -93,7 +94,7 @@ type BypassMinFeeMsgTypes []string func validateBypassMinFeeMsgTypes(i interface{}) error { bypassMinFeeMsgTypes, ok := i.([]string) if !ok { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "type: %T, expected []sdk.Msg", i) + return errorsmod.Wrapf(gaiaerrors.ErrInvalidType, "type: %T, expected []sdk.Msg", i) } for _, msgType := range bypassMinFeeMsgTypes { @@ -112,7 +113,7 @@ func validateBypassMinFeeMsgTypes(i interface{}) error { func validateMaxTotalBypassMinFeeMsgGasUsage(i interface{}) error { _, ok := i.(uint64) if !ok { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "type: %T, expected uint64", i) + return errorsmod.Wrapf(gaiaerrors.ErrInvalidType, "type: %T, expected uint64", i) } return nil From ec7c87086da8d1cac930239c3d87b53afb16d14c Mon Sep 17 00:00:00 2001 From: lg <8335464+glnro@users.noreply.github.com> Date: Tue, 4 Jul 2023 11:49:12 +0200 Subject: [PATCH 02/43] feat!: SDK v0.47 & IBC v7 Base (#2541) * SDK & IBC Base Signed-off-by: lg * revert GaiaApp AnteHandler, InitChainer, BeginBlock, EndBlocker setters and fix linter * fix linter: 2nd attempt * fix sims test * Update app/params/proto.go * deps: bump IBC to v4.4.1 (#2543) * bump IBC to v4.4.1 * update changelog * fix: debug upgrade tests in gh actions (#2531) * Fix upgrade test in gh actions * update testnet link * fix links * docs: update changelog for v9.1.1 (#2546) * run link checker once per day (#2525) * run lint only on diff (#2526) Co-authored-by: Simon Noetzlin * chore: update module to gaia v11 (#2515) * update module to gaia v11 * update go.mod * update globalfee.md * fix: provider keeper * fix: upgrade test in CI * revert to ics v1.1.1 * tidy CI upgrade test scripts * chore: add v10 upgrades * fix: lint * fix: version in app.go * test: improve test * fix: upgrade test (#2550) * ci: bump go to latest 1.20.x for vulncheck (#2520) * bump go to 1.20.4 for vulncheck * use latest version of go * run at 3am UTC * Updated go version * Revert "Updated go version" This reverts commit effe7b745ffbbfef9b808b0542ea492a2d287eb4. --------- Co-authored-by: Yaru Wang Co-authored-by: Milan Mulji <98309852+mmulji-ic@users.noreply.github.com> Co-authored-by: yaruwangway <69694322+yaruwangway@users.noreply.github.com> * chore(deps): bump github.com/cosmos/ibc-go/v4 from 4.4.1 to 4.4.2 (#2554) * chore(deps): bump github.com/cosmos/ibc-go/v4 from 4.4.1 to 4.4.2 Bumps [github.com/cosmos/ibc-go/v4](https://github.com/cosmos/ibc-go) from 4.4.1 to 4.4.2. - [Release notes](https://github.com/cosmos/ibc-go/releases) - [Changelog](https://github.com/cosmos/ibc-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/cosmos/ibc-go/compare/v4.4.1...v4.4.2) --- updated-dependencies: - dependency-name: github.com/cosmos/ibc-go/v4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * update changelog --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mpoke Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * ci: improve codeql (#2523) * improve codeql * update release/v* pattern --------- Co-authored-by: yaruwangway <69694322+yaruwangway@users.noreply.github.com> * fix!: revert to ICS v1.1.0-multiden (#2559) * use ICS v1.1.0-multiden * multisig + distribution fix * chore(deps): bump JamesIves/github-pages-deploy-action (#2551) Bumps [JamesIves/github-pages-deploy-action](https://github.com/JamesIves/github-pages-deploy-action) from 4.4.0 to 4.4.2. - [Release notes](https://github.com/JamesIves/github-pages-deploy-action/releases) - [Commits](https://github.com/JamesIves/github-pages-deploy-action/compare/v4.4.0...v4.4.2) --- updated-dependencies: - dependency-name: JamesIves/github-pages-deploy-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump slackapi/slack-github-action from 1.23.0 to 1.24.0 (#2511) Bumps [slackapi/slack-github-action](https://github.com/slackapi/slack-github-action) from 1.23.0 to 1.24.0. - [Release notes](https://github.com/slackapi/slack-github-action/releases) - [Commits](https://github.com/slackapi/slack-github-action/compare/v1.23.0...v1.24.0) --- updated-dependencies: - dependency-name: slackapi/slack-github-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * refactor: update comments on globalfee, genutil module init order (#2494) * docs: update comments on globalfee, genutil module init order * rename GlobalMinFee GlobalMinFeeParamSource in FeeDecorator * fix: deadlink * test: add e2e test for ibc bypass msg (#2532) * test: setup a new hermes instance * test: add executeHermesCommand * test: add hermesTransfer * test: add ibc-bypass-msg test * test: add hermes config * test: enable all e2e test * fix: tearDownSuite in e2e test * Apply suggestions from code review Co-authored-by: Simon Noetzlin * update according to comments * chore: add comments to code * chore: correct typo * refactor bypass msg test * fix: parse query pending packet result * fix: format print error * fix: pending packets parsing * Apply suggestions from code review Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * docs: fix dead link * chore: fix lint * chore: lint fix * chore: lint fix1 * chore: remove nolint * Update tests/e2e/e2e_ibc_test.go --------- Co-authored-by: Simon Noetzlin Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * docs: Updated atoms amount in governance process (#2566) * Updated atoms amount in governance process * Missed some references * Updated Discord link (#2567) * chore: add goreleaser, cleanup release process (#2549) * chore: add goreleaser, cleanup release process * chore: update RELEASING.md * chore: add RELEASE_NOTES.md; add make create-release * chore: rm old release file * update release process * fix: apply review comments * chore: update RELEASE_PROCESS.md with PR comments * chore: add install step for goreleaser dry-run --------- Co-authored-by: mpoke * test: parsing result of query hermes pending packets (#2571) * fix: e2e test * fix: parsing hermes pending packet query result * fix: rename response RelayerPacketsOutput * chore: update workflow re. issues and PRs (#2573) * update PR workflow * update issue workflow * docs: Increase the validator set of cosmos hub to 180 from 175 (#2572) * Updated references 175 validators * Updated some missing references * chore(deps): bump docker/login-action from 2.1.0 to 2.2.0 (#2576) Bumps [docker/login-action](https://github.com/docker/login-action) from 2.1.0 to 2.2.0. - [Release notes](https://github.com/docker/login-action/releases) - [Commits](https://github.com/docker/login-action/compare/v2.1.0...v2.2.0) --- updated-dependencies: - dependency-name: docker/login-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump docker/metadata-action from 4.4.0 to 4.5.0 (#2577) Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 4.4.0 to 4.5.0. - [Release notes](https://github.com/docker/metadata-action/releases) - [Commits](https://github.com/docker/metadata-action/compare/v4.4.0...v4.5.0) --- updated-dependencies: - dependency-name: docker/metadata-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump docker/build-push-action from 4.0.0 to 4.1.0 (#2578) Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4.0.0 to 4.1.0. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v4.0.0...v4.1.0) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump github.com/spf13/viper from 1.15.0 to 1.16.0 (#2563) Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.15.0 to 1.16.0. - [Release notes](https://github.com/spf13/viper/releases) - [Commits](https://github.com/spf13/viper/compare/v1.15.0...v1.16.0) --- updated-dependencies: - dependency-name: github.com/spf13/viper dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Milan Mulji <98309852+mmulji-ic@users.noreply.github.com> * chore(deps): bump github.com/stretchr/testify from 1.8.3 to 1.8.4 (#2564) Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.3 to 1.8.4. - [Release notes](https://github.com/stretchr/testify/releases) - [Commits](https://github.com/stretchr/testify/compare/v1.8.3...v1.8.4) --- updated-dependencies: - dependency-name: github.com/stretchr/testify dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Milan Mulji <98309852+mmulji-ic@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * chore: update version for mergify and dependabot (#2582) * update mergify * update dependabot * Update CONTRIBUTING.md (#2580) * docs: Updates for v9.1.1 and re-arranging roadmap docs (#2560) * Updates for v9.1.1 and re-arranging roadmap docs * Updated SDK release for Lambda as being an ICS variant * Added living roadmap link to google docs * Updated changelog * bump ICS to v2.0.0-rc2 (#2589) * refactor: errors module (#2471) * use the errors module to ease 47 transition * golangci-lint run ./... --fix --------- Co-authored-by: Marius Poke * go mod tidy (#2592) * Feat : Removed SDK general error types (#2496) * Feat : Removed SDK general error types * Changed unnecessary wrapf to wrap * made some required changes * changed version 10 to 11 * ran go mod tidy --------- Co-authored-by: Marius Poke * ci: migrate code quality tooling from Codecov to Sonar Cloud (#2598) * remove codecov and add sonarcloud * remove /tools folder * add sonarcloud properties * update README.md * docs: Updating the quickstart, joining mainnet & upgrade docs for v10 (#2599) * Updating the quickstart, joining & upgrade docs * Updated the changelog * Updated halt-heights * Updated the banner for the upgrade, on the initial page * Updates for pr comments * Added upgrade doc * Updated incorrect version number * Apply suggestions from code review Co-authored-by: Dante Sanchez --------- Co-authored-by: Dante Sanchez * Update README.md (#2602) * fix broken link (#2585) * docs: update globalfee.md according to the `bypass-msg-types` migration (#2463) * update globalfee.md according to the bypass-msg-types migration * update test cases in globalfee.md * update test cases * improve the docs: globalfee.md * docs: formatting * docs: update globalfee.md * Apply suggestions from code review Co-authored-by: Simon Noetzlin * docs: update globalfee.md * docs: improve globalfee.md * Update docs/modules/globalfee.md Co-authored-by: Simon Noetzlin * Apply suggestions from code review Co-authored-by: Simon Noetzlin * docs: update globalfee.md according to comments * docs: tidy globalfee or global fees * docs: update globalfee.md * docs: update globalfee.md * docs: update docs --------- Co-authored-by: Simon Noetzlin * chore(deps): bump docker/build-push-action from 4.1.0 to 4.1.1 (#2609) Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4.1.0 to 4.1.1. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v4.1.0...v4.1.1) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump docker/metadata-action from 4.5.0 to 4.6.0 (#2610) Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 4.5.0 to 4.6.0. - [Release notes](https://github.com/docker/metadata-action/releases) - [Commits](https://github.com/docker/metadata-action/compare/v4.5.0...v4.6.0) --- updated-dependencies: - dependency-name: docker/metadata-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: update meaning of type-prefix! in production PRs (#2597) * update meaning of type-prefix! in PRs * apply review suggestions * Update test.yml (#2615) * chore(deps): bump github.com/cosmos/interchain-security/v2 (#2612) Bumps [github.com/cosmos/interchain-security/v2](https://github.com/cosmos/interchain-security) from 2.0.0-rc2 to 2.0.0-rc3. - [Release notes](https://github.com/cosmos/interchain-security/releases) - [Changelog](https://github.com/cosmos/interchain-security/blob/main/CHANGELOG.md) - [Commits](https://github.com/cosmos/interchain-security/compare/v2.0.0-rc2...v2.0.0-rc3) --- updated-dependencies: - dependency-name: github.com/cosmos/interchain-security/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * docs: Update docs for Comet BFT (#2493) * initial pass-thru replace of tendermint for cometbft * Updated comet links * Updated vuepress-theme package * Updated based on comments * Update docs/zh/validators/security.md Co-authored-by: yaruwangway <69694322+yaruwangway@users.noreply.github.com> * Updated CometBFT reference * Updated CometBFT references --------- Co-authored-by: yaruwangway <69694322+yaruwangway@users.noreply.github.com> * chore: Update CODEOWNERS (#2614) * Update CODEOWNERS * update codeowners * Updated release notes with v10.0.1 (#2618) * chore: start using unclog (#2605) * add unrelease changelog entries to .changelog * run unclog build -a * rename changelog categories * add tests as a component * update workflow doc * docs: update changelog for unreleased (#2584) * docs: update changelog for v11 * unclog build --------- Co-authored-by: mpoke * deps: bump comet to v0.34.29 (#2594) * bump comet to v0.34.29 * update changelog * add entry to .changelog * bump upgrades v7 and v8 to ibc-v7 * bump ics to v3 * fix go tidy * docs: Update docs for Comet BFT (#2493) * initial pass-thru replace of tendermint for cometbft * Updated comet links * Updated vuepress-theme package * Updated based on comments * Update docs/zh/validators/security.md Co-authored-by: yaruwangway <69694322+yaruwangway@users.noreply.github.com> * Updated CometBFT reference * Updated CometBFT references --------- Co-authored-by: yaruwangway <69694322+yaruwangway@users.noreply.github.com> * docs: update changelog for unreleased (#2584) * docs: update changelog for v11 * unclog build --------- Co-authored-by: mpoke --------- Signed-off-by: lg Signed-off-by: dependabot[bot] Co-authored-by: Simon Noetzlin Co-authored-by: Marius Poke Co-authored-by: yaruwangway <69694322+yaruwangway@users.noreply.github.com> Co-authored-by: Yaru Wang Co-authored-by: Milan Mulji <98309852+mmulji-ic@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> Co-authored-by: MSalopek Co-authored-by: Jacob Gadikian Co-authored-by: ruthishvitwit <122080147+ruthishvitwit@users.noreply.github.com> Co-authored-by: Dante Sanchez --- Makefile | 35 +- ante/ante.go | 24 +- ante/gov_ante.go | 9 +- ante/gov_ante_test.go | 102 +- app/app.go | 108 +- app/app_helpers.go | 9 +- app/app_test.go | 11 +- app/encoding.go | 20 +- app/export.go | 20 +- app/genesis.go | 7 +- app/helpers/test_helpers.go | 51 +- app/keepers/keepers.go | 298 +-- app/keepers/keys.go | 40 +- app/modules.go | 154 +- app/params/amino.go | 6 +- app/params/encoding.go | 2 +- app/params/proto.go | 6 +- app/sim/sim_state.go | 51 +- app/sim/sim_utils.go | 69 +- app/sim_bench_test.go | 86 + app/sim_test.go | 101 +- app/upgrades/v7/constants.go | 8 +- app/upgrades/v7/upgrades.go | 10 +- app/upgrades/v8/constants.go | 2 + app/upgrades/v8/upgrades.go | 8 +- app/upgrades/v9/constants.go | 4 +- app/upgrades/v9/upgrades.go | 2 + buf.work.yaml | 8 + client/docs/config.json | 36 +- cmd/gaiad/cmd/genaccounts.go | 383 ++-- cmd/gaiad/cmd/root.go | 154 +- cmd/gaiad/cmd/root_test.go | 2 +- cmd/gaiad/cmd/testnet.go | 327 ++- cmd/gaiad/main.go | 2 +- go.mod | 178 +- go.sum | 1062 +++++++--- proto/buf.gen.gogo.yaml | 8 + proto/buf.lock | 33 + proto/buf.yaml | 30 + proto/gaia/globalfee/v1beta1/genesis.proto | 88 +- proto/gaia/globalfee/v1beta1/query.proto | 52 +- proto/scripts/protoc-doc-gen.sh | 9 - proto/scripts/protoc-swagger-gen.sh | 23 +- proto/scripts/protocgen.sh | 35 +- tests/e2e/address.go | 63 +- tests/e2e/chain.go | 244 +-- tests/e2e/e2e_bank_test.go | 115 +- tests/e2e/e2e_bypassminfee_test.go | 364 ++-- tests/e2e/e2e_distribution_test.go | 173 +- tests/e2e/e2e_encode_test.go | 97 +- tests/e2e/e2e_evidence_test.go | 103 +- tests/e2e/e2e_exec_test.go | 1383 ++++++------ tests/e2e/e2e_feegrant_test.go | 205 +- tests/e2e/e2e_globalfee_proposal_test.go | 243 +-- tests/e2e/e2e_globalfee_test.go | 665 +++--- tests/e2e/e2e_gov_test.go | 512 ++--- tests/e2e/e2e_ibc_test.go | 960 ++++----- tests/e2e/e2e_query_exec_test.go | 78 +- tests/e2e/e2e_rest_regression_test.go | 175 +- tests/e2e/e2e_setup_test.go | 1866 ++++++++--------- tests/e2e/e2e_slashing_test.go | 43 +- tests/e2e/e2e_staking_test.go | 115 +- tests/e2e/e2e_test.go | 214 +- tests/e2e/e2e_vesting_test.go | 668 +++--- tests/e2e/genesis.go | 400 ++-- tests/e2e/http_util.go | 76 +- tests/e2e/io.go | 84 +- tests/e2e/keys.go | 37 +- tests/e2e/query.go | 574 ++--- tests/e2e/util.go | 101 +- tests/e2e/validator.go | 634 +++--- tests/ics/interchain_security_test.go | 28 +- .../proto/cosmos/auth/v1beta1/auth.proto | 50 - .../proto/cosmos/auth/v1beta1/genesis.proto | 17 - .../proto/cosmos/auth/v1beta1/query.proto | 89 - .../proto/cosmos/authz/v1beta1/authz.proto | 39 - .../proto/cosmos/authz/v1beta1/event.proto | 25 - .../proto/cosmos/authz/v1beta1/genesis.proto | 13 - .../proto/cosmos/authz/v1beta1/query.proto | 81 - .../proto/cosmos/authz/v1beta1/tx.proto | 70 - .../proto/cosmos/bank/v1beta1/authz.proto | 19 - .../proto/cosmos/bank/v1beta1/bank.proto | 96 - .../proto/cosmos/bank/v1beta1/genesis.proto | 39 - .../proto/cosmos/bank/v1beta1/query.proto | 193 -- .../proto/cosmos/bank/v1beta1/tx.proto | 42 - .../proto/cosmos/base/abci/v1beta1/abci.proto | 144 -- .../proto/cosmos/base/kv/v1beta1/kv.proto | 17 - .../cosmos/base/node/v1beta1/query.proto | 22 - .../base/query/v1beta1/pagination.proto | 55 - .../base/reflection/v1beta1/reflection.proto | 44 - .../base/reflection/v2alpha1/reflection.proto | 218 -- .../base/snapshots/v1beta1/snapshot.proto | 57 - .../base/store/v1beta1/commit_info.proto | 29 - .../cosmos/base/store/v1beta1/listening.proto | 16 - .../base/tendermint/v1beta1/query.proto | 138 -- .../proto/cosmos/base/v1beta1/coin.proto | 40 - .../capability/v1beta1/capability.proto | 30 - .../cosmos/capability/v1beta1/genesis.proto | 26 - .../proto/cosmos/crisis/v1beta1/genesis.proto | 15 - .../proto/cosmos/crisis/v1beta1/tx.proto | 25 - .../proto/cosmos/crypto/ed25519/keys.proto | 23 - .../proto/cosmos/crypto/multisig/keys.proto | 18 - .../crypto/multisig/v1beta1/multisig.proto | 25 - .../proto/cosmos/crypto/secp256k1/keys.proto | 22 - .../proto/cosmos/crypto/secp256r1/keys.proto | 23 - .../distribution/v1beta1/distribution.proto | 157 -- .../cosmos/distribution/v1beta1/genesis.proto | 155 -- .../cosmos/distribution/v1beta1/query.proto | 218 -- .../cosmos/distribution/v1beta1/tx.proto | 79 - .../cosmos/evidence/v1beta1/evidence.proto | 21 - .../cosmos/evidence/v1beta1/genesis.proto | 12 - .../proto/cosmos/evidence/v1beta1/query.proto | 51 - .../proto/cosmos/evidence/v1beta1/tx.proto | 32 - .../cosmos/feegrant/v1beta1/feegrant.proto | 78 - .../cosmos/feegrant/v1beta1/genesis.proto | 13 - .../proto/cosmos/feegrant/v1beta1/query.proto | 78 - .../proto/cosmos/feegrant/v1beta1/tx.proto | 49 - .../cosmos/genutil/v1beta1/genesis.proto | 16 - .../proto/cosmos/gov/v1beta1/genesis.proto | 26 - .../proto/cosmos/gov/v1beta1/gov.proto | 200 -- .../proto/cosmos/gov/v1beta1/query.proto | 190 -- third_party/proto/cosmos/gov/v1beta1/tx.proto | 99 - .../proto/cosmos/mint/v1beta1/genesis.proto | 16 - .../proto/cosmos/mint/v1beta1/mint.proto | 53 - .../proto/cosmos/mint/v1beta1/query.proto | 57 - .../proto/cosmos/params/v1beta1/params.proto | 27 - .../proto/cosmos/params/v1beta1/query.proto | 32 - .../cosmos/slashing/v1beta1/genesis.proto | 50 - .../proto/cosmos/slashing/v1beta1/query.proto | 63 - .../cosmos/slashing/v1beta1/slashing.proto | 58 - .../proto/cosmos/slashing/v1beta1/tx.proto | 26 - .../proto/cosmos/staking/v1beta1/authz.proto | 47 - .../cosmos/staking/v1beta1/genesis.proto | 53 - .../proto/cosmos/staking/v1beta1/query.proto | 348 --- .../cosmos/staking/v1beta1/staking.proto | 334 --- .../proto/cosmos/staking/v1beta1/tx.proto | 123 -- .../cosmos/tx/signing/v1beta1/signing.proto | 91 - .../proto/cosmos/tx/v1beta1/service.proto | 165 -- third_party/proto/cosmos/tx/v1beta1/tx.proto | 183 -- .../proto/cosmos/upgrade/v1beta1/query.proto | 104 - .../cosmos/upgrade/v1beta1/upgrade.proto | 78 - .../proto/cosmos/vesting/v1beta1/tx.proto | 31 - .../cosmos/vesting/v1beta1/vesting.proto | 85 - third_party/proto/cosmos_proto/cosmos.proto | 16 - third_party/proto/gogoproto/gogo.proto | 145 -- .../proto/google/api/annotations.proto | 31 - third_party/proto/google/api/http.proto | 318 --- third_party/proto/google/api/httpbody.proto | 78 - third_party/proto/google/protobuf/any.proto | 164 -- x/globalfee/alias.go | 12 +- x/globalfee/ante/antetest/fee_test.go | 1626 +++++++------- x/globalfee/ante/antetest/fee_test_setup.go | 246 +-- x/globalfee/ante/fee.go | 518 ++--- x/globalfee/ante/fee_utils.go | 208 +- x/globalfee/ante/fee_utils_test.go | 593 +++--- x/globalfee/client/cli/query.go | 82 +- x/globalfee/genesis_test.go | 300 +-- x/globalfee/keeper/migrations.go | 34 +- x/globalfee/migrations/v2/migration.go | 36 +- .../migrations/v2/v2_test/migration_test.go | 210 +- x/globalfee/module.go | 288 +-- x/globalfee/querier.go | 100 +- x/globalfee/querier_test.go | 102 +- x/globalfee/types/genesis.go | 76 +- x/globalfee/types/genesis.pb.go | 611 +----- x/globalfee/types/keys.go | 13 +- x/globalfee/types/params.go | 302 +-- x/globalfee/types/params_test.go | 309 +-- x/globalfee/types/query.pb.go | 525 +---- x/globalfee/types/query.pb.gw.go | 153 -- 170 files changed, 9978 insertions(+), 16269 deletions(-) create mode 100644 app/sim_bench_test.go create mode 100644 buf.work.yaml create mode 100644 proto/buf.gen.gogo.yaml create mode 100644 proto/buf.lock create mode 100644 proto/buf.yaml delete mode 100755 proto/scripts/protoc-doc-gen.sh delete mode 100644 third_party/proto/cosmos/auth/v1beta1/auth.proto delete mode 100644 third_party/proto/cosmos/auth/v1beta1/genesis.proto delete mode 100644 third_party/proto/cosmos/auth/v1beta1/query.proto delete mode 100644 third_party/proto/cosmos/authz/v1beta1/authz.proto delete mode 100644 third_party/proto/cosmos/authz/v1beta1/event.proto delete mode 100644 third_party/proto/cosmos/authz/v1beta1/genesis.proto delete mode 100644 third_party/proto/cosmos/authz/v1beta1/query.proto delete mode 100644 third_party/proto/cosmos/authz/v1beta1/tx.proto delete mode 100644 third_party/proto/cosmos/bank/v1beta1/authz.proto delete mode 100644 third_party/proto/cosmos/bank/v1beta1/bank.proto delete mode 100644 third_party/proto/cosmos/bank/v1beta1/genesis.proto delete mode 100644 third_party/proto/cosmos/bank/v1beta1/query.proto delete mode 100644 third_party/proto/cosmos/bank/v1beta1/tx.proto delete mode 100644 third_party/proto/cosmos/base/abci/v1beta1/abci.proto delete mode 100644 third_party/proto/cosmos/base/kv/v1beta1/kv.proto delete mode 100644 third_party/proto/cosmos/base/node/v1beta1/query.proto delete mode 100644 third_party/proto/cosmos/base/query/v1beta1/pagination.proto delete mode 100644 third_party/proto/cosmos/base/reflection/v1beta1/reflection.proto delete mode 100644 third_party/proto/cosmos/base/reflection/v2alpha1/reflection.proto delete mode 100644 third_party/proto/cosmos/base/snapshots/v1beta1/snapshot.proto delete mode 100644 third_party/proto/cosmos/base/store/v1beta1/commit_info.proto delete mode 100644 third_party/proto/cosmos/base/store/v1beta1/listening.proto delete mode 100644 third_party/proto/cosmos/base/tendermint/v1beta1/query.proto delete mode 100644 third_party/proto/cosmos/base/v1beta1/coin.proto delete mode 100644 third_party/proto/cosmos/capability/v1beta1/capability.proto delete mode 100644 third_party/proto/cosmos/capability/v1beta1/genesis.proto delete mode 100644 third_party/proto/cosmos/crisis/v1beta1/genesis.proto delete mode 100644 third_party/proto/cosmos/crisis/v1beta1/tx.proto delete mode 100644 third_party/proto/cosmos/crypto/ed25519/keys.proto delete mode 100644 third_party/proto/cosmos/crypto/multisig/keys.proto delete mode 100644 third_party/proto/cosmos/crypto/multisig/v1beta1/multisig.proto delete mode 100644 third_party/proto/cosmos/crypto/secp256k1/keys.proto delete mode 100644 third_party/proto/cosmos/crypto/secp256r1/keys.proto delete mode 100644 third_party/proto/cosmos/distribution/v1beta1/distribution.proto delete mode 100644 third_party/proto/cosmos/distribution/v1beta1/genesis.proto delete mode 100644 third_party/proto/cosmos/distribution/v1beta1/query.proto delete mode 100644 third_party/proto/cosmos/distribution/v1beta1/tx.proto delete mode 100644 third_party/proto/cosmos/evidence/v1beta1/evidence.proto delete mode 100644 third_party/proto/cosmos/evidence/v1beta1/genesis.proto delete mode 100644 third_party/proto/cosmos/evidence/v1beta1/query.proto delete mode 100644 third_party/proto/cosmos/evidence/v1beta1/tx.proto delete mode 100644 third_party/proto/cosmos/feegrant/v1beta1/feegrant.proto delete mode 100644 third_party/proto/cosmos/feegrant/v1beta1/genesis.proto delete mode 100644 third_party/proto/cosmos/feegrant/v1beta1/query.proto delete mode 100644 third_party/proto/cosmos/feegrant/v1beta1/tx.proto delete mode 100644 third_party/proto/cosmos/genutil/v1beta1/genesis.proto delete mode 100644 third_party/proto/cosmos/gov/v1beta1/genesis.proto delete mode 100644 third_party/proto/cosmos/gov/v1beta1/gov.proto delete mode 100644 third_party/proto/cosmos/gov/v1beta1/query.proto delete mode 100644 third_party/proto/cosmos/gov/v1beta1/tx.proto delete mode 100644 third_party/proto/cosmos/mint/v1beta1/genesis.proto delete mode 100644 third_party/proto/cosmos/mint/v1beta1/mint.proto delete mode 100644 third_party/proto/cosmos/mint/v1beta1/query.proto delete mode 100644 third_party/proto/cosmos/params/v1beta1/params.proto delete mode 100644 third_party/proto/cosmos/params/v1beta1/query.proto delete mode 100644 third_party/proto/cosmos/slashing/v1beta1/genesis.proto delete mode 100644 third_party/proto/cosmos/slashing/v1beta1/query.proto delete mode 100644 third_party/proto/cosmos/slashing/v1beta1/slashing.proto delete mode 100644 third_party/proto/cosmos/slashing/v1beta1/tx.proto delete mode 100644 third_party/proto/cosmos/staking/v1beta1/authz.proto delete mode 100644 third_party/proto/cosmos/staking/v1beta1/genesis.proto delete mode 100644 third_party/proto/cosmos/staking/v1beta1/query.proto delete mode 100644 third_party/proto/cosmos/staking/v1beta1/staking.proto delete mode 100644 third_party/proto/cosmos/staking/v1beta1/tx.proto delete mode 100644 third_party/proto/cosmos/tx/signing/v1beta1/signing.proto delete mode 100644 third_party/proto/cosmos/tx/v1beta1/service.proto delete mode 100644 third_party/proto/cosmos/tx/v1beta1/tx.proto delete mode 100644 third_party/proto/cosmos/upgrade/v1beta1/query.proto delete mode 100644 third_party/proto/cosmos/upgrade/v1beta1/upgrade.proto delete mode 100644 third_party/proto/cosmos/vesting/v1beta1/tx.proto delete mode 100644 third_party/proto/cosmos/vesting/v1beta1/vesting.proto delete mode 100644 third_party/proto/cosmos_proto/cosmos.proto delete mode 100644 third_party/proto/gogoproto/gogo.proto delete mode 100644 third_party/proto/google/api/annotations.proto delete mode 100644 third_party/proto/google/api/http.proto delete mode 100644 third_party/proto/google/api/httpbody.proto delete mode 100644 third_party/proto/google/protobuf/any.proto delete mode 100644 x/globalfee/types/query.pb.gw.go diff --git a/Makefile b/Makefile index feb7e76418..45beabd3f9 100644 --- a/Makefile +++ b/Makefile @@ -271,9 +271,9 @@ start-localnet-ci: build ./build/gaiad config chain-id liveness --home ~/.gaiad-liveness ./build/gaiad config keyring-backend test --home ~/.gaiad-liveness ./build/gaiad keys add val --home ~/.gaiad-liveness - ./build/gaiad add-genesis-account val 10000000000000000000000000stake --home ~/.gaiad-liveness --keyring-backend test - ./build/gaiad gentx val 1000000000stake --home ~/.gaiad-liveness --chain-id liveness - ./build/gaiad collect-gentxs --home ~/.gaiad-liveness + ./build/gaiad genesis add-genesis-account val 10000000000000000000000000stake --home ~/.gaiad-liveness --keyring-backend test + ./build/gaiad genesis gentx val 1000000000stake --home ~/.gaiad-liveness --chain-id liveness + ./build/gaiad genesis collect-gentxs --home ~/.gaiad-liveness sed -i.bak'' 's/minimum-gas-prices = ""/minimum-gas-prices = "0uatom"/' ~/.gaiad-liveness/config/app.toml ./build/gaiad start --home ~/.gaiad-liveness --x-crisis-skip-assert-invariants @@ -300,16 +300,31 @@ test-docker-push: test-docker ############################################################################### ### Protobuf ### ############################################################################### +protoVer=0.13.0 +protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer) +protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) + +proto-all: proto-format proto-lint proto-gen + proto-gen: @echo "Generating Protobuf files" - @sh ./proto/scripts/protocgen.sh - -proto-doc: - @echo "Generating Protoc docs" - @sh ./proto/scripts/protoc-doc-gen.sh + @$(protoImage) sh ./proto/scripts/protocgen.sh proto-swagger-gen: @echo "Generating Protobuf Swagger" - @sh ./proto/scripts/protoc-swagger-gen.sh + @$(protoImage) sh ./proto/scripts/protoc-swagger-gen.sh + +proto-format: + @$(protoImage) find ./ -name "*.proto" -exec clang-format -i {} \; + +proto-lint: + @$(protoImage) buf lint --error-format=json + +proto-check-breaking: + @$(protoImage) buf breaking --against $(HTTPS_GIT)#branch=main + +proto-update-deps: + @echo "Updating Protobuf dependencies" + $(DOCKER) run --rm -v $(CURDIR)/proto:/workspace --workdir /workspace $(protoImageName) buf mod update -.PHONY: proto-gen proto-doc proto-swagger-gen +.PHONY: proto-all proto-gen proto-gen-any proto-swagger-gen proto-format proto-lint proto-check-breaking proto-update-deps diff --git a/ante/ante.go b/ante/ante.go index b6ae8811aa..5a53c94952 100644 --- a/ante/ante.go +++ b/ante/ante.go @@ -7,11 +7,11 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/ante" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - gaiaerrors "github.com/cosmos/gaia/v11/types/errors" - ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante" - ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper" + ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante" + ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" - gaiafeeante "github.com/cosmos/gaia/v11/x/globalfee/ante" + gaiaerrors "github.com/cosmos/gaia/v11/types/errors" + // gaiafeeante "github.com/cosmos/gaia/v11/x/globalfee/ante" ) // HandlerOptions extend the SDK's AnteHandler options by requiring the IBC @@ -38,9 +38,10 @@ func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) { if opts.IBCkeeper == nil { return nil, errorsmod.Wrap(gaiaerrors.ErrLogic, "IBC keeper is required for AnteHandler") } - if opts.GlobalFeeSubspace.Name() == "" { - return nil, errorsmod.Wrap(gaiaerrors.ErrNotFound, "globalfee param store is required for AnteHandler") - } + // TODO: Enable with Globalfee + // if opts.GlobalFeeSubspace.Name() == "" { + // return nil, errorsmod.Wrap(gaiaerrors.ErrNotFound, "globalfee param store is required for AnteHandler") + // } if opts.StakingSubspace.Name() == "" { return nil, errorsmod.Wrap(gaiaerrors.ErrNotFound, "staking param store is required for AnteHandler") } @@ -55,20 +56,21 @@ func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) { anteDecorators := []sdk.AnteDecorator{ ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first - ante.NewRejectExtensionOptionsDecorator(), + ante.NewExtensionOptionsDecorator(opts.ExtensionOptionChecker), ante.NewValidateBasicDecorator(), ante.NewTxTimeoutHeightDecorator(), ante.NewValidateMemoDecorator(opts.AccountKeeper), ante.NewConsumeGasForTxSizeDecorator(opts.AccountKeeper), NewGovPreventSpamDecorator(opts.Codec, opts.GovKeeper), - gaiafeeante.NewFeeDecorator(opts.GlobalFeeSubspace, opts.StakingSubspace), - ante.NewDeductFeeDecorator(opts.AccountKeeper, opts.BankKeeper, opts.FeegrantKeeper), + // TODO: Enable with GlobalFee + // gaiafeeante.NewFeeDecorator(opts.GlobalFeeSubspace, opts.StakingSubspace), + ante.NewDeductFeeDecorator(opts.AccountKeeper, opts.BankKeeper, opts.FeegrantKeeper, opts.TxFeeChecker), ante.NewSetPubKeyDecorator(opts.AccountKeeper), // SetPubKeyDecorator must be called before all signature verification decorators ante.NewValidateSigCountDecorator(opts.AccountKeeper), ante.NewSigGasConsumeDecorator(opts.AccountKeeper, sigGasConsumer), ante.NewSigVerificationDecorator(opts.AccountKeeper, opts.SignModeHandler), ante.NewIncrementSequenceDecorator(opts.AccountKeeper), - ibcante.NewAnteDecorator(opts.IBCkeeper), + ibcante.NewRedundantRelayDecorator(opts.IBCkeeper), } return sdk.ChainAnteDecorators(anteDecorators...), nil diff --git a/ante/gov_ante.go b/ante/gov_ante.go index 88dbddea15..465123795c 100644 --- a/ante/gov_ante.go +++ b/ante/gov_ante.go @@ -4,11 +4,12 @@ import ( errorsmod "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" + gaiaerrors "github.com/cosmos/gaia/v11/types/errors" "github.com/cosmos/cosmos-sdk/x/authz" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ) // initial deposit must be greater than or equal to 10% of the minimum deposit @@ -46,10 +47,10 @@ func (g GovPreventSpamDecorator) AnteHandle( // validateGovMsgs checks if the InitialDeposit amounts are greater than the minimum initial deposit amount func (g GovPreventSpamDecorator) ValidateGovMsgs(ctx sdk.Context, msgs []sdk.Msg) error { validMsg := func(m sdk.Msg) error { - if msg, ok := m.(*govtypes.MsgSubmitProposal); ok { + if msg, ok := m.(*govv1beta1.MsgSubmitProposal); ok { // prevent messages with insufficient initial deposit amount - depositParams := g.govKeeper.GetDepositParams(ctx) - minInitialDeposit := g.calcMinInitialDeposit(depositParams.MinDeposit) + params := g.govKeeper.GetParams(ctx) + minInitialDeposit := g.calcMinInitialDeposit(params.MinDeposit) if msg.InitialDeposit.IsAllLT(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 b4194bdc9b..fbfd86dccd 100644 --- a/ante/gov_ante_test.go +++ b/ante/gov_ante_test.go @@ -5,26 +5,25 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/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" - tmrand "github.com/tendermint/tendermint/libs/rand" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - "github.com/cosmos/gaia/v11/ante" + // "github.com/cosmos/gaia/v11/ante" gaiahelpers "github.com/cosmos/gaia/v11/app/helpers" gaiaapp "github.com/cosmos/gaia/v11/app" ) -var ( - insufficientCoins = sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 100)) - minCoins = sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 1000000)) - moreThanMinCoins = sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 2500000)) - testAddr = sdk.AccAddress("test1") -) +// var ( +// insufficientCoins = sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 100)) +// minCoins = sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 1000000)) +// moreThanMinCoins = sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 2500000)) +// testAddr = sdk.AccAddress("test1") +// ) type GovAnteHandlerTestSuite struct { suite.Suite @@ -41,53 +40,54 @@ func (s *GovAnteHandlerTestSuite) SetupTest() { Height: 1, }) - encodingConfig := gaiaapp.MakeTestEncodingConfig() - encodingConfig.Amino.RegisterConcrete(&testdata.TestMsg{}, "testdata.TestMsg", nil) - testdata.RegisterInterfaces(encodingConfig.InterfaceRegistry) + legacyAmino := app.LegacyAmino() + legacyAmino.Amino.RegisterConcrete(&testdata.TestMsg{}, "testdata.TestMsg", nil) + testdata.RegisterInterfaces(app.InterfaceRegistry()) s.app = app s.ctx = ctx - s.clientCtx = client.Context{}.WithTxConfig(encodingConfig.TxConfig) + s.clientCtx = client.Context{}.WithTxConfig(app.GetTxConfig()) } func TestGovSpamPreventionSuite(t *testing.T) { suite.Run(t, new(GovAnteHandlerTestSuite)) } -func (s *GovAnteHandlerTestSuite) TestGlobalFeeMinimumGasFeeAnteHandler() { - // setup test - s.SetupTest() - tests := []struct { - title, description string - proposalType string - proposerAddr sdk.AccAddress - initialDeposit sdk.Coins - expectPass bool - }{ - {"Passing proposal 1", "the purpose of this proposal is to pass", govtypes.ProposalTypeText, testAddr, minCoins, true}, - {"Passing proposal 2", "the purpose of this proposal is to pass with more coins than minimum", govtypes.ProposalTypeText, testAddr, moreThanMinCoins, true}, - {"Failing proposal", "the purpose of this proposal is to fail", govtypes.ProposalTypeText, testAddr, insufficientCoins, false}, - } - - decorator := ante.NewGovPreventSpamDecorator(s.app.AppCodec(), &s.app.GovKeeper) - - for _, tc := range tests { - content := govtypes.ContentFromProposalType(tc.title, tc.description, tc.proposalType) - s.Require().NotNil(content) - - msg, err := govtypes.NewMsgSubmitProposal( - content, - tc.initialDeposit, - tc.proposerAddr, - ) - - s.Require().NoError(err) - - err = decorator.ValidateGovMsgs(s.ctx, []sdk.Msg{msg}) - if tc.expectPass { - s.Require().NoError(err, "expected %v to pass", tc.title) - } else { - s.Require().Error(err, "expected %v to fail", tc.title) - } - } -} +// TODO: Enable with Global Fee +// func (s *GovAnteHandlerTestSuite) TestGlobalFeeMinimumGasFeeAnteHandler() { +// // setup test +// s.SetupTest() +// tests := []struct { +// title, description string +// proposalType string +// proposerAddr sdk.AccAddress +// initialDeposit sdk.Coins +// expectPass bool +// }{ +// {"Passing proposal 1", "the purpose of this proposal is to pass", govv1beta1.ProposalTypeText, testAddr, minCoins, true}, +// {"Passing proposal 2", "the purpose of this proposal is to pass with more coins than minimum", govv1beta1.ProposalTypeText, testAddr, moreThanMinCoins, true}, +// {"Failing proposal", "the purpose of this proposal is to fail", govv1beta1.ProposalTypeText, testAddr, insufficientCoins, false}, +// } +// +// decorator := ante.NewGovPreventSpamDecorator(s.app.AppCodec(), &s.app.GovKeeper) +// +// for _, tc := range tests { +// content, _ := govv1beta1.ContentFromProposalType(tc.title, tc.description, tc.proposalType) +// s.Require().NotNil(content) +// +// msg, err := govv1beta1.NewMsgSubmitProposal( +// content, +// tc.initialDeposit, +// tc.proposerAddr, +// ) +// +// s.Require().NoError(err) +// +// err = decorator.ValidateGovMsgs(s.ctx, []sdk.Msg{msg}) +// if tc.expectPass { +// s.Require().NoError(err, "expected %v to pass", tc.title) +// } else { +// s.Require().Error(err, "expected %v to fail", tc.title) +// } +// } +//} diff --git a/app/app.go b/app/app.go index d43e43de4e..9534a22d12 100644 --- a/app/app.go +++ b/app/app.go @@ -7,44 +7,52 @@ import ( "os" "path/filepath" + "github.com/cosmos/gaia/v11/app/params" + + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" + + "github.com/cosmos/cosmos-sdk/runtime" + "github.com/cosmos/cosmos-sdk/server" + "github.com/cosmos/cosmos-sdk/testutil/testdata" + + 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" "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/client/rpc" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" + runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services" "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/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/x/auth/ante" - authrest "github.com/cosmos/cosmos-sdk/x/auth/client/rest" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/crisis" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - ibctesting "github.com/cosmos/interchain-security/v2/legacy_ibc_testing/testing" - providertypes "github.com/cosmos/interchain-security/v2/x/ccv/provider/types" + ibctesting "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/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" - abci "github.com/tendermint/tendermint/abci/types" - tmjson "github.com/tendermint/tendermint/libs/json" - "github.com/tendermint/tendermint/libs/log" - tmos "github.com/tendermint/tendermint/libs/os" - dbm "github.com/tendermint/tm-db" gaiaante "github.com/cosmos/gaia/v11/ante" "github.com/cosmos/gaia/v11/app/keepers" - gaiaappparams "github.com/cosmos/gaia/v11/app/params" "github.com/cosmos/gaia/v11/app/upgrades" v11 "github.com/cosmos/gaia/v11/app/upgrades/v11" - "github.com/cosmos/gaia/v11/x/globalfee" + + // "github.com/cosmos/gaia/v11/x/globalfee" // unnamed import of statik for swagger UI support _ "github.com/cosmos/cosmos-sdk/client/docs/statik" @@ -58,7 +66,7 @@ var ( ) var ( - _ simapp.App = (*GaiaApp)(nil) + _ runtime.AppI = (*GaiaApp)(nil) _ servertypes.Application = (*GaiaApp)(nil) _ ibctesting.TestingApp = (*GaiaApp)(nil) ) @@ -72,8 +80,10 @@ type GaiaApp struct { //nolint: revive legacyAmino *codec.LegacyAmino appCodec codec.Codec + txConfig client.TxConfig interfaceRegistry types.InterfaceRegistry - invCheckPeriod uint + + invCheckPeriod uint // the module manager mm *module.Manager @@ -94,32 +104,40 @@ func init() { // NewGaiaApp returns a reference to an initialized Gaia. func NewGaiaApp( logger log.Logger, - db dbm.DB, traceStore io.Writer, + db dbm.DB, + traceStore io.Writer, loadLatest bool, skipUpgradeHeights map[int64]bool, homePath string, - invCheckPeriod uint, - encodingConfig gaiaappparams.EncodingConfig, + encodingConfig params.EncodingConfig, appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp), ) *GaiaApp { - appCodec := encodingConfig.Codec + appCodec := encodingConfig.Marshaler legacyAmino := encodingConfig.Amino interfaceRegistry := encodingConfig.InterfaceRegistry + txConfig := encodingConfig.TxConfig + + // App Opts + skipGenesisInvariants := cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)) + invCheckPeriod := cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)) bApp := baseapp.NewBaseApp( appName, logger, db, - encodingConfig.TxConfig.TxDecoder(), + txConfig.TxDecoder(), baseAppOptions...) + bApp.SetCommitMultiStoreTracer(traceStore) bApp.SetVersion(version.Version) bApp.SetInterfaceRegistry(interfaceRegistry) + bApp.SetTxEncoder(txConfig.TxEncoder()) app := &GaiaApp{ BaseApp: bApp, legacyAmino: legacyAmino, + txConfig: txConfig, appCodec: appCodec, interfaceRegistry: interfaceRegistry, invCheckPeriod: invCheckPeriod, @@ -138,11 +156,10 @@ func NewGaiaApp( skipUpgradeHeights, homePath, invCheckPeriod, + logger, appOpts, ) - skipGenesisInvariants := cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)) - // NOTE: Any module instantiated in the module manager that is later modified // must be passed by reference here. app.mm = module.NewManager(appModules(app, encodingConfig, skipGenesisInvariants)...) @@ -168,12 +185,21 @@ func NewGaiaApp( // Uncomment if you want to set a custom migration order here. // app.mm.SetOrderMigrations(custom order) - app.mm.RegisterInvariants(&app.CrisisKeeper) - app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino) - + app.mm.RegisterInvariants(app.CrisisKeeper) app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter()) app.mm.RegisterServices(app.configurator) + autocliv1.RegisterQueryServer(app.GRPCQueryRouter(), runtimeservices.NewAutoCLIQueryService(app.mm.Modules)) + + reflectionSvc, err := runtimeservices.NewReflectionService() + if err != nil { + panic(err) + } + reflectionv1.RegisterReflectionServiceServer(app.GRPCQueryRouter(), reflectionSvc) + + // add test gRPC service for testing gRPC queries in isolation + testdata.RegisterQueryServer(app.GRPCQueryRouter(), testdata.QueryImpl{}) + // create the simulation manager and define the order of the modules for deterministic simulations // // NOTE: this is not required apps that don't use the simulator for fuzz testing @@ -196,11 +222,11 @@ func NewGaiaApp( SignModeHandler: encodingConfig.TxConfig.SignModeHandler(), SigGasConsumer: ante.DefaultSigVerificationGasConsumer, }, - Codec: appCodec, - IBCkeeper: app.IBCKeeper, - GovKeeper: &app.GovKeeper, - GlobalFeeSubspace: app.GetSubspace(globalfee.ModuleName), - StakingSubspace: app.GetSubspace(stakingtypes.ModuleName), + Codec: appCodec, + IBCkeeper: app.IBCKeeper, + GovKeeper: &app.GovKeeper, + // GlobalFeeSubspace: app.GetSubspace(globalfee.ModuleName), + StakingSubspace: app.GetSubspace(stakingtypes.ModuleName), }, ) if err != nil { @@ -306,21 +332,20 @@ func (app *GaiaApp) SimulationManager() *module.SimulationManager { // API server. func (app *GaiaApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { clientCtx := apiSvr.ClientCtx - rpc.RegisterRoutes(clientCtx, apiSvr.Router) - // Register legacy tx routes. - authrest.RegisterTxRoutes(clientCtx, apiSvr.Router) // Register new tx routes from grpc-gateway. authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // Register new tendermint queries routes from grpc-gateway. tmservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) // Register legacy and grpc-gateway routes for all modules. - ModuleBasics.RegisterRESTRoutes(clientCtx, apiSvr.Router) ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) + // Register nodeservice grpc-gateway routes. + nodeservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) + // register swagger API from root so that other applications can override easily - if apiConfig.Swagger { - RegisterSwaggerAPI(apiSvr.Router) + if err := server.RegisterSwaggerAPI(apiSvr.ClientCtx, apiSvr.Router, apiConfig.Swagger); err != nil { + panic(err) } } @@ -331,7 +356,16 @@ func (app *GaiaApp) RegisterTxService(clientCtx client.Context) { // RegisterTendermintService implements the Application.RegisterTendermintService method. func (app *GaiaApp) RegisterTendermintService(clientCtx client.Context) { - tmservice.RegisterTendermintService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.interfaceRegistry) + tmservice.RegisterTendermintService( + clientCtx, + app.BaseApp.GRPCQueryRouter(), + app.interfaceRegistry, + app.Query, + ) +} + +func (app *GaiaApp) RegisterNodeService(clientCtx client.Context) { + nodeservice.RegisterNodeService(clientCtx, app.GRPCQueryRouter()) } // configure store loader that checks if version == upgradeHeight and applies store upgrades @@ -391,7 +425,7 @@ func (app *GaiaApp) GetBaseApp() *baseapp.BaseApp { // GetTxConfig implements the TestingApp interface. func (app *GaiaApp) GetTxConfig() client.TxConfig { - return MakeTestEncodingConfig().TxConfig + return app.txConfig } // EmptyAppOptions is a stub implementing AppOptions diff --git a/app/app_helpers.go b/app/app_helpers.go index a4e058a0c8..be979819fc 100644 --- a/app/app_helpers.go +++ b/app/app_helpers.go @@ -1,11 +1,12 @@ package gaia +// TODO: Enable with ICS import ( capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" - ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper" - ibcstakinginterface "github.com/cosmos/interchain-security/v2/legacy_ibc_testing/core" - icstest "github.com/cosmos/interchain-security/v2/testutil/integration" - ibcproviderkeeper "github.com/cosmos/interchain-security/v2/x/ccv/provider/keeper" + ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + ibcstakinginterface "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/core" + icstest "github.com/cosmos/interchain-security/v3/testutil/integration" + ibcproviderkeeper "github.com/cosmos/interchain-security/v3/x/ccv/provider/keeper" ) // ProviderApp interface implementations for icstest tests diff --git a/app/app_test.go b/app/app_test.go index a55c5c2cbe..289ea020fb 100644 --- a/app/app_test.go +++ b/app/app_test.go @@ -3,11 +3,11 @@ package gaia_test import ( "testing" + db "github.com/cometbft/cometbft-db" + "github.com/cometbft/cometbft/libs/log" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/libs/log" - db "github.com/tendermint/tm-db" gaia "github.com/cosmos/gaia/v11/app" gaiahelpers "github.com/cosmos/gaia/v11/app/helpers" @@ -20,6 +20,7 @@ func (ao EmptyAppOptions) Get(_ string) interface{} { } func TestGaiaApp_BlockedModuleAccountAddrs(t *testing.T) { + encConfig := gaia.RegisterEncodingConfig() app := gaia.NewGaiaApp( log.NewNopLogger(), db.NewMemDB(), @@ -27,10 +28,10 @@ func TestGaiaApp_BlockedModuleAccountAddrs(t *testing.T) { true, map[int64]bool{}, gaia.DefaultNodeHome, - 0, - gaia.MakeTestEncodingConfig(), + encConfig, EmptyAppOptions{}, ) + moduleAccountAddresses := app.ModuleAccountAddrs() blockedAddrs := app.BlockedModuleAccountAddrs(moduleAccountAddresses) @@ -39,6 +40,6 @@ func TestGaiaApp_BlockedModuleAccountAddrs(t *testing.T) { func TestGaiaApp_Export(t *testing.T) { app := gaiahelpers.Setup(t) - _, err := app.ExportAppStateAndValidators(true, []string{}) + _, err := app.ExportAppStateAndValidators(true, []string{}, []string{}) require.NoError(t, err, "ExportAppStateAndValidators should not have an error") } diff --git a/app/encoding.go b/app/encoding.go index bfb0dbaa17..bf2a44ad9b 100644 --- a/app/encoding.go +++ b/app/encoding.go @@ -6,15 +6,13 @@ import ( "github.com/cosmos/gaia/v11/app/params" ) -// MakeTestEncodingConfig creates an EncodingConfig for testing. This function -// should be used only in tests or when creating a new app instance (NewApp*()). -// App user shouldn't create new codecs - use the app.AppCodec instead. -// [DEPRECATED] -func MakeTestEncodingConfig() params.EncodingConfig { - encodingConfig := params.MakeTestEncodingConfig() - std.RegisterLegacyAminoCodec(encodingConfig.Amino) - std.RegisterInterfaces(encodingConfig.InterfaceRegistry) - ModuleBasics.RegisterLegacyAminoCodec(encodingConfig.Amino) - ModuleBasics.RegisterInterfaces(encodingConfig.InterfaceRegistry) - return encodingConfig +func RegisterEncodingConfig() params.EncodingConfig { + encConfig := params.MakeEncodingConfig() + + std.RegisterLegacyAminoCodec(encConfig.Amino) + std.RegisterInterfaces(encConfig.InterfaceRegistry) + ModuleBasics.RegisterLegacyAminoCodec(encConfig.Amino) + ModuleBasics.RegisterInterfaces(encConfig.InterfaceRegistry) + + return encConfig } diff --git a/app/export.go b/app/export.go index a818f49c8f..0570698057 100644 --- a/app/export.go +++ b/app/export.go @@ -3,18 +3,20 @@ package gaia 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" "github.com/cosmos/cosmos-sdk/x/staking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" ) // ExportAppStateAndValidators exports the state of the application for a genesis // file. func (app *GaiaApp) ExportAppStateAndValidators( - forZeroHeight bool, jailAllowedAddrs []string, + forZeroHeight bool, + jailAllowedAddrs []string, + modulesToExport []string, ) (servertypes.ExportedApp, error) { // as if they could withdraw from the start of the next block ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) @@ -27,7 +29,7 @@ func (app *GaiaApp) ExportAppStateAndValidators( app.prepForZeroHeightGenesis(ctx, jailAllowedAddrs) } - genState := app.mm.ExportGenesis(ctx, app.appCodec) + genState := app.mm.ExportGenesisForModules(ctx, app.appCodec, modulesToExport) appState, err := json.MarshalIndent(genState, "", " ") if err != nil { return servertypes.ExportedApp{}, err @@ -129,7 +131,9 @@ func (app *GaiaApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [ feePool.CommunityPool = feePool.CommunityPool.Add(scraps...) app.DistrKeeper.SetFeePool(ctx, feePool) - app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, val.GetOperator()) + if err := app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, val.GetOperator()); err != nil { + panic(err) + } return false }) @@ -143,8 +147,12 @@ func (app *GaiaApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [ if err != nil { panic(err) } - app.DistrKeeper.Hooks().BeforeDelegationCreated(ctx, delAddr, valAddr) - app.DistrKeeper.Hooks().AfterDelegationModified(ctx, delAddr, valAddr) + if err := app.DistrKeeper.Hooks().BeforeDelegationCreated(ctx, delAddr, valAddr); err != nil { + panic(err) + } + if err := app.DistrKeeper.Hooks().AfterDelegationModified(ctx, delAddr, valAddr); err != nil { + panic(err) + } } // reset context height diff --git a/app/genesis.go b/app/genesis.go index a685f5e344..1cf906d1a6 100644 --- a/app/genesis.go +++ b/app/genesis.go @@ -2,6 +2,8 @@ package gaia import ( "encoding/json" + + "github.com/cosmos/gaia/v11/app/params" ) // The genesis state of the blockchain is represented here as a map of raw json @@ -14,7 +16,6 @@ import ( type GenesisState map[string]json.RawMessage // NewDefaultGenesisState generates the default state for the application. -func NewDefaultGenesisState() GenesisState { - encCfg := MakeTestEncodingConfig() - return ModuleBasics.DefaultGenesis(encCfg.Codec) +func NewDefaultGenesisState(encConfig params.EncodingConfig) GenesisState { + return ModuleBasics.DefaultGenesis(encConfig.Marshaler) } diff --git a/app/helpers/test_helpers.go b/app/helpers/test_helpers.go index 748927ff4e..25e4a2dbce 100644 --- a/app/helpers/test_helpers.go +++ b/app/helpers/test_helpers.go @@ -5,22 +5,23 @@ import ( "testing" "time" - "github.com/tendermint/tendermint/crypto" - + "github.com/cosmos/cosmos-sdk/server" + "github.com/cosmos/cosmos-sdk/testutil/mock" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + + 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" - "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" 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" - abci "github.com/tendermint/tendermint/abci/types" - "github.com/tendermint/tendermint/libs/log" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmtypes "github.com/tendermint/tendermint/types" - dbm "github.com/tendermint/tm-db" gaiaapp "github.com/cosmos/gaia/v11/app" ) @@ -32,8 +33,8 @@ const ( // DefaultConsensusParams defines the default Tendermint consensus params used // in GaiaApp testing. -var DefaultConsensusParams = &abci.ConsensusParams{ - Block: &abci.BlockParams{ +var DefaultConsensusParams = &tmproto.ConsensusParams{ + Block: &tmproto.BlockParams{ MaxBytes: 200000, MaxGas: 2000000, }, @@ -53,15 +54,6 @@ type PV struct { PrivKey cryptotypes.PrivKey } -func NewPV() PV { - return PV{ed25519.GenPrivKey()} -} - -// GetPubKey implements PrivValidator interface -func (pv PV) GetPubKey() (crypto.PubKey, error) { - return cryptocodec.ToTmPubKeyInterface(pv.PrivKey.PubKey()) -} - type EmptyAppOptions struct{} func (EmptyAppOptions) Get(_ string) interface{} { return nil } @@ -69,7 +61,7 @@ func (EmptyAppOptions) Get(_ string) interface{} { return nil } func Setup(t *testing.T) *gaiaapp.GaiaApp { t.Helper() - privVal := NewPV() + privVal := mock.NewPV() pubKey, err := privVal.GetPubKey() require.NoError(t, err) // create validator set with single validator @@ -77,7 +69,7 @@ func Setup(t *testing.T) *gaiaapp.GaiaApp { valSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{validator}) // generate genesis account - senderPrivKey := NewPV() + senderPrivKey := mock.NewPV() senderPubKey := senderPrivKey.PrivKey.PubKey() acc := authtypes.NewBaseAccount(senderPubKey.Address().Bytes(), senderPubKey, 0, 0) @@ -127,8 +119,12 @@ func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs func setup() (*gaiaapp.GaiaApp, gaiaapp.GenesisState) { db := dbm.NewMemDB() - encCdc := gaiaapp.MakeTestEncodingConfig() - var invCheckPeriod uint = 5 + appOptions := make(simtestutil.AppOptionsMap, 0) + appOptions[server.FlagInvCheckPeriod] = 5 + appOptions[server.FlagMinGasPrices] = "0uatom" + + encConfig := gaiaapp.RegisterEncodingConfig() + gaiaApp := gaiaapp.NewGaiaApp( log.NewNopLogger(), db, @@ -136,11 +132,10 @@ func setup() (*gaiaapp.GaiaApp, gaiaapp.GenesisState) { true, map[int64]bool{}, gaiaapp.DefaultNodeHome, - invCheckPeriod, - encCdc, - EmptyAppOptions{}, + encConfig, + appOptions, ) - return gaiaApp, gaiaapp.NewDefaultGenesisState() + return gaiaApp, gaiaapp.NewDefaultGenesisState(encConfig) } func genesisStateWithValSet(t *testing.T, @@ -202,7 +197,7 @@ func genesisStateWithValSet(t *testing.T, }) // update total supply - bankGenesis := banktypes.NewGenesisState(banktypes.DefaultGenesisState().Params, balances, totalSupply, []banktypes.Metadata{}) + bankGenesis := banktypes.NewGenesisState(banktypes.DefaultGenesisState().Params, balances, totalSupply, []banktypes.Metadata{}, []banktypes.SendEnabled{}) genesisState[banktypes.ModuleName] = app.AppCodec().MustMarshalJSON(bankGenesis) return genesisState diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index 70a0f765cc..c558157537 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -1,11 +1,15 @@ package keepers import ( + "os" + + "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" servertypes "github.com/cosmos/cosmos-sdk/server/types" "github.com/cosmos/cosmos-sdk/store/streaming" storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" @@ -13,17 +17,21 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper" + consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" - distr "github.com/cosmos/cosmos-sdk/x/distribution" distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" evidencekeeper "github.com/cosmos/cosmos-sdk/x/evidence/keeper" 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" - providertypes "github.com/cosmos/interchain-security/v2/x/ccv/provider/types" - tmos "github.com/tendermint/tendermint/libs/os" + 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" + + 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" @@ -41,27 +49,25 @@ 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" - ica "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts" - icahost "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host" - icahostkeeper "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/keeper" - icahosttypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types" - "github.com/cosmos/ibc-go/v4/modules/apps/transfer" - ibctransferkeeper "github.com/cosmos/ibc-go/v4/modules/apps/transfer/keeper" - ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" - ibcclient "github.com/cosmos/ibc-go/v4/modules/core/02-client" - ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" - porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types" - ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host" - ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper" - ibcprovider "github.com/cosmos/interchain-security/v2/x/ccv/provider" - ibcproviderkeeper "github.com/cosmos/interchain-security/v2/x/ccv/provider/keeper" - liquiditykeeper "github.com/gravity-devs/liquidity/x/liquidity/keeper" - liquiditytypes "github.com/gravity-devs/liquidity/x/liquidity/types" - "github.com/strangelove-ventures/packet-forward-middleware/v4/router" - routerkeeper "github.com/strangelove-ventures/packet-forward-middleware/v4/router/keeper" - routertypes "github.com/strangelove-ventures/packet-forward-middleware/v4/router/types" - - "github.com/cosmos/gaia/v11/x/globalfee" + 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" + pfmrouter "github.com/strangelove-ventures/packet-forward-middleware/v7/router" + pfmrouterkeeper "github.com/strangelove-ventures/packet-forward-middleware/v7/router/keeper" + pfmroutertypes "github.com/strangelove-ventures/packet-forward-middleware/v7/router/types" + + // liquiditykeeper "github.com/gravity-devs/liquidity/x/liquidity/keeper" + // liquiditytypes "github.com/gravity-devs/liquidity/x/liquidity/types" // unnamed import of statik for swagger UI support _ "github.com/cosmos/cosmos-sdk/client/docs/statik" @@ -77,33 +83,33 @@ type AppKeepers struct { AccountKeeper authkeeper.AccountKeeper BankKeeper bankkeeper.Keeper CapabilityKeeper *capabilitykeeper.Keeper - StakingKeeper stakingkeeper.Keeper + StakingKeeper *stakingkeeper.Keeper SlashingKeeper slashingkeeper.Keeper MintKeeper mintkeeper.Keeper DistrKeeper distrkeeper.Keeper GovKeeper govkeeper.Keeper - CrisisKeeper crisiskeeper.Keeper - UpgradeKeeper upgradekeeper.Keeper + CrisisKeeper *crisiskeeper.Keeper + UpgradeKeeper *upgradekeeper.Keeper ParamsKeeper paramskeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly - IBCKeeper *ibckeeper.Keeper - ICAHostKeeper icahostkeeper.Keeper - EvidenceKeeper evidencekeeper.Keeper - TransferKeeper ibctransferkeeper.Keeper - FeeGrantKeeper feegrantkeeper.Keeper - AuthzKeeper authzkeeper.Keeper - LiquidityKeeper liquiditykeeper.Keeper + IBCKeeper *ibckeeper.Keeper + ICAHostKeeper icahostkeeper.Keeper + EvidenceKeeper evidencekeeper.Keeper + TransferKeeper ibctransferkeeper.Keeper + FeeGrantKeeper feegrantkeeper.Keeper + AuthzKeeper authzkeeper.Keeper + ConsensusParamsKeeper consensusparamkeeper.Keeper // ICS ProviderKeeper ibcproviderkeeper.Keeper - RouterKeeper *routerkeeper.Keeper + PFMRouterKeeper *pfmrouterkeeper.Keeper // Modules - ICAModule ica.AppModule - TransferModule transfer.AppModule - RouterModule router.AppModule - ProviderModule ibcprovider.AppModule + ICAModule ica.AppModule + TransferModule transfer.AppModule + PFMRouterModule pfmrouter.AppModule + ProviderModule ibcprovider.AppModule // make scoped keepers public for test purposes ScopedIBCKeeper capabilitykeeper.ScopedKeeper @@ -122,6 +128,7 @@ func NewAppKeeper( skipUpgradeHeights map[int64]bool, homePath string, invCheckPeriod uint, + logger log.Logger, appOpts servertypes.AppOptions, ) AppKeepers { appKeepers := AppKeepers{} @@ -133,8 +140,11 @@ func NewAppKeeper( configure state listening capabilities using AppOptions we are doing nothing with the returned streamingServices and waitGroup in this case */ - if _, _, err := streaming.LoadStreamingServices(bApp, appOpts, appCodec, appKeepers.keys); err != nil { - tmos.Exit(err.Error()) + // load state streaming if enabled + + if _, _, err := streaming.LoadStreamingServices(bApp, appOpts, appCodec, logger, appKeepers.keys); err != nil { + logger.Error("failed to load state streaming", "err", err) + os.Exit(1) } appKeepers.ParamsKeeper = initParamsKeeper( @@ -145,46 +155,61 @@ func NewAppKeeper( ) // set the BaseApp's parameter store - bApp.SetParamStore( - appKeepers.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramskeeper.ConsensusParamsKeyTable()), + appKeepers.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper( + appCodec, + appKeepers.keys[consensusparamtypes.StoreKey], + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) + bApp.SetParamStore(&appKeepers.ConsensusParamsKeeper) // add capability keeper and ScopeToModule for ibc module - appKeepers.CapabilityKeeper = capabilitykeeper.NewKeeper(appCodec, appKeepers.keys[capabilitytypes.StoreKey], appKeepers.memKeys[capabilitytypes.MemStoreKey]) - appKeepers.ScopedIBCKeeper = appKeepers.CapabilityKeeper.ScopeToModule(ibchost.ModuleName) - appKeepers.ScopedTransferKeeper = appKeepers.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) + appKeepers.CapabilityKeeper = capabilitykeeper.NewKeeper( + appCodec, + appKeepers.keys[capabilitytypes.StoreKey], + appKeepers.memKeys[capabilitytypes.MemStoreKey], + ) + + appKeepers.ScopedIBCKeeper = appKeepers.CapabilityKeeper.ScopeToModule(ibcexported.ModuleName) appKeepers.ScopedICAHostKeeper = appKeepers.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName) + appKeepers.ScopedTransferKeeper = appKeepers.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) appKeepers.ScopedIBCProviderKeeper = appKeepers.CapabilityKeeper.ScopeToModule(providertypes.ModuleName) + // Applications that wish to enforce statically created ScopedKeepers should call `Seal` after creating + // their scoped modules in `NewApp` with `ScopeToModule` appKeepers.CapabilityKeeper.Seal() appKeepers.CrisisKeeper = crisiskeeper.NewKeeper( - appKeepers.GetSubspace(crisistypes.ModuleName), + appCodec, + appKeepers.keys[crisistypes.StoreKey], invCheckPeriod, appKeepers.BankKeeper, authtypes.FeeCollectorName, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) // Add normal keepers appKeepers.AccountKeeper = authkeeper.NewAccountKeeper( appCodec, appKeepers.keys[authtypes.StoreKey], - appKeepers.GetSubspace(authtypes.ModuleName), authtypes.ProtoBaseAccount, maccPerms, + sdk.GetConfig().GetBech32AccountAddrPrefix(), + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) + appKeepers.BankKeeper = bankkeeper.NewBaseKeeper( appCodec, appKeepers.keys[banktypes.StoreKey], appKeepers.AccountKeeper, - appKeepers.GetSubspace(banktypes.ModuleName), blockedAddress, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) appKeepers.AuthzKeeper = authzkeeper.NewKeeper( appKeepers.keys[authzkeeper.StoreKey], appCodec, bApp.MsgServiceRouter(), + appKeepers.AccountKeeper, ) appKeepers.FeeGrantKeeper = feegrantkeeper.NewKeeper( @@ -192,52 +217,46 @@ func NewAppKeeper( appKeepers.keys[feegrant.StoreKey], appKeepers.AccountKeeper, ) - stakingKeeper := stakingkeeper.NewKeeper( + + appKeepers.StakingKeeper = stakingkeeper.NewKeeper( appCodec, appKeepers.keys[stakingtypes.StoreKey], appKeepers.AccountKeeper, appKeepers.BankKeeper, - appKeepers.GetSubspace(stakingtypes.ModuleName), + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) + appKeepers.MintKeeper = mintkeeper.NewKeeper( appCodec, appKeepers.keys[minttypes.StoreKey], - appKeepers.GetSubspace(minttypes.ModuleName), - &stakingKeeper, + appKeepers.StakingKeeper, appKeepers.AccountKeeper, appKeepers.BankKeeper, authtypes.FeeCollectorName, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) appKeepers.DistrKeeper = distrkeeper.NewKeeper( appCodec, appKeepers.keys[distrtypes.StoreKey], - appKeepers.GetSubspace(distrtypes.ModuleName), appKeepers.AccountKeeper, appKeepers.BankKeeper, - &stakingKeeper, + appKeepers.StakingKeeper, authtypes.FeeCollectorName, - modAccAddrs, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) appKeepers.SlashingKeeper = slashingkeeper.NewKeeper( appCodec, + legacyAmino, appKeepers.keys[slashingtypes.StoreKey], - &stakingKeeper, - appKeepers.GetSubspace(slashingtypes.ModuleName), - ) - appKeepers.LiquidityKeeper = liquiditykeeper.NewKeeper( - appCodec, - appKeepers.keys[liquiditytypes.StoreKey], - appKeepers.GetSubspace(liquiditytypes.ModuleName), - appKeepers.BankKeeper, - appKeepers.AccountKeeper, - appKeepers.DistrKeeper, + appKeepers.StakingKeeper, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) // register the staking hooks // NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks - appKeepers.StakingKeeper = *stakingKeeper.SetHooks( + appKeepers.StakingKeeper.SetHooks( stakingtypes.NewMultiStakingHooks( appKeepers.DistrKeeper.Hooks(), appKeepers.SlashingKeeper.Hooks(), @@ -252,26 +271,30 @@ func NewAppKeeper( appCodec, homePath, bApp, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) // UpgradeKeeper must be created before IBCKeeper appKeepers.IBCKeeper = ibckeeper.NewKeeper( appCodec, - appKeepers.keys[ibchost.StoreKey], - appKeepers.GetSubspace(ibchost.ModuleName), + appKeepers.keys[ibcexported.StoreKey], + appKeepers.GetSubspace(ibcexported.ModuleName), appKeepers.StakingKeeper, appKeepers.UpgradeKeeper, appKeepers.ScopedIBCKeeper, ) // EvidenceKeeper must be created before ProviderKeeper - appKeepers.EvidenceKeeper = *evidencekeeper.NewKeeper( + evidenceKeeper := evidencekeeper.NewKeeper( appCodec, appKeepers.keys[evidencetypes.StoreKey], - &appKeepers.StakingKeeper, + appKeepers.StakingKeeper, appKeepers.SlashingKeeper, ) + // If evidence needs to be handled for the app, set routes in router here and seal + appKeepers.EvidenceKeeper = *evidenceKeeper + // TODO: Enable with ICS appKeepers.ProviderKeeper = ibcproviderkeeper.NewKeeper( appCodec, appKeepers.keys[providertypes.StoreKey], @@ -292,35 +315,63 @@ func NewAppKeeper( appKeepers.ProviderModule = ibcprovider.NewAppModule(&appKeepers.ProviderKeeper, appKeepers.GetSubspace(providertypes.ModuleName)) - govRouter := govtypes.NewRouter() + // Register the proposal types + // Deprecated: Avoid adding new handlers, instead use the new proposal flow + // by granting the governance module the right to execute the message. + // See: https://docs.cosmos.network/main/modules/gov#proposal-messages + govRouter := govv1beta1.NewRouter() govRouter. - AddRoute(govtypes.RouterKey, govtypes.ProposalHandler). + AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler). AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(appKeepers.ParamsKeeper)). - AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(appKeepers.DistrKeeper)). AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(appKeepers.UpgradeKeeper)). AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(appKeepers.IBCKeeper.ClientKeeper)). AddRoute(providertypes.RouterKey, ibcprovider.NewProviderProposalHandler(appKeepers.ProviderKeeper)) + govConfig := govtypes.DefaultConfig() /* Example of setting gov params: govConfig.MaxMetadataLen = 10000 */ - appKeepers.GovKeeper = govkeeper.NewKeeper( + govKeeper := govkeeper.NewKeeper( appCodec, appKeepers.keys[govtypes.StoreKey], - appKeepers.GetSubspace(govtypes.ModuleName), appKeepers.AccountKeeper, appKeepers.BankKeeper, - &stakingKeeper, - govRouter, + appKeepers.StakingKeeper, + bApp.MsgServiceRouter(), + govConfig, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) - // RouterKeeper must be created before TransferKeeper - appKeepers.RouterKeeper = routerkeeper.NewKeeper( + // Set legacy router for backwards compatibility with gov v1beta1 + govKeeper.SetLegacyRouter(govRouter) + + appKeepers.GovKeeper = *govKeeper.SetHooks( + govtypes.NewMultiGovHooks( + // register the governance hooks + ), + ) + + // ICA Host keeper + appKeepers.ICAHostKeeper = icahostkeeper.NewKeeper( + appCodec, + appKeepers.keys[icahosttypes.StoreKey], + appKeepers.GetSubspace(icahosttypes.SubModuleName), + // TODO: Pass FeeKeeper as ics4Wrapper if enabled + nil, + appKeepers.IBCKeeper.ChannelKeeper, + &appKeepers.IBCKeeper.PortKeeper, + appKeepers.AccountKeeper, + appKeepers.ScopedICAHostKeeper, + bApp.MsgServiceRouter(), + ) + + // PFMRouterKeeper must be created before TransferKeeper + appKeepers.PFMRouterKeeper = pfmrouterkeeper.NewKeeper( appCodec, - appKeepers.keys[routertypes.StoreKey], - appKeepers.GetSubspace(routertypes.ModuleName), + appKeepers.keys[pfmroutertypes.StoreKey], + appKeepers.GetSubspace(pfmroutertypes.ModuleName), appKeepers.TransferKeeper, appKeepers.IBCKeeper.ChannelKeeper, appKeepers.DistrKeeper, @@ -332,49 +383,51 @@ func NewAppKeeper( appCodec, appKeepers.keys[ibctransfertypes.StoreKey], appKeepers.GetSubspace(ibctransfertypes.ModuleName), - appKeepers.RouterKeeper, + appKeepers.PFMRouterKeeper, // ISC4 Wrapper: PFM Router middleware appKeepers.IBCKeeper.ChannelKeeper, &appKeepers.IBCKeeper.PortKeeper, appKeepers.AccountKeeper, appKeepers.BankKeeper, appKeepers.ScopedTransferKeeper, ) + // Must be called on PFMRouter AFTER TransferKeeper initialized + appKeepers.PFMRouterKeeper.SetTransferKeeper(appKeepers.TransferKeeper) - appKeepers.RouterKeeper.SetTransferKeeper(appKeepers.TransferKeeper) + // Create IBC Router + ibcRouter := porttypes.NewRouter() - appKeepers.TransferModule = transfer.NewAppModule(appKeepers.TransferKeeper) - - appKeepers.ICAHostKeeper = icahostkeeper.NewKeeper( - appCodec, appKeepers.keys[icahosttypes.StoreKey], - appKeepers.GetSubspace(icahosttypes.SubModuleName), - appKeepers.IBCKeeper.ChannelKeeper, - &appKeepers.IBCKeeper.PortKeeper, - appKeepers.AccountKeeper, - appKeepers.ScopedICAHostKeeper, - bApp.MsgServiceRouter(), - ) + // Middleware Stacks + // TODO: Move inline + appKeepers.TransferModule = transfer.NewAppModule(appKeepers.TransferKeeper) + // TODO: Move inline appKeepers.ICAModule = ica.NewAppModule(nil, &appKeepers.ICAHostKeeper) - icaHostIBCModule := icahost.NewIBCModule(appKeepers.ICAHostKeeper) - - appKeepers.RouterModule = router.NewAppModule(appKeepers.RouterKeeper) - - var ibcStack porttypes.IBCModule - ibcStack = transfer.NewIBCModule(appKeepers.TransferKeeper) - ibcStack = router.NewIBCMiddleware( - ibcStack, - appKeepers.RouterKeeper, + // TODO: Move inline + appKeepers.PFMRouterModule = pfmrouter.NewAppModule(appKeepers.PFMRouterKeeper) + + // create IBC module from bottom to top of stack + var transferStack porttypes.IBCModule + transferStack = transfer.NewIBCModule(appKeepers.TransferKeeper) + transferStack = pfmrouter.NewIBCMiddleware( + transferStack, + appKeepers.PFMRouterKeeper, 0, - routerkeeper.DefaultForwardTransferPacketTimeoutTimestamp, - routerkeeper.DefaultRefundTransferPacketTimeoutTimestamp, + pfmrouterkeeper.DefaultForwardTransferPacketTimeoutTimestamp, + pfmrouterkeeper.DefaultRefundTransferPacketTimeoutTimestamp, ) + // Add transfer stack to IBC Router + ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferStack) + + // Create Interchain Accounts Stack + var icaHostStack porttypes.IBCModule = icahost.NewIBCModule(appKeepers.ICAHostKeeper) + // create static IBC router, add transfer route, then set and seal it - ibcRouter := porttypes.NewRouter(). - AddRoute(icahosttypes.SubModuleName, icaHostIBCModule). - AddRoute(ibctransfertypes.ModuleName, ibcStack). + ibcRouter. + AddRoute(icahosttypes.SubModuleName, icaHostStack). AddRoute(providertypes.ModuleName, appKeepers.ProviderModule) + // Seal the IBC Router appKeepers.IBCKeeper.SetRouter(ibcRouter) return appKeepers @@ -390,21 +443,22 @@ func (appKeepers *AppKeepers) GetSubspace(moduleName string) paramstypes.Subspac func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey storetypes.StoreKey) paramskeeper.Keeper { paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey) - paramsKeeper.Subspace(authtypes.ModuleName) - paramsKeeper.Subspace(banktypes.ModuleName) - paramsKeeper.Subspace(stakingtypes.ModuleName) - paramsKeeper.Subspace(minttypes.ModuleName) - paramsKeeper.Subspace(distrtypes.ModuleName) - paramsKeeper.Subspace(slashingtypes.ModuleName) - paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govtypes.ParamKeyTable()) - paramsKeeper.Subspace(crisistypes.ModuleName) - paramsKeeper.Subspace(liquiditytypes.ModuleName) + //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(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 + paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govv1.ParamKeyTable()) //nolint: staticcheck // SA1019 + paramsKeeper.Subspace(crisistypes.ModuleName).WithKeyTable(crisistypes.ParamKeyTable()) //nolint: staticcheck // SA1019 paramsKeeper.Subspace(ibctransfertypes.ModuleName) - paramsKeeper.Subspace(ibchost.ModuleName) - - paramsKeeper.Subspace(routertypes.ModuleName).WithKeyTable(routertypes.ParamKeyTable()) + paramsKeeper.Subspace(ibcexported.ModuleName) paramsKeeper.Subspace(icahosttypes.SubModuleName) - paramsKeeper.Subspace(globalfee.ModuleName) + + paramsKeeper.Subspace(pfmroutertypes.ModuleName).WithKeyTable(pfmroutertypes.ParamKeyTable()) + // TODO: Enable with Globalfee + // paramsKeeper.Subspace(globalfee.ModuleName) paramsKeeper.Subspace(providertypes.ModuleName) return paramsKeeper diff --git a/app/keepers/keys.go b/app/keepers/keys.go index d3b5d0db1d..700ffc819b 100644 --- a/app/keepers/keys.go +++ b/app/keepers/keys.go @@ -7,6 +7,8 @@ import ( authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" + crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" "github.com/cosmos/cosmos-sdk/x/feegrant" @@ -16,24 +18,38 @@ 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/v4/modules/apps/27-interchain-accounts/host/types" - ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" - ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host" - providertypes "github.com/cosmos/interchain-security/v2/x/ccv/provider/types" - liquiditytypes "github.com/gravity-devs/liquidity/x/liquidity/types" - routertypes "github.com/strangelove-ventures/packet-forward-middleware/v4/router/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" + routertypes "github.com/strangelove-ventures/packet-forward-middleware/v7/router/types" + // liquiditytypes "github.com/gravity-devs/liquidity/x/liquidity/types" ) func (appKeepers *AppKeepers) GenerateKeys() { // Define what keys will be used in the cosmos-sdk key/value store. // Cosmos-SDK modules each have a "key" that allows the application to reference what they've stored on the chain. appKeepers.keys = sdk.NewKVStoreKeys( - authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, - minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey, - govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey, - evidencetypes.StoreKey, liquiditytypes.StoreKey, ibctransfertypes.StoreKey, - capabilitytypes.StoreKey, feegrant.StoreKey, authzkeeper.StoreKey, routertypes.StoreKey, - icahosttypes.StoreKey, providertypes.StoreKey, + authtypes.StoreKey, + banktypes.StoreKey, + stakingtypes.StoreKey, + crisistypes.StoreKey, + minttypes.StoreKey, + distrtypes.StoreKey, + slashingtypes.StoreKey, + govtypes.StoreKey, + paramstypes.StoreKey, + ibcexported.StoreKey, + upgradetypes.StoreKey, + evidencetypes.StoreKey, + ibctransfertypes.StoreKey, + icahosttypes.StoreKey, + capabilitytypes.StoreKey, + feegrant.StoreKey, + authzkeeper.StoreKey, + routertypes.StoreKey, + providertypes.StoreKey, + consensusparamtypes.StoreKey, ) // Define transient store keys diff --git a/app/modules.go b/app/modules.go index 024b9c562e..43fc7944a8 100644 --- a/app/modules.go +++ b/app/modules.go @@ -13,10 +13,11 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/capability" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + "github.com/cosmos/cosmos-sdk/x/consensus" + consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" "github.com/cosmos/cosmos-sdk/x/crisis" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" distr "github.com/cosmos/cosmos-sdk/x/distribution" - distrclient "github.com/cosmos/cosmos-sdk/x/distribution/client" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" "github.com/cosmos/cosmos-sdk/x/evidence" evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" @@ -25,10 +26,11 @@ import ( "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" "github.com/cosmos/cosmos-sdk/x/gov" + govclient "github.com/cosmos/cosmos-sdk/x/gov/client" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/mint" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - "github.com/cosmos/cosmos-sdk/x/params" + sdkparams "github.com/cosmos/cosmos-sdk/x/params" paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/cosmos/cosmos-sdk/x/slashing" @@ -38,34 +40,34 @@ 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/v4/modules/apps/27-interchain-accounts" - icatypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/types" - "github.com/cosmos/ibc-go/v4/modules/apps/transfer" - ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/v4/modules/core" - ibcclientclient "github.com/cosmos/ibc-go/v4/modules/core/02-client/client" - ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host" - ibcprovider "github.com/cosmos/interchain-security/v2/x/ccv/provider" - ibcproviderclient "github.com/cosmos/interchain-security/v2/x/ccv/provider/client" - providertypes "github.com/cosmos/interchain-security/v2/x/ccv/provider/types" - "github.com/gravity-devs/liquidity/x/liquidity" - liquiditytypes "github.com/gravity-devs/liquidity/x/liquidity/types" - "github.com/strangelove-ventures/packet-forward-middleware/v4/router" - routertypes "github.com/strangelove-ventures/packet-forward-middleware/v4/router/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" + ibcprovider "github.com/cosmos/interchain-security/v3/x/ccv/provider" + ibcproviderclient "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/v11/app/params" - "github.com/cosmos/gaia/v11/x/globalfee" + "github.com/strangelove-ventures/packet-forward-middleware/v7/router" + routertypes "github.com/strangelove-ventures/packet-forward-middleware/v7/router/types" + + gaiaparams "github.com/cosmos/gaia/v11/app/params" + // "github.com/cosmos/gaia/v11/x/globalfee" ) var maccPerms = map[string][]string{ - authtypes.FeeCollectorName: nil, - distrtypes.ModuleName: nil, - icatypes.ModuleName: nil, - minttypes.ModuleName: {authtypes.Minter}, - stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, - stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, - govtypes.ModuleName: {authtypes.Burner}, - liquiditytypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + authtypes.FeeCollectorName: nil, + distrtypes.ModuleName: nil, + icatypes.ModuleName: nil, + minttypes.ModuleName: {authtypes.Minter}, + stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, + stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, + govtypes.ModuleName: {authtypes.Burner}, + // liquiditytypes.ModuleName: {authtypes.Minter, authtypes.Burner}, ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, providertypes.ConsumerRewardsPool: nil, } @@ -75,46 +77,49 @@ var maccPerms = map[string][]string{ // and genesis verification. var ModuleBasics = module.NewBasicManager( auth.AppModuleBasic{}, - genutil.AppModuleBasic{}, + genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), bank.AppModuleBasic{}, capability.AppModuleBasic{}, staking.AppModuleBasic{}, mint.AppModuleBasic{}, distr.AppModuleBasic{}, gov.NewAppModuleBasic( - paramsclient.ProposalHandler, - distrclient.ProposalHandler, - upgradeclient.ProposalHandler, - upgradeclient.CancelProposalHandler, - ibcclientclient.UpdateClientProposalHandler, - ibcclientclient.UpgradeProposalHandler, - ibcproviderclient.ConsumerAdditionProposalHandler, - ibcproviderclient.ConsumerRemovalProposalHandler, - ibcproviderclient.EquivocationProposalHandler, + []govclient.ProposalHandler{ + paramsclient.ProposalHandler, + upgradeclient.LegacyProposalHandler, + upgradeclient.LegacyCancelProposalHandler, + ibcclientclient.UpdateClientProposalHandler, + ibcclientclient.UpgradeProposalHandler, + ibcproviderclient.ConsumerAdditionProposalHandler, + ibcproviderclient.ConsumerRemovalProposalHandler, + ibcproviderclient.EquivocationProposalHandler, + }, ), - params.AppModuleBasic{}, + sdkparams.AppModuleBasic{}, crisis.AppModuleBasic{}, slashing.AppModuleBasic{}, feegrantmodule.AppModuleBasic{}, authzmodule.AppModuleBasic{}, ibc.AppModuleBasic{}, + ibctm.AppModuleBasic{}, upgrade.AppModuleBasic{}, evidence.AppModuleBasic{}, transfer.AppModuleBasic{}, vesting.AppModuleBasic{}, - liquidity.AppModuleBasic{}, router.AppModuleBasic{}, ica.AppModuleBasic{}, - globalfee.AppModule{}, + // TODO: Enable with Global Fee + // globalfee.AppModule{}, ibcprovider.AppModuleBasic{}, + consensus.AppModuleBasic{}, ) func appModules( app *GaiaApp, - encodingConfig gaiaappparams.EncodingConfig, + encodingConfig gaiaparams.EncodingConfig, skipGenesisInvariants bool, ) []module.AppModule { - appCodec := encodingConfig.Codec + appCodec := encodingConfig.Marshaler return []module.AppModule{ genutil.NewAppModule( @@ -123,27 +128,26 @@ func appModules( app.BaseApp.DeliverTx, encodingConfig.TxConfig, ), - auth.NewAppModule(appCodec, app.AccountKeeper, nil), + auth.NewAppModule(appCodec, app.AccountKeeper, nil, app.GetSubspace(authtypes.ModuleName)), vesting.NewAppModule(app.AccountKeeper, app.BankKeeper), - bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper), - capability.NewAppModule(appCodec, *app.CapabilityKeeper), - crisis.NewAppModule(&app.CrisisKeeper, skipGenesisInvariants), - gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper), - mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper), - slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), - distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), - staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper), + bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)), + capability.NewAppModule(appCodec, *app.CapabilityKeeper, false), + crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), + gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)), + mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil, app.GetSubspace(minttypes.ModuleName)), + slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName)), + distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)), + staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)), upgrade.NewAppModule(app.UpgradeKeeper), evidence.NewAppModule(app.EvidenceKeeper), feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), ibc.NewAppModule(app.IBCKeeper), - params.NewAppModule(app.ParamsKeeper), - liquidity.NewAppModule(appCodec, app.LiquidityKeeper, app.AccountKeeper, app.BankKeeper, app.DistrKeeper), - globalfee.NewAppModule(app.GetSubspace(globalfee.ModuleName)), + sdkparams.NewAppModule(app.ParamsKeeper), + // globalfee.NewAppModule(app.GetSubspace(globalfee.ModuleName)), app.TransferModule, app.ICAModule, - app.RouterModule, + app.PFMRouterModule, app.ProviderModule, } } @@ -152,27 +156,27 @@ func appModules( // define the order of the modules for deterministic simulations func simulationModules( app *GaiaApp, - encodingConfig gaiaappparams.EncodingConfig, + encodingConfig gaiaparams.EncodingConfig, _ bool, ) []module.AppModuleSimulation { - appCodec := encodingConfig.Codec + appCodec := encodingConfig.Marshaler return []module.AppModuleSimulation{ - auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts), - bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper), - capability.NewAppModule(appCodec, *app.CapabilityKeeper), + auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)), + bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)), + capability.NewAppModule(appCodec, *app.CapabilityKeeper, false), feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), - gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper), - mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper), - staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper), - distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), - slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), - params.NewAppModule(app.ParamsKeeper), + gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)), + mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil, app.GetSubspace(minttypes.ModuleName)), + staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)), + distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)), + slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName)), + sdkparams.NewAppModule(app.ParamsKeeper), evidence.NewAppModule(app.EvidenceKeeper), authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), - liquidity.NewAppModule(appCodec, app.LiquidityKeeper, app.AccountKeeper, app.BankKeeper, app.DistrKeeper), ibc.NewAppModule(app.IBCKeeper), app.TransferModule, + app.ICAModule, app.ProviderModule, } } @@ -203,9 +207,8 @@ func orderBeginBlockers() []string { banktypes.ModuleName, govtypes.ModuleName, crisistypes.ModuleName, - liquiditytypes.ModuleName, + ibcexported.ModuleName, ibctransfertypes.ModuleName, - ibchost.ModuleName, icatypes.ModuleName, routertypes.ModuleName, genutiltypes.ModuleName, @@ -213,8 +216,9 @@ func orderBeginBlockers() []string { feegrant.ModuleName, paramstypes.ModuleName, vestingtypes.ModuleName, - globalfee.ModuleName, + // globalfee.ModuleName, providertypes.ModuleName, + consensusparamtypes.ModuleName, } } @@ -231,9 +235,8 @@ func orderEndBlockers() []string { crisistypes.ModuleName, govtypes.ModuleName, stakingtypes.ModuleName, - liquiditytypes.ModuleName, + ibcexported.ModuleName, ibctransfertypes.ModuleName, - ibchost.ModuleName, icatypes.ModuleName, routertypes.ModuleName, capabilitytypes.ModuleName, @@ -249,8 +252,9 @@ func orderEndBlockers() []string { paramstypes.ModuleName, upgradetypes.ModuleName, vestingtypes.ModuleName, - globalfee.ModuleName, + // globalfee.ModuleName, providertypes.ModuleName, + consensusparamtypes.ModuleName, } } @@ -275,10 +279,9 @@ func orderInitBlockers() []string { crisistypes.ModuleName, genutiltypes.ModuleName, ibctransfertypes.ModuleName, - ibchost.ModuleName, + ibcexported.ModuleName, icatypes.ModuleName, evidencetypes.ModuleName, - liquiditytypes.ModuleName, authz.ModuleName, feegrant.ModuleName, routertypes.ModuleName, @@ -293,7 +296,8 @@ func orderInitBlockers() []string { // To resolve this issue, we should initialize the globalfee module after genutil, ensuring that the global // min fee is empty when gentx is called. // For more details, please refer to the following link: https://github.com/cosmos/gaia/issues/2489 - globalfee.ModuleName, + // globalfee.ModuleName, providertypes.ModuleName, + consensusparamtypes.ModuleName, } } diff --git a/app/params/amino.go b/app/params/amino.go index f03eb4662c..364e917b33 100644 --- a/app/params/amino.go +++ b/app/params/amino.go @@ -6,17 +6,17 @@ package params import ( "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx" + "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" ) func MakeTestEncodingConfig() EncodingConfig { cdc := codec.NewLegacyAmino() interfaceRegistry := cdctypes.NewInterfaceRegistry() - marshaler := codec.NewAminoCodec(cdc) + codec := codec.NewProtoCodec(interfaceRegistry) return EncodingConfig{ InterfaceRegistry: interfaceRegistry, - Marshaler: marshaler, + Marshaler: codec, TxConfig: legacytx.StdTxConfig{Cdc: cdc}, Amino: cdc, } diff --git a/app/params/encoding.go b/app/params/encoding.go index 8ff9ea04b3..3d634abf16 100644 --- a/app/params/encoding.go +++ b/app/params/encoding.go @@ -10,7 +10,7 @@ import ( // This is provided for compatibility between protobuf and amino implementations. type EncodingConfig struct { InterfaceRegistry types.InterfaceRegistry - Codec codec.Codec + Marshaler codec.Codec TxConfig client.TxConfig Amino *codec.LegacyAmino } diff --git a/app/params/proto.go b/app/params/proto.go index 9191dd3a3d..4e6c849400 100644 --- a/app/params/proto.go +++ b/app/params/proto.go @@ -6,15 +6,15 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/tx" ) -// MakeTestEncodingConfig creates an EncodingConfig for an amino based test configuration. -func MakeTestEncodingConfig() EncodingConfig { +// MakeEncodingConfig creates an EncodingConfig for an amino based test configuration. +func MakeEncodingConfig() EncodingConfig { amino := codec.NewLegacyAmino() interfaceRegistry := codectypes.NewInterfaceRegistry() cdc := codec.NewProtoCodec(interfaceRegistry) txCfg := tx.NewTxConfig(cdc, tx.DefaultSignModes) return EncodingConfig{ InterfaceRegistry: interfaceRegistry, - Codec: cdc, + Marshaler: cdc, TxConfig: txCfg, Amino: amino, } diff --git a/app/sim/sim_state.go b/app/sim/sim_state.go index a71a0bf5ed..fd6b8a24df 100644 --- a/app/sim/sim_state.go +++ b/app/sim/sim_state.go @@ -8,14 +8,17 @@ import ( "os" "time" - tmjson "github.com/tendermint/tendermint/libs/json" - tmtypes "github.com/tendermint/tendermint/types" + "github.com/cosmos/gaia/v11/app/params" + + "cosmossdk.io/math" + + tmjson "github.com/cometbft/cometbft/libs/json" + tmtypes "github.com/cometbft/cometbft/types" gaia "github.com/cosmos/gaia/v11/app" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - simappparams "github.com/cosmos/cosmos-sdk/simapp/params" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" @@ -24,12 +27,20 @@ import ( stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) +// Simulation parameter constants +const ( + StakePerAccount = "stake_per_account" + InitiallyBondedValidators = "initially_bonded_validators" +) + // AppStateFn returns the initial application state using a genesis or the simulation parameters. // It panics if the user provides files for both of them. // If a file is not given for the genesis or the sim params, it creates a randomized one. -func AppStateFn(cdc codec.JSONCodec, simManager *module.SimulationManager) simtypes.AppStateFn { +func AppStateFn(encConfig params.EncodingConfig, simManager *module.SimulationManager) simtypes.AppStateFn { return func(r *rand.Rand, accs []simtypes.Account, config simtypes.Config, ) (appState json.RawMessage, simAccs []simtypes.Account, chainID string, genesisTimestamp time.Time) { + cdc := encConfig.Marshaler + if FlagGenesisTimeValue == 0 { genesisTimestamp = simtypes.RandTimestamp(r) } else { @@ -43,7 +54,10 @@ func AppStateFn(cdc codec.JSONCodec, simManager *module.SimulationManager) simty case config.GenesisFile != "": // override the default chain-id from simapp to set it later to the config - genesisDoc, accounts := AppStateFromGenesisFileFn(r, cdc, config.GenesisFile) + genesisDoc, accounts, err := AppStateFromGenesisFileFn(r, cdc, config.GenesisFile) + if err != nil { + panic(err) + } if FlagGenesisTimeValue == 0 { // use genesis timestamp if no custom timestamp is provided (i.e no random timestamp) @@ -65,11 +79,11 @@ func AppStateFn(cdc codec.JSONCodec, simManager *module.SimulationManager) simty if err != nil { panic(err) } - appState, simAccs = AppStateRandomizedFn(simManager, r, cdc, accs, genesisTimestamp, appParams) + appState, simAccs = AppStateRandomizedFn(simManager, r, encConfig, accs, genesisTimestamp, appParams) default: appParams := make(simtypes.AppParams) - appState, simAccs = AppStateRandomizedFn(simManager, r, cdc, accs, genesisTimestamp, appParams) + appState, simAccs = AppStateRandomizedFn(simManager, r, encConfig, accs, genesisTimestamp, appParams) } rawState := make(map[string]json.RawMessage) @@ -140,21 +154,26 @@ func AppStateFn(cdc codec.JSONCodec, simManager *module.SimulationManager) simty // AppStateRandomizedFn creates calls each module's GenesisState generator function // and creates the simulation params func AppStateRandomizedFn( - simManager *module.SimulationManager, r *rand.Rand, cdc codec.JSONCodec, + simManager *module.SimulationManager, r *rand.Rand, encConfig params.EncodingConfig, accs []simtypes.Account, genesisTimestamp time.Time, appParams simtypes.AppParams, ) (json.RawMessage, []simtypes.Account) { numAccs := int64(len(accs)) - genesisState := gaia.NewDefaultGenesisState() + cdc := encConfig.Marshaler + genesisState := gaia.NewDefaultGenesisState(encConfig) // generate a random amount of initial stake coins and a random initial // number of bonded accounts - var initialStake, numInitiallyBonded int64 + var ( + numInitiallyBonded int64 + initialStake math.Int + ) + appParams.GetOrGenerate( - cdc, simappparams.StakePerAccount, &initialStake, r, - func(r *rand.Rand) { initialStake = r.Int63n(1e12) }, + cdc, StakePerAccount, &initialStake, r, + func(r *rand.Rand) { initialStake = math.NewInt(r.Int63n(1e12)) }, ) appParams.GetOrGenerate( - cdc, simappparams.InitiallyBondedValidators, &numInitiallyBonded, r, + cdc, InitiallyBondedValidators, &numInitiallyBonded, r, func(r *rand.Rand) { numInitiallyBonded = int64(r.Intn(300)) }, ) @@ -194,7 +213,7 @@ func AppStateRandomizedFn( // AppStateFromGenesisFileFn util function to generate the genesis AppState // from a genesis.json file. -func AppStateFromGenesisFileFn(r io.Reader, cdc codec.JSONCodec, genesisFile string) (tmtypes.GenesisDoc, []simtypes.Account) { +func AppStateFromGenesisFileFn(r io.Reader, cdc codec.JSONCodec, genesisFile string) (tmtypes.GenesisDoc, []simtypes.Account, error) { bytes, err := os.ReadFile(genesisFile) if err != nil { panic(err) @@ -232,7 +251,7 @@ func AppStateFromGenesisFileFn(r io.Reader, cdc codec.JSONCodec, genesisFile str a, ok := acc.GetCachedValue().(authtypes.AccountI) if !ok { - panic("expected account") + return genesis, nil, fmt.Errorf("expected account") } // create simulator accounts @@ -240,5 +259,5 @@ func AppStateFromGenesisFileFn(r io.Reader, cdc codec.JSONCodec, genesisFile str newAccs[i] = simAcc } - return genesis, newAccs + return genesis, newAccs, nil } diff --git a/app/sim/sim_utils.go b/app/sim/sim_utils.go index e672240d97..f0b3b4872f 100644 --- a/app/sim/sim_utils.go +++ b/app/sim/sim_utils.go @@ -5,50 +5,17 @@ import ( "fmt" "os" - "github.com/tendermint/tendermint/libs/log" - dbm "github.com/tendermint/tm-db" + "github.com/cosmos/cosmos-sdk/runtime" + + dbm "github.com/cometbft/cometbft-db" gaia "github.com/cosmos/gaia/v11/app" "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/simapp/helpers" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/kv" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" ) -// SetupSimulation creates the config, db (levelDB), temporary directory and logger for -// the simulation tests. If `FlagEnabledValue` is false it skips the current test. -// Returns error on an invalid db intantiation or temp dir creation. -func SetupSimulation(dirPrefix, dbName string) (simtypes.Config, dbm.DB, string, log.Logger, bool, error) { - if !FlagEnabledValue { - return simtypes.Config{}, nil, "", nil, true, nil - } - - config := NewConfigFromFlags() - config.ChainID = helpers.SimAppChainID - - var logger log.Logger - if FlagVerboseValue { - logger = log.TestingLogger() - } else { - logger = log.NewNopLogger() - } - - dir, err := os.MkdirTemp("", dirPrefix) - if err != nil { - return simtypes.Config{}, nil, "", nil, false, err - } - - db, err := sdk.NewLevelDB(dbName, dir) - if err != nil { - return simtypes.Config{}, nil, "", nil, false, err - } - - return config, db, dir, logger, false, nil -} - // SimulationOperations retrieves the simulation params from the provided file path // and returns all the modules weighted operations func SimulationOperations(app *gaia.GaiaApp, cdc codec.JSONCodec, config simtypes.Config) []simtypes.WeightedOperation { @@ -69,19 +36,17 @@ func SimulationOperations(app *gaia.GaiaApp, cdc codec.JSONCodec, config simtype } } - simState.ParamChanges = app.SimulationManager().GenerateParamChanges(config.Seed) - simState.Contents = app.SimulationManager().GetProposalContents(simState) + simState.LegacyProposalContents = app.SimulationManager().GetProposalContents(simState) //nolint:staticcheck + simState.ProposalMsgs = app.SimulationManager().GetProposalMsgs(simState) return app.SimulationManager().WeightedOperations(simState) } // CheckExportSimulation exports the app state and simulation parameters to JSON // if the export paths are defined. -func CheckExportSimulation( - app *gaia.GaiaApp, config simtypes.Config, params simtypes.Params, -) error { +func CheckExportSimulation(app runtime.AppI, config simtypes.Config, params simtypes.Params) error { if config.ExportStatePath != "" { fmt.Println("exporting app state...") - exported, err := app.ExportAppStateAndValidators(false, nil) + exported, err := app.ExportAppStateAndValidators(false, nil, nil) if err != nil { return err } @@ -111,23 +76,3 @@ func PrintStats(db dbm.DB) { fmt.Println(db.Stats()["leveldb.stats"]) fmt.Println("LevelDB cached block size", db.Stats()["leveldb.cachedblock"]) } - -// GetSimulationLog unmarshals the KVPair's Value to the corresponding type based on the -// each's module store key and the prefix bytes of the KVPair's key. -func GetSimulationLog(storeName string, sdr sdk.StoreDecoderRegistry, kvAs, kvBs []kv.Pair) (log string) { - for i := 0; i < len(kvAs); i++ { - if len(kvAs[i].Value) == 0 && len(kvBs[i].Value) == 0 { - // skip if the value doesn't have any bytes - continue - } - - decoder, ok := sdr[storeName] - if ok { - log += decoder(kvAs[i], kvBs[i]) - } else { - log += fmt.Sprintf("store A %X => %X\nstore B %X => %X\n", kvAs[i].Key, kvAs[i].Value, kvBs[i].Key, kvBs[i].Value) - } - } - - return log -} diff --git a/app/sim_bench_test.go b/app/sim_bench_test.go new file mode 100644 index 0000000000..b83f7a2cdc --- /dev/null +++ b/app/sim_bench_test.go @@ -0,0 +1,86 @@ +package gaia_test + +import ( + "os" + "testing" + + "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/v11/app" + + simulation2 "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/simulation" + + "github.com/cosmos/gaia/v11/app/sim" +) + +// Profile with: +// /usr/local/go/bin/go test -benchmem -run=^$ github.com/cosmos/cosmos-sdk/GaiaApp -bench ^BenchmarkFullAppSimulation$ -Commit=true -cpuprofile cpu.out +func BenchmarkFullAppSimulation(b *testing.B) { + b.ReportAllocs() + + config := simcli.NewConfigFromFlags() + config.ChainID = AppChainID + + db, dir, logger, skip, err := simtestutil.SetupSimulation(config, "goleveldb-app-sim", "Simulation", simcli.FlagVerboseValue, simcli.FlagEnabledValue) + if err != nil { + b.Fatalf("simulation setup failed: %s", err.Error()) + } + + if skip { + b.Skip("skipping benchmark application simulation") + } + + defer func() { + require.NoError(b, db.Close()) + require.NoError(b, os.RemoveAll(dir)) + }() + + appOptions := make(simtestutil.AppOptionsMap, 0) + appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue + + encConfig := gaia.RegisterEncodingConfig() + + app := gaia.NewGaiaApp( + logger, + db, + nil, + true, + map[int64]bool{}, + gaia.DefaultNodeHome, + encConfig, + appOptions, + interBlockCacheOpt(), + baseapp.SetChainID(AppChainID), + ) + + // Run randomized simulation:w + _, simParams, simErr := simulation.SimulateFromSeed( + b, + os.Stdout, + app.BaseApp, + sim.AppStateFn(encConfig, app.SimulationManager()), + simulation2.RandomAccounts, // Replace with own random account function if using keys other than secp256k1 + sim.SimulationOperations(app, app.AppCodec(), config), + app.ModuleAccountAddrs(), + config, + app.AppCodec(), + ) + + // export state and simParams before the simulation error is checked + if err = sim.CheckExportSimulation(app, config, simParams); err != nil { + b.Fatal(err) + } + + if simErr != nil { + b.Fatal(simErr) + } + + if config.Commit { + sim.PrintStats(db) + } +} diff --git a/app/sim_test.go b/app/sim_test.go index c14195b37b..4605b3441e 100644 --- a/app/sim_test.go +++ b/app/sim_test.go @@ -7,70 +7,32 @@ import ( "os" "testing" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/server" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + + dbm "github.com/cometbft/cometbft-db" + "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/simapp" "github.com/cosmos/cosmos-sdk/store" 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" - "github.com/tendermint/tendermint/libs/log" - dbm "github.com/tendermint/tm-db" gaia "github.com/cosmos/gaia/v11/app" - "github.com/cosmos/gaia/v11/app/helpers" - "github.com/cosmos/gaia/v11/app/params" + // "github.com/cosmos/gaia/v11/app/helpers" + // "github.com/cosmos/gaia/v11/app/params" "github.com/cosmos/gaia/v11/app/sim" ) +// AppChainID hardcoded chainID for simulation +const AppChainID = "gaia-app" + func init() { sim.GetSimulatorFlags() } -// Profile with: -// /usr/local/go/bin/go test -benchmem -run=^$ github.com/cosmos/cosmos-sdk/GaiaApp -bench ^BenchmarkFullAppSimulation$ -Commit=true -cpuprofile cpu.out -func BenchmarkFullAppSimulation(b *testing.B) { - config, db, dir, logger, _, err := sim.SetupSimulation("goleveldb-app-sim", "Simulation") - if err != nil { - b.Fatalf("simulation setup failed: %s", err.Error()) - } - - defer func() { - db.Close() - err = os.RemoveAll(dir) - if err != nil { - b.Fatal(err) - } - }() - - app := gaia.NewGaiaApp(logger, db, nil, true, map[int64]bool{}, gaia.DefaultNodeHome, simapp.FlagPeriodValue, params.MakeTestEncodingConfig(), simapp.EmptyAppOptions{}, interBlockCacheOpt()) - - // Run randomized simulation:w - _, simParams, simErr := simulation.SimulateFromSeed( - b, - os.Stdout, - app.BaseApp, - sim.AppStateFn(app.AppCodec(), app.SimulationManager()), - simulation2.RandomAccounts, // Replace with own random account function if using keys other than secp256k1 - sim.SimulationOperations(app, app.AppCodec(), config), - app.ModuleAccountAddrs(), - config, - app.AppCodec(), - ) - - // export state and simParams before the simulation error is checked - if err = sim.CheckExportSimulation(app, config, simParams); err != nil { - b.Fatal(err) - } - - if simErr != nil { - b.Fatal(simErr) - } - - if config.Commit { - sim.PrintStats(db) - } -} - // interBlockCacheOpt returns a BaseApp option function that sets the persistent // inter-block write-through cache. func interBlockCacheOpt() func(*baseapp.BaseApp) { @@ -89,14 +51,27 @@ func TestAppStateDeterminism(t *testing.T) { config.ExportParamsPath = "" config.OnOperation = false config.AllInvariants = false - config.ChainID = helpers.SimAppChainID + config.ChainID = AppChainID numSeeds := 3 numTimesToRunPerSeed := 5 + + // We will be overriding the random seed and just run a single simulation on the provided seed value + if config.Seed != simcli.DefaultSeedValue { + numSeeds = 1 + } + appHashList := make([]json.RawMessage, numTimesToRunPerSeed) + appOptions := make(simtestutil.AppOptionsMap, 0) + appOptions[flags.FlagHome] = gaia.DefaultNodeHome + appOptions[server.FlagInvCheckPeriod] = sim.FlagPeriodValue for i := 0; i < numSeeds; i++ { - config.Seed = rand.Int63() + if config.Seed == simcli.DefaultSeedValue { + config.Seed = rand.Int63() + } + + fmt.Println("config.Seed: ", config.Seed) for j := 0; j < numTimesToRunPerSeed; j++ { var logger log.Logger @@ -107,21 +82,35 @@ func TestAppStateDeterminism(t *testing.T) { } db := dbm.NewMemDB() - app := gaia.NewGaiaApp(logger, db, nil, true, map[int64]bool{}, gaia.DefaultNodeHome, simapp.FlagPeriodValue, gaia.MakeTestEncodingConfig(), EmptyAppOptions{}, interBlockCacheOpt()) + encConfig := gaia.RegisterEncodingConfig() + app := gaia.NewGaiaApp( + logger, + db, + nil, + true, + map[int64]bool{}, + gaia.DefaultNodeHome, + encConfig, + appOptions, + interBlockCacheOpt(), + baseapp.SetChainID(AppChainID), + ) fmt.Printf( "running non-determinism simulation; seed %d: %d/%d, attempt: %d/%d\n", config.Seed, i+1, numSeeds, j+1, numTimesToRunPerSeed, ) + blockedAddresses := app.BlockedModuleAccountAddrs(app.ModuleAccountAddrs()) + _, _, err := simulation.SimulateFromSeed( t, os.Stdout, app.BaseApp, - sim.AppStateFn(app.AppCodec(), app.SimulationManager()), + simtestutil.AppStateFn(app.AppCodec(), app.SimulationManager(), gaia.NewDefaultGenesisState(encConfig)), simulation2.RandomAccounts, // Replace with own random account function if using keys other than secp256k1 - sim.SimulationOperations(app, app.AppCodec(), config), - app.ModuleAccountAddrs(), + simtestutil.SimulationOperations(app, app.AppCodec(), config), + blockedAddresses, config, app.AppCodec(), ) diff --git a/app/upgrades/v7/constants.go b/app/upgrades/v7/constants.go index 63fbf3619f..b5ab2db967 100644 --- a/app/upgrades/v7/constants.go +++ b/app/upgrades/v7/constants.go @@ -1,8 +1,10 @@ +//go:build upgrade_v7 + package v7 import ( store "github.com/cosmos/cosmos-sdk/store/types" - icahosttypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types" + icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" "github.com/cosmos/gaia/v11/app/upgrades" ) @@ -34,10 +36,6 @@ const ( stakingMsgCreateValidator = "/cosmos.staking.v1beta1.MsgCreateValidator" vestingMsgCreateVestingAccount = "/cosmos.vesting.v1beta1.MsgCreateVestingAccount" ibcMsgTransfer = "/ibc.applications.transfer.v1.MsgTransfer" - liquidityMsgSwapWithinBatch = "/tendermint.liquidity.v1beta1.MsgSwapWithinBatch" //#nosec G101 -- This is a false positive - liquidityMsgCreatePool = "/tendermint.liquidity.v1beta1.MsgCreatePool" - liquidityMsgDepositWithinBatch = "/tendermint.liquidity.v1beta1.MsgDepositWithinBatch" - liquidityMsgWithdrawWithinBatch = "/tendermint.liquidity.v1beta1.MsgWithdrawWithinBatch" ) var Upgrade = upgrades.Upgrade{ diff --git a/app/upgrades/v7/upgrades.go b/app/upgrades/v7/upgrades.go index 98df63b913..3d7e9f2b68 100644 --- a/app/upgrades/v7/upgrades.go +++ b/app/upgrades/v7/upgrades.go @@ -1,13 +1,15 @@ +//go:build upgrade_v7 + package v7 import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - ica "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts" - icacontrollertypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/controller/types" - icahosttypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types" - icatypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/types" + ica "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts" + icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types" + icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" + icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" "github.com/cosmos/gaia/v11/app/keepers" ) diff --git a/app/upgrades/v8/constants.go b/app/upgrades/v8/constants.go index a6c22fa9df..827076bc27 100644 --- a/app/upgrades/v8/constants.go +++ b/app/upgrades/v8/constants.go @@ -1,3 +1,5 @@ +//go:build upgrade_v8 + package v8 import ( diff --git a/app/upgrades/v8/upgrades.go b/app/upgrades/v8/upgrades.go index 85627030a3..898b1c3c7e 100644 --- a/app/upgrades/v8/upgrades.go +++ b/app/upgrades/v8/upgrades.go @@ -1,3 +1,5 @@ +//go:build upgrade_v8 + package v8 import ( @@ -9,9 +11,9 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - icahosttypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types" - icatypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/types" - ibcchanneltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" + icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" + ibcchanneltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" "github.com/cosmos/gaia/v11/app/keepers" ) diff --git a/app/upgrades/v9/constants.go b/app/upgrades/v9/constants.go index 544fa0d971..a63bfdad09 100644 --- a/app/upgrades/v9/constants.go +++ b/app/upgrades/v9/constants.go @@ -1,8 +1,10 @@ +//go:build upgrade_v9 + package v9 import ( store "github.com/cosmos/cosmos-sdk/store/types" - ccvprovider "github.com/cosmos/interchain-security/v2/x/ccv/provider/types" + ccvprovider "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" "github.com/cosmos/gaia/v11/app/upgrades" ) diff --git a/app/upgrades/v9/upgrades.go b/app/upgrades/v9/upgrades.go index 420e99678e..5cdb6a59fa 100644 --- a/app/upgrades/v9/upgrades.go +++ b/app/upgrades/v9/upgrades.go @@ -1,3 +1,5 @@ +//go:build upgrade_v9 + package v9 import ( diff --git a/buf.work.yaml b/buf.work.yaml new file mode 100644 index 0000000000..1b4a0d95c2 --- /dev/null +++ b/buf.work.yaml @@ -0,0 +1,8 @@ +# Generated by "buf config migrate-v1beta1". Edit as necessary, and +# remove this comment when you're finished. +# +# This workspace file points to the roots found in your +# previous "buf.yaml" configuration. +version: v1 +directories: + - proto diff --git a/client/docs/config.json b/client/docs/config.json index cb39eb2e77..8ae45a432f 100644 --- a/client/docs/config.json +++ b/client/docs/config.json @@ -1,18 +1,18 @@ -{ - "swagger": "2.0", - "info": { - "title": "Cosmoshub - gRPC Gateway docs", - "description": "A REST interface for state queries", - "version": "1.0.0" - }, - "apis": [ - { - "url": "./tmp-swagger-gen/gaia/globalfee/v1beta1/query.swagger.json", - "operationIds": { - "rename": { - "Params": "GlobalfeeParams" - } - } - } - ] -} +//{ +// "swagger": "2.0", +// "info": { +// "title": "Cosmoshub - gRPC Gateway docs", +// "description": "A REST interface for state queries", +// "version": "1.0.0" +// }, +// "apis": [ +// { +// "url": "./tmp-swagger-gen/gaia/globalfee/v1beta1/query.swagger.json", +// "operationIds": { +// "rename": { +// "Params": "GlobalfeeParams" +// } +// } +// } +// ] +//} diff --git a/cmd/gaiad/cmd/genaccounts.go b/cmd/gaiad/cmd/genaccounts.go index d655b7dc6f..473e3f85a6 100644 --- a/cmd/gaiad/cmd/genaccounts.go +++ b/cmd/gaiad/cmd/genaccounts.go @@ -1,193 +1,194 @@ package cmd -import ( - "bufio" - "encoding/json" - "errors" - "fmt" - - "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" - "github.com/spf13/cobra" -) - -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) - 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 = k.GetAddress() - } - - 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 -} +// +// import ( +// "bufio" +// "encoding/json" +// "errors" +// "fmt" +// +// "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" +// "github.com/spf13/cobra" +//) +// +// 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) +// 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 = k.GetAddress() +// } +// +// 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 2fe5502a75..a9bb5cca8d 100644 --- a/cmd/gaiad/cmd/root.go +++ b/cmd/gaiad/cmd/root.go @@ -6,6 +6,16 @@ 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/viper" + + rosettaCmd "cosmossdk.io/tools/rosetta/cmd" + + dbm "github.com/cometbft/cometbft-db" + tmcli "github.com/cometbft/cometbft/libs/cli" + "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/config" @@ -17,7 +27,9 @@ import ( serverconfig "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" "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" @@ -26,9 +38,6 @@ import ( genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" "github.com/spf13/cast" "github.com/spf13/cobra" - tmcli "github.com/tendermint/tendermint/libs/cli" - "github.com/tendermint/tendermint/libs/log" - dbm "github.com/tendermint/tm-db" gaia "github.com/cosmos/gaia/v11/app" "github.com/cosmos/gaia/v11/app/params" @@ -37,9 +46,9 @@ import ( // NewRootCmd creates a new root command for simd. It is called once in the // main function. func NewRootCmd() (*cobra.Command, params.EncodingConfig) { - encodingConfig := gaia.MakeTestEncodingConfig() + encodingConfig := gaia.RegisterEncodingConfig() initClientCtx := client.Context{}. - WithCodec(encodingConfig.Codec). + WithCodec(encodingConfig.Marshaler). WithInterfaceRegistry(encodingConfig.InterfaceRegistry). WithTxConfig(encodingConfig.TxConfig). WithLegacyAmino(encodingConfig.Amino). @@ -52,6 +61,9 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) { Use: "gaiad", Short: "Stargate Cosmos Hub App", PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { + cmd.SetOut(cmd.OutOrStdout()) + cmd.SetErr(cmd.ErrOrStderr()) + initClientCtx, err := client.ReadPersistentCommandFlags(initClientCtx, cmd.Flags()) if err != nil { return err @@ -66,8 +78,10 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) { return err } - customTemplate, customGaiaConfig := initAppConfig() - return server.InterceptConfigsPreRunHandler(cmd, customTemplate, customGaiaConfig) + customAppTemplate, customAppConfig := initAppConfig() + customTMConfig := initTendermintConfig() + + return server.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, customTMConfig) }, } @@ -76,51 +90,82 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) { return rootCmd, encodingConfig } +// initTendermintConfig helps to override default Tendermint Config values. +// return tmcfg.DefaultConfig if no custom configuration is required for the application. +func initTendermintConfig() *tmcfg.Config { + cfg := tmcfg.DefaultConfig() + + // these values put a higher strain on node memory + // cfg.P2P.MaxNumInboundPeers = 100 + // cfg.P2P.MaxNumOutboundPeers = 40 + + return cfg +} + func initAppConfig() (string, interface{}) { + // Embed additional configurations + type CustomAppConfig struct { + serverconfig.Config + } + + // Can optionally overwrite the SDK's default server config. srvCfg := serverconfig.DefaultConfig() srvCfg.StateSync.SnapshotInterval = 1000 srvCfg.StateSync.SnapshotKeepRecent = 10 - return serverconfig.DefaultConfigTemplate, *srvCfg + customAppConfig := CustomAppConfig{ + Config: *srvCfg, + } + + defaultAppTemplate := serverconfig.DefaultConfigTemplate + + return defaultAppTemplate, customAppConfig } func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) { cfg := sdk.GetConfig() - cfg.Seal() + ac := appCreator{encodingConfig} + rootCmd.AddCommand( genutilcli.InitCmd(gaia.ModuleBasics, gaia.DefaultNodeHome), - genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, gaia.DefaultNodeHome), - genutilcli.GenTxCmd(gaia.ModuleBasics, encodingConfig.TxConfig, banktypes.GenesisBalancesIterator{}, gaia.DefaultNodeHome), - genutilcli.ValidateGenesisCmd(gaia.ModuleBasics), - AddGenesisAccountCmd(gaia.DefaultNodeHome), tmcli.NewCompletionCmd(rootCmd, true), - testnetCmd(gaia.ModuleBasics, banktypes.GenesisBalancesIterator{}), + NewTestnetCmd(gaia.ModuleBasics, banktypes.GenesisBalancesIterator{}), addDebugCommands(debug.Cmd()), config.Cmd(), + pruning.PruningCmd(ac.newApp), ) - ac := appCreator{ - encCfg: encodingConfig, - } server.AddCommands(rootCmd, gaia.DefaultNodeHome, ac.newApp, ac.appExport, addModuleInitFlags) // add keybase, auxiliary RPC, query, and tx child commands rootCmd.AddCommand( rpc.StatusCommand(), + genesisCommand(encodingConfig), queryCommand(), txCommand(), keys.Commands(gaia.DefaultNodeHome), ) - rootCmd.AddCommand(server.RosettaCommand(encodingConfig.InterfaceRegistry, encodingConfig.Codec)) + // add rosetta + rootCmd.AddCommand(rosettaCmd.RosettaCommand(encodingConfig.InterfaceRegistry, encodingConfig.Marshaler)) } func addModuleInitFlags(startCmd *cobra.Command) { crisis.AddModuleInitFlags(startCmd) } +// genesisCommand builds genesis-related `simd genesis` command. Users may provide application specific commands as a parameter +func genesisCommand(encodingConfig params.EncodingConfig, cmds ...*cobra.Command) *cobra.Command { + cmd := genutilcli.GenesisCoreCommand(encodingConfig.TxConfig, gaia.ModuleBasics, gaia.DefaultNodeHome) + + for _, subCmd := range cmds { + cmd.AddCommand(subCmd) + } + return cmd +} + func queryCommand() *cobra.Command { cmd := &cobra.Command{ Use: "query", @@ -164,6 +209,7 @@ func txCommand() *cobra.Command { authcmd.GetBroadcastCommand(), authcmd.GetEncodeCommand(), authcmd.GetDecodeCommand(), + authcmd.GetAuxToFeeCommand(), ) gaia.ModuleBasics.AddTxCommands(cmd) @@ -176,7 +222,7 @@ type appCreator struct { encCfg params.EncodingConfig } -func (ac appCreator) newApp( +func (a appCreator) newApp( logger log.Logger, db dbm.DB, traceStore io.Writer, @@ -188,18 +234,30 @@ func (ac appCreator) newApp( cache = store.NewCommitKVStoreCacheManager() } + pruningOpts, err := server.GetPruningOptionsFromFlags(appOpts) + if err != nil { + panic(err) + } + skipUpgradeHeights := make(map[int64]bool) for _, h := range cast.ToIntSlice(appOpts.Get(server.FlagUnsafeSkipUpgrades)) { skipUpgradeHeights[int64(h)] = true } - pruningOpts, err := server.GetPruningOptionsFromFlags(appOpts) - if err != nil { - panic(err) + homeDir := cast.ToString(appOpts.Get(flags.FlagHome)) + chainID := cast.ToString(appOpts.Get(flags.FlagChainID)) + if chainID == "" { + // fallback to genesis chain-ida. + appGenesis, err := tmtypes.GenesisDocFromFile(filepath.Join(homeDir, "config", "genesis.json")) + if err != nil { + panic(err) + } + + chainID = appGenesis.ChainID } snapshotDir := filepath.Join(cast.ToString(appOpts.Get(flags.FlagHome)), "data", "snapshots") - snapshotDB, err := sdk.NewLevelDB("metadata", snapshotDir) + snapshotDB, err := dbm.NewDB("metadata", server.GetAppDBBackend(appOpts), snapshotDir) if err != nil { panic(err) } @@ -208,12 +266,13 @@ func (ac appCreator) newApp( panic(err) } - return gaia.NewGaiaApp( - logger, db, traceStore, true, skipUpgradeHeights, - cast.ToString(appOpts.Get(flags.FlagHome)), - cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)), - ac.encCfg, - appOpts, + // BaseApp Opts + snapshotOptions := snapshottypes.NewSnapshotOptions( + cast.ToUint64(appOpts.Get(server.FlagStateSyncSnapshotInterval)), + cast.ToUint32(appOpts.Get(server.FlagStateSyncSnapshotKeepRecent)), + ) + baseappOptions := []func(*baseapp.BaseApp){ + baseapp.SetChainID(chainID), baseapp.SetPruning(pruningOpts), baseapp.SetMinGasPrices(cast.ToString(appOpts.Get(server.FlagMinGasPrices))), baseapp.SetHaltHeight(cast.ToUint64(appOpts.Get(server.FlagHaltHeight))), @@ -222,14 +281,24 @@ func (ac appCreator) newApp( baseapp.SetInterBlockCache(cache), baseapp.SetTrace(cast.ToBool(appOpts.Get(server.FlagTrace))), baseapp.SetIndexEvents(cast.ToStringSlice(appOpts.Get(server.FlagIndexEvents))), - baseapp.SetSnapshotStore(snapshotStore), - baseapp.SetSnapshotInterval(cast.ToUint64(appOpts.Get(server.FlagStateSyncSnapshotInterval))), - baseapp.SetSnapshotKeepRecent(cast.ToUint32(appOpts.Get(server.FlagStateSyncSnapshotKeepRecent))), + baseapp.SetSnapshot(snapshotStore, snapshotOptions), baseapp.SetIAVLCacheSize(cast.ToInt(appOpts.Get(server.FlagIAVLCacheSize))), + } + + return gaia.NewGaiaApp( + logger, + db, + traceStore, + true, + skipUpgradeHeights, + cast.ToString(appOpts.Get(flags.FlagHome)), + a.encCfg, + appOpts, + baseappOptions..., ) } -func (ac appCreator) appExport( +func (a appCreator) appExport( logger log.Logger, db dbm.DB, traceStore io.Writer, @@ -237,26 +306,37 @@ func (ac appCreator) appExport( forZeroHeight bool, jailAllowedAddrs []string, appOpts servertypes.AppOptions, + modulesToExport []string, ) (servertypes.ExportedApp, error) { + var gaiaApp *gaia.GaiaApp + homePath, ok := appOpts.Get(flags.FlagHome).(string) if !ok || homePath == "" { return servertypes.ExportedApp{}, errors.New("application home is not set") } + // InvCheckPeriod + viperAppOpts, ok := appOpts.(*viper.Viper) + if !ok { + return servertypes.ExportedApp{}, errors.New("appOpts is not viper.Viper") + } + // overwrite the FlagInvCheckPeriod + viperAppOpts.Set(server.FlagInvCheckPeriod, 1) + appOpts = viperAppOpts + var loadLatest bool if height == -1 { loadLatest = true } - gaiaApp := gaia.NewGaiaApp( + gaiaApp = gaia.NewGaiaApp( logger, db, traceStore, loadLatest, map[int64]bool{}, homePath, - cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)), - ac.encCfg, + a.encCfg, appOpts, ) @@ -266,5 +346,5 @@ func (ac appCreator) appExport( } } - return gaiaApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs) + return gaiaApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport) } diff --git a/cmd/gaiad/cmd/root_test.go b/cmd/gaiad/cmd/root_test.go index 0ce64a1b92..b30bca9382 100644 --- a/cmd/gaiad/cmd/root_test.go +++ b/cmd/gaiad/cmd/root_test.go @@ -18,5 +18,5 @@ func TestRootCmdConfig(t *testing.T) { "test", // value }) - require.NoError(t, svrcmd.Execute(rootCmd, app.DefaultNodeHome)) + require.NoError(t, svrcmd.Execute(rootCmd, "", app.DefaultNodeHome)) } diff --git a/cmd/gaiad/cmd/testnet.go b/cmd/gaiad/cmd/testnet.go index 997ebfed7f..c6ee650c00 100644 --- a/cmd/gaiad/cmd/testnet.go +++ b/cmd/gaiad/cmd/testnet.go @@ -8,6 +8,16 @@ import ( "os" "path/filepath" + "cosmossdk.io/math" + "cosmossdk.io/simapp" + + "github.com/cosmos/cosmos-sdk/testutil/network" + "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" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" @@ -25,13 +35,6 @@ import ( genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/spf13/cobra" - tmconfig "github.com/tendermint/tendermint/config" - tmos "github.com/tendermint/tendermint/libs/os" - tmrand "github.com/tendermint/tendermint/libs/rand" - "github.com/tendermint/tendermint/types" - tmtime "github.com/tendermint/tendermint/types/time" - // ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" - // ibcchanneltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" ) var ( @@ -40,124 +43,183 @@ var ( flagOutputDir = "output-dir" flagNodeDaemonHome = "node-daemon-home" flagStartingIPAddress = "starting-ip-address" + flagEnableLogging = "enable-logging" + flagGRPCAddress = "grpc.address" + flagRPCAddress = "rpc.address" + flagAPIAddress = "api.address" + flagPrintMnemonic = "print-mnemonic" ) -// get cmd to initialize all files for tendermint testnet and application -func testnetCmd(mbm module.BasicManager, genBalIterator banktypes.GenesisBalancesIterator) *cobra.Command { +type initArgs struct { + algo string + chainID string + keyringBackend string + minGasPrices string + nodeDaemonHome string + nodeDirPrefix string + numValidators int + outputDir string + startingIPAddress string +} + +type startArgs struct { + algo string + apiAddress string + chainID string + enableLogging bool + grpcAddress string + minGasPrices string + numValidators int + outputDir string + printMnemonic bool + rpcAddress string +} + +func addTestnetFlagsToCmd(cmd *cobra.Command) { + cmd.Flags().Int(flagNumValidators, 4, "Number of validators to initialize the testnet with") + cmd.Flags().StringP(flagOutputDir, "o", "./.testnets", "Directory to store initialization data for the testnet") + cmd.Flags().String(flags.FlagChainID, "", "genesis file chain-id, if left blank will be randomly created") + cmd.Flags().String(server.FlagMinGasPrices, fmt.Sprintf("0.000006%s", sdk.DefaultBondDenom), "Minimum gas prices to accept for transactions; All fees in a tx must meet this minimum (e.g. 0.01photino,0.001stake)") + cmd.Flags().String(flags.FlagKeyType, string(hd.Secp256k1Type), "Key signing algorithm to generate keys for") + + // support old flags name for backwards compatibility + cmd.Flags().SetNormalizeFunc(func(f *pflag.FlagSet, name string) pflag.NormalizedName { + if name == "algo" { + name = flags.FlagKeyType + } + + return pflag.NormalizedName(name) + }) +} + +// NewTestnetCmd creates a root testnet command with subcommands to run an in-process testnet or initialize +// validator configuration files for running a multi-validator testnet in a separate process +func NewTestnetCmd(mbm module.BasicManager, genBalIterator banktypes.GenesisBalancesIterator) *cobra.Command { + testnetCmd := &cobra.Command{ + Use: "testnet", + Short: "subcommands for starting or configuring local testnets", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + testnetCmd.AddCommand(testnetStartCmd()) + testnetCmd.AddCommand(testnetInitFilesCmd(mbm, genBalIterator)) + + return testnetCmd +} + +// testnetInitFilesCmd returns a cmd to initialize all files for tendermint testnet and application +func testnetInitFilesCmd(mbm module.BasicManager, genBalIterator banktypes.GenesisBalancesIterator) *cobra.Command { cmd := &cobra.Command{ - Use: "testnet", - Short: "Initialize files for a simapp testnet", - Long: `testnet will create "v" number of directories and populate each with -necessary files (private validator, genesis, config, etc.). + Use: "init-files", + Short: "Initialize config directories & files for a multi-validator testnet running locally via separate processes (e.g. Docker Compose or similar)", + Long: `init-files will setup "v" number of directories and populate each with +necessary files (private validator, genesis, config, etc.) for running "v" validator nodes. + +Booting up a network with these validator folders is intended to be used with Docker Compose, +or a similar setup where each node has a manually configurable IP address. Note, strict routability for addresses is turned off in the config file. Example: - gaiad testnet --v 4 --output-dir ./output --starting-ip-address 192.168.10.2 + simd testnet init-files --v 4 --output-dir ./.testnets --starting-ip-address 192.168.10.2 `, RunE: func(cmd *cobra.Command, _ []string) error { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err } + serverCtx := server.GetServerContextFromCmd(cmd) config := serverCtx.Config - outputDir, err := cmd.Flags().GetString(flagOutputDir) - if err != nil { - return err - } - keyringBackend, err := cmd.Flags().GetString(flags.FlagKeyringBackend) - if err != nil { - return err - } - chainID, err := cmd.Flags().GetString(flags.FlagChainID) - if err != nil { - return err - } - minGasPrices, err := cmd.Flags().GetString(server.FlagMinGasPrices) - if err != nil { - return err - } - nodeDirPrefix, err := cmd.Flags().GetString(flagNodeDirPrefix) - if err != nil { - return err - } - nodeDaemonHome, err := cmd.Flags().GetString(flagNodeDaemonHome) - if err != nil { - return err - } - startingIPAddress, err := cmd.Flags().GetString(flagStartingIPAddress) - if err != nil { - return err - } - numValidators, err := cmd.Flags().GetInt(flagNumValidators) - if err != nil { - return err - } - algo, err := cmd.Flags().GetString(flags.FlagKeyAlgorithm) - if err != nil { - return err - } - - return InitTestnet( - clientCtx, cmd, config, mbm, genBalIterator, outputDir, chainID, minGasPrices, - nodeDirPrefix, nodeDaemonHome, startingIPAddress, keyringBackend, algo, numValidators, - ) + args := initArgs{} + args.outputDir, _ = cmd.Flags().GetString(flagOutputDir) + args.keyringBackend, _ = cmd.Flags().GetString(flags.FlagKeyringBackend) + args.chainID, _ = cmd.Flags().GetString(flags.FlagChainID) + args.minGasPrices, _ = cmd.Flags().GetString(server.FlagMinGasPrices) + args.nodeDirPrefix, _ = cmd.Flags().GetString(flagNodeDirPrefix) + args.nodeDaemonHome, _ = cmd.Flags().GetString(flagNodeDaemonHome) + args.startingIPAddress, _ = cmd.Flags().GetString(flagStartingIPAddress) + args.numValidators, _ = cmd.Flags().GetInt(flagNumValidators) + args.algo, _ = cmd.Flags().GetString(flags.FlagKeyType) + + return initTestnetFiles(clientCtx, cmd, config, mbm, genBalIterator, args) }, } - cmd.Flags().Int(flagNumValidators, 4, "Number of validators to initialize the testnet with") - cmd.Flags().StringP(flagOutputDir, "o", "./mytestnet", "Directory to store initialization data for the testnet") + addTestnetFlagsToCmd(cmd) cmd.Flags().String(flagNodeDirPrefix, "node", "Prefix the directory name for each node with (node results in node0, node1, ...)") - cmd.Flags().String(flagNodeDaemonHome, "gaiad", "Home directory of the node's daemon configuration") + cmd.Flags().String(flagNodeDaemonHome, "simd", "Home directory of the node's daemon configuration") cmd.Flags().String(flagStartingIPAddress, "192.168.0.1", "Starting IP address (192.168.0.1 results in persistent peers list ID0@192.168.0.1:46656, ID1@192.168.0.2:46656, ...)") - cmd.Flags().String(flags.FlagChainID, "", "genesis file chain-id, if left blank will be randomly created") - cmd.Flags().String(server.FlagMinGasPrices, fmt.Sprintf("0.000006%s", sdk.DefaultBondDenom), "Minimum gas prices to accept for transactions; All fees in a tx must meet this minimum (e.g. 0.01photino,0.001stake)") cmd.Flags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|test)") - cmd.Flags().String(flags.FlagKeyAlgorithm, string(hd.Secp256k1Type), "Key signing algorithm to generate keys for") return cmd } +// testnetStartCmd returns a cmd to start multi validator in-process testnet +func testnetStartCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "start", + Short: "Launch an in-process multi-validator testnet", + Long: `testnet will launch an in-process multi-validator testnet, +and generate "v" directories, populated with necessary validator configuration files +(private validator, genesis, config, etc.). + +Example: + simd testnet --v 4 --output-dir ./.testnets + `, + RunE: func(cmd *cobra.Command, _ []string) error { + args := startArgs{} + args.outputDir, _ = cmd.Flags().GetString(flagOutputDir) + args.chainID, _ = cmd.Flags().GetString(flags.FlagChainID) + args.minGasPrices, _ = cmd.Flags().GetString(server.FlagMinGasPrices) + args.numValidators, _ = cmd.Flags().GetInt(flagNumValidators) + args.algo, _ = cmd.Flags().GetString(flags.FlagKeyType) + args.enableLogging, _ = cmd.Flags().GetBool(flagEnableLogging) + args.rpcAddress, _ = cmd.Flags().GetString(flagRPCAddress) + args.apiAddress, _ = cmd.Flags().GetString(flagAPIAddress) + args.grpcAddress, _ = cmd.Flags().GetString(flagGRPCAddress) + args.printMnemonic, _ = cmd.Flags().GetBool(flagPrintMnemonic) + + return startTestnet(cmd, args) + }, + } + + addTestnetFlagsToCmd(cmd) + cmd.Flags().Bool(flagEnableLogging, false, "Enable INFO logging of tendermint validator nodes") + cmd.Flags().String(flagRPCAddress, "tcp://0.0.0.0:26657", "the RPC address to listen on") + cmd.Flags().String(flagAPIAddress, "tcp://0.0.0.0:1317", "the address to listen on for REST API") + cmd.Flags().String(flagGRPCAddress, "0.0.0.0:9090", "the gRPC server address to listen on") + cmd.Flags().Bool(flagPrintMnemonic, true, "print mnemonic of first validator to stdout for manual testing") + return cmd +} + const nodeDirPerm = 0o755 -// Initialize the testnet -func InitTestnet( +// initTestnetFiles initializes testnet files for a testnet to be run in a separate process +func initTestnetFiles( clientCtx client.Context, cmd *cobra.Command, nodeConfig *tmconfig.Config, mbm module.BasicManager, genBalIterator banktypes.GenesisBalancesIterator, - outputDir, - chainID, - minGasPrices, - nodeDirPrefix, - nodeDaemonHome, - startingIPAddress, - keyringBackend, - algoStr string, - numValidators int, + args initArgs, ) error { - if chainID == "" { - chainID = "chain-" + tmrand.Str(6) + if args.chainID == "" { + args.chainID = "chain-" + tmrand.Str(6) } + nodeIDs := make([]string, args.numValidators) + valPubKeys := make([]cryptotypes.PubKey, args.numValidators) - nodeIDs := make([]string, numValidators) - valPubKeys := make([]cryptotypes.PubKey, numValidators) - - simappConfig := *srvconfig.DefaultConfig() - simappConfig.MinGasPrices = minGasPrices + simappConfig := srvconfig.DefaultConfig() + simappConfig.MinGasPrices = args.minGasPrices simappConfig.API.Enable = true simappConfig.Telemetry.Enabled = true simappConfig.Telemetry.PrometheusRetentionTime = 60 simappConfig.Telemetry.EnableHostnameLabel = false - simappConfig.Telemetry.GlobalLabels = [][]string{{"chain_id", chainID}} - // simappConfig.BypassMinFeeMsgTypes = []string{ - // sdk.MsgTypeURL(&ibcchanneltypes.MsgRecvPacket{}), - // sdk.MsgTypeURL(&ibcchanneltypes.MsgAcknowledgement{}), - // sdk.MsgTypeURL(&ibcclienttypes.MsgUpdateClient{}), - // } + simappConfig.Telemetry.GlobalLabels = [][]string{{"chain_id", args.chainID}} var ( genAccounts []authtypes.GenesisAccount @@ -167,50 +229,49 @@ func InitTestnet( inBuf := bufio.NewReader(cmd.InOrStdin()) // generate private keys, node IDs, and initial transactions - for i := 0; i < numValidators; i++ { - nodeDirName := fmt.Sprintf("%s%d", nodeDirPrefix, i) - nodeDir := filepath.Join(outputDir, nodeDirName, nodeDaemonHome) - gentxsDir := filepath.Join(outputDir, "gentxs") + for i := 0; i < args.numValidators; i++ { + nodeDirName := fmt.Sprintf("%s%d", args.nodeDirPrefix, i) + nodeDir := filepath.Join(args.outputDir, nodeDirName, args.nodeDaemonHome) + gentxsDir := filepath.Join(args.outputDir, "gentxs") nodeConfig.SetRoot(nodeDir) + nodeConfig.Moniker = nodeDirName nodeConfig.RPC.ListenAddress = "tcp://0.0.0.0:26657" if err := os.MkdirAll(filepath.Join(nodeDir, "config"), nodeDirPerm); err != nil { - _ = os.RemoveAll(outputDir) + _ = os.RemoveAll(args.outputDir) return err } - nodeConfig.Moniker = nodeDirName - - ip, err := getIP(i, startingIPAddress) + ip, err := getIP(i, args.startingIPAddress) if err != nil { - _ = os.RemoveAll(outputDir) + _ = os.RemoveAll(args.outputDir) return err } nodeIDs[i], valPubKeys[i], err = genutil.InitializeNodeValidatorFiles(nodeConfig) if err != nil { - _ = os.RemoveAll(outputDir) + _ = os.RemoveAll(args.outputDir) return err } memo := fmt.Sprintf("%s@%s:26656", nodeIDs[i], ip) genFiles = append(genFiles, nodeConfig.GenesisFile()) - kb, err := keyring.New(sdk.KeyringServiceName(), keyringBackend, nodeDir, inBuf) + kb, err := keyring.New(sdk.KeyringServiceName(), args.keyringBackend, nodeDir, inBuf, clientCtx.Codec) if err != nil { return err } keyringAlgos, _ := kb.SupportedAlgorithms() - algo, err := keyring.NewSigningAlgoFromString(algoStr, keyringAlgos) + algo, err := keyring.NewSigningAlgoFromString(args.algo, keyringAlgos) if err != nil { return err } addr, secret, err := testutil.GenerateSaveCoinKey(kb, nodeDirName, "", true, algo) if err != nil { - _ = os.RemoveAll(outputDir) + _ = os.RemoveAll(args.outputDir) return err } @@ -229,7 +290,7 @@ func InitTestnet( accTokens := sdk.TokensFromConsensusPower(1000, sdk.DefaultPowerReduction) accStakingTokens := sdk.TokensFromConsensusPower(500, sdk.DefaultPowerReduction) coins := sdk.Coins{ - sdk.NewCoin(fmt.Sprintf("%stoken", nodeDirName), accTokens), + sdk.NewCoin("testtoken", accTokens), sdk.NewCoin(sdk.DefaultBondDenom, accStakingTokens), } @@ -242,8 +303,8 @@ func InitTestnet( valPubKeys[i], sdk.NewCoin(sdk.DefaultBondDenom, valTokens), stakingtypes.NewDescription(nodeDirName, "", "", "", ""), - stakingtypes.NewCommissionRates(sdk.OneDec(), sdk.OneDec(), sdk.OneDec()), - sdk.OneInt(), + stakingtypes.NewCommissionRates(math.LegacyOneDec(), math.LegacyOneDec(), math.LegacyOneDec()), + math.OneInt(), ) if err != nil { return err @@ -258,7 +319,7 @@ func InitTestnet( txFactory := tx.Factory{} txFactory = txFactory. - WithChainID(chainID). + WithChainID(args.chainID). WithMemo(memo). WithKeybase(kb). WithTxConfig(clientCtx.TxConfig) @@ -276,22 +337,22 @@ func InitTestnet( return err } - srvconfig.WriteConfigFile(filepath.Join(nodeDir, "config/app.toml"), simappConfig) + srvconfig.WriteConfigFile(filepath.Join(nodeDir, "config", "app.toml"), simappConfig) } - if err := initGenFiles(clientCtx, mbm, chainID, genAccounts, genBalances, genFiles, numValidators); err != nil { + if err := initGenFiles(clientCtx, mbm, args.chainID, genAccounts, genBalances, genFiles, args.numValidators); err != nil { return err } err := collectGenFiles( - clientCtx, nodeConfig, chainID, nodeIDs, valPubKeys, numValidators, - outputDir, nodeDirPrefix, nodeDaemonHome, genBalIterator, + clientCtx, nodeConfig, args.chainID, nodeIDs, valPubKeys, args.numValidators, + args.outputDir, args.nodeDirPrefix, args.nodeDaemonHome, genBalIterator, ) if err != nil { return err } - cmd.PrintErrf("Successfully initialized %d node directories\n", numValidators) + cmd.PrintErrf("Successfully initialized %d node directories\n", args.numValidators) return nil } @@ -317,6 +378,7 @@ func initGenFiles( // set the balances in the genesis state var bankGenState banktypes.GenesisState clientCtx.Codec.MustUnmarshalJSON(appGenState[banktypes.ModuleName], &bankGenState) + bankGenState.Balances = banktypes.SanitizeGenesisBalances(genBalances) for _, bal := range bankGenState.Balances { bankGenState.Supply = bankGenState.Supply.Add(bal.Coins...) @@ -367,7 +429,7 @@ func collectGenFiles( return err } - nodeAppState, err := genutil.GenAppStateFromConfig(clientCtx.Codec, clientCtx.TxConfig, nodeConfig, initCfg, *genDoc, genBalIterator) + nodeAppState, err := genutil.GenAppStateFromConfig(clientCtx.Codec, clientCtx.TxConfig, nodeConfig, initCfg, *genDoc, genBalIterator, genutiltypes.DefaultMessageValidator) if err != nil { return err } @@ -412,18 +474,59 @@ func calculateIP(ip string, i int) (string, error) { return ipv4.String(), nil } -func writeFile(name, dir string, contents []byte) error { +func writeFile(name string, dir string, contents []byte) error { file := filepath.Join(dir, name) - err := tmos.EnsureDir(dir, 0o755) - if err != nil { + if err := os.MkdirAll(dir, 0o755); err != nil { + return fmt.Errorf("could not create directory %q: %w", dir, err) + } + + if err := os.WriteFile(file, contents, 0o644); err != nil { //nolint: gosec return err } - err = os.WriteFile(file, contents, 0o600) + return nil +} + +// startTestnet starts an in-process testnet +func startTestnet(cmd *cobra.Command, args startArgs) error { + networkConfig := network.DefaultConfig(simapp.NewTestNetworkFixture) + + // Default networkConfig.ChainID is random, and we should only override it if chainID provided + // is non-empty + if args.chainID != "" { + networkConfig.ChainID = args.chainID + } + networkConfig.SigningAlgo = args.algo + networkConfig.MinGasPrices = args.minGasPrices + networkConfig.NumValidators = args.numValidators + networkConfig.EnableTMLogging = args.enableLogging + networkConfig.RPCAddress = args.rpcAddress + networkConfig.APIAddress = args.apiAddress + networkConfig.GRPCAddress = args.grpcAddress + networkConfig.PrintMnemonic = args.printMnemonic + networkLogger := network.NewCLILogger(cmd) + + baseDir := fmt.Sprintf("%s/%s", args.outputDir, networkConfig.ChainID) + if _, err := os.Stat(baseDir); !os.IsNotExist(err) { + return fmt.Errorf( + "testnests directory already exists for chain-id '%s': %s, please remove or select a new --chain-id", + networkConfig.ChainID, baseDir) + } + + testnet, err := network.New(networkLogger, baseDir, networkConfig) if err != nil { return err } + if _, err := testnet.WaitForHeight(1); err != nil { + return err + } + cmd.Println("press the Enter Key to terminate") + if _, err := fmt.Scanln(); err != nil { // wait for Enter Key + return err + } + testnet.Cleanup() + return nil } diff --git a/cmd/gaiad/main.go b/cmd/gaiad/main.go index fb48abaf64..542d2940da 100644 --- a/cmd/gaiad/main.go +++ b/cmd/gaiad/main.go @@ -13,7 +13,7 @@ import ( func main() { rootCmd, _ := cmd.NewRootCmd() - if err := svrcmd.Execute(rootCmd, app.DefaultNodeHome); err != nil { + if err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome); err != nil { switch e := err.(type) { case server.ErrorCode: os.Exit(e.Code) diff --git a/go.mod b/go.mod index d3768d1d09..567c0f94dd 100644 --- a/go.mod +++ b/go.mod @@ -3,174 +3,181 @@ module github.com/cosmos/gaia/v11 go 1.20 require ( + cosmossdk.io/api v0.3.1 cosmossdk.io/errors v1.0.0-beta.7 cosmossdk.io/math v1.0.1 - github.com/cosmos/cosmos-sdk v0.45.16-ics - github.com/cosmos/go-bip39 v1.0.0 - github.com/cosmos/ibc-go/v4 v4.4.2 - github.com/cosmos/interchain-security/v2 v2.0.0 - github.com/gogo/protobuf v1.3.3 - github.com/golang/protobuf v1.5.3 + cosmossdk.io/simapp v0.0.0-20230602123434-616841b9704d + cosmossdk.io/tools/rosetta v0.2.1 + github.com/cometbft/cometbft v0.37.1 + github.com/cometbft/cometbft-db v0.8.0 + github.com/cosmos/cosmos-sdk v0.47.3 + github.com/cosmos/gogoproto v1.4.10 + github.com/cosmos/ibc-go/v7 v7.1.0 + github.com/cosmos/interchain-security/v3 v3.0.0-rc0 github.com/gorilla/mux v1.8.0 - github.com/gravity-devs/liquidity v1.6.0 - github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/ory/dockertest/v3 v3.10.0 + github.com/spf13/pflag v1.0.5 + github.com/spf13/viper v1.16.0 + github.com/strangelove-ventures/packet-forward-middleware/v7 v7.0.0-20230412224111-136e94e98861 + github.com/stretchr/testify v1.8.4 +) + +require ( + cloud.google.com/go v0.110.0 // indirect + cloud.google.com/go/compute v1.19.0 // indirect + cloud.google.com/go/compute/metadata v0.2.3 // indirect + cloud.google.com/go/iam v0.13.0 // indirect + cloud.google.com/go/storage v1.29.0 // indirect + github.com/cosmos/go-bip39 v1.0.0 // indirect + github.com/golang/protobuf v1.5.3 // indirect + // github.com/gravity-devs/liquidity v1.6.0 + github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect github.com/rakyll/statik v0.1.7 github.com/spf13/cast v1.5.1 github.com/spf13/cobra v1.7.0 - github.com/spf13/viper v1.16.0 - github.com/strangelove-ventures/packet-forward-middleware/v4 v4.0.5 - github.com/stretchr/testify v1.8.4 - github.com/tendermint/tendermint v0.34.27 - github.com/tendermint/tm-db v0.6.7 - google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 - google.golang.org/grpc v1.55.0 + google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect + google.golang.org/grpc v1.55.0 // indirect ) require ( - cosmossdk.io/api v0.2.6 // indirect cosmossdk.io/core v0.5.1 // indirect cosmossdk.io/depinject v1.0.0-alpha.3 // indirect - filippo.io/edwards25519 v1.0.0-rc.1 // indirect + cosmossdk.io/log v1.1.0 // indirect + filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect - github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect - github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect - github.com/DataDog/zstd v1.5.0 // indirect - github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect - github.com/Microsoft/go-winio v0.6.0 // indirect - github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect - github.com/Workiva/go-datastructures v1.0.53 // indirect + github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect github.com/armon/go-metrics v0.4.1 // indirect + github.com/aws/aws-sdk-go v1.44.203 // indirect github.com/beorn7/perks v1.0.1 // indirect + github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.1.2 // indirect - github.com/cockroachdb/errors v1.9.1 // indirect - github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20220817183557-09c6e030a677 // indirect - github.com/cockroachdb/redact v1.1.3 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/chzyer/readline v1.5.1 // indirect + github.com/cockroachdb/apd/v2 v2.0.2 // indirect github.com/coinbase/rosetta-sdk-go v0.7.9 // indirect - github.com/cometbft/cometbft-db v0.7.0 // indirect github.com/confio/ics23/go v0.9.0 // indirect - github.com/containerd/continuity v0.3.0 // indirect - github.com/cosmos/btcutil v1.0.4 // indirect - github.com/cosmos/cosmos-db v0.0.0-20221226095112-f3c38ecb5e32 // indirect - github.com/cosmos/cosmos-proto v1.0.0-beta.1 // indirect - github.com/cosmos/gorocksdb v1.2.0 // indirect - github.com/cosmos/iavl v0.19.5 // indirect + github.com/cosmos/btcutil v1.0.5 // indirect + github.com/cosmos/cosmos-proto v1.0.0-beta.2 // indirect + github.com/cosmos/gogogateway v1.2.0 // indirect + github.com/cosmos/iavl v0.20.0 // indirect + github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.12.2 // indirect - github.com/creachadair/taskgroup v0.3.2 // indirect + github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect + github.com/creachadair/taskgroup v0.4.2 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect - github.com/dgraph-io/ristretto v0.1.0 // indirect + github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect - github.com/docker/cli v20.10.17+incompatible // indirect - github.com/docker/docker v20.10.24+incompatible // indirect - github.com/docker/go-connections v0.4.0 // indirect - github.com/docker/go-units v0.5.0 // indirect - github.com/dustin/go-humanize v1.0.0 // indirect + github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect github.com/felixge/httpsnoop v1.0.2 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/getsentry/sentry-go v0.17.0 // indirect + github.com/gin-gonic/gin v1.8.1 // indirect github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect - github.com/go-logfmt/logfmt v0.5.1 // indirect - github.com/go-sql-driver/mysql v1.7.0 // indirect + github.com/go-logfmt/logfmt v0.6.0 // indirect + github.com/go-playground/validator/v10 v10.11.1 // indirect github.com/gobwas/ws v1.1.0 // indirect + github.com/goccy/go-json v0.9.11 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect - github.com/gogo/gateway v1.1.0 // indirect - github.com/golang/glog v1.0.0 // indirect + github.com/gogo/googleapis v1.4.1 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/glog v1.1.0 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/mock v1.6.0 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.1.2 // indirect + github.com/google/go-cmp v0.5.9 // indirect github.com/google/orderedcode v0.0.1 // indirect - github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect + github.com/google/s2a-go v0.1.3 // indirect + github.com/google/uuid v1.3.0 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect + github.com/googleapis/gax-go/v2 v2.8.0 // indirect github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.2 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect + github.com/hashicorp/go-getter v1.7.1 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-safetemp v1.0.0 // indirect + github.com/hashicorp/go-version v1.6.0 // indirect github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 // indirect + github.com/hdevalence/ed25519consensus v0.1.0 // indirect + github.com/huandu/skiplist v1.2.0 // indirect github.com/iancoleman/orderedmap v0.2.0 // indirect - github.com/imdario/mergo v0.3.15 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.15.11 // indirect - github.com/kr/pretty v0.3.1 // indirect - github.com/kr/text v0.2.0 // indirect + github.com/klauspost/compress v1.16.3 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.7.10 // indirect + github.com/linxGnu/grocksdb v1.7.16 // indirect github.com/magiconair/properties v1.8.7 // indirect + github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.17 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect + github.com/mattn/go-isatty v0.0.18 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/minio/highwayhash v1.0.2 // indirect + github.com/mitchellh/go-homedir v1.1.0 // indirect + github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae // indirect github.com/mtibben/percent v0.2.1 // indirect - github.com/onsi/ginkgo v1.16.5 // indirect github.com/onsi/gomega v1.26.0 // indirect - github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.1.0-rc2 // indirect github.com/opencontainers/runc v1.1.5 // indirect github.com/oxyno-zeta/gomock-extra-matcher v1.1.0 // indirect github.com/pelletier/go-toml/v2 v2.0.8 // indirect - github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect + github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.14.0 // indirect github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.37.0 // indirect - github.com/prometheus/procfs v0.8.0 // indirect + github.com/prometheus/common v0.42.0 // indirect + github.com/prometheus/procfs v0.9.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/regen-network/cosmos-proto v0.3.1 // indirect - github.com/rogpeppe/go-internal v1.9.0 // indirect - github.com/rs/cors v1.8.2 // indirect - github.com/rs/zerolog v1.27.0 // indirect + github.com/rs/cors v1.8.3 // indirect + github.com/rs/zerolog v1.29.1 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect - github.com/sirupsen/logrus v1.9.0 // indirect github.com/spf13/afero v1.9.5 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.4.2 // indirect - github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect - github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect + github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tendermint/go-amino v0.16.0 // indirect - github.com/tidwall/btree v1.5.0 // indirect - github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect - github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect - github.com/xeipuuv/gojsonschema v1.2.0 // indirect + github.com/tidwall/btree v1.6.0 // indirect + github.com/ulikunitz/xz v0.5.11 // indirect github.com/zondax/hid v0.9.1 // indirect github.com/zondax/ledger-go v0.14.1 // indirect - go.etcd.io/bbolt v1.3.6 // indirect + go.etcd.io/bbolt v1.3.7 // indirect + go.opencensus.io v0.24.0 // indirect golang.org/x/crypto v0.9.0 // indirect - golang.org/x/exp v0.0.0-20221205204356-47842c84f3db // indirect - golang.org/x/mod v0.9.0 // indirect + golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc // indirect golang.org/x/net v0.10.0 // indirect + golang.org/x/oauth2 v0.7.0 // indirect golang.org/x/sys v0.8.0 // indirect golang.org/x/term v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect golang.org/x/tools v0.7.0 // indirect + golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect + google.golang.org/api v0.122.0 // indirect + google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.30.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect + pgregory.net/rapid v0.5.5 // indirect + sigs.k8s.io/yaml v1.3.0 // indirect ) replace ( @@ -182,16 +189,13 @@ replace ( // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.8.1 - // use cosmos style protobufs - github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 - // Liquidity force withdrawal: https://www.mintscan.io/cosmos/proposals/801 - github.com/gravity-devs/liquidity => github.com/gravity-devs/liquidity v1.6.0-forced-withdrawal-rc1 + // github.com/gravity-devs/liquidity => github.com/gravity-devs/liquidity v1.6.0-forced-withdrawal-rc1 // Comet github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.29 // latest grpc doesn't work with 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.33.2 + google.golang.org/grpc => google.golang.org/grpc v1.54.0 ) diff --git a/go.sum b/go.sum index 4038e69ea0..7e0d2592f7 100644 --- a/go.sum +++ b/go.sum @@ -18,87 +18,435 @@ cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHOb cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= +cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= +cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= +cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= +cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= +cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= +cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= +cloud.google.com/go v0.100.1/go.mod h1:fs4QogzfH5n2pBXBP9vRiU+eCny7lD2vmFZy79Iuw1U= +cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= +cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= +cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= +cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= +cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= +cloud.google.com/go v0.107.0/go.mod h1:wpc2eNrD7hXUTy8EKS10jkxpZBjASrORK7goS+3YX2I= +cloud.google.com/go v0.110.0 h1:Zc8gqp3+a9/Eyph2KDmcGaPtbKRIoqq4YTlL4NMD0Ys= +cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY= +cloud.google.com/go/accessapproval v1.4.0/go.mod h1:zybIuC3KpDOvotz59lFe5qxRZx6C75OtwbisN56xYB4= +cloud.google.com/go/accessapproval v1.5.0/go.mod h1:HFy3tuiGvMdcd/u+Cu5b9NkO1pEICJ46IR82PoUdplw= +cloud.google.com/go/accesscontextmanager v1.3.0/go.mod h1:TgCBehyr5gNMz7ZaH9xubp+CE8dkrszb4oK9CWyvD4o= +cloud.google.com/go/accesscontextmanager v1.4.0/go.mod h1:/Kjh7BBu/Gh83sv+K60vN9QE5NJcd80sU33vIe2IFPE= +cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= +cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= +cloud.google.com/go/aiplatform v1.27.0/go.mod h1:Bvxqtl40l0WImSb04d0hXFU7gDOiq9jQmorivIiWcKg= +cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= +cloud.google.com/go/analytics v0.12.0/go.mod h1:gkfj9h6XRf9+TS4bmuhPEShsh3hH8PAZzm/41OOhQd4= +cloud.google.com/go/apigateway v1.3.0/go.mod h1:89Z8Bhpmxu6AmUxuVRg/ECRGReEdiP3vQtk4Z1J9rJk= +cloud.google.com/go/apigateway v1.4.0/go.mod h1:pHVY9MKGaH9PQ3pJ4YLzoj6U5FUDeDFBllIz7WmzJoc= +cloud.google.com/go/apigeeconnect v1.3.0/go.mod h1:G/AwXFAKo0gIXkPTVfZDd2qA1TxBXJ3MgMRBQkIi9jc= +cloud.google.com/go/apigeeconnect v1.4.0/go.mod h1:kV4NwOKqjvt2JYR0AoIWo2QGfoRtn/pkS3QlHp0Ni04= +cloud.google.com/go/appengine v1.4.0/go.mod h1:CS2NhuBuDXM9f+qscZ6V86m1MIIqPj3WC/UoEuR1Sno= +cloud.google.com/go/appengine v1.5.0/go.mod h1:TfasSozdkFI0zeoxW3PTBLiNqRmzraodCWatWI9Dmak= +cloud.google.com/go/area120 v0.5.0/go.mod h1:DE/n4mp+iqVyvxHN41Vf1CR602GiHQjFPusMFW6bGR4= +cloud.google.com/go/area120 v0.6.0/go.mod h1:39yFJqWVgm0UZqWTOdqkLhjoC7uFfgXRC8g/ZegeAh0= +cloud.google.com/go/artifactregistry v1.6.0/go.mod h1:IYt0oBPSAGYj/kprzsBjZ/4LnG/zOcHyFHjWPCi6SAQ= +cloud.google.com/go/artifactregistry v1.7.0/go.mod h1:mqTOFOnGZx8EtSqK/ZWcsm/4U8B77rbcLP6ruDU2Ixk= +cloud.google.com/go/artifactregistry v1.8.0/go.mod h1:w3GQXkJX8hiKN0v+at4b0qotwijQbYUqF2GWkZzAhC0= +cloud.google.com/go/artifactregistry v1.9.0/go.mod h1:2K2RqvA2CYvAeARHRkLDhMDJ3OXy26h3XW+3/Jh2uYc= +cloud.google.com/go/asset v1.5.0/go.mod h1:5mfs8UvcM5wHhqtSv8J1CtxxaQq3AdBxxQi2jGW/K4o= +cloud.google.com/go/asset v1.7.0/go.mod h1:YbENsRK4+xTiL+Ofoj5Ckf+O17kJtgp3Y3nn4uzZz5s= +cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjbytpUaW0= +cloud.google.com/go/asset v1.9.0/go.mod h1:83MOE6jEJBMqFKadM9NLRcs80Gdw76qGuHn8m3h8oHQ= +cloud.google.com/go/asset v1.10.0/go.mod h1:pLz7uokL80qKhzKr4xXGvBQXnzHn5evJAEAtZiIb0wY= +cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY= +cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= +cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI= +cloud.google.com/go/assuredworkloads v1.8.0/go.mod h1:AsX2cqyNCOvEQC8RMPnoc0yEarXQk6WEKkxYfL6kGIo= +cloud.google.com/go/assuredworkloads v1.9.0/go.mod h1:kFuI1P78bplYtT77Tb1hi0FMxM0vVpRC7VVoJC3ZoT0= +cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= +cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= +cloud.google.com/go/automl v1.7.0/go.mod h1:RL9MYCCsJEOmt0Wf3z9uzG0a7adTT1fe+aObgSpkCt8= +cloud.google.com/go/automl v1.8.0/go.mod h1:xWx7G/aPEe/NP+qzYXktoBSDfjO+vnKMGgsApGJJquM= +cloud.google.com/go/baremetalsolution v0.3.0/go.mod h1:XOrocE+pvK1xFfleEnShBlNAXf+j5blPPxrhjKgnIFc= +cloud.google.com/go/baremetalsolution v0.4.0/go.mod h1:BymplhAadOO/eBa7KewQ0Ppg4A4Wplbn+PsFKRLo0uI= +cloud.google.com/go/batch v0.3.0/go.mod h1:TR18ZoAekj1GuirsUsR1ZTKN3FC/4UDnScjT8NXImFE= +cloud.google.com/go/batch v0.4.0/go.mod h1:WZkHnP43R/QCGQsZ+0JyG4i79ranE2u8xvjq/9+STPE= +cloud.google.com/go/beyondcorp v0.2.0/go.mod h1:TB7Bd+EEtcw9PCPQhCJtJGjk/7TC6ckmnSFS+xwTfm4= +cloud.google.com/go/beyondcorp v0.3.0/go.mod h1:E5U5lcrcXMsCuoDNyGrpyTm/hn7ne941Jz2vmksAxW8= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA= +cloud.google.com/go/bigquery v1.43.0/go.mod h1:ZMQcXHsl+xmU1z36G2jNGZmKp9zNY5BUua5wDgmNCfw= +cloud.google.com/go/bigquery v1.44.0/go.mod h1:0Y33VqXTEsbamHJvJHdFmtqHvMIY28aK1+dFsvaChGc= cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o= +cloud.google.com/go/billing v1.4.0/go.mod h1:g9IdKBEFlItS8bTtlrZdVLWSSdSyFUZKXNS02zKMOZY= +cloud.google.com/go/billing v1.5.0/go.mod h1:mztb1tBc3QekhjSgmpf/CV4LzWXLzCArwpLmP2Gm88s= +cloud.google.com/go/billing v1.6.0/go.mod h1:WoXzguj+BeHXPbKfNWkqVtDdzORazmCjraY+vrxcyvI= +cloud.google.com/go/billing v1.7.0/go.mod h1:q457N3Hbj9lYwwRbnlD7vUpyjq6u5U1RAOArInEiD5Y= +cloud.google.com/go/binaryauthorization v1.1.0/go.mod h1:xwnoWu3Y84jbuHa0zd526MJYmtnVXn0syOjaJgy4+dM= +cloud.google.com/go/binaryauthorization v1.2.0/go.mod h1:86WKkJHtRcv5ViNABtYMhhNWRrD1Vpi//uKEy7aYEfI= +cloud.google.com/go/binaryauthorization v1.3.0/go.mod h1:lRZbKgjDIIQvzYQS1p99A7/U1JqvqeZg0wiI5tp6tg0= +cloud.google.com/go/binaryauthorization v1.4.0/go.mod h1:tsSPQrBd77VLplV70GUhBf/Zm3FsKmgSqgm4UmiDItk= +cloud.google.com/go/certificatemanager v1.3.0/go.mod h1:n6twGDvcUBFu9uBgt4eYvvf3sQ6My8jADcOVwHmzadg= +cloud.google.com/go/certificatemanager v1.4.0/go.mod h1:vowpercVFyqs8ABSmrdV+GiFf2H/ch3KyudYQEMM590= +cloud.google.com/go/channel v1.8.0/go.mod h1:W5SwCXDJsq/rg3tn3oG0LOxpAo6IMxNa09ngphpSlnk= +cloud.google.com/go/channel v1.9.0/go.mod h1:jcu05W0my9Vx4mt3/rEHpfxc9eKi9XwsdDL8yBMbKUk= +cloud.google.com/go/cloudbuild v1.3.0/go.mod h1:WequR4ULxlqvMsjDEEEFnOG5ZSRSgWOywXYDb1vPE6U= +cloud.google.com/go/cloudbuild v1.4.0/go.mod h1:5Qwa40LHiOXmz3386FrjrYM93rM/hdRr7b53sySrTqA= +cloud.google.com/go/clouddms v1.3.0/go.mod h1:oK6XsCDdW4Ib3jCCBugx+gVjevp2TMXFtgxvPSee3OM= +cloud.google.com/go/clouddms v1.4.0/go.mod h1:Eh7sUGCC+aKry14O1NRljhjyrr0NFC0G2cjwX0cByRk= +cloud.google.com/go/cloudtasks v1.5.0/go.mod h1:fD92REy1x5woxkKEkLdvavGnPJGEn8Uic9nWuLzqCpY= +cloud.google.com/go/cloudtasks v1.6.0/go.mod h1:C6Io+sxuke9/KNRkbQpihnW93SWDU3uXt92nu85HkYI= +cloud.google.com/go/cloudtasks v1.7.0/go.mod h1:ImsfdYWwlWNJbdgPIIGJWC+gemEGTBK/SunNQQNCAb4= +cloud.google.com/go/cloudtasks v1.8.0/go.mod h1:gQXUIwCSOI4yPVK7DgTVFiiP0ZW/eQkydWzwVMdHxrI= +cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= +cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= +cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= +cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= +cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= +cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= +cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= +cloud.google.com/go/compute v1.12.0/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= +cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= +cloud.google.com/go/compute v1.13.0/go.mod h1:5aPTS0cUNMIc1CE546K+Th6weJUNQErARyZtRXDJ8GE= +cloud.google.com/go/compute v1.14.0/go.mod h1:YfLtxrj9sU4Yxv+sXzZkyPjEyPBZfXHUvjxega5vAdo= +cloud.google.com/go/compute v1.15.1/go.mod h1:bjjoF/NtFUrkD/urWfdHaKuOPDR5nWIs63rR+SXhcpA= +cloud.google.com/go/compute v1.19.0 h1:+9zda3WGgW1ZSTlVppLCYFIr48Pa35q1uG2N1itbCEQ= +cloud.google.com/go/compute v1.19.0/go.mod h1:rikpw2y+UMidAe9tISo04EHNOIf42RLYF/q8Bs93scU= +cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZEXYonfTBHHFPO/4UU= +cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= +cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +cloud.google.com/go/contactcenterinsights v1.3.0/go.mod h1:Eu2oemoePuEFc/xKFPjbTuPSj0fYJcPls9TFlPNnHHY= +cloud.google.com/go/contactcenterinsights v1.4.0/go.mod h1:L2YzkGbPsv+vMQMCADxJoT9YiTTnSEd6fEvCeHTYVck= +cloud.google.com/go/container v1.6.0/go.mod h1:Xazp7GjJSeUYo688S+6J5V+n/t+G5sKBTFkKNudGRxg= +cloud.google.com/go/container v1.7.0/go.mod h1:Dp5AHtmothHGX3DwwIHPgq45Y8KmNsgN3amoYfxVkLo= +cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= +cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= +cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0= +cloud.google.com/go/datacatalog v1.5.0/go.mod h1:M7GPLNQeLfWqeIm3iuiruhPzkt65+Bx8dAKvScX8jvs= +cloud.google.com/go/datacatalog v1.6.0/go.mod h1:+aEyF8JKg+uXcIdAmmaMUmZ3q1b/lKLtXCmXdnc0lbc= +cloud.google.com/go/datacatalog v1.7.0/go.mod h1:9mEl4AuDYWw81UGc41HonIHH7/sn52H0/tc8f8ZbZIE= +cloud.google.com/go/datacatalog v1.8.0/go.mod h1:KYuoVOv9BM8EYz/4eMFxrr4DUKhGIOXxZoKYF5wdISM= +cloud.google.com/go/dataflow v0.6.0/go.mod h1:9QwV89cGoxjjSR9/r7eFDqqjtvbKxAK2BaYU6PVk9UM= +cloud.google.com/go/dataflow v0.7.0/go.mod h1:PX526vb4ijFMesO1o202EaUmouZKBpjHsTlCtB4parQ= +cloud.google.com/go/dataform v0.3.0/go.mod h1:cj8uNliRlHpa6L3yVhDOBrUXH+BPAO1+KFMQQNSThKo= +cloud.google.com/go/dataform v0.4.0/go.mod h1:fwV6Y4Ty2yIFL89huYlEkwUPtS7YZinZbzzj5S9FzCE= +cloud.google.com/go/dataform v0.5.0/go.mod h1:GFUYRe8IBa2hcomWplodVmUx/iTL0FrsauObOM3Ipr0= +cloud.google.com/go/datafusion v1.4.0/go.mod h1:1Zb6VN+W6ALo85cXnM1IKiPw+yQMKMhB9TsTSRDo/38= +cloud.google.com/go/datafusion v1.5.0/go.mod h1:Kz+l1FGHB0J+4XF2fud96WMmRiq/wj8N9u007vyXZ2w= +cloud.google.com/go/datalabeling v0.5.0/go.mod h1:TGcJ0G2NzcsXSE/97yWjIZO0bXj0KbVlINXMG9ud42I= +cloud.google.com/go/datalabeling v0.6.0/go.mod h1:WqdISuk/+WIGeMkpw/1q7bK/tFEZxsrFJOJdY2bXvTQ= +cloud.google.com/go/dataplex v1.3.0/go.mod h1:hQuRtDg+fCiFgC8j0zV222HvzFQdRd+SVX8gdmFcZzA= +cloud.google.com/go/dataplex v1.4.0/go.mod h1:X51GfLXEMVJ6UN47ESVqvlsRplbLhcsAt0kZCCKsU0A= +cloud.google.com/go/dataproc v1.7.0/go.mod h1:CKAlMjII9H90RXaMpSxQ8EU6dQx6iAYNPcYPOkSbi8s= +cloud.google.com/go/dataproc v1.8.0/go.mod h1:5OW+zNAH0pMpw14JVrPONsxMQYMBqJuzORhIBfBn9uI= +cloud.google.com/go/dataqna v0.5.0/go.mod h1:90Hyk596ft3zUQ8NkFfvICSIfHFh1Bc7C4cK3vbhkeo= +cloud.google.com/go/dataqna v0.6.0/go.mod h1:1lqNpM7rqNLVgWBJyk5NF6Uen2PHym0jtVJonplVsDA= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/datastore v1.10.0/go.mod h1:PC5UzAmDEkAmkfaknstTYbNpgE49HAgW2J1gcgUfmdM= +cloud.google.com/go/datastream v1.2.0/go.mod h1:i/uTP8/fZwgATHS/XFu0TcNUhuA0twZxxQ3EyCUQMwo= +cloud.google.com/go/datastream v1.3.0/go.mod h1:cqlOX8xlyYF/uxhiKn6Hbv6WjwPPuI9W2M9SAXwaLLQ= +cloud.google.com/go/datastream v1.4.0/go.mod h1:h9dpzScPhDTs5noEMQVWP8Wx8AFBRyS0s8KWPx/9r0g= +cloud.google.com/go/datastream v1.5.0/go.mod h1:6TZMMNPwjUqZHBKPQ1wwXpb0d5VDVPl2/XoS5yi88q4= +cloud.google.com/go/deploy v1.4.0/go.mod h1:5Xghikd4VrmMLNaF6FiRFDlHb59VM59YoDQnOUdsH/c= +cloud.google.com/go/deploy v1.5.0/go.mod h1:ffgdD0B89tToyW/U/D2eL0jN2+IEV/3EMuXHA0l4r+s= +cloud.google.com/go/dialogflow v1.15.0/go.mod h1:HbHDWs33WOGJgn6rfzBW1Kv807BE3O1+xGbn59zZWI4= +cloud.google.com/go/dialogflow v1.16.1/go.mod h1:po6LlzGfK+smoSmTBnbkIZY2w8ffjz/RcGSS+sh1el0= +cloud.google.com/go/dialogflow v1.17.0/go.mod h1:YNP09C/kXA1aZdBgC/VtXX74G/TKn7XVCcVumTflA+8= +cloud.google.com/go/dialogflow v1.18.0/go.mod h1:trO7Zu5YdyEuR+BhSNOqJezyFQ3aUzz0njv7sMx/iek= +cloud.google.com/go/dialogflow v1.19.0/go.mod h1:JVmlG1TwykZDtxtTXujec4tQ+D8SBFMoosgy+6Gn0s0= +cloud.google.com/go/dlp v1.6.0/go.mod h1:9eyB2xIhpU0sVwUixfBubDoRwP+GjeUoxxeueZmqvmM= +cloud.google.com/go/dlp v1.7.0/go.mod h1:68ak9vCiMBjbasxeVD17hVPxDEck+ExiHavX8kiHG+Q= +cloud.google.com/go/documentai v1.7.0/go.mod h1:lJvftZB5NRiFSX4moiye1SMxHx0Bc3x1+p9e/RfXYiU= +cloud.google.com/go/documentai v1.8.0/go.mod h1:xGHNEB7CtsnySCNrCFdCyyMz44RhFEEX2Q7UD0c5IhU= +cloud.google.com/go/documentai v1.9.0/go.mod h1:FS5485S8R00U10GhgBC0aNGrJxBP8ZVpEeJ7PQDZd6k= +cloud.google.com/go/documentai v1.10.0/go.mod h1:vod47hKQIPeCfN2QS/jULIvQTugbmdc0ZvxxfQY1bg4= +cloud.google.com/go/domains v0.6.0/go.mod h1:T9Rz3GasrpYk6mEGHh4rymIhjlnIuB4ofT1wTxDeT4Y= +cloud.google.com/go/domains v0.7.0/go.mod h1:PtZeqS1xjnXuRPKE/88Iru/LdfoRyEHYA9nFQf4UKpg= +cloud.google.com/go/edgecontainer v0.1.0/go.mod h1:WgkZ9tp10bFxqO8BLPqv2LlfmQF1X8lZqwW4r1BTajk= +cloud.google.com/go/edgecontainer v0.2.0/go.mod h1:RTmLijy+lGpQ7BXuTDa4C4ssxyXT34NIuHIgKuP4s5w= +cloud.google.com/go/errorreporting v0.3.0/go.mod h1:xsP2yaAp+OAW4OIm60An2bbLpqIhKXdWR/tawvl7QzU= +cloud.google.com/go/essentialcontacts v1.3.0/go.mod h1:r+OnHa5jfj90qIfZDO/VztSFqbQan7HV75p8sA+mdGI= +cloud.google.com/go/essentialcontacts v1.4.0/go.mod h1:8tRldvHYsmnBCHdFpvU+GL75oWiBKl80BiqlFh9tp+8= +cloud.google.com/go/eventarc v1.7.0/go.mod h1:6ctpF3zTnaQCxUjHUdcfgcA1A2T309+omHZth7gDfmc= +cloud.google.com/go/eventarc v1.8.0/go.mod h1:imbzxkyAU4ubfsaKYdQg04WS1NvncblHEup4kvF+4gw= +cloud.google.com/go/filestore v1.3.0/go.mod h1:+qbvHGvXU1HaKX2nD0WEPo92TP/8AQuCVEBXNY9z0+w= +cloud.google.com/go/filestore v1.4.0/go.mod h1:PaG5oDfo9r224f8OYXURtAsY+Fbyq/bLYoINEK8XQAI= +cloud.google.com/go/firestore v1.9.0/go.mod h1:HMkjKHNTtRyZNiMzu7YAsLr9K3X2udY2AMwDaMEQiiE= +cloud.google.com/go/functions v1.6.0/go.mod h1:3H1UA3qiIPRWD7PeZKLvHZ9SaQhR26XIJcC0A5GbvAk= +cloud.google.com/go/functions v1.7.0/go.mod h1:+d+QBcWM+RsrgZfV9xo6KfA1GlzJfxcfZcRPEhDDfzg= +cloud.google.com/go/functions v1.8.0/go.mod h1:RTZ4/HsQjIqIYP9a9YPbU+QFoQsAlYgrwOXJWHn1POY= +cloud.google.com/go/functions v1.9.0/go.mod h1:Y+Dz8yGguzO3PpIjhLTbnqV1CWmgQ5UwtlpzoyquQ08= +cloud.google.com/go/gaming v1.5.0/go.mod h1:ol7rGcxP/qHTRQE/RO4bxkXq+Fix0j6D4LFPzYTIrDM= +cloud.google.com/go/gaming v1.6.0/go.mod h1:YMU1GEvA39Qt3zWGyAVA9bpYz/yAhTvaQ1t2sK4KPUA= +cloud.google.com/go/gaming v1.7.0/go.mod h1:LrB8U7MHdGgFG851iHAfqUdLcKBdQ55hzXy9xBJz0+w= +cloud.google.com/go/gaming v1.8.0/go.mod h1:xAqjS8b7jAVW0KFYeRUxngo9My3f33kFmua++Pi+ggM= +cloud.google.com/go/gkebackup v0.2.0/go.mod h1:XKvv/4LfG829/B8B7xRkk8zRrOEbKtEam6yNfuQNH60= +cloud.google.com/go/gkebackup v0.3.0/go.mod h1:n/E671i1aOQvUxT541aTkCwExO/bTer2HDlj4TsBRAo= +cloud.google.com/go/gkeconnect v0.5.0/go.mod h1:c5lsNAg5EwAy7fkqX/+goqFsU1Da/jQFqArp+wGNr/o= +cloud.google.com/go/gkeconnect v0.6.0/go.mod h1:Mln67KyU/sHJEBY8kFZ0xTeyPtzbq9StAVvEULYK16A= +cloud.google.com/go/gkehub v0.9.0/go.mod h1:WYHN6WG8w9bXU0hqNxt8rm5uxnk8IH+lPY9J2TV7BK0= +cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y977wO+hBH0= +cloud.google.com/go/gkemulticloud v0.3.0/go.mod h1:7orzy7O0S+5kq95e4Hpn7RysVA7dPs8W/GgfUtsPbrA= +cloud.google.com/go/gkemulticloud v0.4.0/go.mod h1:E9gxVBnseLWCk24ch+P9+B2CoDFJZTyIgLKSalC7tuI= +cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= +cloud.google.com/go/gsuiteaddons v1.3.0/go.mod h1:EUNK/J1lZEZO8yPtykKxLXI6JSVN2rg9bN8SXOa0bgM= +cloud.google.com/go/gsuiteaddons v1.4.0/go.mod h1:rZK5I8hht7u7HxFQcFei0+AtfS9uSushomRlg+3ua1o= +cloud.google.com/go/iam v0.1.0/go.mod h1:vcUNEa0pEm0qRVpmWepWaFMIAI8/hjB9mO8rNCJtF6c= +cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= +cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= +cloud.google.com/go/iam v0.6.0/go.mod h1:+1AH33ueBne5MzYccyMHtEKqLE4/kJOibtffMHDMFMc= +cloud.google.com/go/iam v0.7.0/go.mod h1:H5Br8wRaDGNc8XP3keLc4unfUUZeyH3Sfl9XpQEYOeg= +cloud.google.com/go/iam v0.8.0/go.mod h1:lga0/y3iH6CX7sYqypWJ33hf7kkfXJag67naqGESjkE= +cloud.google.com/go/iam v0.13.0 h1:+CmB+K0J/33d0zSQ9SlFWUeCCEn5XJA0ZMZ3pHE9u8k= +cloud.google.com/go/iam v0.13.0/go.mod h1:ljOg+rcNfzZ5d6f1nAUJ8ZIxOaZUVoS14bKCtaLZ/D0= +cloud.google.com/go/iap v1.4.0/go.mod h1:RGFwRJdihTINIe4wZ2iCP0zF/qu18ZwyKxrhMhygBEc= +cloud.google.com/go/iap v1.5.0/go.mod h1:UH/CGgKd4KyohZL5Pt0jSKE4m3FR51qg6FKQ/z/Ix9A= +cloud.google.com/go/ids v1.1.0/go.mod h1:WIuwCaYVOzHIj2OhN9HAwvW+DBdmUAdcWlFxRl+KubM= +cloud.google.com/go/ids v1.2.0/go.mod h1:5WXvp4n25S0rA/mQWAg1YEEBBq6/s+7ml1RDCW1IrcY= +cloud.google.com/go/iot v1.3.0/go.mod h1:r7RGh2B61+B8oz0AGE+J72AhA0G7tdXItODWsaA2oLs= +cloud.google.com/go/iot v1.4.0/go.mod h1:dIDxPOn0UvNDUMD8Ger7FIaTuvMkj+aGk94RPP0iV+g= +cloud.google.com/go/kms v1.4.0/go.mod h1:fajBHndQ+6ubNw6Ss2sSd+SWvjL26RNo/dr7uxsnnOA= +cloud.google.com/go/kms v1.5.0/go.mod h1:QJS2YY0eJGBg3mnDfuaCyLauWwBJiHRboYxJ++1xJNg= +cloud.google.com/go/kms v1.6.0/go.mod h1:Jjy850yySiasBUDi6KFUwUv2n1+o7QZFyuUJg6OgjA0= +cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= +cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= +cloud.google.com/go/language v1.7.0/go.mod h1:DJ6dYN/W+SQOjF8e1hLQXMF21AkH2w9wiPzPCJa2MIE= +cloud.google.com/go/language v1.8.0/go.mod h1:qYPVHf7SPoNNiCL2Dr0FfEFNil1qi3pQEyygwpgVKB8= +cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= +cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= +cloud.google.com/go/logging v1.6.1/go.mod h1:5ZO0mHHbvm8gEmeEUHrmDlTDSu5imF6MUP9OfilNXBw= +cloud.google.com/go/longrunning v0.1.1/go.mod h1:UUFxuDWkv22EuY93jjmDMFT5GPQKeFVJBIF6QlTqdsE= +cloud.google.com/go/longrunning v0.3.0/go.mod h1:qth9Y41RRSUE69rDcOn6DdK3HfQfsUI0YSmW3iIlLJc= +cloud.google.com/go/longrunning v0.4.1 h1:v+yFJOfKC3yZdY6ZUI933pIYdhyhV8S3NpWrXWmg7jM= +cloud.google.com/go/managedidentities v1.3.0/go.mod h1:UzlW3cBOiPrzucO5qWkNkh0w33KFtBJU281hacNvsdE= +cloud.google.com/go/managedidentities v1.4.0/go.mod h1:NWSBYbEMgqmbZsLIyKvxrYbtqOsxY1ZrGM+9RgDqInM= +cloud.google.com/go/maps v0.1.0/go.mod h1:BQM97WGyfw9FWEmQMpZ5T6cpovXXSd1cGmFma94eubI= +cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= +cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= +cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE= +cloud.google.com/go/memcache v1.5.0/go.mod h1:dk3fCK7dVo0cUU2c36jKb4VqKPS22BTkf81Xq617aWM= +cloud.google.com/go/memcache v1.6.0/go.mod h1:XS5xB0eQZdHtTuTF9Hf8eJkKtR3pVRCcvJwtm68T3rA= +cloud.google.com/go/memcache v1.7.0/go.mod h1:ywMKfjWhNtkQTxrWxCkCFkoPjLHPW6A7WOTVI8xy3LY= +cloud.google.com/go/metastore v1.5.0/go.mod h1:2ZNrDcQwghfdtCwJ33nM0+GrBGlVuh8rakL3vdPY3XY= +cloud.google.com/go/metastore v1.6.0/go.mod h1:6cyQTls8CWXzk45G55x57DVQ9gWg7RiH65+YgPsNh9s= +cloud.google.com/go/metastore v1.7.0/go.mod h1:s45D0B4IlsINu87/AsWiEVYbLaIMeUSoxlKKDqBGFS8= +cloud.google.com/go/metastore v1.8.0/go.mod h1:zHiMc4ZUpBiM7twCIFQmJ9JMEkDSyZS9U12uf7wHqSI= +cloud.google.com/go/monitoring v1.7.0/go.mod h1:HpYse6kkGo//7p6sT0wsIC6IBDET0RhIsnmlA53dvEk= +cloud.google.com/go/monitoring v1.8.0/go.mod h1:E7PtoMJ1kQXWxPjB6mv2fhC5/15jInuulFdYYtlcvT4= +cloud.google.com/go/networkconnectivity v1.4.0/go.mod h1:nOl7YL8odKyAOtzNX73/M5/mGZgqqMeryi6UPZTk/rA= +cloud.google.com/go/networkconnectivity v1.5.0/go.mod h1:3GzqJx7uhtlM3kln0+x5wyFvuVH1pIBJjhCpjzSt75o= +cloud.google.com/go/networkconnectivity v1.6.0/go.mod h1:OJOoEXW+0LAxHh89nXd64uGG+FbQoeH8DtxCHVOMlaM= +cloud.google.com/go/networkconnectivity v1.7.0/go.mod h1:RMuSbkdbPwNMQjB5HBWD5MpTBnNm39iAVpC3TmsExt8= +cloud.google.com/go/networkmanagement v1.4.0/go.mod h1:Q9mdLLRn60AsOrPc8rs8iNV6OHXaGcDdsIQe1ohekq8= +cloud.google.com/go/networkmanagement v1.5.0/go.mod h1:ZnOeZ/evzUdUsnvRt792H0uYEnHQEMaz+REhhzJRcf4= +cloud.google.com/go/networksecurity v0.5.0/go.mod h1:xS6fOCoqpVC5zx15Z/MqkfDwH4+m/61A3ODiDV1xmiQ= +cloud.google.com/go/networksecurity v0.6.0/go.mod h1:Q5fjhTr9WMI5mbpRYEbiexTzROf7ZbDzvzCrNl14nyU= +cloud.google.com/go/notebooks v1.2.0/go.mod h1:9+wtppMfVPUeJ8fIWPOq1UnATHISkGXGqTkxeieQ6UY= +cloud.google.com/go/notebooks v1.3.0/go.mod h1:bFR5lj07DtCPC7YAAJ//vHskFBxA5JzYlH68kXVdk34= +cloud.google.com/go/notebooks v1.4.0/go.mod h1:4QPMngcwmgb6uw7Po99B2xv5ufVoIQ7nOGDyL4P8AgA= +cloud.google.com/go/notebooks v1.5.0/go.mod h1:q8mwhnP9aR8Hpfnrc5iN5IBhrXUy8S2vuYs+kBJ/gu0= +cloud.google.com/go/optimization v1.1.0/go.mod h1:5po+wfvX5AQlPznyVEZjGJTMr4+CAkJf2XSTQOOl9l4= +cloud.google.com/go/optimization v1.2.0/go.mod h1:Lr7SOHdRDENsh+WXVmQhQTrzdu9ybg0NecjHidBq6xs= +cloud.google.com/go/orchestration v1.3.0/go.mod h1:Sj5tq/JpWiB//X/q3Ngwdl5K7B7Y0KZ7bfv0wL6fqVA= +cloud.google.com/go/orchestration v1.4.0/go.mod h1:6W5NLFWs2TlniBphAViZEVhrXRSMgUGDfW7vrWKvsBk= +cloud.google.com/go/orgpolicy v1.4.0/go.mod h1:xrSLIV4RePWmP9P3tBl8S93lTmlAxjm06NSm2UTmKvE= +cloud.google.com/go/orgpolicy v1.5.0/go.mod h1:hZEc5q3wzwXJaKrsx5+Ewg0u1LxJ51nNFlext7Tanwc= +cloud.google.com/go/osconfig v1.7.0/go.mod h1:oVHeCeZELfJP7XLxcBGTMBvRO+1nQ5tFG9VQTmYS2Fs= +cloud.google.com/go/osconfig v1.8.0/go.mod h1:EQqZLu5w5XA7eKizepumcvWx+m8mJUhEwiPqWiZeEdg= +cloud.google.com/go/osconfig v1.9.0/go.mod h1:Yx+IeIZJ3bdWmzbQU4fxNl8xsZ4amB+dygAwFPlvnNo= +cloud.google.com/go/osconfig v1.10.0/go.mod h1:uMhCzqC5I8zfD9zDEAfvgVhDS8oIjySWh+l4WK6GnWw= +cloud.google.com/go/oslogin v1.4.0/go.mod h1:YdgMXWRaElXz/lDk1Na6Fh5orF7gvmJ0FGLIs9LId4E= +cloud.google.com/go/oslogin v1.5.0/go.mod h1:D260Qj11W2qx/HVF29zBg+0fd6YCSjSqLUkY/qEenQU= +cloud.google.com/go/oslogin v1.6.0/go.mod h1:zOJ1O3+dTU8WPlGEkFSh7qeHPPSoxrcMbbK1Nm2iX70= +cloud.google.com/go/oslogin v1.7.0/go.mod h1:e04SN0xO1UNJ1M5GP0vzVBFicIe4O53FOfcixIqTyXo= +cloud.google.com/go/phishingprotection v0.5.0/go.mod h1:Y3HZknsK9bc9dMi+oE8Bim0lczMU6hrX0UpADuMefr0= +cloud.google.com/go/phishingprotection v0.6.0/go.mod h1:9Y3LBLgy0kDTcYET8ZH3bq/7qni15yVUoAxiFxnlSUA= +cloud.google.com/go/policytroubleshooter v1.3.0/go.mod h1:qy0+VwANja+kKrjlQuOzmlvscn4RNsAc0e15GGqfMxg= +cloud.google.com/go/policytroubleshooter v1.4.0/go.mod h1:DZT4BcRw3QoO8ota9xw/LKtPa8lKeCByYeKTIf/vxdE= +cloud.google.com/go/privatecatalog v0.5.0/go.mod h1:XgosMUvvPyxDjAVNDYxJ7wBW8//hLDDYmnsNcMGq1K0= +cloud.google.com/go/privatecatalog v0.6.0/go.mod h1:i/fbkZR0hLN29eEWiiwue8Pb+GforiEIBnV9yrRUOKI= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/pubsub v1.26.0/go.mod h1:QgBH3U/jdJy/ftjPhTkyXNj543Tin1pRYcdcPRnFIRI= +cloud.google.com/go/pubsub v1.27.1/go.mod h1:hQN39ymbV9geqBnfQq6Xf63yNhUAhv9CZhzp5O6qsW0= +cloud.google.com/go/pubsublite v1.5.0/go.mod h1:xapqNQ1CuLfGi23Yda/9l4bBCKz/wC3KIJ5gKcxveZg= +cloud.google.com/go/recaptchaenterprise v1.3.1/go.mod h1:OdD+q+y4XGeAlxRaMn1Y7/GveP6zmq76byL6tjPE7d4= +cloud.google.com/go/recaptchaenterprise/v2 v2.1.0/go.mod h1:w9yVqajwroDNTfGuhmOjPDN//rZGySaf6PtFVcSCa7o= +cloud.google.com/go/recaptchaenterprise/v2 v2.2.0/go.mod h1:/Zu5jisWGeERrd5HnlS3EUGb/D335f9k51B/FVil0jk= +cloud.google.com/go/recaptchaenterprise/v2 v2.3.0/go.mod h1:O9LwGCjrhGHBQET5CA7dd5NwwNQUErSgEDit1DLNTdo= +cloud.google.com/go/recaptchaenterprise/v2 v2.4.0/go.mod h1:Am3LHfOuBstrLrNCBrlI5sbwx9LBg3te2N6hGvHn2mE= +cloud.google.com/go/recaptchaenterprise/v2 v2.5.0/go.mod h1:O8LzcHXN3rz0j+LBC91jrwI3R+1ZSZEWrfL7XHgNo9U= +cloud.google.com/go/recommendationengine v0.5.0/go.mod h1:E5756pJcVFeVgaQv3WNpImkFP8a+RptV6dDLGPILjvg= +cloud.google.com/go/recommendationengine v0.6.0/go.mod h1:08mq2umu9oIqc7tDy8sx+MNJdLG0fUi3vaSVbztHgJ4= +cloud.google.com/go/recommender v1.5.0/go.mod h1:jdoeiBIVrJe9gQjwd759ecLJbxCDED4A6p+mqoqDvTg= +cloud.google.com/go/recommender v1.6.0/go.mod h1:+yETpm25mcoiECKh9DEScGzIRyDKpZ0cEhWGo+8bo+c= +cloud.google.com/go/recommender v1.7.0/go.mod h1:XLHs/W+T8olwlGOgfQenXBTbIseGclClff6lhFVe9Bs= +cloud.google.com/go/recommender v1.8.0/go.mod h1:PkjXrTT05BFKwxaUxQmtIlrtj0kph108r02ZZQ5FE70= +cloud.google.com/go/redis v1.7.0/go.mod h1:V3x5Jq1jzUcg+UNsRvdmsfuFnit1cfe3Z/PGyq/lm4Y= +cloud.google.com/go/redis v1.8.0/go.mod h1:Fm2szCDavWzBk2cDKxrkmWBqoCiL1+Ctwq7EyqBCA/A= +cloud.google.com/go/redis v1.9.0/go.mod h1:HMYQuajvb2D0LvMgZmLDZW8V5aOC/WxstZHiy4g8OiA= +cloud.google.com/go/redis v1.10.0/go.mod h1:ThJf3mMBQtW18JzGgh41/Wld6vnDDc/F/F35UolRZPM= +cloud.google.com/go/resourcemanager v1.3.0/go.mod h1:bAtrTjZQFJkiWTPDb1WBjzvc6/kifjj4QBYuKCCoqKA= +cloud.google.com/go/resourcemanager v1.4.0/go.mod h1:MwxuzkumyTX7/a3n37gmsT3py7LIXwrShilPh3P1tR0= +cloud.google.com/go/resourcesettings v1.3.0/go.mod h1:lzew8VfESA5DQ8gdlHwMrqZs1S9V87v3oCnKCWoOuQU= +cloud.google.com/go/resourcesettings v1.4.0/go.mod h1:ldiH9IJpcrlC3VSuCGvjR5of/ezRrOxFtpJoJo5SmXg= +cloud.google.com/go/retail v1.8.0/go.mod h1:QblKS8waDmNUhghY2TI9O3JLlFk8jybHeV4BF19FrE4= +cloud.google.com/go/retail v1.9.0/go.mod h1:g6jb6mKuCS1QKnH/dpu7isX253absFl6iE92nHwlBUY= +cloud.google.com/go/retail v1.10.0/go.mod h1:2gDk9HsL4HMS4oZwz6daui2/jmKvqShXKQuB2RZ+cCc= +cloud.google.com/go/retail v1.11.0/go.mod h1:MBLk1NaWPmh6iVFSz9MeKG/Psyd7TAgm6y/9L2B4x9Y= +cloud.google.com/go/run v0.2.0/go.mod h1:CNtKsTA1sDcnqqIFR3Pb5Tq0usWxJJvsWOCPldRU3Do= +cloud.google.com/go/run v0.3.0/go.mod h1:TuyY1+taHxTjrD0ZFk2iAR+xyOXEA0ztb7U3UNA0zBo= +cloud.google.com/go/scheduler v1.4.0/go.mod h1:drcJBmxF3aqZJRhmkHQ9b3uSSpQoltBPGPxGAWROx6s= +cloud.google.com/go/scheduler v1.5.0/go.mod h1:ri073ym49NW3AfT6DZi21vLZrG07GXr5p3H1KxN5QlI= +cloud.google.com/go/scheduler v1.6.0/go.mod h1:SgeKVM7MIwPn3BqtcBntpLyrIJftQISRrYB5ZtT+KOk= +cloud.google.com/go/scheduler v1.7.0/go.mod h1:jyCiBqWW956uBjjPMMuX09n3x37mtyPJegEWKxRsn44= +cloud.google.com/go/secretmanager v1.6.0/go.mod h1:awVa/OXF6IiyaU1wQ34inzQNc4ISIDIrId8qE5QGgKA= +cloud.google.com/go/secretmanager v1.8.0/go.mod h1:hnVgi/bN5MYHd3Gt0SPuTPPp5ENina1/LxM+2W9U9J4= +cloud.google.com/go/secretmanager v1.9.0/go.mod h1:b71qH2l1yHmWQHt9LC80akm86mX8AL6X1MA01dW8ht4= +cloud.google.com/go/security v1.5.0/go.mod h1:lgxGdyOKKjHL4YG3/YwIL2zLqMFCKs0UbQwgyZmfJl4= +cloud.google.com/go/security v1.7.0/go.mod h1:mZklORHl6Bg7CNnnjLH//0UlAlaXqiG7Lb9PsPXLfD0= +cloud.google.com/go/security v1.8.0/go.mod h1:hAQOwgmaHhztFhiQ41CjDODdWP0+AE1B3sX4OFlq+GU= +cloud.google.com/go/security v1.9.0/go.mod h1:6Ta1bO8LXI89nZnmnsZGp9lVoVWXqsVbIq/t9dzI+2Q= +cloud.google.com/go/security v1.10.0/go.mod h1:QtOMZByJVlibUT2h9afNDWRZ1G96gVywH8T5GUSb9IA= +cloud.google.com/go/securitycenter v1.13.0/go.mod h1:cv5qNAqjY84FCN6Y9z28WlkKXyWsgLO832YiWwkCWcU= +cloud.google.com/go/securitycenter v1.14.0/go.mod h1:gZLAhtyKv85n52XYWt6RmeBdydyxfPeTrpToDPw4Auc= +cloud.google.com/go/securitycenter v1.15.0/go.mod h1:PeKJ0t8MoFmmXLXWm41JidyzI3PJjd8sXWaVqg43WWk= +cloud.google.com/go/securitycenter v1.16.0/go.mod h1:Q9GMaLQFUD+5ZTabrbujNWLtSLZIZF7SAR0wWECrjdk= +cloud.google.com/go/servicecontrol v1.4.0/go.mod h1:o0hUSJ1TXJAmi/7fLJAedOovnujSEvjKCAFNXPQ1RaU= +cloud.google.com/go/servicecontrol v1.5.0/go.mod h1:qM0CnXHhyqKVuiZnGKrIurvVImCs8gmqWsDoqe9sU1s= +cloud.google.com/go/servicedirectory v1.4.0/go.mod h1:gH1MUaZCgtP7qQiI+F+A+OpeKF/HQWgtAddhTbhL2bs= +cloud.google.com/go/servicedirectory v1.5.0/go.mod h1:QMKFL0NUySbpZJ1UZs3oFAmdvVxhhxB6eJ/Vlp73dfg= +cloud.google.com/go/servicedirectory v1.6.0/go.mod h1:pUlbnWsLH9c13yGkxCmfumWEPjsRs1RlmJ4pqiNjVL4= +cloud.google.com/go/servicedirectory v1.7.0/go.mod h1:5p/U5oyvgYGYejufvxhgwjL8UVXjkuw7q5XcG10wx1U= +cloud.google.com/go/servicemanagement v1.4.0/go.mod h1:d8t8MDbezI7Z2R1O/wu8oTggo3BI2GKYbdG4y/SJTco= +cloud.google.com/go/servicemanagement v1.5.0/go.mod h1:XGaCRe57kfqu4+lRxaFEAuqmjzF0r+gWHjWqKqBvKFo= +cloud.google.com/go/serviceusage v1.3.0/go.mod h1:Hya1cozXM4SeSKTAgGXgj97GlqUvF5JaoXacR1JTP/E= +cloud.google.com/go/serviceusage v1.4.0/go.mod h1:SB4yxXSaYVuUBYUml6qklyONXNLt83U0Rb+CXyhjEeU= +cloud.google.com/go/shell v1.3.0/go.mod h1:VZ9HmRjZBsjLGXusm7K5Q5lzzByZmJHf1d0IWHEN5X4= +cloud.google.com/go/shell v1.4.0/go.mod h1:HDxPzZf3GkDdhExzD/gs8Grqk+dmYcEjGShZgYa9URw= +cloud.google.com/go/spanner v1.41.0/go.mod h1:MLYDBJR/dY4Wt7ZaMIQ7rXOTLjYrmxLE/5ve9vFfWos= +cloud.google.com/go/speech v1.6.0/go.mod h1:79tcr4FHCimOp56lwC01xnt/WPJZc4v3gzyT7FoBkCM= +cloud.google.com/go/speech v1.7.0/go.mod h1:KptqL+BAQIhMsj1kOP2la5DSEEerPDuOP/2mmkhHhZQ= +cloud.google.com/go/speech v1.8.0/go.mod h1:9bYIl1/tjsAnMgKGHKmBZzXKEkGgtU+MpdDPTE9f7y0= +cloud.google.com/go/speech v1.9.0/go.mod h1:xQ0jTcmnRFFM2RfX/U+rk6FQNUF6DQlydUSyoooSpco= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= +cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= +cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= +cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= +cloud.google.com/go/storage v1.29.0 h1:6weCgzRvMg7lzuUurI4697AqIRPU1SvzHhynwpW31jI= +cloud.google.com/go/storage v1.29.0/go.mod h1:4puEjyTKnku6gfKoTfNOU/W+a9JyuVNxjpS5GBrB8h4= +cloud.google.com/go/storagetransfer v1.5.0/go.mod h1:dxNzUopWy7RQevYFHewchb29POFv3/AaBgnhqzqiK0w= +cloud.google.com/go/storagetransfer v1.6.0/go.mod h1:y77xm4CQV/ZhFZH75PLEXY0ROiS7Gh6pSKrM8dJyg6I= +cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= +cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= +cloud.google.com/go/talent v1.3.0/go.mod h1:CmcxwJ/PKfRgd1pBjQgU6W3YBwiewmUzQYH5HHmSCmM= +cloud.google.com/go/talent v1.4.0/go.mod h1:ezFtAgVuRf8jRsvyE6EwmbTK5LKciD4KVnHuDEFmOOA= +cloud.google.com/go/texttospeech v1.4.0/go.mod h1:FX8HQHA6sEpJ7rCMSfXuzBcysDAuWusNNNvN9FELDd8= +cloud.google.com/go/texttospeech v1.5.0/go.mod h1:oKPLhR4n4ZdQqWKURdwxMy0uiTS1xU161C8W57Wkea4= +cloud.google.com/go/tpu v1.3.0/go.mod h1:aJIManG0o20tfDQlRIej44FcwGGl/cD0oiRyMKG19IQ= +cloud.google.com/go/tpu v1.4.0/go.mod h1:mjZaX8p0VBgllCzF6wcU2ovUXN9TONFLd7iz227X2Xg= +cloud.google.com/go/trace v1.3.0/go.mod h1:FFUE83d9Ca57C+K8rDl/Ih8LwOzWIV1krKgxg6N0G28= +cloud.google.com/go/trace v1.4.0/go.mod h1:UG0v8UBqzusp+z63o7FK74SdFE+AXpCLdFb1rshXG+Y= +cloud.google.com/go/translate v1.3.0/go.mod h1:gzMUwRjvOqj5i69y/LYLd8RrNQk+hOmIXTi9+nb3Djs= +cloud.google.com/go/translate v1.4.0/go.mod h1:06Dn/ppvLD6WvA5Rhdp029IX2Mi3Mn7fpMRLPvXT5Wg= +cloud.google.com/go/video v1.8.0/go.mod h1:sTzKFc0bUSByE8Yoh8X0mn8bMymItVGPfTuUBUyRgxk= +cloud.google.com/go/video v1.9.0/go.mod h1:0RhNKFRF5v92f8dQt0yhaHrEuH95m068JYOvLZYnJSw= +cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= +cloud.google.com/go/videointelligence v1.7.0/go.mod h1:k8pI/1wAhjznARtVT9U1llUaFNPh7muw8QyOUpavru4= +cloud.google.com/go/videointelligence v1.8.0/go.mod h1:dIcCn4gVDdS7yte/w+koiXn5dWVplOZkE+xwG9FgK+M= +cloud.google.com/go/videointelligence v1.9.0/go.mod h1:29lVRMPDYHikk3v8EdPSaL8Ku+eMzDljjuvRs105XoU= +cloud.google.com/go/vision v1.2.0/go.mod h1:SmNwgObm5DpFBme2xpyOyasvBc1aPdjvMk2bBk0tKD0= +cloud.google.com/go/vision/v2 v2.2.0/go.mod h1:uCdV4PpN1S0jyCyq8sIM42v2Y6zOLkZs+4R9LrGYwFo= +cloud.google.com/go/vision/v2 v2.3.0/go.mod h1:UO61abBx9QRMFkNBbf1D8B1LXdS2cGiiCRx0vSpZoUo= +cloud.google.com/go/vision/v2 v2.4.0/go.mod h1:VtI579ll9RpVTrdKdkMzckdnwMyX2JILb+MhPqRbPsY= +cloud.google.com/go/vision/v2 v2.5.0/go.mod h1:MmaezXOOE+IWa+cS7OhRRLK2cNv1ZL98zhqFFZaaH2E= +cloud.google.com/go/vmmigration v1.2.0/go.mod h1:IRf0o7myyWFSmVR1ItrBSFLFD/rJkfDCUTO4vLlJvsE= +cloud.google.com/go/vmmigration v1.3.0/go.mod h1:oGJ6ZgGPQOFdjHuocGcLqX4lc98YQ7Ygq8YQwHh9A7g= +cloud.google.com/go/vmwareengine v0.1.0/go.mod h1:RsdNEf/8UDvKllXhMz5J40XxDrNJNN4sagiox+OI208= +cloud.google.com/go/vpcaccess v1.4.0/go.mod h1:aQHVbTWDYUR1EbTApSVvMq1EnT57ppDmQzZ3imqIk4w= +cloud.google.com/go/vpcaccess v1.5.0/go.mod h1:drmg4HLk9NkZpGfCmZ3Tz0Bwnm2+DKqViEpeEpOq0m8= +cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xXZmFiHmGE= +cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= +cloud.google.com/go/webrisk v1.6.0/go.mod h1:65sW9V9rOosnc9ZY7A7jsy1zoHS5W9IAXv6dGqhMQMc= +cloud.google.com/go/webrisk v1.7.0/go.mod h1:mVMHgEYH0r337nmt1JyLthzMr6YxwN1aAIEc2fTcq7A= +cloud.google.com/go/websecurityscanner v1.3.0/go.mod h1:uImdKm2wyeXQevQJXeh8Uun/Ym1VqworNDlBXQevGMo= +cloud.google.com/go/websecurityscanner v1.4.0/go.mod h1:ebit/Fp0a+FWu5j4JOmJEV8S8CzdTkAS77oDsiSqYWQ= +cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= +cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= +cloud.google.com/go/workflows v1.8.0/go.mod h1:ysGhmEajwZxGn1OhGOGKsTXc5PyxOc0vfKf5Af+to4M= +cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT3ujaO/WwSA= collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= -cosmossdk.io/api v0.2.6 h1:AoNwaLLapcLsphhMK6+o0kZl+D6MMUaHVqSdwinASGU= -cosmossdk.io/api v0.2.6/go.mod h1:u/d+GAxil0nWpl1XnQL8nkziQDIWuBDhv8VnDm/s6dI= +cosmossdk.io/api v0.3.1 h1:NNiOclKRR0AOlO4KIqeaG6PS6kswOMhHD0ir0SscNXE= +cosmossdk.io/api v0.3.1/go.mod h1:DfHfMkiNA2Uhy8fj0JJlOCYOBp4eWUUJ1te5zBGNyIw= cosmossdk.io/core v0.5.1 h1:vQVtFrIYOQJDV3f7rw4pjjVqc1id4+mE0L9hHP66pyI= cosmossdk.io/core v0.5.1/go.mod h1:KZtwHCLjcFuo0nmDc24Xy6CRNEL9Vl/MeimQ2aC7NLE= cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= +cosmossdk.io/log v1.1.0 h1:v0ogPHYeTzPcBTcPR1A3j1hkei4pZama8kz8LKlCMv0= +cosmossdk.io/log v1.1.0/go.mod h1:6zjroETlcDs+mm62gd8Ig7mZ+N+fVOZS91V17H+M4N4= cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= +cosmossdk.io/simapp v0.0.0-20230602123434-616841b9704d h1:G24nV8KQ5tcSLJEYPUEpKxuX4usvpQg5r7LhCLYPs1o= +cosmossdk.io/simapp v0.0.0-20230602123434-616841b9704d/go.mod h1:xbjky3L3DJEylaho6gXplkrMvJ5sFgv+qNX+Nn47bzY= +cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= +cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8MhhO9Hw= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= +filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= +filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw= git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9/go.mod h1:BVJwbDfVjCjoFiKrhkei6NdGcZYpkDkdyCdg1ukytRA= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= -github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= -github.com/CloudyKit/fastprinter v0.0.0-20170127035650-74b38d55f37a/go.mod h1:EFZQ978U7x8IRnstaskI3IysnWY5Ao3QgZUKOXlsAdw= -github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= -github.com/CloudyKit/jet v2.1.3-0.20180809161101-62edd43e4f88+incompatible/go.mod h1:HPYO+50pSWkPoj9Q/eq0aRGByCL6ScRlUmiEX5Zgm+w= -github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= +github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= +github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= -github.com/DataDog/zstd v1.5.0 h1:+K/VEwIAaPcHiMtQvpLD4lqW7f0Gk3xdYZmI1hD+CXo= github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= -github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= -github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= -github.com/Joker/jade v1.0.1-0.20190614124447-d475f43051e7/go.mod h1:6E6s8o2AE4KhCrqr6GRJjdC/gNfTdxkIXvuGZZda2VM= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= -github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= -github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= -github.com/Workiva/go-datastructures v1.0.53 h1:J6Y/52yX10Xc5JjXmGtWoSSxs3mZnGSaq37xZZh7Yig= -github.com/Workiva/go-datastructures v1.0.53/go.mod h1:1yZL+zfsztete+ePzZz/Zb1/t5BnDuE2Ya2MMGhzP6A= github.com/Zilliqa/gozilliqa-sdk v1.2.1-0.20201201074141-dd0ecada1be6/go.mod h1:eSYp2T6f0apnuW8TzhV3f6Aff2SE8Dwio++U4ha4yEM= github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -121,6 +469,9 @@ github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= +github.com/aws/aws-sdk-go v1.44.203 h1:pcsP805b9acL3wUqa4JR2vg1k2wnItkDYNvfmcy6F+U= +github.com/aws/aws-sdk-go v1.44.203/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y= @@ -131,11 +482,12 @@ github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1/go.mod h1:rLiOUrPLW/Er5kRcQ7 github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbEWkXs7QRTQpCLGaKIprQW0= github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM= github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= -github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= +github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= @@ -144,8 +496,8 @@ github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx2 github.com/btcsuite/btcd v0.0.0-20190315201642-aa6e0f35703c/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd v0.21.0-beta.0.20201114000516-e9c7a5ac6401/go.mod h1:Sv4JPQ3/M+teHz9Bo5jBpkNcP0x6r7rdihlNL/7tTAs= +github.com/btcsuite/btcd v0.22.1 h1:CnwP9LM/M9xuRrGSCGeMVs9iv09uMqwsVX7EeIpgV2c= github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= -github.com/btcsuite/btcd v0.22.2 h1:vBZ+lGGd1XubpOWO67ITJpAEsICWhA0YzqkcpkgNBfo= github.com/btcsuite/btcd/btcec/v2 v2.1.2/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= @@ -165,6 +517,7 @@ github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= +github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= @@ -174,49 +527,49 @@ github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInq github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= +github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= +github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= +github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/chzyer/test v1.0.0 h1:p3BQDXSxOhOG0P9z6/hGnII4LGiEPOYBhs8asl/fC04= +github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8= github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3hQ7C/YWzIGLeu5c304= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= +github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.0/go.mod h1:5Ib8Meh+jk1RlHIXej6Pzevx/NLlNvQB9pmSBZErGA4= -github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= -github.com/cockroachdb/errors v1.6.1/go.mod h1:tm6FTP5G81vwJ5lC0SizQo374JNCOPrHyXGitRJoDqM= -github.com/cockroachdb/errors v1.8.1/go.mod h1:qGwQn6JmZ+oMjuLwjWzUNqblqk0xl4CVV3SQbGwK7Ac= -github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= -github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= -github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= -github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v0.0.0-20220817183557-09c6e030a677 h1:qbb/AE938DFhOajUYh9+OXELpSF9KZw2ZivtmW6eX1Q= -github.com/cockroachdb/pebble v0.0.0-20220817183557-09c6e030a677/go.mod h1:890yq1fUb9b6dGNwssgeUO5vQV9qfXnCPxAJhBQfXw0= -github.com/cockroachdb/redact v1.0.8/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= -github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2/go.mod h1:8BT+cPK6xvFOcRlk0R8eg+OTkcqI6baNH4xAkpiYVvQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= github.com/coinbase/kryptology v1.8.0/go.mod h1:RYXOAPdzOGUe3qlSFkMGn58i3xUA8hmxYHksuq+8ciI= github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZr9ZvoCcA= github.com/coinbase/rosetta-sdk-go v0.7.9/go.mod h1:0/knutI7XGVqXmmH4OQD8OckFrbQ8yMsUZTG7FXCR2M= -github.com/cometbft/cometbft v0.34.29 h1:Q4FqMevP9du2pOgryZJHpDV2eA6jg/kMYxBj9ZTY6VQ= -github.com/cometbft/cometbft v0.34.29/go.mod h1:L9shMfbkZ8B+7JlwANEr+NZbBcn+hBpwdbeYvA5rLCw= -github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= -github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= +github.com/cometbft/cometbft v0.37.1 h1:KLxkQTK2hICXYq21U2hn1W5hOVYUdQgDQ1uB+90xPIg= +github.com/cometbft/cometbft v0.37.1/go.mod h1:Y2MMMN//O5K4YKd8ze4r9jmk4Y7h0ajqILXbH5JQFVs= +github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= +github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak= github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ= @@ -225,46 +578,48 @@ github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1 github.com/consensys/gnark-crypto v0.5.3/go.mod h1:hOdPlWQV1gDLp7faZVeg8Y0iEPFaOUnCc4XeCCk96p0= github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= -github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cosmos/btcutil v1.0.4 h1:n7C2ngKXo7UC9gNyMNLbzqz7Asuf+7Qv4gnX/rOdQ44= -github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU= -github.com/cosmos/cosmos-db v0.0.0-20221226095112-f3c38ecb5e32 h1:zlCp9n3uwQieELltZWHRmwPmPaZ8+XoL2Sj+A2YJlr8= -github.com/cosmos/cosmos-db v0.0.0-20221226095112-f3c38ecb5e32/go.mod h1:kwMlEC4wWvB48zAShGKVqboJL6w4zCLesaNQ3YLU2BQ= -github.com/cosmos/cosmos-proto v1.0.0-beta.1 h1:iDL5qh++NoXxG8hSy93FdYJut4XfgbShIocllGaXx/0= -github.com/cosmos/cosmos-proto v1.0.0-beta.1/go.mod h1:8k2GNZghi5sDRFw/scPL8gMSowT1vDA+5ouxL8GjaUE= -github.com/cosmos/cosmos-sdk v0.45.16-ics h1:KsPigLNmdyyQMktAsJzW42eBFsq1uajhQF7rlnHDUgM= -github.com/cosmos/cosmos-sdk v0.45.16-ics/go.mod h1:bScuNwWAP0TZJpUf+SHXRU3xGoUPp+X9nAzfeIXts40= +github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= +github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= +github.com/cosmos/cosmos-proto v1.0.0-beta.2 h1:X3OKvWgK9Gsejo0F1qs5l8Qn6xJV/AzgIWR2wZ8Nua8= +github.com/cosmos/cosmos-proto v1.0.0-beta.2/go.mod h1:+XRCLJ14pr5HFEHIUcn51IKXD1Fy3rkEQqt4WqmN4V0= +github.com/cosmos/cosmos-sdk v0.47.3 h1:r0hGmZoAzP2D+MaPaFGHwAaTdFQq3pNpHaUp1BsffbM= +github.com/cosmos/cosmos-sdk v0.47.3/go.mod h1:c4OfLdAykA9zsj1CqrxBRqXzVz48I++JSvIMPSPcEmk= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= -github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y= -github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= -github.com/cosmos/iavl v0.19.5 h1:rGA3hOrgNxgRM5wYcSCxgQBap7fW82WZgY78V9po/iY= -github.com/cosmos/iavl v0.19.5/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= -github.com/cosmos/ibc-go/v4 v4.4.2 h1:PG4Yy0/bw6Hvmha3RZbc53KYzaCwuB07Ot4GLyzcBvo= -github.com/cosmos/ibc-go/v4 v4.4.2/go.mod h1:j/kD2JCIaV5ozvJvaEkWhLxM2zva7/KTM++EtKFYcB8= -github.com/cosmos/interchain-security/v2 v2.0.0 h1:FQeU+9hYrK+XF4bRfiFgn+h7JJoM71KQKpeKYNxpjA4= -github.com/cosmos/interchain-security/v2 v2.0.0/go.mod h1:3AHbp93smkSJFX6PW9OfYDJtU1i/Ty0yv/FVbF2dO20= +github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= +github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= +github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= +github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= +github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= +github.com/cosmos/iavl v0.20.0 h1:fTVznVlepH0KK8NyKq8w+U7c2L6jofa27aFX6YGlm38= +github.com/cosmos/iavl v0.20.0/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= +github.com/cosmos/ibc-go/v7 v7.1.0 h1:SCLgs7tqVnzdIDO5MRLgovAnc696vTTKl+8qsTu8IMM= +github.com/cosmos/ibc-go/v7 v7.1.0/go.mod h1:7MptlWeIyqmDiuJeRAFqBvXKY8Hybd+rF8vMSmGd2zg= +github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= +github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= +github.com/cosmos/interchain-security/v3 v3.0.0-rc0 h1:Rm2oMSCod27YkEHFZu5BqjkN3HYtxOrcuHDKMYJBDtw= +github.com/cosmos/interchain-security/v3 v3.0.0-rc0/go.mod h1:HKHw9u4xMm5QJV76A03ORAXB2zisgpcunXZSca8TBdg= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= github.com/cosmos/ledger-cosmos-go v0.12.2 h1:/XYaBlE2BJxtvpkHiBm97gFGSGmYGKunKyF3nNqAXZA= github.com/cosmos/ledger-cosmos-go v0.12.2/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI= +github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM= +github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creachadair/taskgroup v0.3.2 h1:zlfutDS+5XG40AOxcHDSThxKzns8Tnr9jnr6VqkYlkM= -github.com/creachadair/taskgroup v0.3.2/go.mod h1:wieWwecHVzsidg2CsUnFinW1faVN4+kq+TDlRJQ0Wbk= +github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJFxv2Li8= +github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= -github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= @@ -279,20 +634,20 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE9iAUlWl9Al3M= github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.0.3/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= -github.com/dgraph-io/ristretto v0.1.0 h1:Jv3CGQHp9OjuMBSne1485aDpUkTKEcUqF+jm/LuerPI= -github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug= +github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= +github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= @@ -301,21 +656,16 @@ github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8 github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= -github.com/docker/cli v20.10.17+incompatible h1:eO2KS7ZFeov5UJeaDmIs1NFEDRf32PaqRpvoEkKBy5M= -github.com/docker/cli v20.10.17+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v20.10.24+incompatible h1:Ugvxm7a8+Gz6vqQYQQ2W7GYq5EUPaAiuPgIfVyI3dYE= -github.com/docker/docker v20.10.24+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= -github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= -github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dop251/goja v0.0.0-20211011172007-d99e4b8cbf48/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= @@ -323,23 +673,18 @@ github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1 github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= +github.com/envoyproxy/go-control-plane v0.10.3/go.mod h1:fJJn/j26vwOu972OllsvAgJJM//w9BV6Fxbg2LuVd34= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= +github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= +github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w= github.com/ethereum/go-ethereum v1.10.17/go.mod h1:Lt5WzjM07XlXc95YzrhosmR4J9Ahd6X2wyEV2SvGhk0= -github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= -github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= -github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= -github.com/flosch/pongo2 v0.0.0-20190707114632-bbf5a6c351f4/go.mod h1:T9YF2M40nIgbVgp3rreNmTged+9HrbNTIQf1PsaIiTA= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= @@ -348,16 +693,12 @@ github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= -github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= -github.com/getsentry/sentry-go v0.17.0 h1:UustVWnOoDFHBS7IJUB2QK/nB5pap748ZEp0swnQJak= -github.com/getsentry/sentry-go v0.17.0/go.mod h1:B82dxtBvxG0KaPD8/hfSV+VcHD+Lg/xUS4JuQn1P4cM= -github.com/ghemawat/stream v0.0.0-20171120220530-696b145b53b9/go.mod h1:106OIgooyS7OzLDOpUGgm9fA3bQENb/cFSyyBmMoJDs= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= @@ -365,10 +706,7 @@ github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= -github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -377,16 +715,13 @@ github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= +github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= +github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= @@ -397,11 +732,10 @@ github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/j github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= +github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc= -github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= @@ -415,35 +749,43 @@ github.com/gobwas/ws v1.1.0 h1:7RFti/xnNkMJnrK7D1yQ/iCIB5OrrY/54/H930kIbHA= github.com/gobwas/ws v1.1.0/go.mod h1:nzvNcVha5eUziGrbxFCo6qFIojQHjJV5cLYIbezhfL0= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= +github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v4.3.0+incompatible h1:CaSVZxm5B+7o45rtab4jC2G37WGYX1zQfuU2i6DSvnc= -github.com/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0= -github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/mbic= -github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= +github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= +github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= -github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= +github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= +github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -462,6 +804,7 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= @@ -470,7 +813,6 @@ github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= -github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= @@ -484,17 +826,24 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -507,15 +856,39 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= +github.com/google/s2a-go v0.1.3 h1:FAgZmpLl/SXurPEZyCMPBIiiYeTbqfjlbdnCNTAkbGE= +github.com/google/s2a-go v0.1.3/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= +github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= +github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= +github.com/googleapis/enterprise-certificate-proxy v0.2.3 h1:yk9/cqRKtT9wXZSsRH9aurXEpJX+U6FLtpYTdC3R06k= +github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= +github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= +github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= +github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= +github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= +github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= +github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= +github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= +github.com/googleapis/gax-go/v2 v2.8.0 h1:UBtEZqx1bjXtOQ5BVTkuYghXrr3N4V123VKJK67vJZc= +github.com/googleapis/gax-go/v2 v2.8.0/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= +github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= @@ -526,25 +899,21 @@ github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2z github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= -github.com/gravity-devs/liquidity v1.6.0-forced-withdrawal-rc1 h1:bPjLY/nctCAPnQydlCVY3t95AUPn7QfBJKqN5aNzpJk= -github.com/gravity-devs/liquidity v1.6.0-forced-withdrawal-rc1/go.mod h1:zyUTghVndwWDRePcf9mHDCvSBzjvyCyDvnZ/tPAl3PA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.2 h1:ERKrevVTnCw3Wu4I3mtR15QU3gtWy86cBo6De0jEohg= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.2/go.mod h1:chrfS3YoLAlKTRE5cFWvCbt8uGAjshktT4PveTUpsFQ= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= @@ -558,6 +927,10 @@ github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brv github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-getter v1.7.1 h1:SWiSWN/42qdpR0MdhaOc/bLR48PLuP1ZQtYLRlM69uY= +github.com/hashicorp/go-getter v1.7.1/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= @@ -565,12 +938,15 @@ github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iP github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= +github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -583,23 +959,23 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 h1:aSVUgRRRtOrZOC1fYmY9gV0e9z/Iu+xNVSASWjsuyGU= -github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3/go.mod h1:5PC6ZNPde8bBqU/ewGZig35+UIZtw9Ytxez8/q5ZyFE= +github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= +github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3c= +github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0JrPVhn/06U= +github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= +github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/huin/goupnp v1.0.3-0.20220313090229-ca81a64b4204/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= -github.com/hydrogen18/memlistener v0.0.0-20141126152155-54553eb933fb/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= -github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= github.com/iancoleman/orderedmap v0.2.0 h1:sq1N/TFpYH++aViPcaKjys3bDClUEU7s5B+z6jq8pNA= github.com/iancoleman/orderedmap v0.2.0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA= +github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM= -github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= -github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= @@ -617,19 +993,15 @@ github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19y github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= -github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= -github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= -github.com/iris-contrib/i18n v0.0.0-20171121225848-987a633949d0/go.mod h1:pMCz62A0xJL6I+umB2YTlFRwWXaDFA0jy+5HzGiJjqI= -github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= -github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g= -github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jhump/protoreflect v1.13.1-0.20220928232736-101791cb1b4c h1:XImQJfpJLmGEEd8ll5yPVyL/aEvmgGHW4WYTyNseLOM= +github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= @@ -641,45 +1013,30 @@ github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= -github.com/juju/loggo v0.0.0-20180524022052-584905176618/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= -github.com/juju/testing v0.0.0-20180920084828-472a3e8b2073/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= -github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= -github.com/kataras/golog v0.0.9/go.mod h1:12HJgwBIZFNGL0EJnMRhmvGA0PQGx8VFwrZtM4CqbAk= -github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= -github.com/kataras/iris/v12 v12.0.1/go.mod h1:udK4vLQKkdDqMGJJVd/msuMtN6hpYJhg/lSzuxjhO+U= -github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= -github.com/kataras/neffos v0.0.10/go.mod h1:ZYmJC07hQPW67eKuzlfY7SO3bC0mw83A3j6im82hfqw= -github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE= -github.com/kataras/pio v0.0.0-20190103105442-ea782b38602d/go.mod h1:NV88laa9UiiDuX9AhMbDPkGYSPugBOV6yTZB1l2K9Z0= -github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro= -github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.15.11 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= +github.com/klauspost/compress v1.16.3 h1:XuJt9zzcnaz6a16/OU53ZjWp/v7/42WcR5t2a0PcNQY= +github.com/klauspost/compress v1.16.3/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -690,15 +1047,12 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/labstack/echo/v4 v4.1.11/go.mod h1:i541M3Fj6f76NZtHSj7TXnyM8n2gaodfvfxNnFqi74g= github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= -github.com/labstack/echo/v4 v4.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= @@ -710,21 +1064,24 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.7.10 h1:dz7RY7GnFUA+GJO6jodyxgkUeGMEkPp3ikt9hAcNGEw= -github.com/linxGnu/grocksdb v1.7.10/go.mod h1:0hTf+iA+GOr0jDX4CgIYyJZxqOH9XlBh6KVj8+zmF34= +github.com/linxGnu/grocksdb v1.7.16 h1:Q2co1xrpdkr5Hx3Fp+f+f7fRGhQFQhvi/+226dtLmA8= +github.com/linxGnu/grocksdb v1.7.16/go.mod h1:JkS7pl5qWpGpuVb3bPqTz8nC12X3YtPZT+Xq7+QfQo4= github.com/lucasjones/reggen v0.0.0-20180717132126-cdb49ff09d77/go.mod h1:5ELEyG+X8f+meRWHuqUOewBOhvHkl7M76pdGEansxW4= +github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= +github.com/lyft/protoc-gen-star v0.6.1/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= +github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= @@ -735,21 +1092,17 @@ github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2y github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= +github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mediocregopher/mediocre-go-lib v0.0.0-20181029021733-cb65787f37ed/go.mod h1:dSsfyI2zABAdhcbvkXqgxOxrCsbYeHCPgrZkku60dSg= -github.com/mediocregopher/radix/v3 v3.3.0/go.mod h1:EmfVyvspXz1uZEyPBMyGK+kjWiKQGvsUt6O3Pj+LDCQ= -github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= -github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= @@ -758,8 +1111,11 @@ github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= +github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= @@ -770,8 +1126,6 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= -github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae h1:O4SWKdcHVCvYqyDV+9CJA1fcDN2L11Bule0iFy3YlAI= -github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -780,7 +1134,6 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= -github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= @@ -794,9 +1147,7 @@ github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= -github.com/nats-io/nats.go v1.8.1/go.mod h1:BrFz9vVn0fU3AcH9Vn4Kd7W0NpJ651tD5omQ3M8LwxM= github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nkeys v0.0.2/go.mod h1:dab7URMsZm6Z/jp9Z5UGa87Uutgc2mVpXLC4B7TDb/4= github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= @@ -812,23 +1163,23 @@ github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:v github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= -github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= -github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= github.com/opencontainers/runc v1.1.5 h1:L44KXEpKmfWDcS02aeGm8QNTFXTo2D+8MYGDIJ/GDEs= github.com/opencontainers/runc v1.1.5/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= @@ -843,9 +1194,6 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= -github.com/ory/dockertest/v3 v3.10.0 h1:4K3z2VMe8Woe++invjaTB7VRyQXQy5UY+loujO4aNE4= -github.com/ory/dockertest/v3 v3.10.0/go.mod h1:nr57ZbRWMqfsdGdFNLHz5jjNdDb7VVFnzAeW1n5N1Lg= -github.com/otiai10/copy v1.6.0 h1:IinKAryFFuPONZ7cm6T6E2QX/vcJwSnlaA5lfoaXIiQ= github.com/oxyno-zeta/gomock-extra-matcher v1.1.0 h1:Yyk5ov0ZPKBXtVEeIWtc4J2XVrHuNoIK+0F2BUJgtsc= github.com/oxyno-zeta/gomock-extra-matcher v1.1.0/go.mod h1:UMGTHYEmJ1dRq8LDZ7VTAYO4nqM3GD1UGC3RJEUxEz0= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= @@ -861,20 +1209,19 @@ github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNc github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= +github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 h1:hDSdbBuw3Lefr6R18ax0tZ2BJeNB3NehB3trOwYBsdU= +github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= -github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= -github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -886,8 +1233,6 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -906,31 +1251,23 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= -github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= +github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= +github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= -github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= +github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= +github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/regen-network/cosmos-proto v0.3.1 h1:rV7iM4SSFAagvy8RiyhiACbWEGotmqzywPxOvwMdxcg= -github.com/regen-network/cosmos-proto v0.3.1/go.mod h1:jO0sVX6a1B36nmE8C9xBFXpNwWejXC7QqCOnH3O0+YM= github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGnWA97M= -github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= -github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= @@ -938,32 +1275,26 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U= -github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.27.0 h1:1T7qCieN22GVc8S4Q2yuexzBb1EqjbgjSH9RohbMjKs= -github.com/rs/zerolog v1.27.0/go.mod h1:7frBqO0oezxmnO7GF86FY++uy8I0Tk/If5ni1G9Qc0U= +github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= +github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc= +github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= -github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= -github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -972,7 +1303,6 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -981,6 +1311,9 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= +github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= @@ -1001,8 +1334,8 @@ github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DM github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= -github.com/strangelove-ventures/packet-forward-middleware/v4 v4.0.5 h1:KKUqeGhVBK38+1LwThC8IeIcsJZ6COX5kvhiJroFqCM= -github.com/strangelove-ventures/packet-forward-middleware/v4 v4.0.5/go.mod h1:4zAtg449/JISRmf+sbmqolqSLP+QJBh+EtWkWtt/AKE= +github.com/strangelove-ventures/packet-forward-middleware/v7 v7.0.0-20230412224111-136e94e98861 h1:amfLQujq8LwWjuadoMDX7lngka6NXcvk4ugkWZ4m7o0= +github.com/strangelove-ventures/packet-forward-middleware/v7 v7.0.0-20230412224111-136e94e98861/go.mod h1:DJNSVK8NCYHM+aZHCFkcAqPwjzwHYAjhjSMlhAGtJ3c= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= @@ -1019,85 +1352,70 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= +github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= +github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tendermint/tm-db v0.6.7 h1:fE00Cbl0jayAoqlExN6oyQJ7fR/ZtoVOmvPJ//+shu8= -github.com/tendermint/tm-db v0.6.7/go.mod h1:byQDzFkZV1syXr/ReXS808NxA2xvyuuVgXOJ/088L6I= -github.com/tidwall/btree v1.5.0 h1:iV0yVY/frd7r6qGBXfEYs7DH0gTDgrKTrDjS7xt/IyQ= -github.com/tidwall/btree v1.5.0/go.mod h1:LGm8L/DZjPLmeWGjv5kFrY8dL4uVhMmzmmLYmsObdKE= +github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= +github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/tidwall/gjson v1.12.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/gjson v1.14.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tidwall/sjson v1.2.4/go.mod h1:098SZ494YoMWPmMO6ct4dcFnqxwj9r/gF0Etp19pSNM= github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= -github.com/tinylib/msgp v1.1.5/go.mod h1:eQsjooMTnV42mHu917E26IogZ2930nFyBQdofk10Udg= github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI= github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZFu0T9wgjM= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31/go.mod h1:onvgF043R+lC5RZ8IT9rBXDaEDnpnw/Cl+HFiw+v/7Q= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= github.com/tyler-smith/go-bip39 v1.0.2/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo= github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= +github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= +github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= -github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= -github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= github.com/ybbus/jsonrpc v2.1.2+incompatible/go.mod h1:XJrh1eMSzdIYFbM08flv0wp5G35eRniyeGut1z+LSiE= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= -go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= +go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= +go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= @@ -1107,6 +1425,11 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -1125,10 +1448,10 @@ golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -1139,6 +1462,9 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= @@ -1156,9 +1482,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20200513190911-00229845015e/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20221205204356-47842c84f3db h1:D/cFflL63o2KSLJIwjlcIt8PR064j/xsmdEJL/YvY/o= -golang.org/x/exp v0.0.0-20221205204356-47842c84f3db/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc h1:mCRnTeVUjcrhlRmO0VK8a6k6Rrf6TF9htwo2pJVSjIU= +golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1184,8 +1509,11 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= -golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1197,7 +1525,6 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -1207,7 +1534,6 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1228,20 +1554,38 @@ golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1253,8 +1597,26 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= +golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= +golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= +golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1266,7 +1628,11 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1322,7 +1688,6 @@ golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1331,16 +1696,20 @@ golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1348,24 +1717,49 @@ golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210909193231-528a39cd75f3/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220315194320-039c03cc5b86/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1377,6 +1771,11 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1385,22 +1784,23 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20220922220347-f3bd1da661af/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181221001348-537d06c36207/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1436,7 +1836,6 @@ golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -1446,19 +1845,27 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= -gonum.org/v1/gonum v0.8.2 h1:CCXrcPKiGGotvnN6jfUsKk4rRqm7q09/YbKb5xCEvtM= -gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= @@ -1482,14 +1889,48 @@ google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz513 google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= +google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= +google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= +google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= +google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= +google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= +google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= +google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= +google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= +google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= +google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= +google.golang.org/api v0.77.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= +google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= +google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= +google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= +google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= +google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.93.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI= +google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= +google.golang.org/api v0.99.0/go.mod h1:1YOf74vkVndF7pG6hIHuINsM7eWwpVTAfNMNiL91A08= +google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= +google.golang.org/api v0.102.0/go.mod h1:3VFl6/fzoA+qNuS1N1/VfXY4LjoXN/wzeIp7TweWwGo= +google.golang.org/api v0.103.0/go.mod h1:hGtW6nK1AC+d9si/UBhw8Xli+QMOf6xyNAyJw4qU9w0= +google.golang.org/api v0.122.0 h1:zDobeejm3E7pEG1mNHvdxvjs5XJoCMzyNH+CmwL94Es= +google.golang.org/api v0.122.0/go.mod h1:gcitW0lvnyWjSp9nKxAbdHKIZ6vF4aajGueeslZOyms= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1514,7 +1955,6 @@ google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200324203455-a04cca1dde73/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= @@ -1533,12 +1973,89 @@ google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= +google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= +google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= +google.golang.org/genproto v0.0.0-20220329172620-7be39ac1afc7/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220628213854-d9e0b6570c03/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= +google.golang.org/genproto v0.0.0-20220722212130-b98a9ff5e252/go.mod h1:GkXuJDJ6aQ7lnJcRF+SJVgFdQhypqgl3LB1C9vabdRE= +google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= +google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220817144833-d7fd3f11b9b1/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220829144015-23454907ede3/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220829175752-36a9c930ecbf/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220913154956-18f8339a66a5/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220914142337-ca0e39ece12f/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220916172020-2692e8806bfa/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220919141832-68c03719ef51/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220920201722-2b89144ce006/go.mod h1:ht8XFiar2npT/g4vkk7O0WYS1sHOHbdujxbEp7CJWbw= +google.golang.org/genproto v0.0.0-20220926165614-551eb538f295/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= +google.golang.org/genproto v0.0.0-20220926220553-6981cbe3cfce/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI= +google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqwhZAwq4wsRUaVG555sVgsNmIjRtO7t/JH29U= +google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= +google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= +google.golang.org/genproto v0.0.0-20221024153911-1573dae28c9c/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= +google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= +google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= +google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+E5bKwmfYo09AXuVN4dD894kIKUFmVbP2/Fo= +google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221117204609-8f9c96812029/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221201164419-0e50fba7f41c/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd/go.mod h1:cTsE614GARnxrLsqKREzmNYJACSWWpAWdNMwnD7c2BE= +google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= -google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= -google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.54.0 h1:EhTqbhiYeixwWQtAEZAxmV9MGqcjEU2mFx52xCzNyag= +google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1553,24 +2070,23 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= @@ -1588,14 +2104,12 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1607,7 +2121,8 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -pgregory.net/rapid v0.5.3 h1:163N50IHFqr1phZens4FQOdPgfJscR7a562mjQqeo4M= +pgregory.net/rapid v0.5.5 h1:jkgx1TjbQPD/feRoK+S/mXw9e1uj6WilpHrXJowi6oA= +pgregory.net/rapid v0.5.5/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= @@ -1615,4 +2130,5 @@ rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/proto/buf.gen.gogo.yaml b/proto/buf.gen.gogo.yaml new file mode 100644 index 0000000000..855ea251ad --- /dev/null +++ b/proto/buf.gen.gogo.yaml @@ -0,0 +1,8 @@ +version: v1 +plugins: + - name: gocosmos + out: .. + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types + - name: grpc-gateway + out: .. + opt: logtostderr=true,allow_colon_final_segments=true \ No newline at end of file diff --git a/proto/buf.lock b/proto/buf.lock new file mode 100644 index 0000000000..92d4c31f60 --- /dev/null +++ b/proto/buf.lock @@ -0,0 +1,33 @@ +# Generated by buf. DO NOT EDIT. +version: v1 +deps: + - remote: buf.build + owner: cosmos + repository: cosmos-proto + commit: 1935555c206d4afb9e94615dfd0fad31 + digest: shake256:c74d91a3ac7ae07d579e90eee33abf9b29664047ac8816500cf22c081fec0d72d62c89ce0bebafc1f6fec7aa5315be72606717740ca95007248425102c365377 + - remote: buf.build + owner: cosmos + repository: cosmos-sdk + commit: 954f7b05f38440fc8250134b15adec47 + digest: shake256:2ab4404fd04a7d1d52df0e2d0f2d477a3d83ffd88d876957bf3fedfd702c8e52833d65b3ce1d89a3c5adf2aab512616b0e4f51d8463f07eda9a8a3317ee3ac54 + - remote: buf.build + owner: cosmos + repository: gogo-proto + commit: 5e5b9fdd01804356895f8f79a6f1ddc1 + digest: shake256:0b85da49e2e5f9ebc4806eae058e2f56096ff3b1c59d1fb7c190413dd15f45dd456f0b69ced9059341c80795d2b6c943de15b120a9e0308b499e43e4b5fc2952 + - remote: buf.build + owner: cosmos + repository: ibc + commit: fbb44f5ad3194450af479a615fa715d9 + digest: shake256:3fbf41c96089017ebf3b5143f78de0d531f604cb11da1bc98b2104eb6dd295b8a49f5f35c60b8389ba50bfa08959da905109324099e75ece9afd8e4087b14019 + - remote: buf.build + owner: cosmos + repository: ics23 + commit: 55085f7c710a45f58fa09947208eb70b + digest: shake256:9bf0bc495b5a11c88d163d39ef521bc4b00bc1374a05758c91d82821bdc61f09e8c2c51dda8452529bf80137f34d852561eacbe9550a59015d51cecb0dacb628 + - remote: buf.build + owner: googleapis + repository: googleapis + commit: cc916c31859748a68fd229a3c8d7a2e8 + digest: shake256:469b049d0eb04203d5272062636c078decefc96fec69739159c25d85349c50c34c7706918a8b216c5c27f76939df48452148cff8c5c3ae77fa6ba5c25c1b8bf8 diff --git a/proto/buf.yaml b/proto/buf.yaml new file mode 100644 index 0000000000..d8b1f9ce8e --- /dev/null +++ b/proto/buf.yaml @@ -0,0 +1,30 @@ +# Generated by "buf config migrate-v1beta1". Edit as necessary, and +# remove this comment when you're finished. +# +# This module represents the "proto" root found in +# the previous configuration. +version: v1 +name: buf.build/cosmos/gaia +deps: + - buf.build/cosmos/gogo-proto + - buf.build/cosmos/cosmos-sdk:v0.47.0 + - buf.build/cosmos/ibc:fbb44f5ad3194450af479a615fa715d9 + - buf.build/googleapis/googleapis + - buf.build/cosmos/ics23:b1abd8678aab07165efd453c96796a179eb3131f + +breaking: + use: + - FILE +lint: + use: + - DEFAULT + - COMMENTS + - FILE_LOWER_SNAKE_CASE + except: + - UNARY_RPC + - COMMENT_FIELD + - SERVICE_SUFFIX + - PACKAGE_VERSION_SUFFIX + - RPC_REQUEST_STANDARD_NAME + ignore: + - tendermint \ No newline at end of file diff --git a/proto/gaia/globalfee/v1beta1/genesis.proto b/proto/gaia/globalfee/v1beta1/genesis.proto index 93f3196521..8368518261 100644 --- a/proto/gaia/globalfee/v1beta1/genesis.proto +++ b/proto/gaia/globalfee/v1beta1/genesis.proto @@ -1,43 +1,47 @@ syntax = "proto3"; -package gaia.globalfee.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; - -option go_package = "github.com/cosmos/gaia/x/globalfee/types"; - -// GenesisState - initial state of module -message GenesisState { - // Params of this module - Params params = 1 [ - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "params,omitempty" - ]; -} - -// Params defines the set of module parameters. -message Params { - // minimum_gas_prices stores the minimum gas price(s) for all TX on the chain. - // When multiple coins are defined then they are accepted alternatively. - // The list must be sorted by denoms asc. No duplicate denoms or zero amount - // values allowed. For more information see - // https://docs.cosmos.network/main/modules/auth#concepts - repeated cosmos.base.v1beta1.DecCoin minimum_gas_prices = 1 [ - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "minimum_gas_prices,omitempty", - (gogoproto.moretags) = "yaml:\"minimum_gas_prices\"", - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" - ]; - - // bypass_min_fee_msg_types defines a list of message type urls - // that are free of fee charge. - repeated string bypass_min_fee_msg_types = 2 [ - (gogoproto.jsontag) = "bypass_min_fee_msg_types,omitempty", - (gogoproto.moretags) = "yaml:\"bypass_min_fee_msg_types\"" - ]; - - // max_total_bypass_min_fee_msg_gas_usage defines the total maximum gas usage - // allowed for a transaction containing only messages of types in bypass_min_fee_msg_types - // to bypass fee charge. - uint64 max_total_bypass_min_fee_msg_gas_usage = 3; -} +// package gaia.globalfee.v1beta1; +// +// import "gogoproto/gogo.proto"; +// import "cosmos/base/v1beta1/coin.proto"; +// +// option go_package = "github.com/cosmos/gaia/x/globalfee/types"; +// +//// GenesisState - initial state of module +// message GenesisState { +// // Params of this module +// Params params = 1 [ +// (gogoproto.nullable) = false, +// (gogoproto.jsontag) = "params,omitempty" +// ]; +// } +// +//// Params defines the set of module parameters. +// message Params { +// // minimum_gas_prices stores the minimum gas price(s) for all TX on the +// chain. +// // When multiple coins are defined then they are accepted alternatively. +// // The list must be sorted by denoms asc. No duplicate denoms or zero +// amount +// // values allowed. For more information see +// // https://docs.cosmos.network/main/modules/auth#concepts +// repeated cosmos.base.v1beta1.DecCoin minimum_gas_prices = 1 [ +// (gogoproto.nullable) = false, +// (gogoproto.jsontag) = "minimum_gas_prices,omitempty", +// (gogoproto.moretags) = "yaml:\"minimum_gas_prices\"", +// (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" +// ]; +// +// // bypass_min_fee_msg_types defines a list of message type urls +// // that are free of fee charge. +// repeated string bypass_min_fee_msg_types = 2 [ +// (gogoproto.jsontag) = "bypass_min_fee_msg_types,omitempty", +// (gogoproto.moretags) = "yaml:\"bypass_min_fee_msg_types\"" +// ]; +// +// // max_total_bypass_min_fee_msg_gas_usage defines the total maximum gas +// usage +// // allowed for a transaction containing only messages of types in +// bypass_min_fee_msg_types +// // to bypass fee charge. +// uint64 max_total_bypass_min_fee_msg_gas_usage = 3; +// } diff --git a/proto/gaia/globalfee/v1beta1/query.proto b/proto/gaia/globalfee/v1beta1/query.proto index ef1bf4b5e1..e6fb7f592c 100644 --- a/proto/gaia/globalfee/v1beta1/query.proto +++ b/proto/gaia/globalfee/v1beta1/query.proto @@ -1,27 +1,27 @@ syntax = "proto3"; -package gaia.globalfee.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "gaia/globalfee/v1beta1/genesis.proto"; - -option go_package = "github.com/cosmos/gaia/x/globalfee/types"; - -// Query defines the gRPC querier service. -service Query { - rpc Params(QueryParamsRequest) - returns (QueryParamsResponse) { - option (google.api.http).get = - "/gaia/globalfee/v1beta1/params"; - } -} - -// QueryMinimumGasPricesRequest is the request type for the -// Query/MinimumGasPrices RPC method. -message QueryParamsRequest {} - -// QueryMinimumGasPricesResponse is the response type for the -// Query/MinimumGasPrices RPC method. -message QueryParamsResponse { - Params params = 1 [(gogoproto.nullable) = false]; -} +// package gaia.globalfee.v1beta1; +// +// import "gogoproto/gogo.proto"; +// import "google/api/annotations.proto"; +// import "gaia/globalfee/v1beta1/genesis.proto"; +// +// option go_package = "github.com/cosmos/gaia/x/globalfee/types"; +// +//// Query defines the gRPC querier service. +// service Query { +// rpc Params(QueryParamsRequest) +// returns (QueryParamsResponse) { +// option (google.api.http).get = +// "/gaia/globalfee/v1beta1/params"; +// } +// } +// +//// QueryMinimumGasPricesRequest is the request type for the +//// Query/MinimumGasPrices RPC method. +// message QueryParamsRequest {} +// +//// QueryMinimumGasPricesResponse is the response type for the +//// Query/MinimumGasPrices RPC method. +// message QueryParamsResponse { +// Params params = 1 [(gogoproto.nullable) = false]; +// } diff --git a/proto/scripts/protoc-doc-gen.sh b/proto/scripts/protoc-doc-gen.sh deleted file mode 100755 index 6f98f48095..0000000000 --- a/proto/scripts/protoc-doc-gen.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -# command to generate docs using protoc-gen-doc -protoc \ --I "proto" \ --I "third_party/proto" \ ---doc_out=./docs/proto \ ---doc_opt=./docs/proto/protodoc-markdown.tmpl,proto-docs.md \ -$(find "proto" -maxdepth 5 -name '*.proto') diff --git a/proto/scripts/protoc-swagger-gen.sh b/proto/scripts/protoc-swagger-gen.sh index 0bf04333d5..fc58c14ef6 100755 --- a/proto/scripts/protoc-swagger-gen.sh +++ b/proto/scripts/protoc-swagger-gen.sh @@ -2,18 +2,23 @@ set -eo pipefail -mkdir -p ./docs/client -proto_dirs=$(find ./proto -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq) +mkdir -p ./tmp-swagger-gen +cd proto +proto_dirs=$(find ./ -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq) for dir in $proto_dirs; do - # generate swagger files (filter query files) query_file=$(find "${dir}" -maxdepth 1 \( -name 'query.proto' -o -name 'service.proto' \)) if [[ ! -z "$query_file" ]]; then - protoc \ - -I "proto" \ - -I "third_party/proto" \ - "$query_file" \ - --swagger_out=./docs/client \ - --swagger_opt=logtostderr=true --swagger_opt=fqn_for_swagger_name=true --swagger_opt=simple_operation_ids=true + buf generate --template buf.gen.swagger.yaml $query_file fi done + +cd .. + +# combine swagger files +# uses nodejs package `swagger-combine`. +# all the individual swagger files need to be configured in `config.json` for merging +swagger-combine ./docs/client/config.json -o ./docs/client/swagger-ui/swagger.yaml -f yaml --continueOnConflictingPaths true --includeDefinitions true + +# clean swagger files +rm -rf ./tmp-swagger-gen \ No newline at end of file diff --git a/proto/scripts/protocgen.sh b/proto/scripts/protocgen.sh index 14e901db6f..4c7323a289 100755 --- a/proto/scripts/protocgen.sh +++ b/proto/scripts/protocgen.sh @@ -1,30 +1,17 @@ #!/usr/bin/env bash set -eo pipefail - -protoc_gen_gocosmos() { - if ! grep "github.com/gogo/protobuf => github.com/regen-network/protobuf" go.mod &>/dev/null ; then - echo -e "\tPlease run this command from somewhere inside the gaia folder." - return 1 - fi - - go get github.com/regen-network/cosmos-proto/protoc-gen-gocosmos@latest 2>/dev/null -} - -protoc_gen_gocosmos - -proto_dirs=$(find ./proto -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq) +echo "Generating gogo proto code" +cd proto +proto_dirs=$(find ./ -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq) for dir in $proto_dirs; do - protoc \ - -I "proto" \ - -I "third_party/proto" \ - --gocosmos_out=plugins=interfacetype+grpc,\ -Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types:. \ - --grpc-gateway_out=logtostderr=true:. \ - $(find "${dir}" -maxdepth 1 -name '*.proto') - + for file in $(find "${dir}" -maxdepth 1 -name '*.proto'); do + if grep "option go_package" $file &> /dev/null ; then + buf generate --template buf.gen.gogo.yaml $file + fi + done done - +cd .. # move proto files to the right places -cp -r github.com/cosmos/gaia/x/* x/ -rm -rf github.com +cp -r github.com/cosmos/gaia/* ./ +rm -rf github.com \ No newline at end of file diff --git a/tests/e2e/address.go b/tests/e2e/address.go index 33079aa8ce..09a8d2e986 100644 --- a/tests/e2e/address.go +++ b/tests/e2e/address.go @@ -1,33 +1,34 @@ package e2e -import ( - "fmt" - "math/rand" - "strconv" - - "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" - crypto "github.com/cosmos/cosmos-sdk/crypto/types" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// HDPath generates an HD path based on the wallet index -func HDPath(index int) string { - return fmt.Sprintf("m/44'/118'/0'/0/%d", index) -} - -// PubKey returns a sample account PubKey -func PubKey() crypto.PubKey { - seed := []byte(strconv.Itoa(rand.Int())) - return ed25519.GenPrivKeyFromSecret(seed).PubKey() -} - -// AccAddress returns a sample account address -func AccAddress() sdk.AccAddress { - addr := PubKey().Address() - return sdk.AccAddress(addr) -} - -// Address returns a sample string account address -func Address() string { - return AccAddress().String() -} +// +// import ( +// "fmt" +// "math/rand" +// "strconv" +// +// "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" +// crypto "github.com/cosmos/cosmos-sdk/crypto/types" +// sdk "github.com/cosmos/cosmos-sdk/types" +//) +// +//// HDPath generates an HD path based on the wallet index +// func HDPath(index int) string { +// return fmt.Sprintf("m/44'/118'/0'/0/%d", index) +//} +// +//// PubKey returns a sample account PubKey +// func PubKey() crypto.PubKey { +// seed := []byte(strconv.Itoa(rand.Int())) +// return ed25519.GenPrivKeyFromSecret(seed).PubKey() +//} +// +//// AccAddress returns a sample account address +// func AccAddress() sdk.AccAddress { +// addr := PubKey().Address() +// return sdk.AccAddress(addr) +//} +// +//// Address returns a sample string account address +// func Address() string { +// return AccAddress().String() +//} diff --git a/tests/e2e/chain.go b/tests/e2e/chain.go index 9c931eede8..b5ff7995c4 100644 --- a/tests/e2e/chain.go +++ b/tests/e2e/chain.go @@ -1,124 +1,124 @@ package e2e -import ( - "fmt" - "os" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - authvesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - tmrand "github.com/tendermint/tendermint/libs/rand" - - gaia "github.com/cosmos/gaia/v11/app" - "github.com/cosmos/gaia/v11/app/params" -) - -const ( - keyringPassphrase = "testpassphrase" - keyringAppName = "testnet" -) - -var ( - encodingConfig params.EncodingConfig - cdc codec.Codec - txConfig client.TxConfig -) - -func init() { - encodingConfig = gaia.MakeTestEncodingConfig() - authvesting.RegisterInterfaces(encodingConfig.InterfaceRegistry) - stakingtypes.RegisterInterfaces(encodingConfig.InterfaceRegistry) - evidencetypes.RegisterInterfaces(encodingConfig.InterfaceRegistry) - cdc = encodingConfig.Codec - txConfig = encodingConfig.TxConfig -} - -type chain struct { - dataDir string - id string - validators []*validator - accounts []*account //nolint:unused - // initial accounts in genesis - genesisAccounts []*account - genesisVestingAccounts map[string]sdk.AccAddress -} - -func newChain() (*chain, error) { - tmpDir, err := os.MkdirTemp("", "gaia-e2e-testnet-") - if err != nil { - return nil, err - } - - return &chain{ - id: "chain-" + tmrand.Str(6), - dataDir: tmpDir, - }, nil -} - -func (c *chain) configDir() string { - return fmt.Sprintf("%s/%s", c.dataDir, c.id) -} - -func (c *chain) createAndInitValidators(count int) error { - for i := 0; i < count; i++ { - node := c.createValidator(i) - - // generate genesis files - if err := node.init(); err != nil { - return err - } - - c.validators = append(c.validators, node) - - // create keys - if err := node.createKey("val"); err != nil { - return err - } - if err := node.createNodeKey(); err != nil { - return err - } - if err := node.createConsensusKey(); err != nil { - return err - } - } - - return nil -} - -func (c *chain) createAndInitValidatorsWithMnemonics(count int, mnemonics []string) error { //nolint:unused // this is called during e2e tests - for i := 0; i < count; i++ { - // create node - node := c.createValidator(i) - - // generate genesis files - if err := node.init(); err != nil { - return err - } - - c.validators = append(c.validators, node) - - // create keys - if err := node.createKeyFromMnemonic("val", mnemonics[i]); err != nil { - return err - } - if err := node.createNodeKey(); err != nil { - return err - } - if err := node.createConsensusKey(); err != nil { - return err - } - } - - return nil -} - -func (c *chain) createValidator(index int) *validator { - return &validator{ - chain: c, - index: index, - moniker: fmt.Sprintf("%s-gaia-%d", c.id, index), - } -} +// import ( +// "fmt" +// "os" + +// "github.com/cosmos/cosmos-sdk/client" +// "github.com/cosmos/cosmos-sdk/codec" +// sdk "github.com/cosmos/cosmos-sdk/types" +// authvesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" +// evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" +// stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" +// tmrand "github.com/tendermint/tendermint/libs/rand" + +// gaia "github.com/cosmos/gaia/v11/app" +// "github.com/cosmos/gaia/v11/app/params" +// ) + +// const ( +// keyringPassphrase = "testpassphrase" +// keyringAppName = "testnet" +// ) + +// var ( +// encodingConfig params.EncodingConfig +// cdc codec.Codec +// txConfig client.TxConfig +// ) + +// func init() { +// encodingConfig = gaia.MakeTestEncodingConfig() +// authvesting.RegisterInterfaces(encodingConfig.InterfaceRegistry) +// stakingtypes.RegisterInterfaces(encodingConfig.InterfaceRegistry) +// evidencetypes.RegisterInterfaces(encodingConfig.InterfaceRegistry) +// cdc = encodingConfig.Codec +// txConfig = encodingConfig.TxConfig +// } + +// type chain struct { +// dataDir string +// id string +// validators []*validator +// accounts []*account //nolint:unused +// // initial accounts in genesis +// genesisAccounts []*account +// genesisVestingAccounts map[string]sdk.AccAddress +// } + +// func newChain() (*chain, error) { +// tmpDir, err := os.MkdirTemp("", "gaia-e2e-testnet-") +// if err != nil { +// return nil, err +// } + +// return &chain{ +// id: "chain-" + tmrand.Str(6), +// dataDir: tmpDir, +// }, nil +// } + +// func (c *chain) configDir() string { +// return fmt.Sprintf("%s/%s", c.dataDir, c.id) +// } + +// func (c *chain) createAndInitValidators(count int) error { +// for i := 0; i < count; i++ { +// node := c.createValidator(i) + +// // generate genesis files +// if err := node.init(); err != nil { +// return err +// } + +// c.validators = append(c.validators, node) + +// // create keys +// if err := node.createKey("val"); err != nil { +// return err +// } +// if err := node.createNodeKey(); err != nil { +// return err +// } +// if err := node.createConsensusKey(); err != nil { +// return err +// } +// } + +// return nil +// } + +// func (c *chain) createAndInitValidatorsWithMnemonics(count int, mnemonics []string) error { //nolint:unused // this is called during e2e tests +// for i := 0; i < count; i++ { +// // create node +// node := c.createValidator(i) + +// // generate genesis files +// if err := node.init(); err != nil { +// return err +// } + +// c.validators = append(c.validators, node) + +// // create keys +// if err := node.createKeyFromMnemonic("val", mnemonics[i]); err != nil { +// return err +// } +// if err := node.createNodeKey(); err != nil { +// return err +// } +// if err := node.createConsensusKey(); err != nil { +// return err +// } +// } + +// return nil +// } + +// func (c *chain) createValidator(index int) *validator { +// return &validator{ +// chain: c, +// index: index, +// moniker: fmt.Sprintf("%s-gaia-%d", c.id, index), +// } +// } diff --git a/tests/e2e/e2e_bank_test.go b/tests/e2e/e2e_bank_test.go index 964f4408e5..4827b1b28a 100644 --- a/tests/e2e/e2e_bank_test.go +++ b/tests/e2e/e2e_bank_test.go @@ -1,59 +1,60 @@ package e2e -import ( - "fmt" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -func (s *IntegrationTestSuite) testBankTokenTransfer() { - s.Run("send_photon_between_accounts", func() { - var err error - senderAddress := s.chainA.validators[0].keyInfo.GetAddress() - sender := senderAddress.String() - - recipientAddress := s.chainA.validators[1].keyInfo.GetAddress() - recipient := recipientAddress.String() - - chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) - - var ( - beforeSenderUAtomBalance sdk.Coin - beforeRecipientUAtomBalance sdk.Coin - ) - - s.Require().Eventually( - func() bool { - beforeSenderUAtomBalance, err = getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) - s.Require().NoError(err) - - beforeRecipientUAtomBalance, err = getSpecificBalance(chainAAPIEndpoint, recipient, uatomDenom) - s.Require().NoError(err) - - return beforeSenderUAtomBalance.IsValid() && beforeRecipientUAtomBalance.IsValid() - }, - 10*time.Second, - 5*time.Second, - ) - - s.execBankSend(s.chainA, 0, sender, recipient, tokenAmount.String(), standardFees.String(), false) - - s.Require().Eventually( - func() bool { - afterSenderUAtomBalance, err := getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) - s.Require().NoError(err) - - afterRecipientUAtomBalance, err := getSpecificBalance(chainAAPIEndpoint, recipient, uatomDenom) - s.Require().NoError(err) - - decremented := beforeSenderUAtomBalance.Sub(tokenAmount).Sub(standardFees).IsEqual(afterSenderUAtomBalance) - incremented := beforeRecipientUAtomBalance.Add(tokenAmount).IsEqual(afterRecipientUAtomBalance) - - return decremented && incremented - }, - time.Minute, - 5*time.Second, - ) - }) -} +// +// import ( +// "fmt" +// "time" +// +// sdk "github.com/cosmos/cosmos-sdk/types" +//) +// +// func (s *IntegrationTestSuite) testBankTokenTransfer() { +// s.Run("send_photon_between_accounts", func() { +// var err error +// senderAddress := s.chainA.validators[0].keyInfo.GetAddress() +// sender := senderAddress.String() +// +// recipientAddress := s.chainA.validators[1].keyInfo.GetAddress() +// recipient := recipientAddress.String() +// +// chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) +// +// var ( +// beforeSenderUAtomBalance sdk.Coin +// beforeRecipientUAtomBalance sdk.Coin +// ) +// +// s.Require().Eventually( +// func() bool { +// beforeSenderUAtomBalance, err = getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) +// s.Require().NoError(err) +// +// beforeRecipientUAtomBalance, err = getSpecificBalance(chainAAPIEndpoint, recipient, uatomDenom) +// s.Require().NoError(err) +// +// return beforeSenderUAtomBalance.IsValid() && beforeRecipientUAtomBalance.IsValid() +// }, +// 10*time.Second, +// 5*time.Second, +// ) +// +// s.execBankSend(s.chainA, 0, sender, recipient, tokenAmount.String(), standardFees.String(), false) +// +// s.Require().Eventually( +// func() bool { +// afterSenderUAtomBalance, err := getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) +// s.Require().NoError(err) +// +// afterRecipientUAtomBalance, err := getSpecificBalance(chainAAPIEndpoint, recipient, uatomDenom) +// s.Require().NoError(err) +// +// decremented := beforeSenderUAtomBalance.Sub(tokenAmount).Sub(standardFees).IsEqual(afterSenderUAtomBalance) +// incremented := beforeRecipientUAtomBalance.Add(tokenAmount).IsEqual(afterRecipientUAtomBalance) +// +// return decremented && incremented +// }, +// time.Minute, +// 5*time.Second, +// ) +// }) +//} diff --git a/tests/e2e/e2e_bypassminfee_test.go b/tests/e2e/e2e_bypassminfee_test.go index 2901c557fe..6e27305c3b 100644 --- a/tests/e2e/e2e_bypassminfee_test.go +++ b/tests/e2e/e2e_bypassminfee_test.go @@ -1,184 +1,184 @@ package e2e -import ( - "time" - - "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" - distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" - ibcchanneltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" -) - -func (s *IntegrationTestSuite) testBypassMinFeeWithdrawReward(endpoint string) { - // submit gov prop to change bypass-msg param to MsgWithdrawDelegatorReward - submitterAddr := s.chainA.validators[0].keyInfo.GetAddress() - submitter := submitterAddr.String() - proposalCounter++ - s.govProposeNewBypassMsgs([]string{sdk.MsgTypeURL(&distributiontypes.MsgWithdrawDelegatorReward{})}, proposalCounter, submitter, standardFees.String()) - - paidFeeAmt := math.LegacyMustNewDecFromStr(minGasPrice).Mul(math.LegacyNewDec(gas)).String() - payee := s.chainA.validators[0].keyInfo.GetAddress() - - testCases := []struct { - name string - fee string - changeMaxBypassGasUsage bool - expErr bool - }{ - { - "bypass-msg with fee in the denom of global fee, pass", - paidFeeAmt + uatomDenom, - false, - false, - }, - { - "bypass-msg with zero coin in the denom of global fee, pass", - "0" + uatomDenom, - false, - false, - }, - { - "bypass-msg with zero coin not in the denom of global fee, pass", - "0" + photonDenom, - false, - false, - }, - { - "bypass-msg with non-zero coin not in the denom of global fee, fail", - paidFeeAmt + photonDenom, - false, - true, - }, - { - "bypass-msg with zero coin in the denom of global fee and maxTotalBypassMinFeeMsgGasUsage set to 1, fail", - "0" + uatomDenom, - true, - true, - }, - { - "bypass-msg with non zero coin in the denom of global fee and maxTotalBypassMinFeeMsgGasUsage set to 1, pass", - paidFeeAmt + uatomDenom, - false, - false, - }, - } - - for _, tc := range testCases { - - if tc.changeMaxBypassGasUsage { - proposalCounter++ - // change MaxTotalBypassMinFeeMsgGasUsage through governance proposal from 1_000_0000 to 1 - s.govProposeNewMaxTotalBypassMinFeeMsgGasUsage(1, proposalCounter, submitter) - } - - // get delegator rewards - rewards, err := queryDelegatorTotalRewards(endpoint, payee.String()) - s.Require().NoError(err) - - // get delegator stake balance - oldBalance, err := getSpecificBalance(endpoint, payee.String(), stakeDenom) - s.Require().NoError(err) - - // withdraw rewards - s.Run(tc.name, func() { - s.execWithdrawAllRewards(s.chainA, 0, payee.String(), tc.fee, tc.expErr) - }) - - if !tc.expErr { - // get updated balance - incrBalance, err := getSpecificBalance(endpoint, payee.String(), stakeDenom) - s.Require().NoError(err) - - // compute sum of old balance and stake token rewards - oldBalancePlusReward := rewards.GetTotal().Add(sdk.NewDecCoinFromCoin(oldBalance)) - s.Require().Equal(oldBalancePlusReward[0].Denom, stakeDenom) - - // check updated balance got increased by at least oldBalancePlusReward - s.Require().True(sdk.NewDecCoinFromCoin(incrBalance).IsGTE(oldBalancePlusReward[0])) - } - } -} - -func (s *IntegrationTestSuite) testIBCBypassMsg() { - // submit gov proposal to change bypass-msg param to - // ["/ibc.core.channel.v1.MsgRecvPacket", - // "/ibc.core.channel.v1.MsgAcknowledgement", - // "/ibc.core.client.v1.MsgUpdateClient"] - submitterAddr := s.chainA.validators[0].keyInfo.GetAddress() - submitter := submitterAddr.String() - proposalCounter++ - s.govProposeNewBypassMsgs([]string{ - sdk.MsgTypeURL(&ibcchanneltypes.MsgRecvPacket{}), - sdk.MsgTypeURL(&ibcchanneltypes.MsgAcknowledgement{}), - sdk.MsgTypeURL(&ibcclienttypes.MsgUpdateClient{}), - }, proposalCounter, submitter, standardFees.String()) - - // use hermes1 to test default ibc bypass-msg - // - // test 1: transaction only contains bypass-msgs, pass - s.testTxContainsOnlyIBCBypassMsg() - // test 2: test transactions contains both bypass and non-bypass msgs (sdk.MsgTypeURL(&ibcchanneltypes.MsgTimeout{}) - s.testTxContainsMixBypassNonBypassMsg() - // test 3: test bypass-msgs exceed the MaxBypassGasUsage - s.testBypassMsgsExceedMaxBypassGasLimit() - - // set the default bypass-msg back - proposalCounter++ - s.govProposeNewBypassMsgs([]string{ - sdk.MsgTypeURL(&ibcchanneltypes.MsgRecvPacket{}), - sdk.MsgTypeURL(&ibcchanneltypes.MsgAcknowledgement{}), - sdk.MsgTypeURL(&ibcclienttypes.MsgUpdateClient{}), - sdk.MsgTypeURL(&ibcchanneltypes.MsgTimeout{}), - sdk.MsgTypeURL(&ibcchanneltypes.MsgTimeoutOnClose{}), - }, proposalCounter, submitter, standardFees.String()) -} - -func (s *IntegrationTestSuite) testTxContainsOnlyIBCBypassMsg() { - s.T().Logf("testing transaction contains only ibc bypass messages") - ok := s.hermesTransfer(hermesConfigWithGasPrices, s.chainA.id, s.chainB.id, transferChannel, uatomDenom, 100, 1000, 1) - s.Require().True(ok) - - scrRelayerBalanceBefore, dstRelayerBalanceBefore := s.queryRelayerWalletsBalances() - - pass := s.hermesClearPacket(hermesConfigNoGasPrices, s.chainA.id, transferChannel) - s.Require().True(pass) - pendingPacketsExist := s.hermesPendingPackets(hermesConfigNoGasPrices, s.chainA.id, transferChannel) - s.Require().False(pendingPacketsExist) - - // confirm relayer wallets do not pay fees - scrRelayerBalanceAfter, dstRelayerBalanceAfter := s.queryRelayerWalletsBalances() - s.Require().Equal(scrRelayerBalanceBefore.String(), scrRelayerBalanceAfter.String()) - s.Require().Equal(dstRelayerBalanceBefore.String(), dstRelayerBalanceAfter.String()) -} - -func (s *IntegrationTestSuite) testTxContainsMixBypassNonBypassMsg() { - s.T().Logf("testing transaction contains both bypass and non-bypass messages") - // hermesTransfer with --timeout-height-offset=1 - ok := s.hermesTransfer(hermesConfigWithGasPrices, s.chainA.id, s.chainB.id, transferChannel, uatomDenom, 100, 1, 1) - s.Require().True(ok) - // make sure that the transaction is timeout - time.Sleep(3 * time.Second) - pendingPacketsExist := s.hermesPendingPackets(hermesConfigNoGasPrices, s.chainA.id, transferChannel) - s.Require().True(pendingPacketsExist) - - pass := s.hermesClearPacket(hermesConfigNoGasPrices, s.chainA.id, transferChannel) - s.Require().False(pass) - // clear packets with paying fee, to not influence the next transaction - pass = s.hermesClearPacket(hermesConfigWithGasPrices, s.chainA.id, transferChannel) - s.Require().True(pass) -} - -func (s *IntegrationTestSuite) testBypassMsgsExceedMaxBypassGasLimit() { - s.T().Logf("testing bypass messages exceed MaxBypassGasUsage") - ok := s.hermesTransfer(hermesConfigWithGasPrices, s.chainA.id, s.chainB.id, transferChannel, uatomDenom, 100, 1000, 12) - s.Require().True(ok) - pass := s.hermesClearPacket(hermesConfigNoGasPrices, s.chainA.id, transferChannel) - s.Require().False(pass) - - pendingPacketsExist := s.hermesPendingPackets(hermesConfigNoGasPrices, s.chainA.id, transferChannel) - s.Require().True(pendingPacketsExist) - - pass = s.hermesClearPacket(hermesConfigWithGasPrices, s.chainA.id, transferChannel) - s.Require().True(pass) -} +// import ( +// "time" + +// "cosmossdk.io/math" +// sdk "github.com/cosmos/cosmos-sdk/types" +// distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/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" +// ) + +// func (s *IntegrationTestSuite) testBypassMinFeeWithdrawReward(endpoint string) { +// // submit gov prop to change bypass-msg param to MsgWithdrawDelegatorReward +// submitterAddr := s.chainA.validators[0].keyInfo.GetAddress() +// submitter := submitterAddr.String() +// proposalCounter++ +// s.govProposeNewBypassMsgs([]string{sdk.MsgTypeURL(&distributiontypes.MsgWithdrawDelegatorReward{})}, proposalCounter, submitter, standardFees.String()) + +// paidFeeAmt := math.LegacyMustNewDecFromStr(minGasPrice).Mul(math.LegacyNewDec(gas)).String() +// payee := s.chainA.validators[0].keyInfo.GetAddress() + +// testCases := []struct { +// name string +// fee string +// changeMaxBypassGasUsage bool +// expErr bool +// }{ +// { +// "bypass-msg with fee in the denom of global fee, pass", +// paidFeeAmt + uatomDenom, +// false, +// false, +// }, +// { +// "bypass-msg with zero coin in the denom of global fee, pass", +// "0" + uatomDenom, +// false, +// false, +// }, +// { +// "bypass-msg with zero coin not in the denom of global fee, pass", +// "0" + photonDenom, +// false, +// false, +// }, +// { +// "bypass-msg with non-zero coin not in the denom of global fee, fail", +// paidFeeAmt + photonDenom, +// false, +// true, +// }, +// { +// "bypass-msg with zero coin in the denom of global fee and maxTotalBypassMinFeeMsgGasUsage set to 1, fail", +// "0" + uatomDenom, +// true, +// true, +// }, +// { +// "bypass-msg with non zero coin in the denom of global fee and maxTotalBypassMinFeeMsgGasUsage set to 1, pass", +// paidFeeAmt + uatomDenom, +// false, +// false, +// }, +// } + +// for _, tc := range testCases { + +// if tc.changeMaxBypassGasUsage { +// proposalCounter++ +// // change MaxTotalBypassMinFeeMsgGasUsage through governance proposal from 1_000_0000 to 1 +// s.govProposeNewMaxTotalBypassMinFeeMsgGasUsage(1, proposalCounter, submitter) +// } + +// // get delegator rewards +// rewards, err := queryDelegatorTotalRewards(endpoint, payee.String()) +// s.Require().NoError(err) + +// // get delegator stake balance +// oldBalance, err := getSpecificBalance(endpoint, payee.String(), stakeDenom) +// s.Require().NoError(err) + +// // withdraw rewards +// s.Run(tc.name, func() { +// s.execWithdrawAllRewards(s.chainA, 0, payee.String(), tc.fee, tc.expErr) +// }) + +// if !tc.expErr { +// // get updated balance +// incrBalance, err := getSpecificBalance(endpoint, payee.String(), stakeDenom) +// s.Require().NoError(err) + +// // compute sum of old balance and stake token rewards +// oldBalancePlusReward := rewards.GetTotal().Add(sdk.NewDecCoinFromCoin(oldBalance)) +// s.Require().Equal(oldBalancePlusReward[0].Denom, stakeDenom) + +// // check updated balance got increased by at least oldBalancePlusReward +// s.Require().True(sdk.NewDecCoinFromCoin(incrBalance).IsGTE(oldBalancePlusReward[0])) +// } +// } +// } + +// func (s *IntegrationTestSuite) testIBCBypassMsg() { +// // submit gov proposal to change bypass-msg param to +// // ["/ibc.core.channel.v1.MsgRecvPacket", +// // "/ibc.core.channel.v1.MsgAcknowledgement", +// // "/ibc.core.client.v1.MsgUpdateClient"] +// submitterAddr := s.chainA.validators[0].keyInfo.GetAddress() +// submitter := submitterAddr.String() +// proposalCounter++ +// s.govProposeNewBypassMsgs([]string{ +// sdk.MsgTypeURL(&ibcchanneltypes.MsgRecvPacket{}), +// sdk.MsgTypeURL(&ibcchanneltypes.MsgAcknowledgement{}), +// sdk.MsgTypeURL(&ibcclienttypes.MsgUpdateClient{}), +// }, proposalCounter, submitter, standardFees.String()) + +// // use hermes1 to test default ibc bypass-msg +// // +// // test 1: transaction only contains bypass-msgs, pass +// s.testTxContainsOnlyIBCBypassMsg() +// // test 2: test transactions contains both bypass and non-bypass msgs (sdk.MsgTypeURL(&ibcchanneltypes.MsgTimeout{}) +// s.testTxContainsMixBypassNonBypassMsg() +// // test 3: test bypass-msgs exceed the MaxBypassGasUsage +// s.testBypassMsgsExceedMaxBypassGasLimit() + +// // set the default bypass-msg back +// proposalCounter++ +// s.govProposeNewBypassMsgs([]string{ +// sdk.MsgTypeURL(&ibcchanneltypes.MsgRecvPacket{}), +// sdk.MsgTypeURL(&ibcchanneltypes.MsgAcknowledgement{}), +// sdk.MsgTypeURL(&ibcclienttypes.MsgUpdateClient{}), +// sdk.MsgTypeURL(&ibcchanneltypes.MsgTimeout{}), +// sdk.MsgTypeURL(&ibcchanneltypes.MsgTimeoutOnClose{}), +// }, proposalCounter, submitter, standardFees.String()) +// } + +// func (s *IntegrationTestSuite) testTxContainsOnlyIBCBypassMsg() { +// s.T().Logf("testing transaction contains only ibc bypass messages") +// ok := s.hermesTransfer(hermesConfigWithGasPrices, s.chainA.id, s.chainB.id, transferChannel, uatomDenom, 100, 1000, 1) +// s.Require().True(ok) + +// scrRelayerBalanceBefore, dstRelayerBalanceBefore := s.queryRelayerWalletsBalances() + +// pass := s.hermesClearPacket(hermesConfigNoGasPrices, s.chainA.id, transferChannel) +// s.Require().True(pass) +// pendingPacketsExist := s.hermesPendingPackets(hermesConfigNoGasPrices, s.chainA.id, transferChannel) +// s.Require().False(pendingPacketsExist) + +// // confirm relayer wallets do not pay fees +// scrRelayerBalanceAfter, dstRelayerBalanceAfter := s.queryRelayerWalletsBalances() +// s.Require().Equal(scrRelayerBalanceBefore.String(), scrRelayerBalanceAfter.String()) +// s.Require().Equal(dstRelayerBalanceBefore.String(), dstRelayerBalanceAfter.String()) +// } + +// func (s *IntegrationTestSuite) testTxContainsMixBypassNonBypassMsg() { +// s.T().Logf("testing transaction contains both bypass and non-bypass messages") +// // hermesTransfer with --timeout-height-offset=1 +// ok := s.hermesTransfer(hermesConfigWithGasPrices, s.chainA.id, s.chainB.id, transferChannel, uatomDenom, 100, 1, 1) +// s.Require().True(ok) +// // make sure that the transaction is timeout +// time.Sleep(3 * time.Second) +// pendingPacketsExist := s.hermesPendingPackets(hermesConfigNoGasPrices, s.chainA.id, transferChannel) +// s.Require().True(pendingPacketsExist) + +// pass := s.hermesClearPacket(hermesConfigNoGasPrices, s.chainA.id, transferChannel) +// s.Require().False(pass) +// // clear packets with paying fee, to not influence the next transaction +// pass = s.hermesClearPacket(hermesConfigWithGasPrices, s.chainA.id, transferChannel) +// s.Require().True(pass) +// } + +// func (s *IntegrationTestSuite) testBypassMsgsExceedMaxBypassGasLimit() { +// s.T().Logf("testing bypass messages exceed MaxBypassGasUsage") +// ok := s.hermesTransfer(hermesConfigWithGasPrices, s.chainA.id, s.chainB.id, transferChannel, uatomDenom, 100, 1000, 12) +// s.Require().True(ok) +// pass := s.hermesClearPacket(hermesConfigNoGasPrices, s.chainA.id, transferChannel) +// s.Require().False(pass) + +// pendingPacketsExist := s.hermesPendingPackets(hermesConfigNoGasPrices, s.chainA.id, transferChannel) +// s.Require().True(pendingPacketsExist) + +// pass = s.hermesClearPacket(hermesConfigWithGasPrices, s.chainA.id, transferChannel) +// s.Require().True(pass) +// } diff --git a/tests/e2e/e2e_distribution_test.go b/tests/e2e/e2e_distribution_test.go index 7f7f41da8d..ff1471e451 100644 --- a/tests/e2e/e2e_distribution_test.go +++ b/tests/e2e/e2e_distribution_test.go @@ -1,88 +1,89 @@ package e2e -import ( - "fmt" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -func (s *IntegrationTestSuite) testDistribution() { - chainEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) - - validatorB := s.chainA.validators[1] - validatorBAddr := validatorB.keyInfo.GetAddress() - - valOperAddressA := sdk.ValAddress(validatorBAddr).String() - - delegatorAddress := s.chainA.genesisAccounts[2].keyInfo.GetAddress().String() - - newWithdrawalAddress := s.chainA.genesisAccounts[3].keyInfo.GetAddress().String() - fees := sdk.NewCoin(uatomDenom, sdk.NewInt(1000)) - - beforeBalance, err := getSpecificBalance(chainEndpoint, newWithdrawalAddress, uatomDenom) - s.Require().NoError(err) - if beforeBalance.IsNil() { - beforeBalance = sdk.NewCoin(uatomDenom, sdk.NewInt(0)) - } - - s.execSetWithdrawAddress(s.chainA, 0, fees.String(), delegatorAddress, newWithdrawalAddress, gaiaHomePath) - - // Verify - s.Require().Eventually( - func() bool { - res, err := queryDelegatorWithdrawalAddress(chainEndpoint, delegatorAddress) - s.Require().NoError(err) - - return res.WithdrawAddress == newWithdrawalAddress - }, - 10*time.Second, - 5*time.Second, - ) - - s.execWithdrawReward(s.chainA, 0, delegatorAddress, valOperAddressA, gaiaHomePath) - s.Require().Eventually( - func() bool { - afterBalance, err := getSpecificBalance(chainEndpoint, newWithdrawalAddress, uatomDenom) - s.Require().NoError(err) - - return afterBalance.IsGTE(beforeBalance) - }, - 10*time.Second, - 5*time.Second, - ) -} - -/* -fundCommunityPool tests the funding of the community pool on behalf of the distribution module. -Test Benchmarks: -1. Validation that balance of the distribution module account before funding -2. Execution funding the community pool -3. Verification that correct funds have been deposited to distribution module account -*/ -func (s *IntegrationTestSuite) fundCommunityPool() { - chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) - sender := s.chainA.validators[0].keyInfo.GetAddress() - - beforeDistUatomBalance, _ := getSpecificBalance(chainAAPIEndpoint, distModuleAddress, tokenAmount.Denom) - if beforeDistUatomBalance.IsNil() { - // Set balance to 0 if previous balance does not exist - beforeDistUatomBalance = sdk.NewInt64Coin(uatomDenom, 0) - } - - s.execDistributionFundCommunityPool(s.chainA, 0, sender.String(), tokenAmount.String(), standardFees.String()) - - // there are still tokens being added to the community pool through block production rewards but they should be less than 500 tokens - marginOfErrorForBlockReward := sdk.NewInt64Coin(uatomDenom, 500) - - s.Require().Eventually( - func() bool { - afterDistPhotonBalance, err := getSpecificBalance(chainAAPIEndpoint, distModuleAddress, tokenAmount.Denom) - s.Require().NoErrorf(err, "Error getting balance: %s", afterDistPhotonBalance) - - return afterDistPhotonBalance.Sub(beforeDistUatomBalance.Add(tokenAmount.Add(standardFees))).IsLT(marginOfErrorForBlockReward) - }, - 15*time.Second, - 5*time.Second, - ) -} +// +// import ( +// "fmt" +// "time" +// +// sdk "github.com/cosmos/cosmos-sdk/types" +//) +// +// func (s *IntegrationTestSuite) testDistribution() { +// chainEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) +// +// validatorB := s.chainA.validators[1] +// validatorBAddr := validatorB.keyInfo.GetAddress() +// +// valOperAddressA := sdk.ValAddress(validatorBAddr).String() +// +// delegatorAddress := s.chainA.genesisAccounts[2].keyInfo.GetAddress().String() +// +// newWithdrawalAddress := s.chainA.genesisAccounts[3].keyInfo.GetAddress().String() +// fees := sdk.NewCoin(uatomDenom, sdk.NewInt(1000)) +// +// beforeBalance, err := getSpecificBalance(chainEndpoint, newWithdrawalAddress, uatomDenom) +// s.Require().NoError(err) +// if beforeBalance.IsNil() { +// beforeBalance = sdk.NewCoin(uatomDenom, sdk.NewInt(0)) +// } +// +// s.execSetWithdrawAddress(s.chainA, 0, fees.String(), delegatorAddress, newWithdrawalAddress, gaiaHomePath) +// +// // Verify +// s.Require().Eventually( +// func() bool { +// res, err := queryDelegatorWithdrawalAddress(chainEndpoint, delegatorAddress) +// s.Require().NoError(err) +// +// return res.WithdrawAddress == newWithdrawalAddress +// }, +// 10*time.Second, +// 5*time.Second, +// ) +// +// s.execWithdrawReward(s.chainA, 0, delegatorAddress, valOperAddressA, gaiaHomePath) +// s.Require().Eventually( +// func() bool { +// afterBalance, err := getSpecificBalance(chainEndpoint, newWithdrawalAddress, uatomDenom) +// s.Require().NoError(err) +// +// return afterBalance.IsGTE(beforeBalance) +// }, +// 10*time.Second, +// 5*time.Second, +// ) +//} +// +///* +// fundCommunityPool tests the funding of the community pool on behalf of the distribution module. +// Test Benchmarks: +// 1. Validation that balance of the distribution module account before funding +// 2. Execution funding the community pool +// 3. Verification that correct funds have been deposited to distribution module account +// */ +// func (s *IntegrationTestSuite) fundCommunityPool() { +// chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) +// sender := s.chainA.validators[0].keyInfo.GetAddress() +// +// beforeDistUatomBalance, _ := getSpecificBalance(chainAAPIEndpoint, distModuleAddress, tokenAmount.Denom) +// if beforeDistUatomBalance.IsNil() { +// // Set balance to 0 if previous balance does not exist +// beforeDistUatomBalance = sdk.NewInt64Coin(uatomDenom, 0) +// } +// +// s.execDistributionFundCommunityPool(s.chainA, 0, sender.String(), tokenAmount.String(), standardFees.String()) +// +// // there are still tokens being added to the community pool through block production rewards but they should be less than 500 tokens +// marginOfErrorForBlockReward := sdk.NewInt64Coin(uatomDenom, 500) +// +// s.Require().Eventually( +// func() bool { +// afterDistPhotonBalance, err := getSpecificBalance(chainAAPIEndpoint, distModuleAddress, tokenAmount.Denom) +// s.Require().NoErrorf(err, "Error getting balance: %s", afterDistPhotonBalance) +// +// return afterDistPhotonBalance.Sub(beforeDistUatomBalance.Add(tokenAmount.Add(standardFees))).IsLT(marginOfErrorForBlockReward) +// }, +// 15*time.Second, +// 5*time.Second, +// ) +//} diff --git a/tests/e2e/e2e_encode_test.go b/tests/e2e/e2e_encode_test.go index 073c6e2a11..89ac30c97e 100644 --- a/tests/e2e/e2e_encode_test.go +++ b/tests/e2e/e2e_encode_test.go @@ -1,50 +1,51 @@ package e2e -import ( - "encoding/base64" - "path/filepath" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -const ( - rawTxFile = "tx_raw.json" -) - -func (s *IntegrationTestSuite) testEncode() { - chain := s.chainA - _, encoded, err := buildRawTx() - s.Require().NoError(err) - - got := s.execEncode(chain, filepath.Join(gaiaHomePath, rawTxFile)) - s.T().Logf("encoded tx: %s", got) - s.Require().Equal(encoded, got) -} - -func (s *IntegrationTestSuite) testDecode() { - chain := s.chainA - rawTx, encoded, err := buildRawTx() - s.Require().NoError(err) - - got := s.execDecode(chain, encoded) - s.T().Logf("raw tx: %s", got) - s.Require().Equal(string(rawTx), got) -} - -// buildRawTx build a dummy tx using the TxBuilder and -// return the JSON and encoded tx's -func buildRawTx() ([]byte, string, error) { - builder := txConfig.NewTxBuilder() - builder.SetGasLimit(gas) - builder.SetFeeAmount(sdk.NewCoins(standardFees)) - builder.SetMemo("foomemo") - tx, err := txConfig.TxJSONEncoder()(builder.GetTx()) - if err != nil { - return nil, "", err - } - txBytes, err := txConfig.TxEncoder()(builder.GetTx()) - if err != nil { - return nil, "", err - } - return tx, base64.StdEncoding.EncodeToString(txBytes), err -} +// +// import ( +// "encoding/base64" +// "path/filepath" +// +// sdk "github.com/cosmos/cosmos-sdk/types" +//) +// +// const ( +// rawTxFile = "tx_raw.json" +//) +// +// func (s *IntegrationTestSuite) testEncode() { +// chain := s.chainA +// _, encoded, err := buildRawTx() +// s.Require().NoError(err) +// +// got := s.execEncode(chain, filepath.Join(gaiaHomePath, rawTxFile)) +// s.T().Logf("encoded tx: %s", got) +// s.Require().Equal(encoded, got) +//} +// +// func (s *IntegrationTestSuite) testDecode() { +// chain := s.chainA +// rawTx, encoded, err := buildRawTx() +// s.Require().NoError(err) +// +// got := s.execDecode(chain, encoded) +// s.T().Logf("raw tx: %s", got) +// s.Require().Equal(string(rawTx), got) +//} +// +//// buildRawTx build a dummy tx using the TxBuilder and +//// return the JSON and encoded tx's +// func buildRawTx() ([]byte, string, error) { +// builder := txConfig.NewTxBuilder() +// builder.SetGasLimit(gas) +// builder.SetFeeAmount(sdk.NewCoins(standardFees)) +// builder.SetMemo("foomemo") +// tx, err := txConfig.TxJSONEncoder()(builder.GetTx()) +// if err != nil { +// return nil, "", err +// } +// txBytes, err := txConfig.TxEncoder()(builder.GetTx()) +// if err != nil { +// return nil, "", err +// } +// return tx, base64.StdEncoding.EncodeToString(txBytes), err +//} diff --git a/tests/e2e/e2e_evidence_test.go b/tests/e2e/e2e_evidence_test.go index 9f49fc278e..e026c5e5b9 100644 --- a/tests/e2e/e2e_evidence_test.go +++ b/tests/e2e/e2e_evidence_test.go @@ -1,53 +1,54 @@ package e2e -import ( - "context" - "fmt" - "time" - - "github.com/cosmos/cosmos-sdk/x/evidence/exported" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" -) - -func (s *IntegrationTestSuite) testEvidence() { - s.Run("test evidence queries", func() { - var ( - valIdx = 0 - chain = s.chainA - chainAPI = fmt.Sprintf("http://%s", s.valResources[chain.id][valIdx].GetHostPort("1317/tcp")) - ) - res, err := queryAllEvidence(chainAPI) - s.Require().NoError(err) - s.Require().Equal(numberOfEvidences, len(res.Evidence)) - for _, evidence := range res.Evidence { - var exportedEvidence exported.Evidence - err := cdc.UnpackAny(evidence, &exportedEvidence) - s.Require().NoError(err) - eq, ok := exportedEvidence.(*evidencetypes.Equivocation) - s.Require().True(ok) - s.execQueryEvidence(chain, valIdx, eq.Hash().String()) - } - }) -} - -func (s *IntegrationTestSuite) execQueryEvidence(c *chain, valIdx int, hash string) (res evidencetypes.Equivocation) { - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() - - s.T().Logf("querying evidence %s on chain %s", hash, c.id) - - gaiaCommand := []string{ - gaiadBinary, - queryCommand, - evidencetypes.ModuleName, - hash, - } - - s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, func(stdOut []byte, stdErr []byte) bool { - // TODO parse evidence after fix the SDK - // https://github.com/cosmos/cosmos-sdk/issues/13444 - // s.Require().NoError(yaml.Unmarshal(stdOut, &res)) - return true - }) - return res -} +// +// import ( +// "context" +// "fmt" +// "time" +// +// "github.com/cosmos/cosmos-sdk/x/evidence/exported" +// evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" +//) +// +// func (s *IntegrationTestSuite) testEvidence() { +// s.Run("test evidence queries", func() { +// var ( +// valIdx = 0 +// chain = s.chainA +// chainAPI = fmt.Sprintf("http://%s", s.valResources[chain.id][valIdx].GetHostPort("1317/tcp")) +// ) +// res, err := queryAllEvidence(chainAPI) +// s.Require().NoError(err) +// s.Require().Equal(numberOfEvidences, len(res.Evidence)) +// for _, evidence := range res.Evidence { +// var exportedEvidence exported.Evidence +// err := cdc.UnpackAny(evidence, &exportedEvidence) +// s.Require().NoError(err) +// eq, ok := exportedEvidence.(*evidencetypes.Equivocation) +// s.Require().True(ok) +// s.execQueryEvidence(chain, valIdx, eq.Hash().String()) +// } +// }) +//} +// +// func (s *IntegrationTestSuite) execQueryEvidence(c *chain, valIdx int, hash string) (res evidencetypes.Equivocation) { +// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) +// defer cancel() +// +// s.T().Logf("querying evidence %s on chain %s", hash, c.id) +// +// gaiaCommand := []string{ +// gaiadBinary, +// queryCommand, +// evidencetypes.ModuleName, +// hash, +// } +// +// s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, func(stdOut []byte, stdErr []byte) bool { +// // TODO parse evidence after fix the SDK +// // https://github.com/cosmos/cosmos-sdk/issues/13444 +// // s.Require().NoError(yaml.Unmarshal(stdOut, &res)) +// return true +// }) +// return res +//} diff --git a/tests/e2e/e2e_exec_test.go b/tests/e2e/e2e_exec_test.go index c85c11d42e..4910753ef0 100644 --- a/tests/e2e/e2e_exec_test.go +++ b/tests/e2e/e2e_exec_test.go @@ -1,694 +1,693 @@ -//nolint:unused package e2e -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "strconv" - "strings" - "time" - - "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 ( - flagFrom = "from" - flagHome = "home" - flagFees = "fees" - flagGas = "gas" - flagOutput = "output" - flagChainID = "chain-id" - flagSpendLimit = "spend-limit" - flagGasAdjustment = "gas-adjustment" - flagFeeAccount = "fee-account" - flagBroadcastMode = "broadcast-mode" - flagKeyringBackend = "keyring-backend" - flagAllowedMessages = "allowed-messages" -) - -type flagOption func(map[string]interface{}) - -// withKeyValue add a new flag to command -func withKeyValue(key string, value interface{}) flagOption { - return func(o map[string]interface{}) { - o[key] = value - } -} - -func applyOptions(chainID string, options []flagOption) map[string]interface{} { - opts := map[string]interface{}{ - flagKeyringBackend: "test", - flagOutput: "json", - flagGas: "auto", - flagFrom: "alice", - flagBroadcastMode: "sync", - flagGasAdjustment: "1.5", - flagChainID: chainID, - flagHome: gaiaHomePath, - flagFees: standardFees.String(), - } - for _, apply := range options { - apply(opts) - } - return opts -} - -func (s *IntegrationTestSuite) execEncode( - c *chain, - txPath string, - opt ...flagOption, -) string { - opts := applyOptions(c.id, opt) - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() - - s.T().Logf("%s - Executing gaiad encoding with %v", c.id, txPath) - gaiaCommand := []string{ - gaiadBinary, - txCommand, - "encode", - txPath, - } - for flag, value := range opts { - gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) - } - - var encoded string - s.executeGaiaTxCommand(ctx, c, gaiaCommand, 0, func(stdOut []byte, stdErr []byte) bool { - if stdErr != nil { - return false - } - encoded = strings.TrimSuffix(string(stdOut), "\n") - return true - }) - s.T().Logf("successfully encode with %v", txPath) - return encoded -} - -func (s *IntegrationTestSuite) execDecode( - c *chain, - txPath string, - opt ...flagOption, -) string { - opts := applyOptions(c.id, opt) - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() - - s.T().Logf("%s - Executing gaiad decoding with %v", c.id, txPath) - gaiaCommand := []string{ - gaiadBinary, - txCommand, - "decode", - txPath, - } - for flag, value := range opts { - gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) - } - - var decoded string - s.executeGaiaTxCommand(ctx, c, gaiaCommand, 0, func(stdOut []byte, stdErr []byte) bool { - if stdErr != nil { - return false - } - decoded = strings.TrimSuffix(string(stdOut), "\n") - return true - }) - s.T().Logf("successfully decode %v", txPath) - return decoded -} - -func (s *IntegrationTestSuite) execVestingTx( - c *chain, - method string, - args []string, - opt ...flagOption, -) { - opts := applyOptions(c.id, opt) - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() - - s.T().Logf("%s - Executing gaiad %s with %v", c.id, method, args) - gaiaCommand := []string{ - gaiadBinary, - txCommand, - vestingtypes.ModuleName, - method, - "-y", - } - gaiaCommand = append(gaiaCommand, args...) - - for flag, value := range opts { - gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) - } - - s.executeGaiaTxCommand(ctx, c, gaiaCommand, 0, s.defaultExecValidation(c, 0)) - s.T().Logf("successfully %s with %v", method, args) -} - -func (s *IntegrationTestSuite) execCreatePeriodicVestingAccount( - c *chain, - address, - jsonPath string, - opt ...flagOption, -) { - s.T().Logf("Executing gaiad create periodic vesting account %s", c.id) - s.execVestingTx(c, "create-periodic-vesting-account", []string{address, jsonPath}, opt...) - s.T().Logf("successfully created periodic vesting account %s with %s", address, jsonPath) -} - -func (s *IntegrationTestSuite) execUnjail( - c *chain, - opt ...flagOption, -) { - opts := applyOptions(c.id, opt) - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() - - s.T().Logf("Executing gaiad slashing unjail %s with options: %v", c.id, opt) - gaiaCommand := []string{ - gaiadBinary, - txCommand, - slashingtypes.ModuleName, - "unjail", - "-y", - } - - for flag, value := range opts { - gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) - } - - s.executeGaiaTxCommand(ctx, c, gaiaCommand, 0, s.defaultExecValidation(c, 0)) - s.T().Logf("successfully unjail with options %v", opt) -} - -func (s *IntegrationTestSuite) execFeeGrant(c *chain, valIdx int, granter, grantee, spendLimit string, opt ...flagOption) { - opt = append(opt, withKeyValue(flagFrom, granter)) - opt = append(opt, withKeyValue(flagSpendLimit, spendLimit)) - opts := applyOptions(c.id, opt) - - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() - - s.T().Logf("granting %s fee from %s on chain %s", grantee, granter, c.id) - - gaiaCommand := []string{ - gaiadBinary, - txCommand, - feegrant.ModuleName, - "grant", - granter, - grantee, - "-y", - } - for flag, value := range opts { - gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) - } - - s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) -} - -func (s *IntegrationTestSuite) execFeeGrantRevoke(c *chain, valIdx int, granter, grantee string, opt ...flagOption) { - opt = append(opt, withKeyValue(flagFrom, granter)) - opts := applyOptions(c.id, opt) - - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() - - s.T().Logf("revoking %s fee grant from %s on chain %s", grantee, granter, c.id) - - gaiaCommand := []string{ - gaiadBinary, - txCommand, - feegrant.ModuleName, - "revoke", - granter, - grantee, - "-y", - } - for flag, value := range opts { - gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) - } - - s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) -} - -func (s *IntegrationTestSuite) execBankSend( - c *chain, - valIdx int, - from, - to, - amt, - fees string, - expectErr bool, - opt ...flagOption, -) { - // TODO remove the hardcode opt after refactor, all methods should accept custom flags - opt = append(opt, withKeyValue(flagFees, fees)) - opt = append(opt, withKeyValue(flagFrom, from)) - opts := applyOptions(c.id, opt) - - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() - - s.T().Logf("sending %s tokens from %s to %s on chain %s", amt, from, to, c.id) - - gaiaCommand := []string{ - gaiadBinary, - txCommand, - banktypes.ModuleName, - "send", - from, - to, - amt, - "-y", - } - for flag, value := range opts { - gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) - } - - s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.expectErrExecValidation(c, valIdx, expectErr)) -} - -type txBankSend struct { - from string - to string - amt string - fees string - log string - expectErr bool -} - -func (s *IntegrationTestSuite) execBankSendBatch( - c *chain, - valIdx int, //nolint:unparam - txs ...txBankSend, -) int { - sucessBankSendCount := 0 - - for i := range txs { - s.T().Logf(txs[i].log) - - s.execBankSend(c, valIdx, txs[i].from, txs[i].to, txs[i].amt, txs[i].fees, txs[i].expectErr) - if !txs[i].expectErr { - if !txs[i].expectErr { - sucessBankSendCount++ - } - } - } - - return sucessBankSendCount -} - -func (s *IntegrationTestSuite) execWithdrawAllRewards(c *chain, valIdx int, payee, fees string, expectErr bool) { - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() - - gaiaCommand := []string{ - gaiadBinary, - txCommand, - distributiontypes.ModuleName, - "withdraw-all-rewards", - fmt.Sprintf("--%s=%s", flags.FlagFrom, payee), - fmt.Sprintf("--%s=%s", flags.FlagGasPrices, fees), - fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), - "--keyring-backend=test", - "--output=json", - "-y", - } - - s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.expectErrExecValidation(c, valIdx, expectErr)) -} - -func (s *IntegrationTestSuite) execDistributionFundCommunityPool(c *chain, valIdx int, from, amt, fees string) { - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() - - s.T().Logf("Executing gaiad tx distribution fund-community-pool on chain %s", c.id) - - gaiaCommand := []string{ - gaiadBinary, - txCommand, - distributiontypes.ModuleName, - "fund-community-pool", - amt, - fmt.Sprintf("--%s=%s", flags.FlagFrom, from), - fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), - fmt.Sprintf("--%s=%s", flags.FlagFees, fees), - "--keyring-backend=test", - "--output=json", - "-y", - } - - s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) - s.T().Logf("Successfully funded community pool") -} - -func (s *IntegrationTestSuite) runGovExec(c *chain, valIdx int, submitterAddr, govCommand string, proposalFlags []string, fees string) { - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() - - gaiaCommand := []string{ - gaiadBinary, - txCommand, - govtypes.ModuleName, - govCommand, - } - - generalFlags := []string{ - fmt.Sprintf("--%s=%s", flags.FlagFrom, submitterAddr), - fmt.Sprintf("--%s=%s", flags.FlagGas, "300000"), // default 200000 isn't enough - fmt.Sprintf("--%s=%s", flags.FlagGasPrices, fees), - fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), - "--keyring-backend=test", - "--output=json", - "-y", - } - - gaiaCommand = concatFlags(gaiaCommand, proposalFlags, generalFlags) - - s.T().Logf("Executing gaiad tx gov %s on chain %s", govCommand, c.id) - s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) - s.T().Logf("Successfully executed %s", govCommand) -} - -func (s *IntegrationTestSuite) executeGKeysAddCommand(c *chain, valIdx int, name string, home string) string { - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() - - gaiaCommand := []string{ - gaiadBinary, - keysCommand, - "add", - name, - fmt.Sprintf("--%s=%s", flags.FlagHome, home), - "--keyring-backend=test", - "--output=json", - } - - var addrRecord AddressResponse - s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, func(stdOut []byte, stdErr []byte) bool { - // Gaiad keys add by default returns payload to stdErr - if err := json.Unmarshal(stdErr, &addrRecord); err != nil { - return false - } - return strings.Contains(addrRecord.Address, "cosmos") - }) - return addrRecord.Address -} - -func (s *IntegrationTestSuite) executeKeysList(c *chain, valIdx int, home string) { - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() - - gaiaCommand := []string{ - gaiadBinary, - keysCommand, - "list", - "--keyring-backend=test", - fmt.Sprintf("--%s=%s", flags.FlagHome, home), - "--output=json", - } - - s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, func([]byte, []byte) bool { - return true - }) -} - -func (s *IntegrationTestSuite) executeDelegate(c *chain, valIdx int, amount, valOperAddress, delegatorAddr, home, delegateFees string) { //nolint:unparam - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() - - s.T().Logf("Executing gaiad tx staking delegate %s", c.id) - - gaiaCommand := []string{ - gaiadBinary, - txCommand, - stakingtypes.ModuleName, - "delegate", - valOperAddress, - amount, - fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddr), - fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), - fmt.Sprintf("--%s=%s", flags.FlagGasPrices, delegateFees), - "--keyring-backend=test", - fmt.Sprintf("--%s=%s", flags.FlagHome, home), - "--output=json", - "-y", - } - - s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) - s.T().Logf("%s successfully delegated %s to %s", delegatorAddr, amount, valOperAddress) -} - -func (s *IntegrationTestSuite) executeRedelegate(c *chain, valIdx int, amount, originalValOperAddress, - newValOperAddress, delegatorAddr, home, delegateFees string, -) { - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() - - s.T().Logf("Executing gaiad tx staking redelegate %s", c.id) - - gaiaCommand := []string{ - gaiadBinary, - txCommand, - stakingtypes.ModuleName, - "redelegate", - originalValOperAddress, - newValOperAddress, - amount, - fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddr), - fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), - fmt.Sprintf("--%s=%s", flags.FlagGas, "300000"), // default 200000 isn't enough - fmt.Sprintf("--%s=%s", flags.FlagGasPrices, delegateFees), - "--keyring-backend=test", - fmt.Sprintf("--%s=%s", flags.FlagHome, home), - "--output=json", - "-y", - } - - s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) - s.T().Logf("%s successfully redelegated %s from %s to %s", delegatorAddr, amount, originalValOperAddress, newValOperAddress) -} - -func (s *IntegrationTestSuite) getLatestBlockHeight(c *chain, valIdx int) int { - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() - - type syncInfo struct { - SyncInfo struct { - LatestHeight string `json:"latest_block_height"` - } `json:"SyncInfo"` - } - - var currentHeight int - gaiaCommand := []string{gaiadBinary, "status"} - s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, func(stdOut []byte, stdErr []byte) bool { - var ( - err error - block syncInfo - ) - s.Require().NoError(json.Unmarshal(stdErr, &block)) - currentHeight, err = strconv.Atoi(block.SyncInfo.LatestHeight) - s.Require().NoError(err) - return currentHeight > 0 - }) - return currentHeight -} - -func (s *IntegrationTestSuite) verifyBalanceChange(endpoint string, expectedAmount sdk.Coin, recipientAddress string) { - s.Require().Eventually( - func() bool { - afterAtomBalance, err := getSpecificBalance(endpoint, recipientAddress, uatomDenom) - s.Require().NoError(err) - - return afterAtomBalance.IsEqual(expectedAmount) - }, - 20*time.Second, - 5*time.Second, - ) -} - -func (s *IntegrationTestSuite) execSetWithdrawAddress( - c *chain, - valIdx int, - fees, - delegatorAddress, - newWithdrawalAddress, - homePath string, -) { - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() - - s.T().Logf("Setting distribution withdrawal address on chain %s for %s to %s", c.id, delegatorAddress, newWithdrawalAddress) - gaiaCommand := []string{ - gaiadBinary, - txCommand, - distributiontypes.ModuleName, - "set-withdraw-addr", - newWithdrawalAddress, - fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddress), - fmt.Sprintf("--%s=%s", flags.FlagFees, fees), - fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), - fmt.Sprintf("--%s=%s", flags.FlagHome, homePath), - "--keyring-backend=test", - "--output=json", - "-y", - } - - s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) - s.T().Logf("Successfully set new distribution withdrawal address for %s to %s", delegatorAddress, newWithdrawalAddress) -} - -func (s *IntegrationTestSuite) execWithdrawReward( - c *chain, - valIdx int, - delegatorAddress, - validatorAddress, - homePath string, -) { - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() - - s.T().Logf("Withdrawing distribution rewards on chain %s for delegator %s from %s validator", c.id, delegatorAddress, validatorAddress) - gaiaCommand := []string{ - gaiadBinary, - txCommand, - distributiontypes.ModuleName, - "withdraw-rewards", - validatorAddress, - fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddress), - fmt.Sprintf("--%s=%s", flags.FlagGasPrices, "300uatom"), - fmt.Sprintf("--%s=%s", flags.FlagGas, "auto"), - fmt.Sprintf("--%s=%s", flags.FlagGasAdjustment, "1.5"), - fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), - fmt.Sprintf("--%s=%s", flags.FlagHome, homePath), - "--keyring-backend=test", - "--output=json", - "-y", - } - - s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) - s.T().Logf("Successfully withdrew distribution rewards for delegator %s from validator %s", delegatorAddress, validatorAddress) -} - -func (s *IntegrationTestSuite) executeGaiaTxCommand(ctx context.Context, c *chain, gaiaCommand []string, valIdx int, validation func([]byte, []byte) bool) { - if validation == nil { - validation = s.defaultExecValidation(s.chainA, 0) - } - var ( - outBuf bytes.Buffer - errBuf bytes.Buffer - ) - exec, err := s.dkrPool.Client.CreateExec(docker.CreateExecOptions{ - Context: ctx, - AttachStdout: true, - AttachStderr: true, - Container: s.valResources[c.id][valIdx].Container.ID, - User: "nonroot", - Cmd: gaiaCommand, - }) - s.Require().NoError(err) - - err = s.dkrPool.Client.StartExec(exec.ID, docker.StartExecOptions{ - Context: ctx, - Detach: false, - OutputStream: &outBuf, - ErrorStream: &errBuf, - }) - s.Require().NoError(err) - - stdOut := outBuf.Bytes() - stdErr := errBuf.Bytes() - - if !validation(stdOut, stdErr) { - s.Require().FailNowf("Exec validation failed", "stdout: %s, stderr: %s", - string(stdOut), string(stdErr)) - } -} - -func (s *IntegrationTestSuite) executeHermesCommand(ctx context.Context, hermesCmd []string) ([]byte, []byte) { - var ( - outBuf bytes.Buffer - errBuf bytes.Buffer - ) - exec, err := s.dkrPool.Client.CreateExec(docker.CreateExecOptions{ - Context: ctx, - AttachStdout: true, - AttachStderr: true, - Container: s.hermesResource1.Container.ID, - User: "root", - Cmd: hermesCmd, - }) - s.Require().NoError(err) - - err = s.dkrPool.Client.StartExec(exec.ID, docker.StartExecOptions{ - Context: ctx, - Detach: false, - OutputStream: &outBuf, - ErrorStream: &errBuf, - }) - s.Require().NoError(err) - - stdOut := outBuf.Bytes() - stdErr := errBuf.Bytes() - - return stdOut, stdErr -} - -func (s *IntegrationTestSuite) expectErrExecValidation(chain *chain, valIdx int, expectErr bool) func([]byte, []byte) bool { - return func(stdOut []byte, stdErr []byte) bool { - var txResp sdk.TxResponse - gotErr := cdc.UnmarshalJSON(stdOut, &txResp) != nil - if gotErr { - s.Require().True(expectErr) - } - - endpoint := fmt.Sprintf("http://%s", s.valResources[chain.id][valIdx].GetHostPort("1317/tcp")) - // wait for the tx to be committed on chain - s.Require().Eventuallyf( - func() bool { - gotErr := queryGaiaTx(endpoint, txResp.TxHash) != nil - return gotErr == expectErr - }, - time.Minute, - 5*time.Second, - "stdOut: %s, stdErr: %s", - string(stdOut), string(stdErr), - ) - return true - } -} - -func (s *IntegrationTestSuite) defaultExecValidation(chain *chain, valIdx int) func([]byte, []byte) bool { - return func(stdOut []byte, stdErr []byte) bool { - var txResp sdk.TxResponse - if err := cdc.UnmarshalJSON(stdOut, &txResp); err != nil { - return false - } - if strings.Contains(txResp.String(), "code: 0") || txResp.Code == 0 { - endpoint := fmt.Sprintf("http://%s", s.valResources[chain.id][valIdx].GetHostPort("1317/tcp")) - s.Require().Eventually( - func() bool { - return queryGaiaTx(endpoint, txResp.TxHash) == nil - }, - time.Minute, - 5*time.Second, - "stdOut: %s, stdErr: %s", - string(stdOut), string(stdErr), - ) - return true - } - return false - } -} +// import ( +// "bytes" +// "context" +// "encoding/json" +// "fmt" +// "strconv" +// "strings" +// "time" + +// "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 ( +// flagFrom = "from" +// flagHome = "home" +// flagFees = "fees" +// flagGas = "gas" +// flagOutput = "output" +// flagChainID = "chain-id" +// flagSpendLimit = "spend-limit" +// flagGasAdjustment = "gas-adjustment" +// flagFeeAccount = "fee-account" +// flagBroadcastMode = "broadcast-mode" +// flagKeyringBackend = "keyring-backend" +// flagAllowedMessages = "allowed-messages" +// ) + +// type flagOption func(map[string]interface{}) + +// // withKeyValue add a new flag to command +// func withKeyValue(key string, value interface{}) flagOption { +// return func(o map[string]interface{}) { +// o[key] = value +// } +// } + +// func applyOptions(chainID string, options []flagOption) map[string]interface{} { +// opts := map[string]interface{}{ +// flagKeyringBackend: "test", +// flagOutput: "json", +// flagGas: "auto", +// flagFrom: "alice", +// flagBroadcastMode: "sync", +// flagGasAdjustment: "1.5", +// flagChainID: chainID, +// flagHome: gaiaHomePath, +// flagFees: standardFees.String(), +// } +// for _, apply := range options { +// apply(opts) +// } +// return opts +// } + +// func (s *IntegrationTestSuite) execEncode( +// c *chain, +// txPath string, +// opt ...flagOption, +// ) string { +// opts := applyOptions(c.id, opt) +// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) +// defer cancel() + +// s.T().Logf("%s - Executing gaiad encoding with %v", c.id, txPath) +// gaiaCommand := []string{ +// gaiadBinary, +// txCommand, +// "encode", +// txPath, +// } +// for flag, value := range opts { +// gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) +// } + +// var encoded string +// s.executeGaiaTxCommand(ctx, c, gaiaCommand, 0, func(stdOut []byte, stdErr []byte) bool { +// if stdErr != nil { +// return false +// } +// encoded = strings.TrimSuffix(string(stdOut), "\n") +// return true +// }) +// s.T().Logf("successfully encode with %v", txPath) +// return encoded +// } + +// func (s *IntegrationTestSuite) execDecode( +// c *chain, +// txPath string, +// opt ...flagOption, +// ) string { +// opts := applyOptions(c.id, opt) +// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) +// defer cancel() + +// s.T().Logf("%s - Executing gaiad decoding with %v", c.id, txPath) +// gaiaCommand := []string{ +// gaiadBinary, +// txCommand, +// "decode", +// txPath, +// } +// for flag, value := range opts { +// gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) +// } + +// var decoded string +// s.executeGaiaTxCommand(ctx, c, gaiaCommand, 0, func(stdOut []byte, stdErr []byte) bool { +// if stdErr != nil { +// return false +// } +// decoded = strings.TrimSuffix(string(stdOut), "\n") +// return true +// }) +// s.T().Logf("successfully decode %v", txPath) +// return decoded +// } + +// func (s *IntegrationTestSuite) execVestingTx( +// c *chain, +// method string, +// args []string, +// opt ...flagOption, +// ) { +// opts := applyOptions(c.id, opt) +// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) +// defer cancel() + +// s.T().Logf("%s - Executing gaiad %s with %v", c.id, method, args) +// gaiaCommand := []string{ +// gaiadBinary, +// txCommand, +// vestingtypes.ModuleName, +// method, +// "-y", +// } +// gaiaCommand = append(gaiaCommand, args...) + +// for flag, value := range opts { +// gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) +// } + +// s.executeGaiaTxCommand(ctx, c, gaiaCommand, 0, s.defaultExecValidation(c, 0)) +// s.T().Logf("successfully %s with %v", method, args) +// } + +// func (s *IntegrationTestSuite) execCreatePeriodicVestingAccount( +// c *chain, +// address, +// jsonPath string, +// opt ...flagOption, +// ) { +// s.T().Logf("Executing gaiad create periodic vesting account %s", c.id) +// s.execVestingTx(c, "create-periodic-vesting-account", []string{address, jsonPath}, opt...) +// s.T().Logf("successfully created periodic vesting account %s with %s", address, jsonPath) +// } + +// func (s *IntegrationTestSuite) execUnjail( +// c *chain, +// opt ...flagOption, +// ) { +// opts := applyOptions(c.id, opt) +// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) +// defer cancel() + +// s.T().Logf("Executing gaiad slashing unjail %s with options: %v", c.id, opt) +// gaiaCommand := []string{ +// gaiadBinary, +// txCommand, +// slashingtypes.ModuleName, +// "unjail", +// "-y", +// } + +// for flag, value := range opts { +// gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) +// } + +// s.executeGaiaTxCommand(ctx, c, gaiaCommand, 0, s.defaultExecValidation(c, 0)) +// s.T().Logf("successfully unjail with options %v", opt) +// } + +// func (s *IntegrationTestSuite) execFeeGrant(c *chain, valIdx int, granter, grantee, spendLimit string, opt ...flagOption) { +// opt = append(opt, withKeyValue(flagFrom, granter)) +// opt = append(opt, withKeyValue(flagSpendLimit, spendLimit)) +// opts := applyOptions(c.id, opt) + +// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) +// defer cancel() + +// s.T().Logf("granting %s fee from %s on chain %s", grantee, granter, c.id) + +// gaiaCommand := []string{ +// gaiadBinary, +// txCommand, +// feegrant.ModuleName, +// "grant", +// granter, +// grantee, +// "-y", +// } +// for flag, value := range opts { +// gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) +// } + +// s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) +// } + +// func (s *IntegrationTestSuite) execFeeGrantRevoke(c *chain, valIdx int, granter, grantee string, opt ...flagOption) { +// opt = append(opt, withKeyValue(flagFrom, granter)) +// opts := applyOptions(c.id, opt) + +// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) +// defer cancel() + +// s.T().Logf("revoking %s fee grant from %s on chain %s", grantee, granter, c.id) + +// gaiaCommand := []string{ +// gaiadBinary, +// txCommand, +// feegrant.ModuleName, +// "revoke", +// granter, +// grantee, +// "-y", +// } +// for flag, value := range opts { +// gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) +// } + +// s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) +// } + +// func (s *IntegrationTestSuite) execBankSend( +// c *chain, +// valIdx int, +// from, +// to, +// amt, +// fees string, +// expectErr bool, +// opt ...flagOption, +// ) { +// // TODO remove the hardcode opt after refactor, all methods should accept custom flags +// opt = append(opt, withKeyValue(flagFees, fees)) +// opt = append(opt, withKeyValue(flagFrom, from)) +// opts := applyOptions(c.id, opt) + +// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) +// defer cancel() + +// s.T().Logf("sending %s tokens from %s to %s on chain %s", amt, from, to, c.id) + +// gaiaCommand := []string{ +// gaiadBinary, +// txCommand, +// banktypes.ModuleName, +// "send", +// from, +// to, +// amt, +// "-y", +// } +// for flag, value := range opts { +// gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) +// } + +// s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.expectErrExecValidation(c, valIdx, expectErr)) +// } + +// type txBankSend struct { +// from string +// to string +// amt string +// fees string +// log string +// expectErr bool +// } + +// func (s *IntegrationTestSuite) execBankSendBatch( +// c *chain, +// valIdx int, //nolint:unparam +// txs ...txBankSend, +// ) int { +// sucessBankSendCount := 0 + +// for i := range txs { +// s.T().Logf(txs[i].log) + +// s.execBankSend(c, valIdx, txs[i].from, txs[i].to, txs[i].amt, txs[i].fees, txs[i].expectErr) +// if !txs[i].expectErr { +// if !txs[i].expectErr { +// sucessBankSendCount++ +// } +// } +// } + +// return sucessBankSendCount +// } + +// func (s *IntegrationTestSuite) execWithdrawAllRewards(c *chain, valIdx int, payee, fees string, expectErr bool) { +// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) +// defer cancel() + +// gaiaCommand := []string{ +// gaiadBinary, +// txCommand, +// distributiontypes.ModuleName, +// "withdraw-all-rewards", +// fmt.Sprintf("--%s=%s", flags.FlagFrom, payee), +// fmt.Sprintf("--%s=%s", flags.FlagGasPrices, fees), +// fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), +// "--keyring-backend=test", +// "--output=json", +// "-y", +// } + +// s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.expectErrExecValidation(c, valIdx, expectErr)) +// } + +// func (s *IntegrationTestSuite) execDistributionFundCommunityPool(c *chain, valIdx int, from, amt, fees string) { +// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) +// defer cancel() + +// s.T().Logf("Executing gaiad tx distribution fund-community-pool on chain %s", c.id) + +// gaiaCommand := []string{ +// gaiadBinary, +// txCommand, +// distributiontypes.ModuleName, +// "fund-community-pool", +// amt, +// fmt.Sprintf("--%s=%s", flags.FlagFrom, from), +// fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), +// fmt.Sprintf("--%s=%s", flags.FlagFees, fees), +// "--keyring-backend=test", +// "--output=json", +// "-y", +// } + +// s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) +// s.T().Logf("Successfully funded community pool") +// } + +// func (s *IntegrationTestSuite) runGovExec(c *chain, valIdx int, submitterAddr, govCommand string, proposalFlags []string, fees string) { +// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) +// defer cancel() + +// gaiaCommand := []string{ +// gaiadBinary, +// txCommand, +// govtypes.ModuleName, +// govCommand, +// } + +// generalFlags := []string{ +// fmt.Sprintf("--%s=%s", flags.FlagFrom, submitterAddr), +// fmt.Sprintf("--%s=%s", flags.FlagGas, "300000"), // default 200000 isn't enough +// fmt.Sprintf("--%s=%s", flags.FlagGasPrices, fees), +// fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), +// "--keyring-backend=test", +// "--output=json", +// "-y", +// } + +// gaiaCommand = concatFlags(gaiaCommand, proposalFlags, generalFlags) + +// s.T().Logf("Executing gaiad tx gov %s on chain %s", govCommand, c.id) +// s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) +// s.T().Logf("Successfully executed %s", govCommand) +// } + +// func (s *IntegrationTestSuite) executeGKeysAddCommand(c *chain, valIdx int, name string, home string) string { +// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) +// defer cancel() + +// gaiaCommand := []string{ +// gaiadBinary, +// keysCommand, +// "add", +// name, +// fmt.Sprintf("--%s=%s", flags.FlagHome, home), +// "--keyring-backend=test", +// "--output=json", +// } + +// var addrRecord AddressResponse +// s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, func(stdOut []byte, stdErr []byte) bool { +// // Gaiad keys add by default returns payload to stdErr +// if err := json.Unmarshal(stdErr, &addrRecord); err != nil { +// return false +// } +// return strings.Contains(addrRecord.Address, "cosmos") +// }) +// return addrRecord.Address +// } + +// func (s *IntegrationTestSuite) executeKeysList(c *chain, valIdx int, home string) { +// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) +// defer cancel() + +// gaiaCommand := []string{ +// gaiadBinary, +// keysCommand, +// "list", +// "--keyring-backend=test", +// fmt.Sprintf("--%s=%s", flags.FlagHome, home), +// "--output=json", +// } + +// s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, func([]byte, []byte) bool { +// return true +// }) +// } + +// func (s *IntegrationTestSuite) executeDelegate(c *chain, valIdx int, amount, valOperAddress, delegatorAddr, home, delegateFees string) { //nolint:unparam +// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) +// defer cancel() + +// s.T().Logf("Executing gaiad tx staking delegate %s", c.id) + +// gaiaCommand := []string{ +// gaiadBinary, +// txCommand, +// stakingtypes.ModuleName, +// "delegate", +// valOperAddress, +// amount, +// fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddr), +// fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), +// fmt.Sprintf("--%s=%s", flags.FlagGasPrices, delegateFees), +// "--keyring-backend=test", +// fmt.Sprintf("--%s=%s", flags.FlagHome, home), +// "--output=json", +// "-y", +// } + +// s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) +// s.T().Logf("%s successfully delegated %s to %s", delegatorAddr, amount, valOperAddress) +// } + +// func (s *IntegrationTestSuite) executeRedelegate(c *chain, valIdx int, amount, originalValOperAddress, +// newValOperAddress, delegatorAddr, home, delegateFees string, +// ) { +// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) +// defer cancel() + +// s.T().Logf("Executing gaiad tx staking redelegate %s", c.id) + +// gaiaCommand := []string{ +// gaiadBinary, +// txCommand, +// stakingtypes.ModuleName, +// "redelegate", +// originalValOperAddress, +// newValOperAddress, +// amount, +// fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddr), +// fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), +// fmt.Sprintf("--%s=%s", flags.FlagGas, "300000"), // default 200000 isn't enough +// fmt.Sprintf("--%s=%s", flags.FlagGasPrices, delegateFees), +// "--keyring-backend=test", +// fmt.Sprintf("--%s=%s", flags.FlagHome, home), +// "--output=json", +// "-y", +// } + +// s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) +// s.T().Logf("%s successfully redelegated %s from %s to %s", delegatorAddr, amount, originalValOperAddress, newValOperAddress) +// } + +// func (s *IntegrationTestSuite) getLatestBlockHeight(c *chain, valIdx int) int { +// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) +// defer cancel() + +// type syncInfo struct { +// SyncInfo struct { +// LatestHeight string `json:"latest_block_height"` +// } `json:"SyncInfo"` +// } + +// var currentHeight int +// gaiaCommand := []string{gaiadBinary, "status"} +// s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, func(stdOut []byte, stdErr []byte) bool { +// var ( +// err error +// block syncInfo +// ) +// s.Require().NoError(json.Unmarshal(stdErr, &block)) +// currentHeight, err = strconv.Atoi(block.SyncInfo.LatestHeight) +// s.Require().NoError(err) +// return currentHeight > 0 +// }) +// return currentHeight +// } + +// func (s *IntegrationTestSuite) verifyBalanceChange(endpoint string, expectedAmount sdk.Coin, recipientAddress string) { +// s.Require().Eventually( +// func() bool { +// afterAtomBalance, err := getSpecificBalance(endpoint, recipientAddress, uatomDenom) +// s.Require().NoError(err) + +// return afterAtomBalance.IsEqual(expectedAmount) +// }, +// 20*time.Second, +// 5*time.Second, +// ) +// } + +// func (s *IntegrationTestSuite) execSetWithdrawAddress( +// c *chain, +// valIdx int, +// fees, +// delegatorAddress, +// newWithdrawalAddress, +// homePath string, +// ) { +// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) +// defer cancel() + +// s.T().Logf("Setting distribution withdrawal address on chain %s for %s to %s", c.id, delegatorAddress, newWithdrawalAddress) +// gaiaCommand := []string{ +// gaiadBinary, +// txCommand, +// distributiontypes.ModuleName, +// "set-withdraw-addr", +// newWithdrawalAddress, +// fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddress), +// fmt.Sprintf("--%s=%s", flags.FlagFees, fees), +// fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), +// fmt.Sprintf("--%s=%s", flags.FlagHome, homePath), +// "--keyring-backend=test", +// "--output=json", +// "-y", +// } + +// s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) +// s.T().Logf("Successfully set new distribution withdrawal address for %s to %s", delegatorAddress, newWithdrawalAddress) +// } + +// func (s *IntegrationTestSuite) execWithdrawReward( +// c *chain, +// valIdx int, +// delegatorAddress, +// validatorAddress, +// homePath string, +// ) { +// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) +// defer cancel() + +// s.T().Logf("Withdrawing distribution rewards on chain %s for delegator %s from %s validator", c.id, delegatorAddress, validatorAddress) +// gaiaCommand := []string{ +// gaiadBinary, +// txCommand, +// distributiontypes.ModuleName, +// "withdraw-rewards", +// validatorAddress, +// fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddress), +// fmt.Sprintf("--%s=%s", flags.FlagGasPrices, "300uatom"), +// fmt.Sprintf("--%s=%s", flags.FlagGas, "auto"), +// fmt.Sprintf("--%s=%s", flags.FlagGasAdjustment, "1.5"), +// fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), +// fmt.Sprintf("--%s=%s", flags.FlagHome, homePath), +// "--keyring-backend=test", +// "--output=json", +// "-y", +// } + +// s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) +// s.T().Logf("Successfully withdrew distribution rewards for delegator %s from validator %s", delegatorAddress, validatorAddress) +// } + +// func (s *IntegrationTestSuite) executeGaiaTxCommand(ctx context.Context, c *chain, gaiaCommand []string, valIdx int, validation func([]byte, []byte) bool) { +// if validation == nil { +// validation = s.defaultExecValidation(s.chainA, 0) +// } +// var ( +// outBuf bytes.Buffer +// errBuf bytes.Buffer +// ) +// exec, err := s.dkrPool.Client.CreateExec(docker.CreateExecOptions{ +// Context: ctx, +// AttachStdout: true, +// AttachStderr: true, +// Container: s.valResources[c.id][valIdx].Container.ID, +// User: "nonroot", +// Cmd: gaiaCommand, +// }) +// s.Require().NoError(err) + +// err = s.dkrPool.Client.StartExec(exec.ID, docker.StartExecOptions{ +// Context: ctx, +// Detach: false, +// OutputStream: &outBuf, +// ErrorStream: &errBuf, +// }) +// s.Require().NoError(err) + +// stdOut := outBuf.Bytes() +// stdErr := errBuf.Bytes() + +// if !validation(stdOut, stdErr) { +// s.Require().FailNowf("Exec validation failed", "stdout: %s, stderr: %s", +// string(stdOut), string(stdErr)) +// } +// } + +// func (s *IntegrationTestSuite) executeHermesCommand(ctx context.Context, hermesCmd []string) ([]byte, []byte) { +// var ( +// outBuf bytes.Buffer +// errBuf bytes.Buffer +// ) +// exec, err := s.dkrPool.Client.CreateExec(docker.CreateExecOptions{ +// Context: ctx, +// AttachStdout: true, +// AttachStderr: true, +// Container: s.hermesResource1.Container.ID, +// User: "root", +// Cmd: hermesCmd, +// }) +// s.Require().NoError(err) + +// err = s.dkrPool.Client.StartExec(exec.ID, docker.StartExecOptions{ +// Context: ctx, +// Detach: false, +// OutputStream: &outBuf, +// ErrorStream: &errBuf, +// }) +// s.Require().NoError(err) + +// stdOut := outBuf.Bytes() +// stdErr := errBuf.Bytes() + +// return stdOut, stdErr +// } + +// func (s *IntegrationTestSuite) expectErrExecValidation(chain *chain, valIdx int, expectErr bool) func([]byte, []byte) bool { +// return func(stdOut []byte, stdErr []byte) bool { +// var txResp sdk.TxResponse +// gotErr := cdc.UnmarshalJSON(stdOut, &txResp) != nil +// if gotErr { +// s.Require().True(expectErr) +// } + +// endpoint := fmt.Sprintf("http://%s", s.valResources[chain.id][valIdx].GetHostPort("1317/tcp")) +// // wait for the tx to be committed on chain +// s.Require().Eventuallyf( +// func() bool { +// gotErr := queryGaiaTx(endpoint, txResp.TxHash) != nil +// return gotErr == expectErr +// }, +// time.Minute, +// 5*time.Second, +// "stdOut: %s, stdErr: %s", +// string(stdOut), string(stdErr), +// ) +// return true +// } +// } + +// func (s *IntegrationTestSuite) defaultExecValidation(chain *chain, valIdx int) func([]byte, []byte) bool { +// return func(stdOut []byte, stdErr []byte) bool { +// var txResp sdk.TxResponse +// if err := cdc.UnmarshalJSON(stdOut, &txResp); err != nil { +// return false +// } +// if strings.Contains(txResp.String(), "code: 0") || txResp.Code == 0 { +// endpoint := fmt.Sprintf("http://%s", s.valResources[chain.id][valIdx].GetHostPort("1317/tcp")) +// s.Require().Eventually( +// func() bool { +// return queryGaiaTx(endpoint, txResp.TxHash) == nil +// }, +// time.Minute, +// 5*time.Second, +// "stdOut: %s, stdErr: %s", +// string(stdOut), string(stdErr), +// ) +// return true +// } +// return false +// } +// } diff --git a/tests/e2e/e2e_feegrant_test.go b/tests/e2e/e2e_feegrant_test.go index 3e0f862bbd..36750715b2 100644 --- a/tests/e2e/e2e_feegrant_test.go +++ b/tests/e2e/e2e_feegrant_test.go @@ -1,104 +1,105 @@ package e2e -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" -) - -/* -TestFeeGrant creates a test to ensure that Alice can grant the fees for bob. -Test Benchmarks: -1. Execute fee grant CLI command for Alice to pay bob fees -2. Send a transaction from bob with Alice as a fee granter -3. Check the bob balances if the fee was not deducted -4. Try to send a transaction from bob with Alice as a fee granter again. Should fail -because all amount granted was expended -*/ -func (s *IntegrationTestSuite) testFeeGrant() { - s.Run("test fee grant module", func() { - var ( - valIdx = 0 - c = s.chainA - api = fmt.Sprintf("http://%s", s.valResources[c.id][valIdx].GetHostPort("1317/tcp")) - ) - - alice := c.genesisAccounts[1].keyInfo.GetAddress() - bob := c.genesisAccounts[2].keyInfo.GetAddress() - charlie := c.genesisAccounts[3].keyInfo.GetAddress() - - // add fee grant from alice to bob - s.execFeeGrant( - c, - valIdx, - alice.String(), - bob.String(), - standardFees.String(), - withKeyValue(flagAllowedMessages, sdk.MsgTypeURL(&banktypes.MsgSend{})), - ) - - bobBalance, err := getSpecificBalance(api, bob.String(), uatomDenom) - s.Require().NoError(err) - - // withdrawal all balance + fee + fee granter flag should succeed - s.execBankSend( - c, - valIdx, - bob.String(), - Address(), - tokenAmount.String(), - standardFees.String(), - false, - withKeyValue(flagFeeAccount, alice.String()), - ) - - // check if the bob balance was subtracted without the fees - expectedBobBalance := bobBalance.Sub(tokenAmount) - bobBalance, err = getSpecificBalance(api, bob.String(), uatomDenom) - s.Require().NoError(err) - s.Require().Equal(expectedBobBalance, bobBalance) - - // tx should fail after spend limit reach - s.execBankSend( - c, - valIdx, - bob.String(), - Address(), - tokenAmount.String(), - standardFees.String(), - true, - withKeyValue(flagFeeAccount, alice.String()), - ) - - // add fee grant from alice to charlie - s.execFeeGrant( - c, - valIdx, - alice.String(), - charlie.String(), - standardFees.String(), // spend limit - withKeyValue(flagAllowedMessages, sdk.MsgTypeURL(&banktypes.MsgSend{})), - ) - - // revoke fee grant from alice to charlie - s.execFeeGrantRevoke( - c, - valIdx, - alice.String(), - charlie.String(), - ) - - // tx should fail because the grant was revoked - s.execBankSend( - c, - valIdx, - charlie.String(), - Address(), - tokenAmount.String(), - standardFees.String(), - true, - withKeyValue(flagFeeAccount, alice.String()), - ) - }) -} +// +// import ( +// "fmt" +// +// sdk "github.com/cosmos/cosmos-sdk/types" +// banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" +//) +// +///* +// TestFeeGrant creates a test to ensure that Alice can grant the fees for bob. +// Test Benchmarks: +// 1. Execute fee grant CLI command for Alice to pay bob fees +// 2. Send a transaction from bob with Alice as a fee granter +// 3. Check the bob balances if the fee was not deducted +// 4. Try to send a transaction from bob with Alice as a fee granter again. Should fail +// because all amount granted was expended +// */ +// func (s *IntegrationTestSuite) testFeeGrant() { +// s.Run("test fee grant module", func() { +// var ( +// valIdx = 0 +// c = s.chainA +// api = fmt.Sprintf("http://%s", s.valResources[c.id][valIdx].GetHostPort("1317/tcp")) +// ) +// +// alice := c.genesisAccounts[1].keyInfo.GetAddress() +// bob := c.genesisAccounts[2].keyInfo.GetAddress() +// charlie := c.genesisAccounts[3].keyInfo.GetAddress() +// +// // add fee grant from alice to bob +// s.execFeeGrant( +// c, +// valIdx, +// alice.String(), +// bob.String(), +// standardFees.String(), +// withKeyValue(flagAllowedMessages, sdk.MsgTypeURL(&banktypes.MsgSend{})), +// ) +// +// bobBalance, err := getSpecificBalance(api, bob.String(), uatomDenom) +// s.Require().NoError(err) +// +// // withdrawal all balance + fee + fee granter flag should succeed +// s.execBankSend( +// c, +// valIdx, +// bob.String(), +// Address(), +// tokenAmount.String(), +// standardFees.String(), +// false, +// withKeyValue(flagFeeAccount, alice.String()), +// ) +// +// // check if the bob balance was subtracted without the fees +// expectedBobBalance := bobBalance.Sub(tokenAmount) +// bobBalance, err = getSpecificBalance(api, bob.String(), uatomDenom) +// s.Require().NoError(err) +// s.Require().Equal(expectedBobBalance, bobBalance) +// +// // tx should fail after spend limit reach +// s.execBankSend( +// c, +// valIdx, +// bob.String(), +// Address(), +// tokenAmount.String(), +// standardFees.String(), +// true, +// withKeyValue(flagFeeAccount, alice.String()), +// ) +// +// // add fee grant from alice to charlie +// s.execFeeGrant( +// c, +// valIdx, +// alice.String(), +// charlie.String(), +// standardFees.String(), // spend limit +// withKeyValue(flagAllowedMessages, sdk.MsgTypeURL(&banktypes.MsgSend{})), +// ) +// +// // revoke fee grant from alice to charlie +// s.execFeeGrantRevoke( +// c, +// valIdx, +// alice.String(), +// charlie.String(), +// ) +// +// // tx should fail because the grant was revoked +// s.execBankSend( +// c, +// valIdx, +// charlie.String(), +// Address(), +// tokenAmount.String(), +// standardFees.String(), +// true, +// withKeyValue(flagFeeAccount, alice.String()), +// ) +// }) +//} diff --git a/tests/e2e/e2e_globalfee_proposal_test.go b/tests/e2e/e2e_globalfee_proposal_test.go index 232868cedc..bb3e5fe5ad 100644 --- a/tests/e2e/e2e_globalfee_proposal_test.go +++ b/tests/e2e/e2e_globalfee_proposal_test.go @@ -1,123 +1,124 @@ package e2e -import ( - "fmt" - "strconv" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - gov "github.com/cosmos/cosmos-sdk/x/gov/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types/proposal" -) - -func (s *IntegrationTestSuite) govProposeNewGlobalfee(newGlobalfee sdk.DecCoins, proposalCounter int, submitter string, _ string) { - s.writeGovParamChangeProposalGlobalFees(s.chainA, newGlobalfee) - chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) - submitGovFlags := []string{"param-change", configFile(proposalGlobalFeeFilename)} - depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} - voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} - - // gov proposing new fees - s.T().Logf("Proposal number: %d", proposalCounter) - s.T().Logf("Submitting, deposit and vote legacy Gov Proposal: change global fee to %s", newGlobalfee.String()) - s.runGovProcess(chainAAPIEndpoint, submitter, proposalCounter, paramtypes.ProposalTypeChange, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false) - - // query the proposal status and new fee - s.Require().Eventually( - func() bool { - proposal, err := queryGovProposal(chainAAPIEndpoint, proposalCounter) - s.Require().NoError(err) - return proposal.GetProposal().Status == gov.StatusPassed - }, - 15*time.Second, - 5*time.Second, - ) - - s.Require().Eventually( - func() bool { - globalFees, err := queryGlobalFees(chainAAPIEndpoint) - s.T().Logf("After gov new global fee proposal: %s", globalFees.String()) - s.Require().NoError(err) - - // attention: if global fee is empty, when query globalfee, it shows empty rather than default ante.DefaultZeroGlobalFee() = 0uatom. - return globalFees.IsEqual(newGlobalfee) - }, - 15*time.Second, - 5*time.Second, - ) -} - -func (s *IntegrationTestSuite) govProposeNewBypassMsgs(newBypassMsgs []string, proposalCounter int, submitter string, fees string) { //nolint:unparam - s.writeGovParamChangeProposalBypassMsgs(s.chainA, newBypassMsgs) - chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) - submitGovFlags := []string{"param-change", configFile(proposalBypassMsgFilename)} - depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} - voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} - - // gov proposing new fees - s.T().Logf("Proposal number: %d", proposalCounter) - s.T().Logf("Submitting, deposit and vote legacy Gov Proposal: change bypass min fee msg types to %s", newBypassMsgs) - s.runGovProcess(chainAAPIEndpoint, submitter, proposalCounter, paramtypes.ProposalTypeChange, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false) - - // query the proposal status and new fee - s.Require().Eventually( - func() bool { - proposal, err := queryGovProposal(chainAAPIEndpoint, proposalCounter) - s.Require().NoError(err) - return proposal.GetProposal().Status == gov.StatusPassed - }, - 15*time.Second, - 5*time.Second, - ) - - s.Require().Eventually( - func() bool { - bypassMsgs, err := queryBypassMsgs(chainAAPIEndpoint) - s.T().Logf("After gov new global fee proposal: %s", newBypassMsgs) - s.Require().NoError(err) - - // attention: if global fee is empty, when query globalfee, it shows empty rather than default ante.DefaultZeroGlobalFee() = 0uatom. - s.Require().Equal(newBypassMsgs, bypassMsgs) - return true - }, - 15*time.Second, - 5*time.Second, - ) -} - -func (s *IntegrationTestSuite) govProposeNewMaxTotalBypassMinFeeMsgGasUsage(newGas uint64, proposalCounter int, submitter string) { - s.writeGovParamChangeProposalMaxTotalBypass(s.chainA, newGas) - chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) - submitGovFlags := []string{"param-change", configFile(proposalMaxTotalBypassFilename)} - depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} - voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} - - // gov proposing new max gas usage for bypass msgs - s.T().Logf("Proposal number: %d", proposalCounter) - s.T().Logf("Submitting, deposit and vote legacy Gov Proposal: change maxTotalBypassMinFeeMsgGasUsage to %d", newGas) - s.runGovProcess(chainAAPIEndpoint, submitter, proposalCounter, paramtypes.ProposalTypeChange, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false) - - // query the proposal status and max gas usage for bypass msgs - s.Require().Eventually( - func() bool { - proposal, err := queryGovProposal(chainAAPIEndpoint, proposalCounter) - s.Require().NoError(err) - return proposal.GetProposal().Status == gov.StatusPassed - }, - 15*time.Second, - 5*time.Second, - ) - - s.Require().Eventually( - func() bool { - gas, err := queryMaxTotalBypassMinFeeMsgGasUsage(chainAAPIEndpoint) - s.T().Logf("After gov new global fee proposal: %d", gas) - s.Require().NoError(err) - - s.Require().Equal(newGas, gas) - return true - }, - 15*time.Second, - 5*time.Second, - ) -} +// +// import ( +// "fmt" +// "strconv" +// "time" +// +// sdk "github.com/cosmos/cosmos-sdk/types" +// gov "github.com/cosmos/cosmos-sdk/x/gov/types" +// paramtypes "github.com/cosmos/cosmos-sdk/x/params/types/proposal" +//) +// +// func (s *IntegrationTestSuite) govProposeNewGlobalfee(newGlobalfee sdk.DecCoins, proposalCounter int, submitter string, _ string) { +// s.writeGovParamChangeProposalGlobalFees(s.chainA, newGlobalfee) +// chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) +// submitGovFlags := []string{"param-change", configFile(proposalGlobalFeeFilename)} +// depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} +// voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} +// +// // gov proposing new fees +// s.T().Logf("Proposal number: %d", proposalCounter) +// s.T().Logf("Submitting, deposit and vote legacy Gov Proposal: change global fee to %s", newGlobalfee.String()) +// s.runGovProcess(chainAAPIEndpoint, submitter, proposalCounter, paramtypes.ProposalTypeChange, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false) +// +// // query the proposal status and new fee +// s.Require().Eventually( +// func() bool { +// proposal, err := queryGovProposal(chainAAPIEndpoint, proposalCounter) +// s.Require().NoError(err) +// return proposal.GetProposal().Status == gov.StatusPassed +// }, +// 15*time.Second, +// 5*time.Second, +// ) +// +// s.Require().Eventually( +// func() bool { +// globalFees, err := queryGlobalFees(chainAAPIEndpoint) +// s.T().Logf("After gov new global fee proposal: %s", globalFees.String()) +// s.Require().NoError(err) +// +// // attention: if global fee is empty, when query globalfee, it shows empty rather than default ante.DefaultZeroGlobalFee() = 0uatom. +// return globalFees.IsEqual(newGlobalfee) +// }, +// 15*time.Second, +// 5*time.Second, +// ) +//} +// +// func (s *IntegrationTestSuite) govProposeNewBypassMsgs(newBypassMsgs []string, proposalCounter int, submitter string, fees string) { //nolint:unparam +// s.writeGovParamChangeProposalBypassMsgs(s.chainA, newBypassMsgs) +// chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) +// submitGovFlags := []string{"param-change", configFile(proposalBypassMsgFilename)} +// depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} +// voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} +// +// // gov proposing new fees +// s.T().Logf("Proposal number: %d", proposalCounter) +// s.T().Logf("Submitting, deposit and vote legacy Gov Proposal: change bypass min fee msg types to %s", newBypassMsgs) +// s.runGovProcess(chainAAPIEndpoint, submitter, proposalCounter, paramtypes.ProposalTypeChange, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false) +// +// // query the proposal status and new fee +// s.Require().Eventually( +// func() bool { +// proposal, err := queryGovProposal(chainAAPIEndpoint, proposalCounter) +// s.Require().NoError(err) +// return proposal.GetProposal().Status == gov.StatusPassed +// }, +// 15*time.Second, +// 5*time.Second, +// ) +// +// s.Require().Eventually( +// func() bool { +// bypassMsgs, err := queryBypassMsgs(chainAAPIEndpoint) +// s.T().Logf("After gov new global fee proposal: %s", newBypassMsgs) +// s.Require().NoError(err) +// +// // attention: if global fee is empty, when query globalfee, it shows empty rather than default ante.DefaultZeroGlobalFee() = 0uatom. +// s.Require().Equal(newBypassMsgs, bypassMsgs) +// return true +// }, +// 15*time.Second, +// 5*time.Second, +// ) +//} +// +// func (s *IntegrationTestSuite) govProposeNewMaxTotalBypassMinFeeMsgGasUsage(newGas uint64, proposalCounter int, submitter string) { +// s.writeGovParamChangeProposalMaxTotalBypass(s.chainA, newGas) +// chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) +// submitGovFlags := []string{"param-change", configFile(proposalMaxTotalBypassFilename)} +// depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} +// voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} +// +// // gov proposing new max gas usage for bypass msgs +// s.T().Logf("Proposal number: %d", proposalCounter) +// s.T().Logf("Submitting, deposit and vote legacy Gov Proposal: change maxTotalBypassMinFeeMsgGasUsage to %d", newGas) +// s.runGovProcess(chainAAPIEndpoint, submitter, proposalCounter, paramtypes.ProposalTypeChange, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false) +// +// // query the proposal status and max gas usage for bypass msgs +// s.Require().Eventually( +// func() bool { +// proposal, err := queryGovProposal(chainAAPIEndpoint, proposalCounter) +// s.Require().NoError(err) +// return proposal.GetProposal().Status == gov.StatusPassed +// }, +// 15*time.Second, +// 5*time.Second, +// ) +// +// s.Require().Eventually( +// func() bool { +// gas, err := queryMaxTotalBypassMinFeeMsgGasUsage(chainAAPIEndpoint) +// s.T().Logf("After gov new global fee proposal: %d", gas) +// s.Require().NoError(err) +// +// s.Require().Equal(newGas, gas) +// return true +// }, +// 15*time.Second, +// 5*time.Second, +// ) +//} diff --git a/tests/e2e/e2e_globalfee_test.go b/tests/e2e/e2e_globalfee_test.go index f70cb5cb98..27ab9f1e97 100644 --- a/tests/e2e/e2e_globalfee_test.go +++ b/tests/e2e/e2e_globalfee_test.go @@ -1,334 +1,335 @@ package e2e -import ( - "fmt" - "time" - - "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// globalfee in genesis is set to be "0.00001uatom" -func (s *IntegrationTestSuite) testQueryGlobalFeesInGenesis() { - chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) - feeInGenesis, err := sdk.ParseDecCoins(initialGlobalFeeAmt + uatomDenom) - s.Require().NoError(err) - s.Require().Eventually( - func() bool { - fees, err := queryGlobalFees(chainAAPIEndpoint) - s.T().Logf("Global Fees in Genesis: %s", fees.String()) - s.Require().NoError(err) - - return fees.IsEqual(feeInGenesis) - }, - 15*time.Second, - 5*time.Second, - ) -} - -/* -global fee e2e tests: -initial setup: initial globalfee = 0.00001uatom, min_gas_price = 0.00001uatom -(This initial value setup is to pass other e2e tests) - -test1: gov proposal globalfee = [], min_gas_price=0.00001uatom, query globalfee still get empty -- tx with fee denom photon, fail -- tx with zero fee denom photon, fail -- tx with fee denom uatom, pass -- tx with fee empty, fail - -test2: gov propose globalfee = 0.000001uatom(lower than min_gas_price) -- tx with fee higher than 0.000001uatom but lower than 0.00001uatom, fail -- tx with fee higher than/equal to 0.00001uatom, pass -- tx with fee photon fail - -test3: gov propose globalfee = 0.0001uatom (higher than min_gas_price) -- tx with fee equal to 0.0001uatom, pass -- tx with fee equal to 0.00001uatom, fail - -test4: gov propose globalfee = 0.000001uatom (lower than min_gas_price), 0photon -- tx with fee 0.0000001photon, fail -- tx with fee 0.000001photon, pass -- tx with empty fee, pass -- tx with fee photon pass -- tx with fee 0photon, 0.000005uatom fail -- tx with fee 0photon, 0.00001uatom pass -test5: check balance correct: all the successful bank sent tokens are received -test6: gov propose change back to initial globalfee = 0.00001photon, This is for not influence other e2e tests. -*/ -func (s *IntegrationTestSuite) testGlobalFees() { - chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) - - submitterAddr := s.chainA.validators[0].keyInfo.GetAddress() - submitter := submitterAddr.String() - recipientAddress := s.chainA.validators[1].keyInfo.GetAddress() - recipient := recipientAddress.String() - - var beforeRecipientPhotonBalance sdk.Coin - s.Require().Eventually( - func() bool { - var err error - beforeRecipientPhotonBalance, err = getSpecificBalance(chainAAPIEndpoint, recipient, photonDenom) - s.Require().NoError(err) - - return beforeRecipientPhotonBalance.IsValid() - }, - 10*time.Second, - 5*time.Second, - ) - if beforeRecipientPhotonBalance.Equal(sdk.Coin{}) { - beforeRecipientPhotonBalance = sdk.NewCoin(photonDenom, sdk.ZeroInt()) - } - - sendAmt := int64(1000) - token := sdk.NewInt64Coin(photonDenom, sendAmt) // send 1000photon each time - sucessBankSendCount := 0 - - // ---------------------------- test1: globalfee empty -------------------------------------------- - // prepare gov globalfee proposal - emptyGlobalFee := sdk.DecCoins{} - proposalCounter++ - s.govProposeNewGlobalfee(emptyGlobalFee, proposalCounter, submitter, standardFees.String()) - paidFeeAmt := math.LegacyMustNewDecFromStr(minGasPrice).Mul(math.LegacyNewDec(gas)).String() - - s.T().Logf("test case: empty global fee, globalfee=%s, min_gas_price=%s", emptyGlobalFee.String(), minGasPrice+uatomDenom) - txBankSends := []txBankSend{ - { - from: submitter, - to: recipient, - amt: token.String(), - fees: "0" + uatomDenom, - log: "Tx fee is zero coin with correct denom: uatom, fail", - expectErr: true, - }, - { - from: submitter, - to: recipient, - amt: token.String(), - fees: "", - log: "Tx fee is empty, fail", - expectErr: true, - }, - { - from: submitter, - to: recipient, - amt: token.String(), - fees: "4" + photonDenom, - log: "Tx with wrong denom: photon, fail", - expectErr: true, - }, - { - from: submitter, - to: recipient, - amt: token.String(), - fees: "0" + photonDenom, - log: "Tx fee is zero coins of wrong denom: photon, fail", - expectErr: true, - }, - { - from: submitter, - to: recipient, - amt: token.String(), - fees: paidFeeAmt + uatomDenom, - log: "Tx fee is higher than min_gas_price, pass", - expectErr: false, - }, - } - sucessBankSendCount += s.execBankSendBatch(s.chainA, 0, txBankSends...) - - // ------------------ test2: globalfee lower than min_gas_price ----------------------------------- - // prepare gov globalfee proposal - lowGlobalFee := sdk.DecCoins{sdk.NewDecCoinFromDec(uatomDenom, sdk.MustNewDecFromStr(lowGlobalFeesAmt))} - proposalCounter++ - s.govProposeNewGlobalfee(lowGlobalFee, proposalCounter, submitter, standardFees.String()) - - paidFeeAmt = math.LegacyMustNewDecFromStr(minGasPrice).Mul(math.LegacyNewDec(gas)).String() - paidFeeAmtLowMinGasHighGlobalFee := math.LegacyMustNewDecFromStr(lowGlobalFeesAmt). - Mul(math.LegacyNewDec(2)). - Mul(math.LegacyNewDec(gas)). - String() - paidFeeAmtLowGlobalFee := math.LegacyMustNewDecFromStr(lowGlobalFeesAmt).Quo(math.LegacyNewDec(2)).String() - - s.T().Logf("test case: global fee is lower than min_gas_price, globalfee=%s, min_gas_price=%s", lowGlobalFee.String(), minGasPrice+uatomDenom) - txBankSends = []txBankSend{ - { - from: submitter, - to: recipient, - amt: token.String(), - fees: paidFeeAmt + uatomDenom, - log: "Tx fee higher than/equal to min_gas_price and global fee, pass", - expectErr: false, - }, - { - from: submitter, - to: recipient, - amt: token.String(), - fees: paidFeeAmtLowGlobalFee + uatomDenom, - log: "Tx fee lower than/equal to min_gas_price and global fee, pass", - expectErr: true, - }, - { - from: submitter, - to: recipient, - amt: token.String(), - fees: paidFeeAmtLowMinGasHighGlobalFee + uatomDenom, - log: "Tx fee lower than/equal global fee and lower than min_gas_price, fail", - expectErr: true, - }, - { - from: submitter, - to: recipient, - amt: token.String(), - fees: paidFeeAmt + photonDenom, - log: "Tx fee has wrong denom, fail", - expectErr: true, - }, - } - sucessBankSendCount += s.execBankSendBatch(s.chainA, 0, txBankSends...) - - // ------------------ test3: globalfee higher than min_gas_price ---------------------------------- - // prepare gov globalfee proposal - highGlobalFee := sdk.DecCoins{sdk.NewDecCoinFromDec(uatomDenom, sdk.MustNewDecFromStr(highGlobalFeeAmt))} - proposalCounter++ - s.govProposeNewGlobalfee(highGlobalFee, proposalCounter, submitter, paidFeeAmt+uatomDenom) - - paidFeeAmt = math.LegacyMustNewDecFromStr(highGlobalFeeAmt).Mul(math.LegacyNewDec(gas)).String() - paidFeeAmtHigherMinGasLowerGalobalFee := math.LegacyMustNewDecFromStr(minGasPrice). - Quo(math.LegacyNewDec(2)).String() - - s.T().Logf("test case: global fee is higher than min_gas_price, globalfee=%s, min_gas_price=%s", highGlobalFee.String(), minGasPrice+uatomDenom) - txBankSends = []txBankSend{ - { - from: submitter, - to: recipient, - amt: token.String(), - fees: paidFeeAmt + uatomDenom, - log: "Tx fee is higher than/equal to global fee and min_gas_price, pass", - expectErr: false, - }, - { - from: submitter, - to: recipient, - amt: token.String(), - fees: paidFeeAmtHigherMinGasLowerGalobalFee + uatomDenom, - log: "Tx fee is higher than/equal to min_gas_price but lower than global fee, fail", - expectErr: true, - }, - } - sucessBankSendCount += s.execBankSendBatch(s.chainA, 0, txBankSends...) - - // ---------------------------- test4: global fee with two denoms ----------------------------------- - // prepare gov globalfee proposal - mixGlobalFee := sdk.DecCoins{ - sdk.NewDecCoinFromDec(photonDenom, sdk.NewDec(0)), - sdk.NewDecCoinFromDec(uatomDenom, sdk.MustNewDecFromStr(lowGlobalFeesAmt)), - }.Sort() - proposalCounter++ - s.govProposeNewGlobalfee(mixGlobalFee, proposalCounter, submitter, paidFeeAmt+uatomDenom) - - // equal to min_gas_price - paidFeeAmt = math.LegacyMustNewDecFromStr(minGasPrice).Mul(math.LegacyNewDec(gas)).String() - paidFeeAmtLow := math.LegacyMustNewDecFromStr(lowGlobalFeesAmt). - Quo(math.LegacyNewDec(2)). - Mul(math.LegacyNewDec(gas)). - String() - - s.T().Logf("test case: global fees contain multiple denoms: one zero coin, one non-zero coin, globalfee=%s, min_gas_price=%s", mixGlobalFee.String(), minGasPrice+uatomDenom) - txBankSends = []txBankSend{ - { - from: submitter, - to: recipient, - amt: token.String(), - fees: paidFeeAmt + uatomDenom, - log: "Tx with fee higher than/equal to one of denom's amount the global fee, pass", - expectErr: false, - }, - { - from: submitter, - to: recipient, - amt: token.String(), - fees: paidFeeAmtLow + uatomDenom, - log: "Tx with fee lower than one of denom's amount the global fee, fail", - expectErr: true, - }, - { - from: submitter, - to: recipient, - amt: token.String(), - fees: "", - log: "Tx with fee empty fee, pass", - expectErr: false, - }, - { - from: submitter, - to: recipient, - amt: token.String(), - fees: "0" + photonDenom, - log: "Tx with zero coin in the denom of zero coin of global fee, pass", - expectErr: false, - }, - { - from: submitter, - to: recipient, - amt: token.String(), - fees: "0" + photonDenom, - log: "Tx with zero coin in the denom of zero coin of global fee, pass", - expectErr: false, - }, - { - from: submitter, - to: recipient, - amt: token.String(), - fees: "2" + photonDenom, - log: "Tx with non-zero coin in the denom of zero coin of global fee, pass", - expectErr: false, - }, - { - from: submitter, - to: recipient, - amt: token.String(), - fees: "0" + photonDenom + "," + paidFeeAmtLow + uatomDenom, - log: "Tx with multiple fee coins, zero coin and low fee, fail", - expectErr: true, - }, - { - from: submitter, - to: recipient, - amt: token.String(), - fees: "0" + photonDenom + "," + paidFeeAmt + uatomDenom, - log: "Tx with multiple fee coins, zero coin and high fee, pass", - expectErr: false, - }, - - { - from: submitter, - to: recipient, - amt: token.String(), - fees: "2" + photonDenom + "," + paidFeeAmt + uatomDenom, - log: "Tx with multiple fee coins, all higher than global fee and min_gas_price", - expectErr: false, - }, - } - sucessBankSendCount += s.execBankSendBatch(s.chainA, 0, txBankSends...) - - // --------------------------------------------------------------------------- - // check the balance is correct after previous txs - s.Require().Eventually( - func() bool { - afterRecipientPhotonBalance, err := getSpecificBalance(chainAAPIEndpoint, recipient, photonDenom) - s.Require().NoError(err) - IncrementedPhoton := afterRecipientPhotonBalance.Sub(beforeRecipientPhotonBalance) - photonSent := sdk.NewInt64Coin(photonDenom, sendAmt*int64(sucessBankSendCount)) - return IncrementedPhoton.IsEqual(photonSent) - }, - time.Minute, - 5*time.Second, - ) - - // gov proposing to change back to original global fee - s.T().Logf("Propose to change back to original global fees: %s", initialGlobalFeeAmt+uatomDenom) - oldfees, err := sdk.ParseDecCoins(initialGlobalFeeAmt + uatomDenom) - s.Require().NoError(err) - proposalCounter++ - s.govProposeNewGlobalfee(oldfees, proposalCounter, submitter, paidFeeAmt+photonDenom) -} +// +// import ( +// "fmt" +// "time" +// +// "cosmossdk.io/math" +// sdk "github.com/cosmos/cosmos-sdk/types" +//) +// +//// globalfee in genesis is set to be "0.00001uatom" +// func (s *IntegrationTestSuite) testQueryGlobalFeesInGenesis() { +// chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) +// feeInGenesis, err := sdk.ParseDecCoins(initialGlobalFeeAmt + uatomDenom) +// s.Require().NoError(err) +// s.Require().Eventually( +// func() bool { +// fees, err := queryGlobalFees(chainAAPIEndpoint) +// s.T().Logf("Global Fees in Genesis: %s", fees.String()) +// s.Require().NoError(err) +// +// return fees.IsEqual(feeInGenesis) +// }, +// 15*time.Second, +// 5*time.Second, +// ) +//} +// +///* +// global fee e2e tests: +// initial setup: initial globalfee = 0.00001uatom, min_gas_price = 0.00001uatom +// (This initial value setup is to pass other e2e tests) +// +//test1: gov proposal globalfee = [], min_gas_price=0.00001uatom, query globalfee still get empty +//- tx with fee denom photon, fail +//- tx with zero fee denom photon, fail +//- tx with fee denom uatom, pass +//- tx with fee empty, fail +// +//test2: gov propose globalfee = 0.000001uatom(lower than min_gas_price) +//- tx with fee higher than 0.000001uatom but lower than 0.00001uatom, fail +//- tx with fee higher than/equal to 0.00001uatom, pass +//- tx with fee photon fail +// +//test3: gov propose globalfee = 0.0001uatom (higher than min_gas_price) +//- tx with fee equal to 0.0001uatom, pass +//- tx with fee equal to 0.00001uatom, fail +// +//test4: gov propose globalfee = 0.000001uatom (lower than min_gas_price), 0photon +//- tx with fee 0.0000001photon, fail +//- tx with fee 0.000001photon, pass +//- tx with empty fee, pass +//- tx with fee photon pass +//- tx with fee 0photon, 0.000005uatom fail +//- tx with fee 0photon, 0.00001uatom pass +//test5: check balance correct: all the successful bank sent tokens are received +//test6: gov propose change back to initial globalfee = 0.00001photon, This is for not influence other e2e tests. +// */ +// func (s *IntegrationTestSuite) testGlobalFees() { +// chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) +// +// submitterAddr := s.chainA.validators[0].keyInfo.GetAddress() +// submitter := submitterAddr.String() +// recipientAddress := s.chainA.validators[1].keyInfo.GetAddress() +// recipient := recipientAddress.String() +// +// var beforeRecipientPhotonBalance sdk.Coin +// s.Require().Eventually( +// func() bool { +// var err error +// beforeRecipientPhotonBalance, err = getSpecificBalance(chainAAPIEndpoint, recipient, photonDenom) +// s.Require().NoError(err) +// +// return beforeRecipientPhotonBalance.IsValid() +// }, +// 10*time.Second, +// 5*time.Second, +// ) +// if beforeRecipientPhotonBalance.Equal(sdk.Coin{}) { +// beforeRecipientPhotonBalance = sdk.NewCoin(photonDenom, sdk.ZeroInt()) +// } +// +// sendAmt := int64(1000) +// token := sdk.NewInt64Coin(photonDenom, sendAmt) // send 1000photon each time +// sucessBankSendCount := 0 +// +// // ---------------------------- test1: globalfee empty -------------------------------------------- +// // prepare gov globalfee proposal +// emptyGlobalFee := sdk.DecCoins{} +// proposalCounter++ +// s.govProposeNewGlobalfee(emptyGlobalFee, proposalCounter, submitter, standardFees.String()) +// paidFeeAmt := math.LegacyMustNewDecFromStr(minGasPrice).Mul(math.LegacyNewDec(gas)).String() +// +// s.T().Logf("test case: empty global fee, globalfee=%s, min_gas_price=%s", emptyGlobalFee.String(), minGasPrice+uatomDenom) +// txBankSends := []txBankSend{ +// { +// from: submitter, +// to: recipient, +// amt: token.String(), +// fees: "0" + uatomDenom, +// log: "Tx fee is zero coin with correct denom: uatom, fail", +// expectErr: true, +// }, +// { +// from: submitter, +// to: recipient, +// amt: token.String(), +// fees: "", +// log: "Tx fee is empty, fail", +// expectErr: true, +// }, +// { +// from: submitter, +// to: recipient, +// amt: token.String(), +// fees: "4" + photonDenom, +// log: "Tx with wrong denom: photon, fail", +// expectErr: true, +// }, +// { +// from: submitter, +// to: recipient, +// amt: token.String(), +// fees: "0" + photonDenom, +// log: "Tx fee is zero coins of wrong denom: photon, fail", +// expectErr: true, +// }, +// { +// from: submitter, +// to: recipient, +// amt: token.String(), +// fees: paidFeeAmt + uatomDenom, +// log: "Tx fee is higher than min_gas_price, pass", +// expectErr: false, +// }, +// } +// sucessBankSendCount += s.execBankSendBatch(s.chainA, 0, txBankSends...) +// +// // ------------------ test2: globalfee lower than min_gas_price ----------------------------------- +// // prepare gov globalfee proposal +// lowGlobalFee := sdk.DecCoins{sdk.NewDecCoinFromDec(uatomDenom, sdk.MustNewDecFromStr(lowGlobalFeesAmt))} +// proposalCounter++ +// s.govProposeNewGlobalfee(lowGlobalFee, proposalCounter, submitter, standardFees.String()) +// +// paidFeeAmt = math.LegacyMustNewDecFromStr(minGasPrice).Mul(math.LegacyNewDec(gas)).String() +// paidFeeAmtLowMinGasHighGlobalFee := math.LegacyMustNewDecFromStr(lowGlobalFeesAmt). +// Mul(math.LegacyNewDec(2)). +// Mul(math.LegacyNewDec(gas)). +// String() +// paidFeeAmtLowGlobalFee := math.LegacyMustNewDecFromStr(lowGlobalFeesAmt).Quo(math.LegacyNewDec(2)).String() +// +// s.T().Logf("test case: global fee is lower than min_gas_price, globalfee=%s, min_gas_price=%s", lowGlobalFee.String(), minGasPrice+uatomDenom) +// txBankSends = []txBankSend{ +// { +// from: submitter, +// to: recipient, +// amt: token.String(), +// fees: paidFeeAmt + uatomDenom, +// log: "Tx fee higher than/equal to min_gas_price and global fee, pass", +// expectErr: false, +// }, +// { +// from: submitter, +// to: recipient, +// amt: token.String(), +// fees: paidFeeAmtLowGlobalFee + uatomDenom, +// log: "Tx fee lower than/equal to min_gas_price and global fee, pass", +// expectErr: true, +// }, +// { +// from: submitter, +// to: recipient, +// amt: token.String(), +// fees: paidFeeAmtLowMinGasHighGlobalFee + uatomDenom, +// log: "Tx fee lower than/equal global fee and lower than min_gas_price, fail", +// expectErr: true, +// }, +// { +// from: submitter, +// to: recipient, +// amt: token.String(), +// fees: paidFeeAmt + photonDenom, +// log: "Tx fee has wrong denom, fail", +// expectErr: true, +// }, +// } +// sucessBankSendCount += s.execBankSendBatch(s.chainA, 0, txBankSends...) +// +// // ------------------ test3: globalfee higher than min_gas_price ---------------------------------- +// // prepare gov globalfee proposal +// highGlobalFee := sdk.DecCoins{sdk.NewDecCoinFromDec(uatomDenom, sdk.MustNewDecFromStr(highGlobalFeeAmt))} +// proposalCounter++ +// s.govProposeNewGlobalfee(highGlobalFee, proposalCounter, submitter, paidFeeAmt+uatomDenom) +// +// paidFeeAmt = math.LegacyMustNewDecFromStr(highGlobalFeeAmt).Mul(math.LegacyNewDec(gas)).String() +// paidFeeAmtHigherMinGasLowerGalobalFee := math.LegacyMustNewDecFromStr(minGasPrice). +// Quo(math.LegacyNewDec(2)).String() +// +// s.T().Logf("test case: global fee is higher than min_gas_price, globalfee=%s, min_gas_price=%s", highGlobalFee.String(), minGasPrice+uatomDenom) +// txBankSends = []txBankSend{ +// { +// from: submitter, +// to: recipient, +// amt: token.String(), +// fees: paidFeeAmt + uatomDenom, +// log: "Tx fee is higher than/equal to global fee and min_gas_price, pass", +// expectErr: false, +// }, +// { +// from: submitter, +// to: recipient, +// amt: token.String(), +// fees: paidFeeAmtHigherMinGasLowerGalobalFee + uatomDenom, +// log: "Tx fee is higher than/equal to min_gas_price but lower than global fee, fail", +// expectErr: true, +// }, +// } +// sucessBankSendCount += s.execBankSendBatch(s.chainA, 0, txBankSends...) +// +// // ---------------------------- test4: global fee with two denoms ----------------------------------- +// // prepare gov globalfee proposal +// mixGlobalFee := sdk.DecCoins{ +// sdk.NewDecCoinFromDec(photonDenom, sdk.NewDec(0)), +// sdk.NewDecCoinFromDec(uatomDenom, sdk.MustNewDecFromStr(lowGlobalFeesAmt)), +// }.Sort() +// proposalCounter++ +// s.govProposeNewGlobalfee(mixGlobalFee, proposalCounter, submitter, paidFeeAmt+uatomDenom) +// +// // equal to min_gas_price +// paidFeeAmt = math.LegacyMustNewDecFromStr(minGasPrice).Mul(math.LegacyNewDec(gas)).String() +// paidFeeAmtLow := math.LegacyMustNewDecFromStr(lowGlobalFeesAmt). +// Quo(math.LegacyNewDec(2)). +// Mul(math.LegacyNewDec(gas)). +// String() +// +// s.T().Logf("test case: global fees contain multiple denoms: one zero coin, one non-zero coin, globalfee=%s, min_gas_price=%s", mixGlobalFee.String(), minGasPrice+uatomDenom) +// txBankSends = []txBankSend{ +// { +// from: submitter, +// to: recipient, +// amt: token.String(), +// fees: paidFeeAmt + uatomDenom, +// log: "Tx with fee higher than/equal to one of denom's amount the global fee, pass", +// expectErr: false, +// }, +// { +// from: submitter, +// to: recipient, +// amt: token.String(), +// fees: paidFeeAmtLow + uatomDenom, +// log: "Tx with fee lower than one of denom's amount the global fee, fail", +// expectErr: true, +// }, +// { +// from: submitter, +// to: recipient, +// amt: token.String(), +// fees: "", +// log: "Tx with fee empty fee, pass", +// expectErr: false, +// }, +// { +// from: submitter, +// to: recipient, +// amt: token.String(), +// fees: "0" + photonDenom, +// log: "Tx with zero coin in the denom of zero coin of global fee, pass", +// expectErr: false, +// }, +// { +// from: submitter, +// to: recipient, +// amt: token.String(), +// fees: "0" + photonDenom, +// log: "Tx with zero coin in the denom of zero coin of global fee, pass", +// expectErr: false, +// }, +// { +// from: submitter, +// to: recipient, +// amt: token.String(), +// fees: "2" + photonDenom, +// log: "Tx with non-zero coin in the denom of zero coin of global fee, pass", +// expectErr: false, +// }, +// { +// from: submitter, +// to: recipient, +// amt: token.String(), +// fees: "0" + photonDenom + "," + paidFeeAmtLow + uatomDenom, +// log: "Tx with multiple fee coins, zero coin and low fee, fail", +// expectErr: true, +// }, +// { +// from: submitter, +// to: recipient, +// amt: token.String(), +// fees: "0" + photonDenom + "," + paidFeeAmt + uatomDenom, +// log: "Tx with multiple fee coins, zero coin and high fee, pass", +// expectErr: false, +// }, +// +// { +// from: submitter, +// to: recipient, +// amt: token.String(), +// fees: "2" + photonDenom + "," + paidFeeAmt + uatomDenom, +// log: "Tx with multiple fee coins, all higher than global fee and min_gas_price", +// expectErr: false, +// }, +// } +// sucessBankSendCount += s.execBankSendBatch(s.chainA, 0, txBankSends...) +// +// // --------------------------------------------------------------------------- +// // check the balance is correct after previous txs +// s.Require().Eventually( +// func() bool { +// afterRecipientPhotonBalance, err := getSpecificBalance(chainAAPIEndpoint, recipient, photonDenom) +// s.Require().NoError(err) +// IncrementedPhoton := afterRecipientPhotonBalance.Sub(beforeRecipientPhotonBalance) +// photonSent := sdk.NewInt64Coin(photonDenom, sendAmt*int64(sucessBankSendCount)) +// return IncrementedPhoton.IsEqual(photonSent) +// }, +// time.Minute, +// 5*time.Second, +// ) +// +// // gov proposing to change back to original global fee +// s.T().Logf("Propose to change back to original global fees: %s", initialGlobalFeeAmt+uatomDenom) +// oldfees, err := sdk.ParseDecCoins(initialGlobalFeeAmt + uatomDenom) +// s.Require().NoError(err) +// proposalCounter++ +// s.govProposeNewGlobalfee(oldfees, proposalCounter, submitter, paidFeeAmt+photonDenom) +//} diff --git a/tests/e2e/e2e_gov_test.go b/tests/e2e/e2e_gov_test.go index eefdfc0bf2..ffbfab5014 100644 --- a/tests/e2e/e2e_gov_test.go +++ b/tests/e2e/e2e_gov_test.go @@ -1,258 +1,258 @@ package e2e -import ( - "fmt" - "strconv" - "strings" - "time" - - ccvtypes "github.com/cosmos/interchain-security/v2/x/ccv/provider/types" - - sdk "github.com/cosmos/cosmos-sdk/types" - - distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" -) - -/* -GovSoftwareUpgrade tests passing a gov proposal to upgrade the chain at a given height. -Test Benchmarks: -1. Submission, deposit and vote of message based proposal to upgrade the chain at a height (current height + buffer) -2. Validation that chain halted at upgrade height -3. Teardown & restart chains -4. Reset proposalCounter so subsequent tests have the correct last effective proposal id for chainA -TODO: Perform upgrade in place of chain restart -*/ -func (s *IntegrationTestSuite) GovSoftwareUpgrade() { - chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) - senderAddress := s.chainA.validators[0].keyInfo.GetAddress() - sender := senderAddress.String() - height := s.getLatestBlockHeight(s.chainA, 0) - proposalHeight := height + govProposalBlockBuffer - // Gov tests may be run in arbitrary order, each test must increment proposalCounter to have the correct proposal id to submit and query - proposalCounter++ - submitGovFlags := []string{"software-upgrade", "Upgrade-0", "--title='Upgrade V1'", "--description='Software Upgrade'", fmt.Sprintf("--upgrade-height=%d", proposalHeight)} - depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} - voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes=0.8,no=0.1,abstain=0.05,no_with_veto=0.05"} - s.runGovProcess(chainAAPIEndpoint, sender, proposalCounter, upgradetypes.ProposalTypeSoftwareUpgrade, submitGovFlags, depositGovFlags, voteGovFlags, "weighted-vote", true) - - s.verifyChainHaltedAtUpgradeHeight(s.chainA, 0, proposalHeight) - s.T().Logf("Successfully halted chain at height %d", proposalHeight) - - s.TearDownSuite() - - s.T().Logf("Restarting containers") - s.SetupSuite() - - s.Require().Eventually( - func() bool { - h := s.getLatestBlockHeight(s.chainA, 0) - return h > 0 - }, - 30*time.Second, - 5*time.Second, - ) - - proposalCounter = 0 -} - -/* -GovCancelSoftwareUpgrade tests passing a gov proposal that cancels a pending upgrade. -Test Benchmarks: -1. Submission, deposit and vote of message based proposal to upgrade the chain at a height (current height + buffer) -2. Submission, deposit and vote of message based proposal to cancel the pending upgrade -3. Validation that the chain produced blocks past the intended upgrade height -*/ -func (s *IntegrationTestSuite) GovCancelSoftwareUpgrade() { - chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) - senderAddress := s.chainA.validators[0].keyInfo.GetAddress() - - sender := senderAddress.String() - height := s.getLatestBlockHeight(s.chainA, 0) - proposalHeight := height + 50 - // Gov tests may be run in arbitrary order, each test must increment proposalCounter to have the correct proposal id to submit and query - proposalCounter++ - submitGovFlags := []string{"software-upgrade", "Upgrade-1", "--title='Upgrade V1'", "--description='Software Upgrade'", fmt.Sprintf("--upgrade-height=%d", proposalHeight)} - depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} - voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} - s.runGovProcess(chainAAPIEndpoint, sender, proposalCounter, upgradetypes.ProposalTypeSoftwareUpgrade, submitGovFlags, depositGovFlags, voteGovFlags, "vote", true) - - proposalCounter++ - submitGovFlags = []string{"cancel-software-upgrade", "--title='Upgrade V1'", "--description='Software Upgrade'"} - depositGovFlags = []string{strconv.Itoa(proposalCounter), depositAmount.String()} - voteGovFlags = []string{strconv.Itoa(proposalCounter), "yes"} - s.runGovProcess(chainAAPIEndpoint, sender, proposalCounter, upgradetypes.ProposalTypeCancelSoftwareUpgrade, submitGovFlags, depositGovFlags, voteGovFlags, "vote", true) - - s.verifyChainPassesUpgradeHeight(s.chainA, 0, proposalHeight) - s.T().Logf("Successfully canceled upgrade at height %d", proposalHeight) -} - -/* -GovCommunityPoolSpend tests passing a community spend proposal. -Test Benchmarks: -1. Fund Community Pool -2. Submission, deposit and vote of proposal to spend from the community pool to send atoms to a recipient -3. Validation that the recipient balance has increased by proposal amount -*/ -func (s *IntegrationTestSuite) GovCommunityPoolSpend() { - s.fundCommunityPool() - chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) - senderAddress := s.chainA.validators[0].keyInfo.GetAddress() - sender := senderAddress.String() - recipientAddress := s.chainA.validators[1].keyInfo.GetAddress() - recipient := recipientAddress.String() - sendAmount := sdk.NewCoin(uatomDenom, sdk.NewInt(10000000)) // 10uatom - s.writeGovCommunitySpendProposal(s.chainA, sendAmount.String(), recipient) - - beforeRecipientBalance, err := getSpecificBalance(chainAAPIEndpoint, recipient, uatomDenom) - s.Require().NoError(err) - - // Gov tests may be run in arbitrary order, each test must increment proposalCounter to have the correct proposal id to submit and query - proposalCounter++ - submitGovFlags := []string{"community-pool-spend", configFile(proposalCommunitySpendFilename)} - depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} - voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} - s.runGovProcess(chainAAPIEndpoint, sender, proposalCounter, distrtypes.ProposalTypeCommunityPoolSpend, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false) - - s.Require().Eventually( - func() bool { - afterRecipientBalance, err := getSpecificBalance(chainAAPIEndpoint, recipient, uatomDenom) - s.Require().NoError(err) - - return afterRecipientBalance.Sub(sendAmount).IsEqual(beforeRecipientBalance) - }, - 10*time.Second, - 5*time.Second, - ) -} - -/* -AddRemoveConsumerChain tests adding and subsequently removing a new consumer chain to Gaia. -Test Benchmarks: -1. Submit and pass proposal to add consumer chain -2. Validation that consumer chain was added -3. Submit and pass proposal to remove consumer chain -4. Validation that consumer chain was removed -*/ -func (s *IntegrationTestSuite) AddRemoveConsumerChain() { - s.fundCommunityPool() - chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) - proposerAddress := s.chainA.validators[0].keyInfo.GetAddress() - sender := proposerAddress.String() - consumerChainID := "consumer" - s.writeAddRemoveConsumerProposals(s.chainA, consumerChainID) - - // Gov tests may be run in arbitrary order, each test must increment proposalCounter to have the correct proposal id to submit and query - // Add Consumer Chain - proposalCounter++ - submitGovFlags := []string{"consumer-addition", configFile(proposalAddConsumerChainFilename)} - depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} - voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} - s.runGovProcess(chainAAPIEndpoint, sender, proposalCounter, ccvtypes.ProposalTypeConsumerAddition, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false) - - // Query and assert consumer has been added - s.execQueryConsumerChains(s.chainA, 0, gaiaHomePath, validateConsumerAddition, consumerChainID) - - // Remove Consumer Chain - proposalCounter++ - submitGovFlags = []string{"consumer-removal", configFile(proposalRemoveConsumerChainFilename)} - depositGovFlags = []string{strconv.Itoa(proposalCounter), depositAmount.String()} - voteGovFlags = []string{strconv.Itoa(proposalCounter), "yes"} - s.runGovProcess(chainAAPIEndpoint, sender, proposalCounter, ccvtypes.ProposalTypeConsumerRemoval, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false) - // Query and assert consumer has been removed - s.execQueryConsumerChains(s.chainA, 0, gaiaHomePath, validateConsumerRemoval, consumerChainID) -} - -func validateConsumerAddition(res ccvtypes.QueryConsumerChainsResponse, consumerChainID string) bool { - if res.Size() == 0 { - return false - } - for _, chain := range res.GetChains() { - return strings.Compare(chain.ChainId, consumerChainID) == 0 - } - return false -} - -func validateConsumerRemoval(res ccvtypes.QueryConsumerChainsResponse, consumerChainID string) bool { - if res.Size() > 0 { - for _, chain := range res.GetChains() { - if strings.Compare(chain.ChainId, consumerChainID) == 0 { - return false - } - } - } - return true -} - -func (s *IntegrationTestSuite) runGovProcess(chainAAPIEndpoint, sender string, proposalID int, proposalType string, submitFlags []string, depositFlags []string, voteFlags []string, voteCommand string, withDeposit bool) { - s.T().Logf("Submitting Gov Proposal: %s", proposalType) - // min deposit of 1000uatom is required in e2e tests, otherwise the gov antehandler causes the proposal to be dropped - sflags := submitFlags - if withDeposit { - sflags = append(sflags, "--deposit=1000uatom") - } - s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, "submit-proposal", sflags, govtypes.StatusDepositPeriod) - s.T().Logf("Depositing Gov Proposal: %s", proposalType) - s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, "deposit", depositFlags, govtypes.StatusVotingPeriod) - s.T().Logf("Voting Gov Proposal: %s", proposalType) - s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, voteCommand, voteFlags, govtypes.StatusPassed) -} - -func (s *IntegrationTestSuite) verifyChainHaltedAtUpgradeHeight(c *chain, valIdx, upgradeHeight int) { - s.Require().Eventually( - func() bool { - currentHeight := s.getLatestBlockHeight(c, valIdx) - - return currentHeight == upgradeHeight - }, - 30*time.Second, - 5*time.Second, - ) - - counter := 0 - s.Require().Eventually( - func() bool { - currentHeight := s.getLatestBlockHeight(c, valIdx) - - if currentHeight > upgradeHeight { - return false - } - if currentHeight == upgradeHeight { - counter++ - } - return counter >= 2 - }, - 8*time.Second, - 2*time.Second, - ) -} - -func (s *IntegrationTestSuite) verifyChainPassesUpgradeHeight(c *chain, valIdx, upgradeHeight int) { - s.Require().Eventually( - func() bool { - currentHeight := s.getLatestBlockHeight(c, valIdx) - - return currentHeight > upgradeHeight - }, - 30*time.Second, - 5*time.Second, - ) -} - -func (s *IntegrationTestSuite) submitGovCommand(chainAAPIEndpoint, sender string, proposalID int, govCommand string, proposalFlags []string, expectedSuccessStatus govtypes.ProposalStatus) { - s.Run(fmt.Sprintf("Running tx gov %s", govCommand), func() { - s.runGovExec(s.chainA, 0, sender, govCommand, proposalFlags, standardFees.String()) - - s.Require().Eventually( - func() bool { - proposal, err := queryGovProposal(chainAAPIEndpoint, proposalID) - s.Require().NoError(err) - - return proposal.GetProposal().Status == expectedSuccessStatus - }, - 15*time.Second, - 5*time.Second, - ) - }) -} +// import ( +// "fmt" +// "strconv" +// "strings" +// "time" + +// ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" + +// sdk "github.com/cosmos/cosmos-sdk/types" + +// distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" +// govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" +// upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" +// ) + +// /* +// GovSoftwareUpgrade tests passing a gov proposal to upgrade the chain at a given height. +// Test Benchmarks: +// 1. Submission, deposit and vote of message based proposal to upgrade the chain at a height (current height + buffer) +// 2. Validation that chain halted at upgrade height +// 3. Teardown & restart chains +// 4. Reset proposalCounter so subsequent tests have the correct last effective proposal id for chainA +// TODO: Perform upgrade in place of chain restart +// */ +// func (s *IntegrationTestSuite) GovSoftwareUpgrade() { +// chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) +// senderAddress := s.chainA.validators[0].keyInfo.GetAddress() +// sender := senderAddress.String() +// height := s.getLatestBlockHeight(s.chainA, 0) +// proposalHeight := height + govProposalBlockBuffer +// // Gov tests may be run in arbitrary order, each test must increment proposalCounter to have the correct proposal id to submit and query +// proposalCounter++ +// submitGovFlags := []string{"software-upgrade", "Upgrade-0", "--title='Upgrade V1'", "--description='Software Upgrade'", fmt.Sprintf("--upgrade-height=%d", proposalHeight)} +// depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} +// voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes=0.8,no=0.1,abstain=0.05,no_with_veto=0.05"} +// s.runGovProcess(chainAAPIEndpoint, sender, proposalCounter, upgradetypes.ProposalTypeSoftwareUpgrade, submitGovFlags, depositGovFlags, voteGovFlags, "weighted-vote", true) + +// s.verifyChainHaltedAtUpgradeHeight(s.chainA, 0, proposalHeight) +// s.T().Logf("Successfully halted chain at height %d", proposalHeight) + +// s.TearDownSuite() + +// s.T().Logf("Restarting containers") +// s.SetupSuite() + +// s.Require().Eventually( +// func() bool { +// h := s.getLatestBlockHeight(s.chainA, 0) +// return h > 0 +// }, +// 30*time.Second, +// 5*time.Second, +// ) + +// proposalCounter = 0 +// } + +// /* +// GovCancelSoftwareUpgrade tests passing a gov proposal that cancels a pending upgrade. +// Test Benchmarks: +// 1. Submission, deposit and vote of message based proposal to upgrade the chain at a height (current height + buffer) +// 2. Submission, deposit and vote of message based proposal to cancel the pending upgrade +// 3. Validation that the chain produced blocks past the intended upgrade height +// */ +// func (s *IntegrationTestSuite) GovCancelSoftwareUpgrade() { +// chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) +// senderAddress := s.chainA.validators[0].keyInfo.GetAddress() + +// sender := senderAddress.String() +// height := s.getLatestBlockHeight(s.chainA, 0) +// proposalHeight := height + 50 +// // Gov tests may be run in arbitrary order, each test must increment proposalCounter to have the correct proposal id to submit and query +// proposalCounter++ +// submitGovFlags := []string{"software-upgrade", "Upgrade-1", "--title='Upgrade V1'", "--description='Software Upgrade'", fmt.Sprintf("--upgrade-height=%d", proposalHeight)} +// depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} +// voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} +// s.runGovProcess(chainAAPIEndpoint, sender, proposalCounter, upgradetypes.ProposalTypeSoftwareUpgrade, submitGovFlags, depositGovFlags, voteGovFlags, "vote", true) + +// proposalCounter++ +// submitGovFlags = []string{"cancel-software-upgrade", "--title='Upgrade V1'", "--description='Software Upgrade'"} +// depositGovFlags = []string{strconv.Itoa(proposalCounter), depositAmount.String()} +// voteGovFlags = []string{strconv.Itoa(proposalCounter), "yes"} +// s.runGovProcess(chainAAPIEndpoint, sender, proposalCounter, upgradetypes.ProposalTypeCancelSoftwareUpgrade, submitGovFlags, depositGovFlags, voteGovFlags, "vote", true) + +// s.verifyChainPassesUpgradeHeight(s.chainA, 0, proposalHeight) +// s.T().Logf("Successfully canceled upgrade at height %d", proposalHeight) +// } + +// /* +// GovCommunityPoolSpend tests passing a community spend proposal. +// Test Benchmarks: +// 1. Fund Community Pool +// 2. Submission, deposit and vote of proposal to spend from the community pool to send atoms to a recipient +// 3. Validation that the recipient balance has increased by proposal amount +// */ +// func (s *IntegrationTestSuite) GovCommunityPoolSpend() { +// s.fundCommunityPool() +// chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) +// senderAddress := s.chainA.validators[0].keyInfo.GetAddress() +// sender := senderAddress.String() +// recipientAddress := s.chainA.validators[1].keyInfo.GetAddress() +// recipient := recipientAddress.String() +// sendAmount := sdk.NewCoin(uatomDenom, sdk.NewInt(10000000)) // 10uatom +// s.writeGovCommunitySpendProposal(s.chainA, sendAmount.String(), recipient) + +// beforeRecipientBalance, err := getSpecificBalance(chainAAPIEndpoint, recipient, uatomDenom) +// s.Require().NoError(err) + +// // Gov tests may be run in arbitrary order, each test must increment proposalCounter to have the correct proposal id to submit and query +// proposalCounter++ +// submitGovFlags := []string{"community-pool-spend", configFile(proposalCommunitySpendFilename)} +// depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} +// voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} +// s.runGovProcess(chainAAPIEndpoint, sender, proposalCounter, distrtypes.ProposalTypeCommunityPoolSpend, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false) + +// s.Require().Eventually( +// func() bool { +// afterRecipientBalance, err := getSpecificBalance(chainAAPIEndpoint, recipient, uatomDenom) +// s.Require().NoError(err) + +// return afterRecipientBalance.Sub(sendAmount).IsEqual(beforeRecipientBalance) +// }, +// 10*time.Second, +// 5*time.Second, +// ) +// } + +// /* +// AddRemoveConsumerChain tests adding and subsequently removing a new consumer chain to Gaia. +// Test Benchmarks: +// 1. Submit and pass proposal to add consumer chain +// 2. Validation that consumer chain was added +// 3. Submit and pass proposal to remove consumer chain +// 4. Validation that consumer chain was removed +// */ +// func (s *IntegrationTestSuite) AddRemoveConsumerChain() { +// s.fundCommunityPool() +// chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) +// proposerAddress := s.chainA.validators[0].keyInfo.GetAddress() +// sender := proposerAddress.String() +// consumerChainID := "consumer" +// s.writeAddRemoveConsumerProposals(s.chainA, consumerChainID) + +// // Gov tests may be run in arbitrary order, each test must increment proposalCounter to have the correct proposal id to submit and query +// // Add Consumer Chain +// proposalCounter++ +// submitGovFlags := []string{"consumer-addition", configFile(proposalAddConsumerChainFilename)} +// depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} +// voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} +// s.runGovProcess(chainAAPIEndpoint, sender, proposalCounter, ccvtypes.ProposalTypeConsumerAddition, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false) + +// // Query and assert consumer has been added +// s.execQueryConsumerChains(s.chainA, 0, gaiaHomePath, validateConsumerAddition, consumerChainID) + +// // Remove Consumer Chain +// proposalCounter++ +// submitGovFlags = []string{"consumer-removal", configFile(proposalRemoveConsumerChainFilename)} +// depositGovFlags = []string{strconv.Itoa(proposalCounter), depositAmount.String()} +// voteGovFlags = []string{strconv.Itoa(proposalCounter), "yes"} +// s.runGovProcess(chainAAPIEndpoint, sender, proposalCounter, ccvtypes.ProposalTypeConsumerRemoval, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false) +// // Query and assert consumer has been removed +// s.execQueryConsumerChains(s.chainA, 0, gaiaHomePath, validateConsumerRemoval, consumerChainID) +// } + +// func validateConsumerAddition(res ccvtypes.QueryConsumerChainsResponse, consumerChainID string) bool { +// if res.Size() == 0 { +// return false +// } +// for _, chain := range res.GetChains() { +// return strings.Compare(chain.ChainId, consumerChainID) == 0 +// } +// return false +// } + +// func validateConsumerRemoval(res ccvtypes.QueryConsumerChainsResponse, consumerChainID string) bool { +// if res.Size() > 0 { +// for _, chain := range res.GetChains() { +// if strings.Compare(chain.ChainId, consumerChainID) == 0 { +// return false +// } +// } +// } +// return true +// } + +// func (s *IntegrationTestSuite) runGovProcess(chainAAPIEndpoint, sender string, proposalID int, proposalType string, submitFlags []string, depositFlags []string, voteFlags []string, voteCommand string, withDeposit bool) { +// s.T().Logf("Submitting Gov Proposal: %s", proposalType) +// // min deposit of 1000uatom is required in e2e tests, otherwise the gov antehandler causes the proposal to be dropped +// sflags := submitFlags +// if withDeposit { +// sflags = append(sflags, "--deposit=1000uatom") +// } +// s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, "submit-proposal", sflags, govtypes.StatusDepositPeriod) +// s.T().Logf("Depositing Gov Proposal: %s", proposalType) +// s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, "deposit", depositFlags, govtypes.StatusVotingPeriod) +// s.T().Logf("Voting Gov Proposal: %s", proposalType) +// s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, voteCommand, voteFlags, govtypes.StatusPassed) +// } + +// func (s *IntegrationTestSuite) verifyChainHaltedAtUpgradeHeight(c *chain, valIdx, upgradeHeight int) { +// s.Require().Eventually( +// func() bool { +// currentHeight := s.getLatestBlockHeight(c, valIdx) + +// return currentHeight == upgradeHeight +// }, +// 30*time.Second, +// 5*time.Second, +// ) + +// counter := 0 +// s.Require().Eventually( +// func() bool { +// currentHeight := s.getLatestBlockHeight(c, valIdx) + +// if currentHeight > upgradeHeight { +// return false +// } +// if currentHeight == upgradeHeight { +// counter++ +// } +// return counter >= 2 +// }, +// 8*time.Second, +// 2*time.Second, +// ) +// } + +// func (s *IntegrationTestSuite) verifyChainPassesUpgradeHeight(c *chain, valIdx, upgradeHeight int) { +// s.Require().Eventually( +// func() bool { +// currentHeight := s.getLatestBlockHeight(c, valIdx) + +// return currentHeight > upgradeHeight +// }, +// 30*time.Second, +// 5*time.Second, +// ) +// } + +// func (s *IntegrationTestSuite) submitGovCommand(chainAAPIEndpoint, sender string, proposalID int, govCommand string, proposalFlags []string, expectedSuccessStatus govtypes.ProposalStatus) { +// s.Run(fmt.Sprintf("Running tx gov %s", govCommand), func() { +// s.runGovExec(s.chainA, 0, sender, govCommand, proposalFlags, standardFees.String()) + +// s.Require().Eventually( +// func() bool { +// proposal, err := queryGovProposal(chainAAPIEndpoint, proposalID) +// s.Require().NoError(err) + +// return proposal.GetProposal().Status == expectedSuccessStatus +// }, +// 15*time.Second, +// 5*time.Second, +// ) +// }) +// } diff --git a/tests/e2e/e2e_ibc_test.go b/tests/e2e/e2e_ibc_test.go index be6a1d2c3f..a8b8d57cbb 100644 --- a/tests/e2e/e2e_ibc_test.go +++ b/tests/e2e/e2e_ibc_test.go @@ -1,482 +1,482 @@ package e2e -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "strconv" - "strings" - "time" - - "github.com/cosmos/cosmos-sdk/client/flags" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/ory/dockertest/v3/docker" -) - -type ForwardMetadata struct { - Receiver string `json:"receiver"` - Port string `json:"port"` - Channel string `json:"channel"` - // Timeout time.Duration `json:"timeout"` - // Retries *uint8 `json:"retries,omitempty"` - // Next *string `json:"next,omitempty"` - // RefundSequence *uint64 `json:"refund_sequence,omitempty"` -} - -type PacketMetadata struct { - Forward *ForwardMetadata `json:"forward"` -} - -func (s *IntegrationTestSuite) sendIBC(c *chain, valIdx int, sender, recipient, token, fees, note string) { - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() - - ibcCmd := []string{ - gaiadBinary, - txCommand, - "ibc-transfer", - "transfer", - "transfer", - "channel-0", - recipient, - token, - fmt.Sprintf("--from=%s", sender), - fmt.Sprintf("--%s=%s", flags.FlagFees, fees), - fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), - // fmt.Sprintf("--%s=%s", flags.FlagNote, note), - fmt.Sprintf("--memo=%s", note), - "--keyring-backend=test", - "--broadcast-mode=sync", - "--output=json", - "-y", - } - s.T().Logf("sending %s from %s (%s) to %s (%s) with memo %s", token, s.chainA.id, sender, s.chainB.id, recipient, note) - s.executeGaiaTxCommand(ctx, c, ibcCmd, valIdx, s.defaultExecValidation(c, valIdx)) - s.T().Log("successfully sent IBC tokens") -} - -func (s *IntegrationTestSuite) hermesTransfer(configPath, srcChainID, dstChainID, srcChannelID, denom string, sendAmt, timeOutOffset, numMsg int) (success bool) { - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() - - hermesCmd := []string{ - hermesBinary, - fmt.Sprintf("--config=%s", configPath), - "tx", - "ft-transfer", - fmt.Sprintf("--dst-chain=%s", dstChainID), - fmt.Sprintf("--src-chain=%s", srcChainID), - fmt.Sprintf("--src-channel=%s", srcChannelID), - fmt.Sprintf("--src-port=%s", "transfer"), - fmt.Sprintf("--amount=%v", sendAmt), - fmt.Sprintf("--denom=%s", denom), - fmt.Sprintf("--timeout-height-offset=%v", timeOutOffset), - fmt.Sprintf("--number-msgs=%v", numMsg), - } - - stdout, stderr := s.executeHermesCommand(ctx, hermesCmd) - if strings.Contains(string(stdout), "ERROR") || strings.Contains(string(stderr), "ERROR") { - return false - } - - return true -} - -func (s *IntegrationTestSuite) hermesClearPacket(configPath, chainID, channelID string) (success bool) { //nolint:unparam - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() - - hermesCmd := []string{ - hermesBinary, - fmt.Sprintf("--config=%s", configPath), - "clear", - "packets", - fmt.Sprintf("--chain=%s", chainID), - fmt.Sprintf("--channel=%s", channelID), - fmt.Sprintf("--port=%s", "transfer"), - } - - stdout, stderr := s.executeHermesCommand(ctx, hermesCmd) - if strings.Contains(string(stdout), "ERROR") || strings.Contains(string(stderr), "ERROR") { - return false - } - - return true -} - -type RelayerPacketsOutput struct { - Result struct { - Dst struct { - UnreceivedPackets []interface{} `json:"unreceived_packets"` - } `json:"dst"` - Src struct { - UnreceivedPackets []interface{} `json:"unreceived_packets"` - } `json:"src"` - } `json:"result"` - Status string `json:"status"` -} - -func (s *IntegrationTestSuite) hermesPendingPackets(configPath, chainID, channelID string) (pendingPackets bool) { - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() - hermesCmd := []string{ - hermesBinary, - "--json", - fmt.Sprintf("--config=%s", configPath), - "query", - "packet", - "pending", - fmt.Sprintf("--chain=%s", chainID), - fmt.Sprintf("--channel=%s", channelID), - fmt.Sprintf("--port=%s", "transfer"), - } - - stdout, _ := s.executeHermesCommand(ctx, hermesCmd) - - var relayerPacketsOutput RelayerPacketsOutput - err := json.Unmarshal(stdout, &relayerPacketsOutput) - s.Require().NoError(err) - - // Check if "unreceived_packets" exists in "src" - return len(relayerPacketsOutput.Result.Src.UnreceivedPackets) != 0 -} - -func (s *IntegrationTestSuite) queryRelayerWalletsBalances() (sdk.Coin, sdk.Coin) { - chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) - scrRelayerBalance, err := getSpecificBalance( - chainAAPIEndpoint, - s.chainA.genesisAccounts[relayerAccountIndexHermes1].keyInfo.GetAddress().String(), - uatomDenom) - s.Require().NoError(err) - - chainBAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainB.id][0].GetHostPort("1317/tcp")) - dstRelayerBalance, err := getSpecificBalance( - chainBAPIEndpoint, - s.chainB.genesisAccounts[relayerAccountIndexHermes1].keyInfo.GetAddress().String(), - uatomDenom) - s.Require().NoError(err) - - return scrRelayerBalance, dstRelayerBalance -} - -func (s *IntegrationTestSuite) createConnection() { - s.T().Logf("connecting %s and %s chains via IBC", s.chainA.id, s.chainB.id) - - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() - - exec, err := s.dkrPool.Client.CreateExec(docker.CreateExecOptions{ - Context: ctx, - AttachStdout: true, - AttachStderr: true, - Container: s.hermesResource0.Container.ID, - User: "root", - Cmd: []string{ - "hermes", - "create", - "connection", - "--a-chain", - s.chainA.id, - "--b-chain", - s.chainB.id, - }, - }) - s.Require().NoError(err) - - var ( - outBuf bytes.Buffer - errBuf bytes.Buffer - ) - - err = s.dkrPool.Client.StartExec(exec.ID, docker.StartExecOptions{ - Context: ctx, - Detach: false, - OutputStream: &outBuf, - ErrorStream: &errBuf, - }) - s.Require().NoErrorf( - err, - "failed connect chains; stdout: %s, stderr: %s", outBuf.String(), errBuf.String(), - ) - - s.T().Logf("connected %s and %s chains via IBC", s.chainA.id, s.chainB.id) -} - -func (s *IntegrationTestSuite) createChannel() { - s.T().Logf("connecting %s and %s chains via IBC", s.chainA.id, s.chainB.id) - - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() - - exec, err := s.dkrPool.Client.CreateExec(docker.CreateExecOptions{ - Context: ctx, - AttachStdout: true, - AttachStderr: true, - Container: s.hermesResource0.Container.ID, - User: "root", - Cmd: []string{ - "hermes", - txCommand, - "chan-open-init", - "--dst-chain", - s.chainA.id, - "--src-chain", - s.chainB.id, - "--dst-connection", - "connection-0", - "--src-port=transfer", - "--dst-port=transfer", - }, - }) - s.Require().NoError(err) - - var ( - outBuf bytes.Buffer - errBuf bytes.Buffer - ) - - err = s.dkrPool.Client.StartExec(exec.ID, docker.StartExecOptions{ - Context: ctx, - Detach: false, - OutputStream: &outBuf, - ErrorStream: &errBuf, - }) - s.Require().NoErrorf( - err, - "failed connect chains; stdout: %s, stderr: %s", outBuf.String(), errBuf.String(), - ) - - s.T().Logf("connected %s and %s chains via IBC", s.chainA.id, s.chainB.id) -} - -func (s *IntegrationTestSuite) testIBCTokenTransfer() { - s.Run("send_uatom_to_chainB", func() { - // require the recipient account receives the IBC tokens (IBC packets ACKd) - var ( - balances sdk.Coins - err error - beforeBalance int64 - ibcStakeDenom string - ) - - address := s.chainA.validators[0].keyInfo.GetAddress() - sender := address.String() - - address = s.chainB.validators[0].keyInfo.GetAddress() - recipient := address.String() - - chainBAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainB.id][0].GetHostPort("1317/tcp")) - - s.Require().Eventually( - func() bool { - balances, err = queryGaiaAllBalances(chainBAPIEndpoint, recipient) - s.Require().NoError(err) - return balances.Len() != 0 - }, - time.Minute, - 5*time.Second, - ) - for _, c := range balances { - if strings.Contains(c.Denom, "ibc/") { - beforeBalance = c.Amount.Int64() - break - } - } - - tokenAmt := 3300000000 - s.sendIBC(s.chainA, 0, sender, recipient, strconv.Itoa(tokenAmt)+uatomDenom, standardFees.String(), "") - - s.Require().Eventually( - func() bool { - balances, err = queryGaiaAllBalances(chainBAPIEndpoint, recipient) - s.Require().NoError(err) - return balances.Len() != 0 - }, - time.Minute, - 5*time.Second, - ) - for _, c := range balances { - if strings.Contains(c.Denom, "ibc/") { - ibcStakeDenom = c.Denom - s.Require().Equal((int64(tokenAmt) + beforeBalance), c.Amount.Int64()) - break - } - } - - s.Require().NotEmpty(ibcStakeDenom) - }) -} - -/* -TestMultihopIBCTokenTransfer tests that sending an IBC transfer using the IBC Packet Forward Middleware accepts a port, channel and account address - -Steps: -1. Check balance of Account 1 on Chain 1 -2. Check balance of Account 2 on Chain 1 -3. Account 1 on Chain 1 sends x tokens to Account 2 on Chain 1 via Account 1 on Chain 2 -4. Check Balance of Account 1 on Chain 1, confirm it is original minus x tokens -5. Check Balance of Account 2 on Chain 1, confirm it is original plus x tokens - -*/ -// TODO: Add back only if packet forward middleware has a working version compatible with IBC v3.0.x -func (s *IntegrationTestSuite) testMultihopIBCTokenTransfer() { - time.Sleep(30 * time.Second) - - s.Run("send_successful_multihop_uatom_to_chainA_from_chainA", func() { - // require the recipient account receives the IBC tokens (IBC packets ACKd) - var ( - err error - ) - - address := s.chainA.validators[0].keyInfo.GetAddress() - sender := address.String() - - address = s.chainB.validators[0].keyInfo.GetAddress() - middlehop := address.String() - - address = s.chainA.validators[1].keyInfo.GetAddress() - recipient := address.String() - - forwardPort := "transfer" - forwardChannel := "channel-0" - - tokenAmt := 3300000000 - - chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) - - var ( - beforeSenderUAtomBalance sdk.Coin - beforeRecipientUAtomBalance sdk.Coin - ) - - s.Require().Eventually( - func() bool { - beforeSenderUAtomBalance, err = getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) - s.Require().NoError(err) - fmt.Println("beforeSenderUAtomBalance", beforeSenderUAtomBalance) - - beforeRecipientUAtomBalance, err = getSpecificBalance(chainAAPIEndpoint, recipient, uatomDenom) - s.Require().NoError(err) - fmt.Print("beforeRecipientUAtomBalance", beforeRecipientUAtomBalance) - - return beforeSenderUAtomBalance.IsValid() && beforeRecipientUAtomBalance.IsValid() - }, - 1*time.Minute, - 5*time.Second, - ) - - firstHopMetadata := &PacketMetadata{ - Forward: &ForwardMetadata{ - Receiver: recipient, - Channel: forwardChannel, - Port: forwardPort, - }, - } - - memo, err := json.Marshal(firstHopMetadata) - s.Require().NoError(err) - - s.sendIBC(s.chainA, 0, sender, middlehop, strconv.Itoa(tokenAmt)+uatomDenom, standardFees.String(), string(memo)) - - s.Require().Eventually( - func() bool { - afterSenderUAtomBalance, err := getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) - s.Require().NoError(err) - - afterRecipientUAtomBalance, err := getSpecificBalance(chainAAPIEndpoint, recipient, uatomDenom) - s.Require().NoError(err) - - decremented := beforeSenderUAtomBalance.Sub(tokenAmount).Sub(standardFees).IsEqual(afterSenderUAtomBalance) - incremented := beforeRecipientUAtomBalance.Add(tokenAmount).IsEqual(afterRecipientUAtomBalance) - - return decremented && incremented - }, - 1*time.Minute, - 5*time.Second, - ) - }) -} - -/* -TestFailedMultihopIBCTokenTransfer tests that sending a failing IBC transfer using the IBC Packet Forward -Middleware will send the tokens back to the original account after failing. -*/ -func (s *IntegrationTestSuite) testFailedMultihopIBCTokenTransfer() { - time.Sleep(30 * time.Second) - - s.Run("send_failed_multihop_uatom_to_chainA_from_chainA", func() { - address := s.chainA.validators[0].keyInfo.GetAddress() - sender := address.String() - - address = s.chainB.validators[0].keyInfo.GetAddress() - middlehop := address.String() - - address = s.chainA.validators[1].keyInfo.GetAddress() - recipient := strings.Replace(address.String(), "cosmos", "foobar", 1) // this should be an invalid recipient to force the tx to fail - - forwardPort := "transfer" - forwardChannel := "channel-0" - - tokenAmt := 3300000000 - - chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) - - var ( - beforeSenderUAtomBalance sdk.Coin - err error - ) - - s.Require().Eventually( - func() bool { - beforeSenderUAtomBalance, err = getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) - s.Require().NoError(err) - - return beforeSenderUAtomBalance.IsValid() - }, - 1*time.Minute, - 5*time.Second, - ) - - firstHopMetadata := &PacketMetadata{ - Forward: &ForwardMetadata{ - Receiver: recipient, - Channel: forwardChannel, - Port: forwardPort, - }, - } - - memo, err := json.Marshal(firstHopMetadata) - s.Require().NoError(err) - - s.sendIBC(s.chainA, 0, sender, middlehop, strconv.Itoa(tokenAmt)+uatomDenom, standardFees.String(), string(memo)) - - // Sender account should be initially decremented the full amount - s.Require().Eventually( - func() bool { - afterSenderUAtomBalance, err := getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) - s.Require().NoError(err) - - returned := beforeSenderUAtomBalance.Sub(tokenAmount).Sub(standardFees).IsEqual(afterSenderUAtomBalance) - - return returned - }, - 1*time.Minute, - 1*time.Second, - ) - - // since the forward receiving account is invalid, it should be refunded to the original sender (minus the original fee) - s.Require().Eventually( - func() bool { - afterSenderUAtomBalance, err := getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) - s.Require().NoError(err) - - returned := beforeSenderUAtomBalance.Sub(standardFees).IsEqual(afterSenderUAtomBalance) - - return returned - }, - 5*time.Minute, - 5*time.Second, - ) - }) -} +// import ( +// "bytes" +// "context" +// "encoding/json" +// "fmt" +// "strconv" +// "strings" +// "time" + +// "github.com/cosmos/cosmos-sdk/client/flags" +// sdk "github.com/cosmos/cosmos-sdk/types" +// "github.com/ory/dockertest/v3/docker" +// ) + +// type ForwardMetadata struct { +// Receiver string `json:"receiver"` +// Port string `json:"port"` +// Channel string `json:"channel"` +// // Timeout time.Duration `json:"timeout"` +// // Retries *uint8 `json:"retries,omitempty"` +// // Next *string `json:"next,omitempty"` +// // RefundSequence *uint64 `json:"refund_sequence,omitempty"` +// } + +// type PacketMetadata struct { +// Forward *ForwardMetadata `json:"forward"` +// } + +// func (s *IntegrationTestSuite) sendIBC(c *chain, valIdx int, sender, recipient, token, fees, note string) { +// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) +// defer cancel() + +// ibcCmd := []string{ +// gaiadBinary, +// txCommand, +// "ibc-transfer", +// "transfer", +// "transfer", +// "channel-0", +// recipient, +// token, +// fmt.Sprintf("--from=%s", sender), +// fmt.Sprintf("--%s=%s", flags.FlagFees, fees), +// fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), +// // fmt.Sprintf("--%s=%s", flags.FlagNote, note), +// fmt.Sprintf("--memo=%s", note), +// "--keyring-backend=test", +// "--broadcast-mode=sync", +// "--output=json", +// "-y", +// } +// s.T().Logf("sending %s from %s (%s) to %s (%s) with memo %s", token, s.chainA.id, sender, s.chainB.id, recipient, note) +// s.executeGaiaTxCommand(ctx, c, ibcCmd, valIdx, s.defaultExecValidation(c, valIdx)) +// s.T().Log("successfully sent IBC tokens") +// } + +// func (s *IntegrationTestSuite) hermesTransfer(configPath, srcChainID, dstChainID, srcChannelID, denom string, sendAmt, timeOutOffset, numMsg int) (success bool) { +// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) +// defer cancel() + +// hermesCmd := []string{ +// hermesBinary, +// fmt.Sprintf("--config=%s", configPath), +// "tx", +// "ft-transfer", +// fmt.Sprintf("--dst-chain=%s", dstChainID), +// fmt.Sprintf("--src-chain=%s", srcChainID), +// fmt.Sprintf("--src-channel=%s", srcChannelID), +// fmt.Sprintf("--src-port=%s", "transfer"), +// fmt.Sprintf("--amount=%v", sendAmt), +// fmt.Sprintf("--denom=%s", denom), +// fmt.Sprintf("--timeout-height-offset=%v", timeOutOffset), +// fmt.Sprintf("--number-msgs=%v", numMsg), +// } + +// stdout, stderr := s.executeHermesCommand(ctx, hermesCmd) +// if strings.Contains(string(stdout), "ERROR") || strings.Contains(string(stderr), "ERROR") { +// return false +// } + +// return true +// } + +// func (s *IntegrationTestSuite) hermesClearPacket(configPath, chainID, channelID string) (success bool) { //nolint:unparam +// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) +// defer cancel() + +// hermesCmd := []string{ +// hermesBinary, +// fmt.Sprintf("--config=%s", configPath), +// "clear", +// "packets", +// fmt.Sprintf("--chain=%s", chainID), +// fmt.Sprintf("--channel=%s", channelID), +// fmt.Sprintf("--port=%s", "transfer"), +// } + +// stdout, stderr := s.executeHermesCommand(ctx, hermesCmd) +// if strings.Contains(string(stdout), "ERROR") || strings.Contains(string(stderr), "ERROR") { +// return false +// } + +// return true +// } + +// type RelayerPacketsOutput struct { +// Result struct { +// Dst struct { +// UnreceivedPackets []interface{} `json:"unreceived_packets"` +// } `json:"dst"` +// Src struct { +// UnreceivedPackets []interface{} `json:"unreceived_packets"` +// } `json:"src"` +// } `json:"result"` +// Status string `json:"status"` +// } + +// func (s *IntegrationTestSuite) hermesPendingPackets(configPath, chainID, channelID string) (pendingPackets bool) { +// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) +// defer cancel() +// hermesCmd := []string{ +// hermesBinary, +// "--json", +// fmt.Sprintf("--config=%s", configPath), +// "query", +// "packet", +// "pending", +// fmt.Sprintf("--chain=%s", chainID), +// fmt.Sprintf("--channel=%s", channelID), +// fmt.Sprintf("--port=%s", "transfer"), +// } + +// stdout, _ := s.executeHermesCommand(ctx, hermesCmd) + +// var relayerPacketsOutput RelayerPacketsOutput +// err := json.Unmarshal(stdout, &relayerPacketsOutput) +// s.Require().NoError(err) + +// // Check if "unreceived_packets" exists in "src" +// return len(relayerPacketsOutput.Result.Src.UnreceivedPackets) != 0 +// } + +// func (s *IntegrationTestSuite) queryRelayerWalletsBalances() (sdk.Coin, sdk.Coin) { +// chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) +// scrRelayerBalance, err := getSpecificBalance( +// chainAAPIEndpoint, +// s.chainA.genesisAccounts[relayerAccountIndexHermes1].keyInfo.GetAddress().String(), +// uatomDenom) +// s.Require().NoError(err) + +// chainBAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainB.id][0].GetHostPort("1317/tcp")) +// dstRelayerBalance, err := getSpecificBalance( +// chainBAPIEndpoint, +// s.chainB.genesisAccounts[relayerAccountIndexHermes1].keyInfo.GetAddress().String(), +// uatomDenom) +// s.Require().NoError(err) + +// return scrRelayerBalance, dstRelayerBalance +// } + +// func (s *IntegrationTestSuite) createConnection() { +// s.T().Logf("connecting %s and %s chains via IBC", s.chainA.id, s.chainB.id) + +// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) +// defer cancel() + +// exec, err := s.dkrPool.Client.CreateExec(docker.CreateExecOptions{ +// Context: ctx, +// AttachStdout: true, +// AttachStderr: true, +// Container: s.hermesResource0.Container.ID, +// User: "root", +// Cmd: []string{ +// "hermes", +// "create", +// "connection", +// "--a-chain", +// s.chainA.id, +// "--b-chain", +// s.chainB.id, +// }, +// }) +// s.Require().NoError(err) + +// var ( +// outBuf bytes.Buffer +// errBuf bytes.Buffer +// ) + +// err = s.dkrPool.Client.StartExec(exec.ID, docker.StartExecOptions{ +// Context: ctx, +// Detach: false, +// OutputStream: &outBuf, +// ErrorStream: &errBuf, +// }) +// s.Require().NoErrorf( +// err, +// "failed connect chains; stdout: %s, stderr: %s", outBuf.String(), errBuf.String(), +// ) + +// s.T().Logf("connected %s and %s chains via IBC", s.chainA.id, s.chainB.id) +// } + +// func (s *IntegrationTestSuite) createChannel() { +// s.T().Logf("connecting %s and %s chains via IBC", s.chainA.id, s.chainB.id) + +// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) +// defer cancel() + +// exec, err := s.dkrPool.Client.CreateExec(docker.CreateExecOptions{ +// Context: ctx, +// AttachStdout: true, +// AttachStderr: true, +// Container: s.hermesResource0.Container.ID, +// User: "root", +// Cmd: []string{ +// "hermes", +// txCommand, +// "chan-open-init", +// "--dst-chain", +// s.chainA.id, +// "--src-chain", +// s.chainB.id, +// "--dst-connection", +// "connection-0", +// "--src-port=transfer", +// "--dst-port=transfer", +// }, +// }) +// s.Require().NoError(err) + +// var ( +// outBuf bytes.Buffer +// errBuf bytes.Buffer +// ) + +// err = s.dkrPool.Client.StartExec(exec.ID, docker.StartExecOptions{ +// Context: ctx, +// Detach: false, +// OutputStream: &outBuf, +// ErrorStream: &errBuf, +// }) +// s.Require().NoErrorf( +// err, +// "failed connect chains; stdout: %s, stderr: %s", outBuf.String(), errBuf.String(), +// ) + +// s.T().Logf("connected %s and %s chains via IBC", s.chainA.id, s.chainB.id) +// } + +// func (s *IntegrationTestSuite) testIBCTokenTransfer() { +// s.Run("send_uatom_to_chainB", func() { +// // require the recipient account receives the IBC tokens (IBC packets ACKd) +// var ( +// balances sdk.Coins +// err error +// beforeBalance int64 +// ibcStakeDenom string +// ) + +// address := s.chainA.validators[0].keyInfo.GetAddress() +// sender := address.String() + +// address = s.chainB.validators[0].keyInfo.GetAddress() +// recipient := address.String() + +// chainBAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainB.id][0].GetHostPort("1317/tcp")) + +// s.Require().Eventually( +// func() bool { +// balances, err = queryGaiaAllBalances(chainBAPIEndpoint, recipient) +// s.Require().NoError(err) +// return balances.Len() != 0 +// }, +// time.Minute, +// 5*time.Second, +// ) +// for _, c := range balances { +// if strings.Contains(c.Denom, "ibc/") { +// beforeBalance = c.Amount.Int64() +// break +// } +// } + +// tokenAmt := 3300000000 +// s.sendIBC(s.chainA, 0, sender, recipient, strconv.Itoa(tokenAmt)+uatomDenom, standardFees.String(), "") + +// s.Require().Eventually( +// func() bool { +// balances, err = queryGaiaAllBalances(chainBAPIEndpoint, recipient) +// s.Require().NoError(err) +// return balances.Len() != 0 +// }, +// time.Minute, +// 5*time.Second, +// ) +// for _, c := range balances { +// if strings.Contains(c.Denom, "ibc/") { +// ibcStakeDenom = c.Denom +// s.Require().Equal((int64(tokenAmt) + beforeBalance), c.Amount.Int64()) +// break +// } +// } + +// s.Require().NotEmpty(ibcStakeDenom) +// }) +// } + +// /* +// TestMultihopIBCTokenTransfer tests that sending an IBC transfer using the IBC Packet Forward Middleware accepts a port, channel and account address + +// Steps: +// 1. Check balance of Account 1 on Chain 1 +// 2. Check balance of Account 2 on Chain 1 +// 3. Account 1 on Chain 1 sends x tokens to Account 2 on Chain 1 via Account 1 on Chain 2 +// 4. Check Balance of Account 1 on Chain 1, confirm it is original minus x tokens +// 5. Check Balance of Account 2 on Chain 1, confirm it is original plus x tokens + +// */ +// // TODO: Add back only if packet forward middleware has a working version compatible with IBC v3.0.x +// func (s *IntegrationTestSuite) testMultihopIBCTokenTransfer() { +// time.Sleep(30 * time.Second) + +// s.Run("send_successful_multihop_uatom_to_chainA_from_chainA", func() { +// // require the recipient account receives the IBC tokens (IBC packets ACKd) +// var ( +// err error +// ) + +// address := s.chainA.validators[0].keyInfo.GetAddress() +// sender := address.String() + +// address = s.chainB.validators[0].keyInfo.GetAddress() +// middlehop := address.String() + +// address = s.chainA.validators[1].keyInfo.GetAddress() +// recipient := address.String() + +// forwardPort := "transfer" +// forwardChannel := "channel-0" + +// tokenAmt := 3300000000 + +// chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) + +// var ( +// beforeSenderUAtomBalance sdk.Coin +// beforeRecipientUAtomBalance sdk.Coin +// ) + +// s.Require().Eventually( +// func() bool { +// beforeSenderUAtomBalance, err = getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) +// s.Require().NoError(err) +// fmt.Println("beforeSenderUAtomBalance", beforeSenderUAtomBalance) + +// beforeRecipientUAtomBalance, err = getSpecificBalance(chainAAPIEndpoint, recipient, uatomDenom) +// s.Require().NoError(err) +// fmt.Print("beforeRecipientUAtomBalance", beforeRecipientUAtomBalance) + +// return beforeSenderUAtomBalance.IsValid() && beforeRecipientUAtomBalance.IsValid() +// }, +// 1*time.Minute, +// 5*time.Second, +// ) + +// firstHopMetadata := &PacketMetadata{ +// Forward: &ForwardMetadata{ +// Receiver: recipient, +// Channel: forwardChannel, +// Port: forwardPort, +// }, +// } + +// memo, err := json.Marshal(firstHopMetadata) +// s.Require().NoError(err) + +// s.sendIBC(s.chainA, 0, sender, middlehop, strconv.Itoa(tokenAmt)+uatomDenom, standardFees.String(), string(memo)) + +// s.Require().Eventually( +// func() bool { +// afterSenderUAtomBalance, err := getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) +// s.Require().NoError(err) + +// afterRecipientUAtomBalance, err := getSpecificBalance(chainAAPIEndpoint, recipient, uatomDenom) +// s.Require().NoError(err) + +// decremented := beforeSenderUAtomBalance.Sub(tokenAmount).Sub(standardFees).IsEqual(afterSenderUAtomBalance) +// incremented := beforeRecipientUAtomBalance.Add(tokenAmount).IsEqual(afterRecipientUAtomBalance) + +// return decremented && incremented +// }, +// 1*time.Minute, +// 5*time.Second, +// ) +// }) +// } + +// /* +// TestFailedMultihopIBCTokenTransfer tests that sending a failing IBC transfer using the IBC Packet Forward +// Middleware will send the tokens back to the original account after failing. +// */ +// func (s *IntegrationTestSuite) testFailedMultihopIBCTokenTransfer() { +// time.Sleep(30 * time.Second) + +// s.Run("send_failed_multihop_uatom_to_chainA_from_chainA", func() { +// address := s.chainA.validators[0].keyInfo.GetAddress() +// sender := address.String() + +// address = s.chainB.validators[0].keyInfo.GetAddress() +// middlehop := address.String() + +// address = s.chainA.validators[1].keyInfo.GetAddress() +// recipient := strings.Replace(address.String(), "cosmos", "foobar", 1) // this should be an invalid recipient to force the tx to fail + +// forwardPort := "transfer" +// forwardChannel := "channel-0" + +// tokenAmt := 3300000000 + +// chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) + +// var ( +// beforeSenderUAtomBalance sdk.Coin +// err error +// ) + +// s.Require().Eventually( +// func() bool { +// beforeSenderUAtomBalance, err = getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) +// s.Require().NoError(err) + +// return beforeSenderUAtomBalance.IsValid() +// }, +// 1*time.Minute, +// 5*time.Second, +// ) + +// firstHopMetadata := &PacketMetadata{ +// Forward: &ForwardMetadata{ +// Receiver: recipient, +// Channel: forwardChannel, +// Port: forwardPort, +// }, +// } + +// memo, err := json.Marshal(firstHopMetadata) +// s.Require().NoError(err) + +// s.sendIBC(s.chainA, 0, sender, middlehop, strconv.Itoa(tokenAmt)+uatomDenom, standardFees.String(), string(memo)) + +// // Sender account should be initially decremented the full amount +// s.Require().Eventually( +// func() bool { +// afterSenderUAtomBalance, err := getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) +// s.Require().NoError(err) + +// returned := beforeSenderUAtomBalance.Sub(tokenAmount).Sub(standardFees).IsEqual(afterSenderUAtomBalance) + +// return returned +// }, +// 1*time.Minute, +// 1*time.Second, +// ) + +// // since the forward receiving account is invalid, it should be refunded to the original sender (minus the original fee) +// s.Require().Eventually( +// func() bool { +// afterSenderUAtomBalance, err := getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) +// s.Require().NoError(err) + +// returned := beforeSenderUAtomBalance.Sub(standardFees).IsEqual(afterSenderUAtomBalance) + +// return returned +// }, +// 5*time.Minute, +// 5*time.Second, +// ) +// }) +// } diff --git a/tests/e2e/e2e_query_exec_test.go b/tests/e2e/e2e_query_exec_test.go index b958a776e8..184732a6a1 100644 --- a/tests/e2e/e2e_query_exec_test.go +++ b/tests/e2e/e2e_query_exec_test.go @@ -1,47 +1,47 @@ package e2e -import ( - "context" - "fmt" - "time" +// import ( +// "context" +// "fmt" +// "time" - ccvtypes "github.com/cosmos/interchain-security/v2/x/ccv/provider/types" +// ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" - "github.com/cosmos/cosmos-sdk/client/flags" -) +// "github.com/cosmos/cosmos-sdk/client/flags" +// ) -func (s *IntegrationTestSuite) execQueryConsumerChains( - c *chain, - valIdx int, - homePath string, - queryValidation func(res ccvtypes.QueryConsumerChainsResponse, consumerChainId string) bool, - consumerChainID string, -) { - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() +// func (s *IntegrationTestSuite) execQueryConsumerChains( +// c *chain, +// valIdx int, +// homePath string, +// queryValidation func(res ccvtypes.QueryConsumerChainsResponse, consumerChainId string) bool, +// consumerChainID string, +// ) { +// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) +// defer cancel() - s.T().Logf("Querying consumer chains for chain: %s", c.id) - gaiaCommand := []string{ - gaiadBinary, - "query", - "provider", - "list-consumer-chains", - fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), - fmt.Sprintf("--%s=%s", flags.FlagHome, homePath), - "--output=json", - } +// s.T().Logf("Querying consumer chains for chain: %s", c.id) +// gaiaCommand := []string{ +// gaiadBinary, +// "query", +// "provider", +// "list-consumer-chains", +// fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), +// fmt.Sprintf("--%s=%s", flags.FlagHome, homePath), +// "--output=json", +// } - s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.validateQueryConsumers(queryValidation, consumerChainID)) - s.T().Logf("Successfully queried consumer chains for chain %s", c.id) -} +// s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.validateQueryConsumers(queryValidation, consumerChainID)) +// s.T().Logf("Successfully queried consumer chains for chain %s", c.id) +// } -func (s *IntegrationTestSuite) validateQueryConsumers(queryValidation func(ccvtypes.QueryConsumerChainsResponse, string) bool, consumerChainID string) func([]byte, []byte) bool { - return func(stdOut []byte, stdErr []byte) bool { - var queryConsumersRes ccvtypes.QueryConsumerChainsResponse - if err := cdc.UnmarshalJSON(stdOut, &queryConsumersRes); err != nil { - s.T().Logf("Error unmarshalling query consumer chains: %s", err.Error()) - return false - } - return queryValidation(queryConsumersRes, consumerChainID) - } -} +// func (s *IntegrationTestSuite) validateQueryConsumers(queryValidation func(ccvtypes.QueryConsumerChainsResponse, string) bool, consumerChainID string) func([]byte, []byte) bool { +// return func(stdOut []byte, stdErr []byte) bool { +// var queryConsumersRes ccvtypes.QueryConsumerChainsResponse +// if err := cdc.UnmarshalJSON(stdOut, &queryConsumersRes); err != nil { +// s.T().Logf("Error unmarshalling query consumer chains: %s", err.Error()) +// return false +// } +// return queryValidation(queryConsumersRes, consumerChainID) +// } +// } diff --git a/tests/e2e/e2e_rest_regression_test.go b/tests/e2e/e2e_rest_regression_test.go index 8777c516a6..aa0c2b2f18 100644 --- a/tests/e2e/e2e_rest_regression_test.go +++ b/tests/e2e/e2e_rest_regression_test.go @@ -1,89 +1,90 @@ package e2e -import ( - "fmt" - "net/http" -) - -/* -RestRegression tests the continuity of critical endpoints that node operators, block explorers, and ecosystem participants depend on. -Test Node REST Endpoints: -1. http://host:1317/validatorsets/latest -2. http://host:1317/validatorsets/{height} -3. http://host:1317/blocks/latest -4. http://host:1317/blocks/{height} -5. http://host:1317/syncing -6. http://host:1317/node_info -7. http://host:1317/txs -Test Module REST Endpoints -1. Bank total -2. Auth params -3. Distribution for Community Pool -4. Evidence -5. Gov proposals -6. Mint params -7. Slashing params -8. Staking params -*/ - -const ( - valSetLatestPath = "/validatorsets/latest" - valSetHeightPath = "/validatorsets/1" - blocksLatestPath = "/blocks/latest" - blocksHeightPath = "/blocks/1" - syncingPath = "/syncing" - nodeInfoPath = "/node_info" - transactionsPath = "/txs" - bankTotalModuleQueryPath = "/bank/total" - authParamsModuleQueryPath = "/auth/params" - distributionCommPoolModuleQueryPath = "/distribution/community_pool" - evidenceModuleQueryPath = "/evidence" - govPropsModuleQueryPath = "/gov/proposals" - mintingParamsModuleQueryPath = "/minting/parameters" - slashingParamsModuleQueryPath = "/slashing/parameters" - stakingParamsModuleQueryPath = "/staking/parameters" - missingPath = "/missing_endpoint" -) - -func (s *IntegrationTestSuite) testRestInterfaces() { - s.Run("test rest interfaces", func() { - var ( - valIdx = 0 - c = s.chainA - endpointURL = fmt.Sprintf("http://%s", s.valResources[c.id][valIdx].GetHostPort("1317/tcp")) - testEndpoints = []struct { - Path string - ExpectedStatus int - }{ - // Client Endpoints - {nodeInfoPath, 200}, - {syncingPath, 200}, - {valSetLatestPath, 200}, - {valSetHeightPath, 200}, - {blocksLatestPath, 200}, - {blocksHeightPath, 200}, - {transactionsPath, 200}, - // Module Endpoints - {bankTotalModuleQueryPath, 200}, - {authParamsModuleQueryPath, 200}, - {distributionCommPoolModuleQueryPath, 200}, - {evidenceModuleQueryPath, 200}, - {govPropsModuleQueryPath, 200}, - {mintingParamsModuleQueryPath, 200}, - {slashingParamsModuleQueryPath, 200}, - {stakingParamsModuleQueryPath, 200}, - {missingPath, 501}, - } - ) - - for _, endpoint := range testEndpoints { - resp, err := http.Get(fmt.Sprintf("%s%s", endpointURL, endpoint.Path)) - s.NoError(err, fmt.Sprintf("failed to get endpoint: %s%s", endpointURL, endpoint.Path)) - - _, err = readJSON(resp) - s.NoError(err, fmt.Sprintf("failed to read body of endpoint: %s%s", endpointURL, endpoint.Path)) - - s.EqualValues(resp.StatusCode, endpoint.ExpectedStatus) - } - }) -} +// +// import ( +// "fmt" +// "net/http" +//) +// +///* +// RestRegression tests the continuity of critical endpoints that node operators, block explorers, and ecosystem participants depend on. +// Test Node REST Endpoints: +// 1. http://host:1317/validatorsets/latest +// 2. http://host:1317/validatorsets/{height} +// 3. http://host:1317/blocks/latest +// 4. http://host:1317/blocks/{height} +// 5. http://host:1317/syncing +// 6. http://host:1317/node_info +// 7. http://host:1317/txs +// Test Module REST Endpoints +// 1. Bank total +// 2. Auth params +// 3. Distribution for Community Pool +// 4. Evidence +// 5. Gov proposals +// 6. Mint params +// 7. Slashing params +// 8. Staking params +// */ +// +// const ( +// valSetLatestPath = "/validatorsets/latest" +// valSetHeightPath = "/validatorsets/1" +// blocksLatestPath = "/blocks/latest" +// blocksHeightPath = "/blocks/1" +// syncingPath = "/syncing" +// nodeInfoPath = "/node_info" +// transactionsPath = "/txs" +// bankTotalModuleQueryPath = "/bank/total" +// authParamsModuleQueryPath = "/auth/params" +// distributionCommPoolModuleQueryPath = "/distribution/community_pool" +// evidenceModuleQueryPath = "/evidence" +// govPropsModuleQueryPath = "/gov/proposals" +// mintingParamsModuleQueryPath = "/minting/parameters" +// slashingParamsModuleQueryPath = "/slashing/parameters" +// stakingParamsModuleQueryPath = "/staking/parameters" +// missingPath = "/missing_endpoint" +//) +// +// func (s *IntegrationTestSuite) testRestInterfaces() { +// s.Run("test rest interfaces", func() { +// var ( +// valIdx = 0 +// c = s.chainA +// endpointURL = fmt.Sprintf("http://%s", s.valResources[c.id][valIdx].GetHostPort("1317/tcp")) +// testEndpoints = []struct { +// Path string +// ExpectedStatus int +// }{ +// // Client Endpoints +// {nodeInfoPath, 200}, +// {syncingPath, 200}, +// {valSetLatestPath, 200}, +// {valSetHeightPath, 200}, +// {blocksLatestPath, 200}, +// {blocksHeightPath, 200}, +// {transactionsPath, 200}, +// // Module Endpoints +// {bankTotalModuleQueryPath, 200}, +// {authParamsModuleQueryPath, 200}, +// {distributionCommPoolModuleQueryPath, 200}, +// {evidenceModuleQueryPath, 200}, +// {govPropsModuleQueryPath, 200}, +// {mintingParamsModuleQueryPath, 200}, +// {slashingParamsModuleQueryPath, 200}, +// {stakingParamsModuleQueryPath, 200}, +// {missingPath, 501}, +// } +// ) +// +// for _, endpoint := range testEndpoints { +// resp, err := http.Get(fmt.Sprintf("%s%s", endpointURL, endpoint.Path)) +// s.NoError(err, fmt.Sprintf("failed to get endpoint: %s%s", endpointURL, endpoint.Path)) +// +// _, err = readJSON(resp) +// s.NoError(err, fmt.Sprintf("failed to read body of endpoint: %s%s", endpointURL, endpoint.Path)) +// +// s.EqualValues(resp.StatusCode, endpoint.ExpectedStatus) +// } +// }) +//} diff --git a/tests/e2e/e2e_setup_test.go b/tests/e2e/e2e_setup_test.go index 37c2b910d8..34c1c166ba 100644 --- a/tests/e2e/e2e_setup_test.go +++ b/tests/e2e/e2e_setup_test.go @@ -1,935 +1,935 @@ package e2e -import ( - "context" - "encoding/json" - "fmt" - "io" - "net/http" - "os" - "os/exec" - "path" - "path/filepath" - "strconv" - "strings" - "testing" - "time" - - ccvprovider "github.com/cosmos/interchain-security/v2/x/ccv/provider/types" - - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/crypto/hd" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" - "github.com/cosmos/cosmos-sdk/server" - srvconfig "github.com/cosmos/cosmos-sdk/server/config" - 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" - 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" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" - "github.com/ory/dockertest/v3" - "github.com/ory/dockertest/v3/docker" - "github.com/spf13/viper" - "github.com/stretchr/testify/suite" - tmconfig "github.com/tendermint/tendermint/config" - tmjson "github.com/tendermint/tendermint/libs/json" - "github.com/tendermint/tendermint/libs/rand" - rpchttp "github.com/tendermint/tendermint/rpc/client/http" -) - -const ( - gaiadBinary = "gaiad" - txCommand = "tx" - queryCommand = "query" - keysCommand = "keys" - gaiaHomePath = "/home/nonroot/.gaia" - photonDenom = "photon" - uatomDenom = "uatom" - stakeDenom = "stake" - initBalanceStr = "110000000000stake,100000000000000000photon,100000000000000000uatom" - minGasPrice = "0.00001" - // the test globalfee in genesis is the same as minGasPrice - // global fee lower/higher than min_gas_price - initialGlobalFeeAmt = "0.00001" - lowGlobalFeesAmt = "0.000001" - highGlobalFeeAmt = "0.0001" - maxTotalBypassMinFeeMsgGasUsage = "1" - gas = 200000 - govProposalBlockBuffer = 35 - relayerAccountIndexHermes0 = 0 - relayerAccountIndexHermes1 = 1 - numberOfEvidences = 10 - slashingShares int64 = 10000 - - proposalGlobalFeeFilename = "proposal_globalfee.json" - proposalBypassMsgFilename = "proposal_bypass_msg.json" - proposalMaxTotalBypassFilename = "proposal_max_total_bypass.json" - proposalCommunitySpendFilename = "proposal_community_spend.json" - proposalAddConsumerChainFilename = "proposal_add_consumer.json" - proposalRemoveConsumerChainFilename = "proposal_remove_consumer.json" - - hermesBinary = "hermes" - hermesConfigWithGasPrices = "/root/.hermes/config.toml" - hermesConfigNoGasPrices = "/root/.hermes/config-zero.toml" - transferChannel = "channel-0" -) - -var ( - gaiaConfigPath = filepath.Join(gaiaHomePath, "config") - stakingAmount = sdk.NewInt(100000000000) - stakingAmountCoin = sdk.NewCoin(uatomDenom, stakingAmount) - tokenAmount = sdk.NewCoin(uatomDenom, sdk.NewInt(3300000000)) // 3,300uatom - standardFees = sdk.NewCoin(uatomDenom, sdk.NewInt(330000)) // 0.33uatom - depositAmount = sdk.NewCoin(uatomDenom, sdk.NewInt(330000000)) // 3,300uatom - distModuleAddress = authtypes.NewModuleAddress(distrtypes.ModuleName).String() - proposalCounter = 0 - HermesResource0Purged = false -) - -type IntegrationTestSuite struct { - suite.Suite - - tmpDirs []string - chainA *chain - chainB *chain - dkrPool *dockertest.Pool - dkrNet *dockertest.Network - hermesResource0 *dockertest.Resource - hermesResource1 *dockertest.Resource - - valResources map[string][]*dockertest.Resource -} - -type AddressResponse struct { - Name string `json:"name"` - Type string `json:"type"` - Address string `json:"address"` - Mnemonic string `json:"mnemonic"` -} - -func TestIntegrationTestSuite(t *testing.T) { - suite.Run(t, new(IntegrationTestSuite)) -} - -func (s *IntegrationTestSuite) SetupSuite() { - s.T().Log("setting up e2e integration test suite...") - - var err error - s.chainA, err = newChain() - s.Require().NoError(err) - - s.chainB, err = newChain() - s.Require().NoError(err) - - s.dkrPool, err = dockertest.NewPool("") - s.Require().NoError(err) - - s.dkrNet, err = s.dkrPool.CreateNetwork(fmt.Sprintf("%s-%s-testnet", s.chainA.id, s.chainB.id)) - s.Require().NoError(err) - - s.valResources = make(map[string][]*dockertest.Resource) - - vestingMnemonic, err := createMnemonic() - s.Require().NoError(err) - - jailedValMnemonic, err := createMnemonic() - s.Require().NoError(err) - - // The boostrapping phase is as follows: - // - // 1. Initialize Gaia validator nodes. - // 2. Create and initialize Gaia validator genesis files (both chains) - // 3. Start both networks. - // 4. Create and run IBC relayer (Hermes) containers. - - s.T().Logf("starting e2e infrastructure for chain A; chain-id: %s; datadir: %s", s.chainA.id, s.chainA.dataDir) - s.initNodes(s.chainA) - s.initGenesis(s.chainA, vestingMnemonic, jailedValMnemonic) - s.initValidatorConfigs(s.chainA) - s.runValidators(s.chainA, 0) - - s.T().Logf("starting e2e infrastructure for chain B; chain-id: %s; datadir: %s", s.chainB.id, s.chainB.dataDir) - s.initNodes(s.chainB) - s.initGenesis(s.chainB, vestingMnemonic, jailedValMnemonic) - s.initValidatorConfigs(s.chainB) - s.runValidators(s.chainB, 10) - - time.Sleep(10 * time.Second) - s.runIBCRelayer0() - s.runIBCRelayer1() -} - -func (s *IntegrationTestSuite) TearDownSuite() { - if str := os.Getenv("GAIA_E2E_SKIP_CLEANUP"); len(str) > 0 { - skipCleanup, err := strconv.ParseBool(str) - s.Require().NoError(err) - - if skipCleanup { - return - } - } - - s.T().Log("tearing down e2e integration test suite...") - - s.Require().NoError(s.dkrPool.Purge(s.hermesResource1)) - // if runIBCTest, s.hermesResource0 already purged in TestIBC() - // in GovSoftwareUpgrade test, s.TearDownSuite() then s.SetupSuite() - // if IBCTest runs before GovSoftwareUpgrade, s.hermesResource0 is already purged. - if !HermesResource0Purged { - s.Require().NoError(s.dkrPool.Purge(s.hermesResource0)) - } - - for _, vr := range s.valResources { - for _, r := range vr { - s.Require().NoError(s.dkrPool.Purge(r)) - } - } - - s.Require().NoError(s.dkrPool.RemoveNetwork(s.dkrNet)) - - os.RemoveAll(s.chainA.dataDir) - os.RemoveAll(s.chainB.dataDir) - - for _, td := range s.tmpDirs { - os.RemoveAll(td) - } -} - -func (s *IntegrationTestSuite) initNodes(c *chain) { - s.Require().NoError(c.createAndInitValidators(2)) - /* Adding 4 accounts to val0 local directory - c.genesisAccounts[0]: Relayer0 Wallet - c.genesisAccounts[1]: ICA Owner - c.genesisAccounts[2]: Test Account 1 - c.genesisAccounts[3]: Test Account 2 - c.genesisAccounts[4]: Relayer1 Wallet - */ - s.Require().NoError(c.addAccountFromMnemonic(5)) - // Initialize a genesis file for the first validator - val0ConfigDir := c.validators[0].configDir() - var addrAll []sdk.AccAddress - for _, val := range c.validators { - address := val.keyInfo.GetAddress() - addrAll = append(addrAll, address) - } - - for _, addr := range c.genesisAccounts { - acctAddr := addr.keyInfo.GetAddress() - addrAll = append(addrAll, acctAddr) - } - - s.Require().NoError( - modifyGenesis(val0ConfigDir, "", initBalanceStr, addrAll, initialGlobalFeeAmt+uatomDenom, uatomDenom), - ) - // copy the genesis file to the remaining validators - for _, val := range c.validators[1:] { - _, err := copyFile( - filepath.Join(val0ConfigDir, "config", "genesis.json"), - filepath.Join(val.configDir(), "config", "genesis.json"), - ) - s.Require().NoError(err) - } -} - -// TODO find a better way to manipulate accounts to add genesis accounts -func (s *IntegrationTestSuite) addGenesisVestingAndJailedAccounts( - c *chain, - valConfigDir, - vestingMnemonic, - jailedValMnemonic string, - appGenState map[string]json.RawMessage, -) map[string]json.RawMessage { - var ( - authGenState = authtypes.GetGenesisStateFromAppState(cdc, appGenState) - bankGenState = banktypes.GetGenesisStateFromAppState(cdc, appGenState) - stakingGenState = stakingtypes.GetGenesisStateFromAppState(cdc, appGenState) - ) - - // create genesis vesting accounts keys - kb, err := keyring.New(keyringAppName, keyring.BackendTest, valConfigDir, nil) - s.Require().NoError(err) - - keyringAlgos, _ := kb.SupportedAlgorithms() - algo, err := keyring.NewSigningAlgoFromString(string(hd.Secp256k1Type), keyringAlgos) - s.Require().NoError(err) - - // create jailed validator account keys - jailedValKey, err := kb.NewAccount(jailedValidatorKey, jailedValMnemonic, "", sdk.FullFundraiserPath, algo) - s.Require().NoError(err) - - // create genesis vesting accounts keys - c.genesisVestingAccounts = make(map[string]sdk.AccAddress) - for i, key := range genesisVestingKeys { - // Use the first wallet from the same mnemonic by HD path - acc, err := kb.NewAccount(key, vestingMnemonic, "", HDPath(i), algo) - s.Require().NoError(err) - c.genesisVestingAccounts[key] = acc.GetAddress() - s.T().Logf("created %s genesis account %s\n", key, c.genesisVestingAccounts[key].String()) - } - var ( - continuousVestingAcc = c.genesisVestingAccounts[continuousVestingKey] - delayedVestingAcc = c.genesisVestingAccounts[delayedVestingKey] - ) - - // add jailed validator to staking store - pubKey := jailedValKey.GetPubKey() - jailedValAcc := jailedValKey.GetAddress() - jailedValAddr := sdk.ValAddress(jailedValAcc) - val, err := stakingtypes.NewValidator( - jailedValAddr, - pubKey, - stakingtypes.NewDescription("jailed", "", "", "", ""), - ) - s.Require().NoError(err) - val.Jailed = true - val.Tokens = sdk.NewInt(slashingShares) - val.DelegatorShares = sdk.NewDec(slashingShares) - stakingGenState.Validators = append(stakingGenState.Validators, val) - - // add jailed validator delegations - stakingGenState.Delegations = append(stakingGenState.Delegations, stakingtypes.Delegation{ - DelegatorAddress: jailedValAcc.String(), - ValidatorAddress: jailedValAddr.String(), - Shares: sdk.NewDec(slashingShares), - }) - - appGenState[stakingtypes.ModuleName], err = cdc.MarshalJSON(stakingGenState) - s.Require().NoError(err) - - // add jailed account to the genesis - baseJailedAccount := authtypes.NewBaseAccount(jailedValAcc, pubKey, 0, 0) - s.Require().NoError(baseJailedAccount.Validate()) - - // add continuous vesting account to the genesis - baseVestingContinuousAccount := authtypes.NewBaseAccount( - continuousVestingAcc, nil, 0, 0) - vestingContinuousGenAccount := authvesting.NewContinuousVestingAccountRaw( - authvesting.NewBaseVestingAccount( - baseVestingContinuousAccount, - sdk.NewCoins(vestingAmountVested), - time.Now().Add(time.Duration(rand.Intn(80)+150)*time.Second).Unix(), - ), - time.Now().Add(time.Duration(rand.Intn(40)+90)*time.Second).Unix(), - ) - s.Require().NoError(vestingContinuousGenAccount.Validate()) - - // add delayed vesting account to the genesis - baseVestingDelayedAccount := authtypes.NewBaseAccount( - delayedVestingAcc, nil, 0, 0) - vestingDelayedGenAccount := authvesting.NewDelayedVestingAccountRaw( - authvesting.NewBaseVestingAccount( - baseVestingDelayedAccount, - sdk.NewCoins(vestingAmountVested), - time.Now().Add(time.Duration(rand.Intn(40)+90)*time.Second).Unix(), - ), - ) - s.Require().NoError(vestingDelayedGenAccount.Validate()) - - // unpack and append accounts - accs, err := authtypes.UnpackAccounts(authGenState.Accounts) - s.Require().NoError(err) - accs = append(accs, vestingContinuousGenAccount, vestingDelayedGenAccount, baseJailedAccount) - accs = authtypes.SanitizeGenesisAccounts(accs) - genAccs, err := authtypes.PackAccounts(accs) - s.Require().NoError(err) - authGenState.Accounts = genAccs - - // update auth module state - appGenState[authtypes.ModuleName], err = cdc.MarshalJSON(&authGenState) - s.Require().NoError(err) - - // update balances - vestingContinuousBalances := banktypes.Balance{ - Address: continuousVestingAcc.String(), - Coins: vestingBalance, - } - vestingDelayedBalances := banktypes.Balance{ - Address: delayedVestingAcc.String(), - Coins: vestingBalance, - } - jailedValidatorBalances := banktypes.Balance{ - Address: jailedValAcc.String(), - Coins: sdk.NewCoins(tokenAmount), - } - stakingModuleBalances := banktypes.Balance{ - Address: authtypes.NewModuleAddress(stakingtypes.NotBondedPoolName).String(), - Coins: sdk.NewCoins(sdk.NewCoin(uatomDenom, sdk.NewInt(slashingShares))), - } - bankGenState.Balances = append( - bankGenState.Balances, - vestingContinuousBalances, - vestingDelayedBalances, - jailedValidatorBalances, - stakingModuleBalances, - ) - bankGenState.Balances = banktypes.SanitizeGenesisBalances(bankGenState.Balances) - - // update the denom metadata for the bank module - bankGenState.DenomMetadata = append(bankGenState.DenomMetadata, banktypes.Metadata{ - Description: "An example stable token", - Display: uatomDenom, - Base: uatomDenom, - Symbol: uatomDenom, - Name: uatomDenom, - DenomUnits: []*banktypes.DenomUnit{ - { - Denom: uatomDenom, - Exponent: 0, - }, - }, - }) - - // update bank module state - appGenState[banktypes.ModuleName], err = cdc.MarshalJSON(bankGenState) - s.Require().NoError(err) - - return appGenState -} - -func (s *IntegrationTestSuite) initGenesis(c *chain, vestingMnemonic, jailedValMnemonic string) { - var ( - serverCtx = server.NewDefaultContext() - config = serverCtx.Config - validator = c.validators[0] - ) - - config.SetRoot(validator.configDir()) - config.Moniker = validator.moniker - - genFilePath := config.GenesisFile() - appGenState, genDoc, err := genutiltypes.GenesisStateFromGenFile(genFilePath) - s.Require().NoError(err) - - appGenState = s.addGenesisVestingAndJailedAccounts( - c, - validator.configDir(), - vestingMnemonic, - jailedValMnemonic, - appGenState, - ) - - var evidenceGenState evidencetypes.GenesisState - s.Require().NoError(cdc.UnmarshalJSON(appGenState[evidencetypes.ModuleName], &evidenceGenState)) - - evidenceGenState.Evidence = make([]*codectypes.Any, numberOfEvidences) - for i := range evidenceGenState.Evidence { - pk := ed25519.GenPrivKey() - evidence := &evidencetypes.Equivocation{ - Height: 1, - Power: 100, - Time: time.Now().UTC(), - ConsensusAddress: sdk.ConsAddress(pk.PubKey().Address().Bytes()).String(), - } - evidenceGenState.Evidence[i], err = codectypes.NewAnyWithValue(evidence) - s.Require().NoError(err) - } - - appGenState[evidencetypes.ModuleName], err = cdc.MarshalJSON(&evidenceGenState) - s.Require().NoError(err) - - var genUtilGenState genutiltypes.GenesisState - s.Require().NoError(cdc.UnmarshalJSON(appGenState[genutiltypes.ModuleName], &genUtilGenState)) - - // generate genesis txs - genTxs := make([]json.RawMessage, len(c.validators)) - for i, val := range c.validators { - createValmsg, err := val.buildCreateValidatorMsg(stakingAmountCoin) - s.Require().NoError(err) - signedTx, err := val.signMsg(createValmsg) - - s.Require().NoError(err) - - txRaw, err := cdc.MarshalJSON(signedTx) - s.Require().NoError(err) - - genTxs[i] = txRaw - } - - genUtilGenState.GenTxs = genTxs - - appGenState[genutiltypes.ModuleName], err = cdc.MarshalJSON(&genUtilGenState) - s.Require().NoError(err) - - genDoc.AppState, err = json.MarshalIndent(appGenState, "", " ") - s.Require().NoError(err) - - bz, err := tmjson.MarshalIndent(genDoc, "", " ") - s.Require().NoError(err) - - vestingPeriod, err := generateVestingPeriod() - s.Require().NoError(err) - - rawTx, _, err := buildRawTx() - s.Require().NoError(err) - - // write the updated genesis file to each validator. - for _, val := range c.validators { - err = writeFile(filepath.Join(val.configDir(), "config", "genesis.json"), bz) - s.Require().NoError(err) - - err = writeFile(filepath.Join(val.configDir(), vestingPeriodFile), vestingPeriod) - s.Require().NoError(err) - - err = writeFile(filepath.Join(val.configDir(), rawTxFile), rawTx) - s.Require().NoError(err) - } -} - -// initValidatorConfigs initializes the validator configs for the given chain. -func (s *IntegrationTestSuite) initValidatorConfigs(c *chain) { - for i, val := range c.validators { - tmCfgPath := filepath.Join(val.configDir(), "config", "config.toml") - - vpr := viper.New() - vpr.SetConfigFile(tmCfgPath) - s.Require().NoError(vpr.ReadInConfig()) - - valConfig := tmconfig.DefaultConfig() - - s.Require().NoError(vpr.Unmarshal(valConfig)) - - valConfig.P2P.ListenAddress = "tcp://0.0.0.0:26656" - valConfig.P2P.AddrBookStrict = false - valConfig.P2P.ExternalAddress = fmt.Sprintf("%s:%d", val.instanceName(), 26656) - valConfig.RPC.ListenAddress = "tcp://0.0.0.0:26657" - valConfig.StateSync.Enable = false - valConfig.LogLevel = "info" - - var peers []string - - for j := 0; j < len(c.validators); j++ { - if i == j { - continue - } - - peer := c.validators[j] - peerID := fmt.Sprintf("%s@%s%d:26656", peer.nodeKey.ID(), peer.moniker, j) - peers = append(peers, peerID) - } - - valConfig.P2P.PersistentPeers = strings.Join(peers, ",") - - tmconfig.WriteConfigFile(tmCfgPath, valConfig) - - // set application configuration - appCfgPath := filepath.Join(val.configDir(), "config", "app.toml") - - appConfig := srvconfig.DefaultConfig() - appConfig.API.Enable = true - appConfig.MinGasPrices = fmt.Sprintf("%s%s", minGasPrice, uatomDenom) - - srvconfig.SetConfigTemplate(srvconfig.DefaultConfigTemplate) - srvconfig.WriteConfigFile(appCfgPath, appConfig) - } -} - -// runValidators runs the validators in the chain -func (s *IntegrationTestSuite) runValidators(c *chain, portOffset int) { - s.T().Logf("starting Gaia %s validator containers...", c.id) - - s.valResources[c.id] = make([]*dockertest.Resource, len(c.validators)) - for i, val := range c.validators { - runOpts := &dockertest.RunOptions{ - Name: val.instanceName(), - NetworkID: s.dkrNet.Network.ID, - Mounts: []string{ - fmt.Sprintf("%s/:%s", val.configDir(), gaiaHomePath), - }, - Repository: "cosmos/gaiad-e2e", - } - - s.Require().NoError(exec.Command("chmod", "-R", "0777", val.configDir()).Run()) //nolint:gosec // this is a test - - // expose the first validator for debugging and communication - if val.index == 0 { - runOpts.PortBindings = map[docker.Port][]docker.PortBinding{ - "1317/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 1317+portOffset)}}, - "6060/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 6060+portOffset)}}, - "6061/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 6061+portOffset)}}, - "6062/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 6062+portOffset)}}, - "6063/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 6063+portOffset)}}, - "6064/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 6064+portOffset)}}, - "6065/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 6065+portOffset)}}, - "9090/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 9090+portOffset)}}, - "26656/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 26656+portOffset)}}, - "26657/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 26657+portOffset)}}, - } - } - - resource, err := s.dkrPool.RunWithOptions(runOpts, noRestart) - s.Require().NoError(err) - - s.valResources[c.id][i] = resource - s.T().Logf("started Gaia %s validator container: %s", c.id, resource.Container.ID) - } - - rpcClient, err := rpchttp.New("tcp://localhost:26657", "/websocket") - s.Require().NoError(err) - - s.Require().Eventually( - func() bool { - ctx, cancel := context.WithTimeout(context.Background(), time.Second*5) - defer cancel() - - status, err := rpcClient.Status(ctx) - if err != nil { - return false - } - - // let the node produce a few blocks - if status.SyncInfo.CatchingUp || status.SyncInfo.LatestBlockHeight < 3 { - return false - } - - return true - }, - 5*time.Minute, - time.Second, - "Gaia node failed to produce blocks", - ) -} - -func noRestart(config *docker.HostConfig) { - // in this case we don't want the nodes to restart on failure - config.RestartPolicy = docker.RestartPolicy{ - Name: "no", - } -} - -// hermes0 is for ibc and packet-forward-middleware(PFM) test, hermes0 is keep running during the ibc and PFM test. -func (s *IntegrationTestSuite) runIBCRelayer0() { - s.T().Log("starting Hermes relayer container 0...") - - tmpDir, err := os.MkdirTemp("", "gaia-e2e-testnet-hermes-") - s.Require().NoError(err) - s.tmpDirs = append(s.tmpDirs, tmpDir) - - gaiaAVal := s.chainA.validators[0] - gaiaBVal := s.chainB.validators[0] - - gaiaARly := s.chainA.genesisAccounts[relayerAccountIndexHermes0] - gaiaBRly := s.chainB.genesisAccounts[relayerAccountIndexHermes0] - - hermesCfgPath := path.Join(tmpDir, "hermes") - - s.Require().NoError(os.MkdirAll(hermesCfgPath, 0o755)) - _, err = copyFile( - filepath.Join("./scripts/", "hermes_bootstrap.sh"), - filepath.Join(hermesCfgPath, "hermes_bootstrap.sh"), - ) - s.Require().NoError(err) - - s.hermesResource0, err = s.dkrPool.RunWithOptions( - &dockertest.RunOptions{ - Name: fmt.Sprintf("%s-%s-relayer-0", s.chainA.id, s.chainB.id), - Repository: "ghcr.io/cosmos/hermes-e2e", - Tag: "1.0.0", - NetworkID: s.dkrNet.Network.ID, - Mounts: []string{ - fmt.Sprintf("%s/:/root/hermes", hermesCfgPath), - }, - PortBindings: map[docker.Port][]docker.PortBinding{ - "3031/tcp": {{HostIP: "", HostPort: "3031"}}, - }, - Env: []string{ - fmt.Sprintf("GAIA_A_E2E_CHAIN_ID=%s", s.chainA.id), - fmt.Sprintf("GAIA_B_E2E_CHAIN_ID=%s", s.chainB.id), - fmt.Sprintf("GAIA_A_E2E_VAL_MNEMONIC=%s", gaiaAVal.mnemonic), - fmt.Sprintf("GAIA_B_E2E_VAL_MNEMONIC=%s", gaiaBVal.mnemonic), - fmt.Sprintf("GAIA_A_E2E_RLY_MNEMONIC=%s", gaiaARly.mnemonic), - fmt.Sprintf("GAIA_B_E2E_RLY_MNEMONIC=%s", gaiaBRly.mnemonic), - fmt.Sprintf("GAIA_A_E2E_VAL_HOST=%s", s.valResources[s.chainA.id][0].Container.Name[1:]), - fmt.Sprintf("GAIA_B_E2E_VAL_HOST=%s", s.valResources[s.chainB.id][0].Container.Name[1:]), - }, - Entrypoint: []string{ - "sh", - "-c", - "chmod +x /root/hermes/hermes_bootstrap.sh && /root/hermes/hermes_bootstrap.sh", - }, - }, - noRestart, - ) - s.Require().NoError(err) - - endpoint := fmt.Sprintf("http://%s/state", s.hermesResource0.GetHostPort("3031/tcp")) - s.Require().Eventually( - func() bool { - resp, err := http.Get(endpoint) //nolint:gosec // this is a test - if err != nil { - return false - } - - defer resp.Body.Close() - - bz, err := io.ReadAll(resp.Body) - if err != nil { - return false - } - - var respBody map[string]interface{} - if err := json.Unmarshal(bz, &respBody); err != nil { - return false - } - - status := respBody["status"].(string) - result := respBody["result"].(map[string]interface{}) - - return status == "success" && len(result["chains"].([]interface{})) == 2 - }, - 5*time.Minute, - time.Second, - "hermes relayer not healthy", - ) - - s.T().Logf("started Hermes relayer 0 container: %s", s.hermesResource0.Container.ID) - - // XXX: Give time to both networks to start, otherwise we might see gRPC - // transport errors. - time.Sleep(10 * time.Second) - - // create the client, connection and channel between the two Gaia chains - s.createConnection() - time.Sleep(10 * time.Second) - s.createChannel() -} - -// hermes1 is for bypass-msg test. Hermes1 is to process asynchronous transactions, -// Hermes1 has access to two Hermes configurations: one configuration allows paying fees, while the other does not. -// With Hermes1, better control can be achieved regarding whether fees are paid when clearing transactions. -func (s *IntegrationTestSuite) runIBCRelayer1() { - s.T().Log("starting Hermes relayer container 1...") - - tmpDir, err := os.MkdirTemp("", "gaia-e2e-testnet-hermes-") - s.Require().NoError(err) - s.tmpDirs = append(s.tmpDirs, tmpDir) - - gaiaAVal := s.chainA.validators[0] - gaiaBVal := s.chainB.validators[0] - - gaiaARly := s.chainA.genesisAccounts[relayerAccountIndexHermes1] - gaiaBRly := s.chainB.genesisAccounts[relayerAccountIndexHermes1] - - hermesCfgPath := path.Join(tmpDir, "hermes") - - s.Require().NoError(os.MkdirAll(hermesCfgPath, 0o755)) - _, err = copyFile( - filepath.Join("./scripts/", "hermes1_bootstrap.sh"), - filepath.Join(hermesCfgPath, "hermes1_bootstrap.sh"), - ) - s.Require().NoError(err) - - s.hermesResource1, err = s.dkrPool.RunWithOptions( - &dockertest.RunOptions{ - Name: fmt.Sprintf("%s-%s-relayer-1", s.chainA.id, s.chainB.id), - Repository: "ghcr.io/cosmos/hermes-e2e", - Tag: "1.0.0", - NetworkID: s.dkrNet.Network.ID, - Mounts: []string{ - fmt.Sprintf("%s/:/root/hermes", hermesCfgPath), - }, - PortBindings: map[docker.Port][]docker.PortBinding{ - "3032/tcp": {{HostIP: "", HostPort: "3032"}}, - }, - Env: []string{ - fmt.Sprintf("GAIA_A_E2E_CHAIN_ID=%s", s.chainA.id), - fmt.Sprintf("GAIA_B_E2E_CHAIN_ID=%s", s.chainB.id), - fmt.Sprintf("GAIA_A_E2E_VAL_MNEMONIC=%s", gaiaAVal.mnemonic), - fmt.Sprintf("GAIA_B_E2E_VAL_MNEMONIC=%s", gaiaBVal.mnemonic), - fmt.Sprintf("GAIA_A_E2E_RLY_MNEMONIC=%s", gaiaARly.mnemonic), - fmt.Sprintf("GAIA_B_E2E_RLY_MNEMONIC=%s", gaiaBRly.mnemonic), - fmt.Sprintf("GAIA_A_E2E_VAL_HOST=%s", s.valResources[s.chainA.id][0].Container.Name[1:]), - fmt.Sprintf("GAIA_B_E2E_VAL_HOST=%s", s.valResources[s.chainB.id][0].Container.Name[1:]), - }, - Entrypoint: []string{ - "sh", - "-c", - "chmod +x /root/hermes/hermes1_bootstrap.sh && /root/hermes/hermes1_bootstrap.sh && tail -f /dev/null", - }, - }, - noRestart, - ) - s.Require().NoError(err) - - s.T().Logf("started Hermes relayer 1 container: %s", s.hermesResource1.Container.ID) - - // XXX: Give time to both networks to start, otherwise we might see gRPC - // transport errors. - time.Sleep(10 * time.Second) -} - -func (s *IntegrationTestSuite) writeGovParamChangeProposalGlobalFees(c *chain, coins sdk.DecCoins) { - type ParamInfo struct { - Subspace string `json:"subspace"` - Key string `json:"key"` - Value sdk.DecCoins `json:"value"` - } - - type ParamChangeMessage struct { - Title string `json:"title"` - Description string `json:"description"` - Changes []ParamInfo `json:"changes"` - Deposit string `json:"deposit"` - } - - paramChangeProposalBody, err := json.MarshalIndent(ParamChangeMessage{ - Title: "global fee test", - Description: "global fee change", - Changes: []ParamInfo{ - { - Subspace: "globalfee", - Key: "MinimumGasPricesParam", - Value: coins, - }, - }, - Deposit: "1000uatom", - }, "", " ") - s.Require().NoError(err) - - err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalGlobalFeeFilename), paramChangeProposalBody) - s.Require().NoError(err) -} - -func (s *IntegrationTestSuite) writeGovParamChangeProposalBypassMsgs(c *chain, msgs []string) { - type ParamInfo struct { - Subspace string `json:"subspace"` - Key string `json:"key"` - Value []string `json:"value"` - } - - type ParamChangeMessage struct { - Title string `json:"title"` - Description string `json:"description"` - Changes []ParamInfo `json:"changes"` - Deposit string `json:"deposit"` - } - paramChangeProposalBody, err := json.MarshalIndent(ParamChangeMessage{ - Title: "ChangeProposalBypassMsgs", - Description: "global fee change", - Changes: []ParamInfo{ - { - Subspace: "globalfee", - Key: "BypassMinFeeMsgTypes", - Value: msgs, - }, - }, - Deposit: "1000uatom", - }, "", " ") - s.Require().NoError(err) - - err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalBypassMsgFilename), paramChangeProposalBody) - s.Require().NoError(err) -} - -func (s *IntegrationTestSuite) writeGovParamChangeProposalMaxTotalBypass(c *chain, gas uint64) { - type ParamInfo struct { - Subspace string `json:"subspace"` - Key string `json:"key"` - Value string `json:"value"` - } - - type ParamChangeMessage struct { - Title string `json:"title"` - Description string `json:"description"` - Changes []ParamInfo `json:"changes"` - Deposit string `json:"deposit"` - } - paramChangeProposalBody, err := json.MarshalIndent(ParamChangeMessage{ - Title: "ChangeProposalMaxTotalBypass", - Description: "global fee change", - Changes: []ParamInfo{ - { - Subspace: "globalfee", - Key: "MaxTotalBypassMinFeeMsgGasUsage", - Value: strconv.FormatInt(int64(gas), 10), - }, - }, - Deposit: "1000uatom", - }, "", " ") - s.Require().NoError(err) - - err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalMaxTotalBypassFilename), paramChangeProposalBody) - s.Require().NoError(err) -} - -func (s *IntegrationTestSuite) writeGovCommunitySpendProposal(c *chain, amount string, recipient string) { - proposalCommSpend := &distrtypes.CommunityPoolSpendProposalWithDeposit{ - Title: "Community Pool Spend", - Description: "Fund Team!", - Recipient: recipient, - Amount: amount, - Deposit: "1000uatom", - } - commSpendBody, err := json.MarshalIndent(proposalCommSpend, "", " ") - s.Require().NoError(err) - - err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalCommunitySpendFilename), commSpendBody) - s.Require().NoError(err) -} - -type ConsumerAdditionProposalWithDeposit struct { - ccvprovider.ConsumerAdditionProposal - Deposit string `json:"deposit"` -} - -type ConsumerRemovalProposalWithDeposit struct { - ccvprovider.ConsumerRemovalProposal - Deposit string `json:"deposit"` -} - -func (s *IntegrationTestSuite) writeAddRemoveConsumerProposals(c *chain, consumerChainID string) { - hash, _ := json.Marshal("Z2VuX2hhc2g=") - addProp := &ccvprovider.ConsumerAdditionProposal{ - Title: "Create consumer chain", - Description: "First consumer chain", - ChainId: consumerChainID, - InitialHeight: ibcclienttypes.Height{ - RevisionHeight: 1, - }, - GenesisHash: hash, - BinaryHash: hash, - SpawnTime: time.Now(), - UnbondingPeriod: time.Duration(100000000000), - CcvTimeoutPeriod: time.Duration(100000000000), - TransferTimeoutPeriod: time.Duration(100000000000), - ConsumerRedistributionFraction: "0.75", - BlocksPerDistributionTransmission: 10, - HistoricalEntries: 10000, - } - addPropWithDeposit := ConsumerAdditionProposalWithDeposit{ - ConsumerAdditionProposal: *addProp, - Deposit: "1000uatom", - } - - removeProp := &ccvprovider.ConsumerRemovalProposal{ - Title: "Remove consumer chain", - Description: "Removing consumer chain", - ChainId: consumerChainID, - StopTime: time.Now(), - } - - removePropWithDeposit := ConsumerRemovalProposalWithDeposit{ - ConsumerRemovalProposal: *removeProp, - Deposit: "1000uatom", - } - - consumerAddBody, err := json.MarshalIndent(addPropWithDeposit, "", " ") - s.Require().NoError(err) - - consumerRemoveBody, err := json.MarshalIndent(removePropWithDeposit, "", " ") - s.Require().NoError(err) - - err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalAddConsumerChainFilename), consumerAddBody) - s.Require().NoError(err) - err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalRemoveConsumerChainFilename), consumerRemoveBody) - s.Require().NoError(err) -} - -func configFile(filename string) string { - filepath := filepath.Join(gaiaConfigPath, filename) - return filepath -} +// import ( +// "context" +// "encoding/json" +// "fmt" +// "io" +// "net/http" +// "os" +// "os/exec" +// "path" +// "path/filepath" +// "strconv" +// "strings" +// "testing" +// "time" + +// ccvprovider "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" + +// codectypes "github.com/cosmos/cosmos-sdk/codec/types" +// "github.com/cosmos/cosmos-sdk/crypto/hd" +// "github.com/cosmos/cosmos-sdk/crypto/keyring" +// "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" +// "github.com/cosmos/cosmos-sdk/server" +// srvconfig "github.com/cosmos/cosmos-sdk/server/config" +// 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" +// 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" +// stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" +// ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" +// "github.com/ory/dockertest/v3" +// "github.com/ory/dockertest/v3/docker" +// "github.com/spf13/viper" +// "github.com/stretchr/testify/suite" +// tmconfig "github.com/tendermint/tendermint/config" +// tmjson "github.com/tendermint/tendermint/libs/json" +// "github.com/tendermint/tendermint/libs/rand" +// rpchttp "github.com/tendermint/tendermint/rpc/client/http" +// ) + +// const ( +// gaiadBinary = "gaiad" +// txCommand = "tx" +// queryCommand = "query" +// keysCommand = "keys" +// gaiaHomePath = "/home/nonroot/.gaia" +// photonDenom = "photon" +// uatomDenom = "uatom" +// stakeDenom = "stake" +// initBalanceStr = "110000000000stake,100000000000000000photon,100000000000000000uatom" +// minGasPrice = "0.00001" +// // the test globalfee in genesis is the same as minGasPrice +// // global fee lower/higher than min_gas_price +// initialGlobalFeeAmt = "0.00001" +// lowGlobalFeesAmt = "0.000001" +// highGlobalFeeAmt = "0.0001" +// maxTotalBypassMinFeeMsgGasUsage = "1" +// gas = 200000 +// govProposalBlockBuffer = 35 +// relayerAccountIndexHermes0 = 0 +// relayerAccountIndexHermes1 = 1 +// numberOfEvidences = 10 +// slashingShares int64 = 10000 + +// proposalGlobalFeeFilename = "proposal_globalfee.json" +// proposalBypassMsgFilename = "proposal_bypass_msg.json" +// proposalMaxTotalBypassFilename = "proposal_max_total_bypass.json" +// proposalCommunitySpendFilename = "proposal_community_spend.json" +// proposalAddConsumerChainFilename = "proposal_add_consumer.json" +// proposalRemoveConsumerChainFilename = "proposal_remove_consumer.json" + +// hermesBinary = "hermes" +// hermesConfigWithGasPrices = "/root/.hermes/config.toml" +// hermesConfigNoGasPrices = "/root/.hermes/config-zero.toml" +// transferChannel = "channel-0" +// ) + +// var ( +// gaiaConfigPath = filepath.Join(gaiaHomePath, "config") +// stakingAmount = sdk.NewInt(100000000000) +// stakingAmountCoin = sdk.NewCoin(uatomDenom, stakingAmount) +// tokenAmount = sdk.NewCoin(uatomDenom, sdk.NewInt(3300000000)) // 3,300uatom +// standardFees = sdk.NewCoin(uatomDenom, sdk.NewInt(330000)) // 0.33uatom +// depositAmount = sdk.NewCoin(uatomDenom, sdk.NewInt(330000000)) // 3,300uatom +// distModuleAddress = authtypes.NewModuleAddress(distrtypes.ModuleName).String() +// proposalCounter = 0 +// HermesResource0Purged = false +// ) + +// type IntegrationTestSuite struct { +// suite.Suite + +// tmpDirs []string +// chainA *chain +// chainB *chain +// dkrPool *dockertest.Pool +// dkrNet *dockertest.Network +// hermesResource0 *dockertest.Resource +// hermesResource1 *dockertest.Resource + +// valResources map[string][]*dockertest.Resource +// } + +// type AddressResponse struct { +// Name string `json:"name"` +// Type string `json:"type"` +// Address string `json:"address"` +// Mnemonic string `json:"mnemonic"` +// } + +// func TestIntegrationTestSuite(t *testing.T) { +// suite.Run(t, new(IntegrationTestSuite)) +// } + +// func (s *IntegrationTestSuite) SetupSuite() { +// s.T().Log("setting up e2e integration test suite...") + +// var err error +// s.chainA, err = newChain() +// s.Require().NoError(err) + +// s.chainB, err = newChain() +// s.Require().NoError(err) + +// s.dkrPool, err = dockertest.NewPool("") +// s.Require().NoError(err) + +// s.dkrNet, err = s.dkrPool.CreateNetwork(fmt.Sprintf("%s-%s-testnet", s.chainA.id, s.chainB.id)) +// s.Require().NoError(err) + +// s.valResources = make(map[string][]*dockertest.Resource) + +// vestingMnemonic, err := createMnemonic() +// s.Require().NoError(err) + +// jailedValMnemonic, err := createMnemonic() +// s.Require().NoError(err) + +// // The boostrapping phase is as follows: +// // +// // 1. Initialize Gaia validator nodes. +// // 2. Create and initialize Gaia validator genesis files (both chains) +// // 3. Start both networks. +// // 4. Create and run IBC relayer (Hermes) containers. + +// s.T().Logf("starting e2e infrastructure for chain A; chain-id: %s; datadir: %s", s.chainA.id, s.chainA.dataDir) +// s.initNodes(s.chainA) +// s.initGenesis(s.chainA, vestingMnemonic, jailedValMnemonic) +// s.initValidatorConfigs(s.chainA) +// s.runValidators(s.chainA, 0) + +// s.T().Logf("starting e2e infrastructure for chain B; chain-id: %s; datadir: %s", s.chainB.id, s.chainB.dataDir) +// s.initNodes(s.chainB) +// s.initGenesis(s.chainB, vestingMnemonic, jailedValMnemonic) +// s.initValidatorConfigs(s.chainB) +// s.runValidators(s.chainB, 10) + +// time.Sleep(10 * time.Second) +// s.runIBCRelayer0() +// s.runIBCRelayer1() +// } + +// func (s *IntegrationTestSuite) TearDownSuite() { +// if str := os.Getenv("GAIA_E2E_SKIP_CLEANUP"); len(str) > 0 { +// skipCleanup, err := strconv.ParseBool(str) +// s.Require().NoError(err) + +// if skipCleanup { +// return +// } +// } + +// s.T().Log("tearing down e2e integration test suite...") + +// s.Require().NoError(s.dkrPool.Purge(s.hermesResource1)) +// // if runIBCTest, s.hermesResource0 already purged in TestIBC() +// // in GovSoftwareUpgrade test, s.TearDownSuite() then s.SetupSuite() +// // if IBCTest runs before GovSoftwareUpgrade, s.hermesResource0 is already purged. +// if !HermesResource0Purged { +// s.Require().NoError(s.dkrPool.Purge(s.hermesResource0)) +// } + +// for _, vr := range s.valResources { +// for _, r := range vr { +// s.Require().NoError(s.dkrPool.Purge(r)) +// } +// } + +// s.Require().NoError(s.dkrPool.RemoveNetwork(s.dkrNet)) + +// os.RemoveAll(s.chainA.dataDir) +// os.RemoveAll(s.chainB.dataDir) + +// for _, td := range s.tmpDirs { +// os.RemoveAll(td) +// } +// } + +// func (s *IntegrationTestSuite) initNodes(c *chain) { +// s.Require().NoError(c.createAndInitValidators(2)) +// /* Adding 4 accounts to val0 local directory +// c.genesisAccounts[0]: Relayer0 Wallet +// c.genesisAccounts[1]: ICA Owner +// c.genesisAccounts[2]: Test Account 1 +// c.genesisAccounts[3]: Test Account 2 +// c.genesisAccounts[4]: Relayer1 Wallet +// */ +// s.Require().NoError(c.addAccountFromMnemonic(5)) +// // Initialize a genesis file for the first validator +// val0ConfigDir := c.validators[0].configDir() +// var addrAll []sdk.AccAddress +// for _, val := range c.validators { +// address := val.keyInfo.GetAddress() +// addrAll = append(addrAll, address) +// } + +// for _, addr := range c.genesisAccounts { +// acctAddr := addr.keyInfo.GetAddress() +// addrAll = append(addrAll, acctAddr) +// } + +// s.Require().NoError( +// modifyGenesis(val0ConfigDir, "", initBalanceStr, addrAll, initialGlobalFeeAmt+uatomDenom, uatomDenom), +// ) +// // copy the genesis file to the remaining validators +// for _, val := range c.validators[1:] { +// _, err := copyFile( +// filepath.Join(val0ConfigDir, "config", "genesis.json"), +// filepath.Join(val.configDir(), "config", "genesis.json"), +// ) +// s.Require().NoError(err) +// } +// } + +// // TODO find a better way to manipulate accounts to add genesis accounts +// func (s *IntegrationTestSuite) addGenesisVestingAndJailedAccounts( +// c *chain, +// valConfigDir, +// vestingMnemonic, +// jailedValMnemonic string, +// appGenState map[string]json.RawMessage, +// ) map[string]json.RawMessage { +// var ( +// authGenState = authtypes.GetGenesisStateFromAppState(cdc, appGenState) +// bankGenState = banktypes.GetGenesisStateFromAppState(cdc, appGenState) +// stakingGenState = stakingtypes.GetGenesisStateFromAppState(cdc, appGenState) +// ) + +// // create genesis vesting accounts keys +// kb, err := keyring.New(keyringAppName, keyring.BackendTest, valConfigDir, nil) +// s.Require().NoError(err) + +// keyringAlgos, _ := kb.SupportedAlgorithms() +// algo, err := keyring.NewSigningAlgoFromString(string(hd.Secp256k1Type), keyringAlgos) +// s.Require().NoError(err) + +// // create jailed validator account keys +// jailedValKey, err := kb.NewAccount(jailedValidatorKey, jailedValMnemonic, "", sdk.FullFundraiserPath, algo) +// s.Require().NoError(err) + +// // create genesis vesting accounts keys +// c.genesisVestingAccounts = make(map[string]sdk.AccAddress) +// for i, key := range genesisVestingKeys { +// // Use the first wallet from the same mnemonic by HD path +// acc, err := kb.NewAccount(key, vestingMnemonic, "", HDPath(i), algo) +// s.Require().NoError(err) +// c.genesisVestingAccounts[key] = acc.GetAddress() +// s.T().Logf("created %s genesis account %s\n", key, c.genesisVestingAccounts[key].String()) +// } +// var ( +// continuousVestingAcc = c.genesisVestingAccounts[continuousVestingKey] +// delayedVestingAcc = c.genesisVestingAccounts[delayedVestingKey] +// ) + +// // add jailed validator to staking store +// pubKey := jailedValKey.GetPubKey() +// jailedValAcc := jailedValKey.GetAddress() +// jailedValAddr := sdk.ValAddress(jailedValAcc) +// val, err := stakingtypes.NewValidator( +// jailedValAddr, +// pubKey, +// stakingtypes.NewDescription("jailed", "", "", "", ""), +// ) +// s.Require().NoError(err) +// val.Jailed = true +// val.Tokens = sdk.NewInt(slashingShares) +// val.DelegatorShares = sdk.NewDec(slashingShares) +// stakingGenState.Validators = append(stakingGenState.Validators, val) + +// // add jailed validator delegations +// stakingGenState.Delegations = append(stakingGenState.Delegations, stakingtypes.Delegation{ +// DelegatorAddress: jailedValAcc.String(), +// ValidatorAddress: jailedValAddr.String(), +// Shares: sdk.NewDec(slashingShares), +// }) + +// appGenState[stakingtypes.ModuleName], err = cdc.MarshalJSON(stakingGenState) +// s.Require().NoError(err) + +// // add jailed account to the genesis +// baseJailedAccount := authtypes.NewBaseAccount(jailedValAcc, pubKey, 0, 0) +// s.Require().NoError(baseJailedAccount.Validate()) + +// // add continuous vesting account to the genesis +// baseVestingContinuousAccount := authtypes.NewBaseAccount( +// continuousVestingAcc, nil, 0, 0) +// vestingContinuousGenAccount := authvesting.NewContinuousVestingAccountRaw( +// authvesting.NewBaseVestingAccount( +// baseVestingContinuousAccount, +// sdk.NewCoins(vestingAmountVested), +// time.Now().Add(time.Duration(rand.Intn(80)+150)*time.Second).Unix(), +// ), +// time.Now().Add(time.Duration(rand.Intn(40)+90)*time.Second).Unix(), +// ) +// s.Require().NoError(vestingContinuousGenAccount.Validate()) + +// // add delayed vesting account to the genesis +// baseVestingDelayedAccount := authtypes.NewBaseAccount( +// delayedVestingAcc, nil, 0, 0) +// vestingDelayedGenAccount := authvesting.NewDelayedVestingAccountRaw( +// authvesting.NewBaseVestingAccount( +// baseVestingDelayedAccount, +// sdk.NewCoins(vestingAmountVested), +// time.Now().Add(time.Duration(rand.Intn(40)+90)*time.Second).Unix(), +// ), +// ) +// s.Require().NoError(vestingDelayedGenAccount.Validate()) + +// // unpack and append accounts +// accs, err := authtypes.UnpackAccounts(authGenState.Accounts) +// s.Require().NoError(err) +// accs = append(accs, vestingContinuousGenAccount, vestingDelayedGenAccount, baseJailedAccount) +// accs = authtypes.SanitizeGenesisAccounts(accs) +// genAccs, err := authtypes.PackAccounts(accs) +// s.Require().NoError(err) +// authGenState.Accounts = genAccs + +// // update auth module state +// appGenState[authtypes.ModuleName], err = cdc.MarshalJSON(&authGenState) +// s.Require().NoError(err) + +// // update balances +// vestingContinuousBalances := banktypes.Balance{ +// Address: continuousVestingAcc.String(), +// Coins: vestingBalance, +// } +// vestingDelayedBalances := banktypes.Balance{ +// Address: delayedVestingAcc.String(), +// Coins: vestingBalance, +// } +// jailedValidatorBalances := banktypes.Balance{ +// Address: jailedValAcc.String(), +// Coins: sdk.NewCoins(tokenAmount), +// } +// stakingModuleBalances := banktypes.Balance{ +// Address: authtypes.NewModuleAddress(stakingtypes.NotBondedPoolName).String(), +// Coins: sdk.NewCoins(sdk.NewCoin(uatomDenom, sdk.NewInt(slashingShares))), +// } +// bankGenState.Balances = append( +// bankGenState.Balances, +// vestingContinuousBalances, +// vestingDelayedBalances, +// jailedValidatorBalances, +// stakingModuleBalances, +// ) +// bankGenState.Balances = banktypes.SanitizeGenesisBalances(bankGenState.Balances) + +// // update the denom metadata for the bank module +// bankGenState.DenomMetadata = append(bankGenState.DenomMetadata, banktypes.Metadata{ +// Description: "An example stable token", +// Display: uatomDenom, +// Base: uatomDenom, +// Symbol: uatomDenom, +// Name: uatomDenom, +// DenomUnits: []*banktypes.DenomUnit{ +// { +// Denom: uatomDenom, +// Exponent: 0, +// }, +// }, +// }) + +// // update bank module state +// appGenState[banktypes.ModuleName], err = cdc.MarshalJSON(bankGenState) +// s.Require().NoError(err) + +// return appGenState +// } + +// func (s *IntegrationTestSuite) initGenesis(c *chain, vestingMnemonic, jailedValMnemonic string) { +// var ( +// serverCtx = server.NewDefaultContext() +// config = serverCtx.Config +// validator = c.validators[0] +// ) + +// config.SetRoot(validator.configDir()) +// config.Moniker = validator.moniker + +// genFilePath := config.GenesisFile() +// appGenState, genDoc, err := genutiltypes.GenesisStateFromGenFile(genFilePath) +// s.Require().NoError(err) + +// appGenState = s.addGenesisVestingAndJailedAccounts( +// c, +// validator.configDir(), +// vestingMnemonic, +// jailedValMnemonic, +// appGenState, +// ) + +// var evidenceGenState evidencetypes.GenesisState +// s.Require().NoError(cdc.UnmarshalJSON(appGenState[evidencetypes.ModuleName], &evidenceGenState)) + +// evidenceGenState.Evidence = make([]*codectypes.Any, numberOfEvidences) +// for i := range evidenceGenState.Evidence { +// pk := ed25519.GenPrivKey() +// evidence := &evidencetypes.Equivocation{ +// Height: 1, +// Power: 100, +// Time: time.Now().UTC(), +// ConsensusAddress: sdk.ConsAddress(pk.PubKey().Address().Bytes()).String(), +// } +// evidenceGenState.Evidence[i], err = codectypes.NewAnyWithValue(evidence) +// s.Require().NoError(err) +// } + +// appGenState[evidencetypes.ModuleName], err = cdc.MarshalJSON(&evidenceGenState) +// s.Require().NoError(err) + +// var genUtilGenState genutiltypes.GenesisState +// s.Require().NoError(cdc.UnmarshalJSON(appGenState[genutiltypes.ModuleName], &genUtilGenState)) + +// // generate genesis txs +// genTxs := make([]json.RawMessage, len(c.validators)) +// for i, val := range c.validators { +// createValmsg, err := val.buildCreateValidatorMsg(stakingAmountCoin) +// s.Require().NoError(err) +// signedTx, err := val.signMsg(createValmsg) + +// s.Require().NoError(err) + +// txRaw, err := cdc.MarshalJSON(signedTx) +// s.Require().NoError(err) + +// genTxs[i] = txRaw +// } + +// genUtilGenState.GenTxs = genTxs + +// appGenState[genutiltypes.ModuleName], err = cdc.MarshalJSON(&genUtilGenState) +// s.Require().NoError(err) + +// genDoc.AppState, err = json.MarshalIndent(appGenState, "", " ") +// s.Require().NoError(err) + +// bz, err := tmjson.MarshalIndent(genDoc, "", " ") +// s.Require().NoError(err) + +// vestingPeriod, err := generateVestingPeriod() +// s.Require().NoError(err) + +// rawTx, _, err := buildRawTx() +// s.Require().NoError(err) + +// // write the updated genesis file to each validator. +// for _, val := range c.validators { +// err = writeFile(filepath.Join(val.configDir(), "config", "genesis.json"), bz) +// s.Require().NoError(err) + +// err = writeFile(filepath.Join(val.configDir(), vestingPeriodFile), vestingPeriod) +// s.Require().NoError(err) + +// err = writeFile(filepath.Join(val.configDir(), rawTxFile), rawTx) +// s.Require().NoError(err) +// } +// } + +// // initValidatorConfigs initializes the validator configs for the given chain. +// func (s *IntegrationTestSuite) initValidatorConfigs(c *chain) { +// for i, val := range c.validators { +// tmCfgPath := filepath.Join(val.configDir(), "config", "config.toml") + +// vpr := viper.New() +// vpr.SetConfigFile(tmCfgPath) +// s.Require().NoError(vpr.ReadInConfig()) + +// valConfig := tmconfig.DefaultConfig() + +// s.Require().NoError(vpr.Unmarshal(valConfig)) + +// valConfig.P2P.ListenAddress = "tcp://0.0.0.0:26656" +// valConfig.P2P.AddrBookStrict = false +// valConfig.P2P.ExternalAddress = fmt.Sprintf("%s:%d", val.instanceName(), 26656) +// valConfig.RPC.ListenAddress = "tcp://0.0.0.0:26657" +// valConfig.StateSync.Enable = false +// valConfig.LogLevel = "info" + +// var peers []string + +// for j := 0; j < len(c.validators); j++ { +// if i == j { +// continue +// } + +// peer := c.validators[j] +// peerID := fmt.Sprintf("%s@%s%d:26656", peer.nodeKey.ID(), peer.moniker, j) +// peers = append(peers, peerID) +// } + +// valConfig.P2P.PersistentPeers = strings.Join(peers, ",") + +// tmconfig.WriteConfigFile(tmCfgPath, valConfig) + +// // set application configuration +// appCfgPath := filepath.Join(val.configDir(), "config", "app.toml") + +// appConfig := srvconfig.DefaultConfig() +// appConfig.API.Enable = true +// appConfig.MinGasPrices = fmt.Sprintf("%s%s", minGasPrice, uatomDenom) + +// srvconfig.SetConfigTemplate(srvconfig.DefaultConfigTemplate) +// srvconfig.WriteConfigFile(appCfgPath, appConfig) +// } +// } + +// // runValidators runs the validators in the chain +// func (s *IntegrationTestSuite) runValidators(c *chain, portOffset int) { +// s.T().Logf("starting Gaia %s validator containers...", c.id) + +// s.valResources[c.id] = make([]*dockertest.Resource, len(c.validators)) +// for i, val := range c.validators { +// runOpts := &dockertest.RunOptions{ +// Name: val.instanceName(), +// NetworkID: s.dkrNet.Network.ID, +// Mounts: []string{ +// fmt.Sprintf("%s/:%s", val.configDir(), gaiaHomePath), +// }, +// Repository: "cosmos/gaiad-e2e", +// } + +// s.Require().NoError(exec.Command("chmod", "-R", "0777", val.configDir()).Run()) //nolint:gosec // this is a test + +// // expose the first validator for debugging and communication +// if val.index == 0 { +// runOpts.PortBindings = map[docker.Port][]docker.PortBinding{ +// "1317/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 1317+portOffset)}}, +// "6060/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 6060+portOffset)}}, +// "6061/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 6061+portOffset)}}, +// "6062/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 6062+portOffset)}}, +// "6063/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 6063+portOffset)}}, +// "6064/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 6064+portOffset)}}, +// "6065/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 6065+portOffset)}}, +// "9090/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 9090+portOffset)}}, +// "26656/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 26656+portOffset)}}, +// "26657/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 26657+portOffset)}}, +// } +// } + +// resource, err := s.dkrPool.RunWithOptions(runOpts, noRestart) +// s.Require().NoError(err) + +// s.valResources[c.id][i] = resource +// s.T().Logf("started Gaia %s validator container: %s", c.id, resource.Container.ID) +// } + +// rpcClient, err := rpchttp.New("tcp://localhost:26657", "/websocket") +// s.Require().NoError(err) + +// s.Require().Eventually( +// func() bool { +// ctx, cancel := context.WithTimeout(context.Background(), time.Second*5) +// defer cancel() + +// status, err := rpcClient.Status(ctx) +// if err != nil { +// return false +// } + +// // let the node produce a few blocks +// if status.SyncInfo.CatchingUp || status.SyncInfo.LatestBlockHeight < 3 { +// return false +// } + +// return true +// }, +// 5*time.Minute, +// time.Second, +// "Gaia node failed to produce blocks", +// ) +// } + +// func noRestart(config *docker.HostConfig) { +// // in this case we don't want the nodes to restart on failure +// config.RestartPolicy = docker.RestartPolicy{ +// Name: "no", +// } +// } + +// // hermes0 is for ibc and packet-forward-middleware(PFM) test, hermes0 is keep running during the ibc and PFM test. +// func (s *IntegrationTestSuite) runIBCRelayer0() { +// s.T().Log("starting Hermes relayer container 0...") + +// tmpDir, err := os.MkdirTemp("", "gaia-e2e-testnet-hermes-") +// s.Require().NoError(err) +// s.tmpDirs = append(s.tmpDirs, tmpDir) + +// gaiaAVal := s.chainA.validators[0] +// gaiaBVal := s.chainB.validators[0] + +// gaiaARly := s.chainA.genesisAccounts[relayerAccountIndexHermes0] +// gaiaBRly := s.chainB.genesisAccounts[relayerAccountIndexHermes0] + +// hermesCfgPath := path.Join(tmpDir, "hermes") + +// s.Require().NoError(os.MkdirAll(hermesCfgPath, 0o755)) +// _, err = copyFile( +// filepath.Join("./scripts/", "hermes_bootstrap.sh"), +// filepath.Join(hermesCfgPath, "hermes_bootstrap.sh"), +// ) +// s.Require().NoError(err) + +// s.hermesResource0, err = s.dkrPool.RunWithOptions( +// &dockertest.RunOptions{ +// Name: fmt.Sprintf("%s-%s-relayer-0", s.chainA.id, s.chainB.id), +// Repository: "ghcr.io/cosmos/hermes-e2e", +// Tag: "1.0.0", +// NetworkID: s.dkrNet.Network.ID, +// Mounts: []string{ +// fmt.Sprintf("%s/:/root/hermes", hermesCfgPath), +// }, +// PortBindings: map[docker.Port][]docker.PortBinding{ +// "3031/tcp": {{HostIP: "", HostPort: "3031"}}, +// }, +// Env: []string{ +// fmt.Sprintf("GAIA_A_E2E_CHAIN_ID=%s", s.chainA.id), +// fmt.Sprintf("GAIA_B_E2E_CHAIN_ID=%s", s.chainB.id), +// fmt.Sprintf("GAIA_A_E2E_VAL_MNEMONIC=%s", gaiaAVal.mnemonic), +// fmt.Sprintf("GAIA_B_E2E_VAL_MNEMONIC=%s", gaiaBVal.mnemonic), +// fmt.Sprintf("GAIA_A_E2E_RLY_MNEMONIC=%s", gaiaARly.mnemonic), +// fmt.Sprintf("GAIA_B_E2E_RLY_MNEMONIC=%s", gaiaBRly.mnemonic), +// fmt.Sprintf("GAIA_A_E2E_VAL_HOST=%s", s.valResources[s.chainA.id][0].Container.Name[1:]), +// fmt.Sprintf("GAIA_B_E2E_VAL_HOST=%s", s.valResources[s.chainB.id][0].Container.Name[1:]), +// }, +// Entrypoint: []string{ +// "sh", +// "-c", +// "chmod +x /root/hermes/hermes_bootstrap.sh && /root/hermes/hermes_bootstrap.sh", +// }, +// }, +// noRestart, +// ) +// s.Require().NoError(err) + +// endpoint := fmt.Sprintf("http://%s/state", s.hermesResource0.GetHostPort("3031/tcp")) +// s.Require().Eventually( +// func() bool { +// resp, err := http.Get(endpoint) //nolint:gosec // this is a test +// if err != nil { +// return false +// } + +// defer resp.Body.Close() + +// bz, err := io.ReadAll(resp.Body) +// if err != nil { +// return false +// } + +// var respBody map[string]interface{} +// if err := json.Unmarshal(bz, &respBody); err != nil { +// return false +// } + +// status := respBody["status"].(string) +// result := respBody["result"].(map[string]interface{}) + +// return status == "success" && len(result["chains"].([]interface{})) == 2 +// }, +// 5*time.Minute, +// time.Second, +// "hermes relayer not healthy", +// ) + +// s.T().Logf("started Hermes relayer 0 container: %s", s.hermesResource0.Container.ID) + +// // XXX: Give time to both networks to start, otherwise we might see gRPC +// // transport errors. +// time.Sleep(10 * time.Second) + +// // create the client, connection and channel between the two Gaia chains +// s.createConnection() +// time.Sleep(10 * time.Second) +// s.createChannel() +// } + +// // hermes1 is for bypass-msg test. Hermes1 is to process asynchronous transactions, +// // Hermes1 has access to two Hermes configurations: one configuration allows paying fees, while the other does not. +// // With Hermes1, better control can be achieved regarding whether fees are paid when clearing transactions. +// func (s *IntegrationTestSuite) runIBCRelayer1() { +// s.T().Log("starting Hermes relayer container 1...") + +// tmpDir, err := os.MkdirTemp("", "gaia-e2e-testnet-hermes-") +// s.Require().NoError(err) +// s.tmpDirs = append(s.tmpDirs, tmpDir) + +// gaiaAVal := s.chainA.validators[0] +// gaiaBVal := s.chainB.validators[0] + +// gaiaARly := s.chainA.genesisAccounts[relayerAccountIndexHermes1] +// gaiaBRly := s.chainB.genesisAccounts[relayerAccountIndexHermes1] + +// hermesCfgPath := path.Join(tmpDir, "hermes") + +// s.Require().NoError(os.MkdirAll(hermesCfgPath, 0o755)) +// _, err = copyFile( +// filepath.Join("./scripts/", "hermes1_bootstrap.sh"), +// filepath.Join(hermesCfgPath, "hermes1_bootstrap.sh"), +// ) +// s.Require().NoError(err) + +// s.hermesResource1, err = s.dkrPool.RunWithOptions( +// &dockertest.RunOptions{ +// Name: fmt.Sprintf("%s-%s-relayer-1", s.chainA.id, s.chainB.id), +// Repository: "ghcr.io/cosmos/hermes-e2e", +// Tag: "1.0.0", +// NetworkID: s.dkrNet.Network.ID, +// Mounts: []string{ +// fmt.Sprintf("%s/:/root/hermes", hermesCfgPath), +// }, +// PortBindings: map[docker.Port][]docker.PortBinding{ +// "3032/tcp": {{HostIP: "", HostPort: "3032"}}, +// }, +// Env: []string{ +// fmt.Sprintf("GAIA_A_E2E_CHAIN_ID=%s", s.chainA.id), +// fmt.Sprintf("GAIA_B_E2E_CHAIN_ID=%s", s.chainB.id), +// fmt.Sprintf("GAIA_A_E2E_VAL_MNEMONIC=%s", gaiaAVal.mnemonic), +// fmt.Sprintf("GAIA_B_E2E_VAL_MNEMONIC=%s", gaiaBVal.mnemonic), +// fmt.Sprintf("GAIA_A_E2E_RLY_MNEMONIC=%s", gaiaARly.mnemonic), +// fmt.Sprintf("GAIA_B_E2E_RLY_MNEMONIC=%s", gaiaBRly.mnemonic), +// fmt.Sprintf("GAIA_A_E2E_VAL_HOST=%s", s.valResources[s.chainA.id][0].Container.Name[1:]), +// fmt.Sprintf("GAIA_B_E2E_VAL_HOST=%s", s.valResources[s.chainB.id][0].Container.Name[1:]), +// }, +// Entrypoint: []string{ +// "sh", +// "-c", +// "chmod +x /root/hermes/hermes1_bootstrap.sh && /root/hermes/hermes1_bootstrap.sh && tail -f /dev/null", +// }, +// }, +// noRestart, +// ) +// s.Require().NoError(err) + +// s.T().Logf("started Hermes relayer 1 container: %s", s.hermesResource1.Container.ID) + +// // XXX: Give time to both networks to start, otherwise we might see gRPC +// // transport errors. +// time.Sleep(10 * time.Second) +// } + +// func (s *IntegrationTestSuite) writeGovParamChangeProposalGlobalFees(c *chain, coins sdk.DecCoins) { +// type ParamInfo struct { +// Subspace string `json:"subspace"` +// Key string `json:"key"` +// Value sdk.DecCoins `json:"value"` +// } + +// type ParamChangeMessage struct { +// Title string `json:"title"` +// Description string `json:"description"` +// Changes []ParamInfo `json:"changes"` +// Deposit string `json:"deposit"` +// } + +// paramChangeProposalBody, err := json.MarshalIndent(ParamChangeMessage{ +// Title: "global fee test", +// Description: "global fee change", +// Changes: []ParamInfo{ +// { +// Subspace: "globalfee", +// Key: "MinimumGasPricesParam", +// Value: coins, +// }, +// }, +// Deposit: "1000uatom", +// }, "", " ") +// s.Require().NoError(err) + +// err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalGlobalFeeFilename), paramChangeProposalBody) +// s.Require().NoError(err) +// } + +// func (s *IntegrationTestSuite) writeGovParamChangeProposalBypassMsgs(c *chain, msgs []string) { +// type ParamInfo struct { +// Subspace string `json:"subspace"` +// Key string `json:"key"` +// Value []string `json:"value"` +// } + +// type ParamChangeMessage struct { +// Title string `json:"title"` +// Description string `json:"description"` +// Changes []ParamInfo `json:"changes"` +// Deposit string `json:"deposit"` +// } +// paramChangeProposalBody, err := json.MarshalIndent(ParamChangeMessage{ +// Title: "ChangeProposalBypassMsgs", +// Description: "global fee change", +// Changes: []ParamInfo{ +// { +// Subspace: "globalfee", +// Key: "BypassMinFeeMsgTypes", +// Value: msgs, +// }, +// }, +// Deposit: "1000uatom", +// }, "", " ") +// s.Require().NoError(err) + +// err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalBypassMsgFilename), paramChangeProposalBody) +// s.Require().NoError(err) +// } + +// func (s *IntegrationTestSuite) writeGovParamChangeProposalMaxTotalBypass(c *chain, gas uint64) { +// type ParamInfo struct { +// Subspace string `json:"subspace"` +// Key string `json:"key"` +// Value string `json:"value"` +// } + +// type ParamChangeMessage struct { +// Title string `json:"title"` +// Description string `json:"description"` +// Changes []ParamInfo `json:"changes"` +// Deposit string `json:"deposit"` +// } +// paramChangeProposalBody, err := json.MarshalIndent(ParamChangeMessage{ +// Title: "ChangeProposalMaxTotalBypass", +// Description: "global fee change", +// Changes: []ParamInfo{ +// { +// Subspace: "globalfee", +// Key: "MaxTotalBypassMinFeeMsgGasUsage", +// Value: strconv.FormatInt(int64(gas), 10), +// }, +// }, +// Deposit: "1000uatom", +// }, "", " ") +// s.Require().NoError(err) + +// err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalMaxTotalBypassFilename), paramChangeProposalBody) +// s.Require().NoError(err) +// } + +// func (s *IntegrationTestSuite) writeGovCommunitySpendProposal(c *chain, amount string, recipient string) { +// proposalCommSpend := &distrtypes.CommunityPoolSpendProposalWithDeposit{ +// Title: "Community Pool Spend", +// Description: "Fund Team!", +// Recipient: recipient, +// Amount: amount, +// Deposit: "1000uatom", +// } +// commSpendBody, err := json.MarshalIndent(proposalCommSpend, "", " ") +// s.Require().NoError(err) + +// err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalCommunitySpendFilename), commSpendBody) +// s.Require().NoError(err) +// } + +// type ConsumerAdditionProposalWithDeposit struct { +// ccvprovider.ConsumerAdditionProposal +// Deposit string `json:"deposit"` +// } + +// type ConsumerRemovalProposalWithDeposit struct { +// ccvprovider.ConsumerRemovalProposal +// Deposit string `json:"deposit"` +// } + +// func (s *IntegrationTestSuite) writeAddRemoveConsumerProposals(c *chain, consumerChainID string) { +// hash, _ := json.Marshal("Z2VuX2hhc2g=") +// addProp := &ccvprovider.ConsumerAdditionProposal{ +// Title: "Create consumer chain", +// Description: "First consumer chain", +// ChainId: consumerChainID, +// InitialHeight: ibcclienttypes.Height{ +// RevisionHeight: 1, +// }, +// GenesisHash: hash, +// BinaryHash: hash, +// SpawnTime: time.Now(), +// UnbondingPeriod: time.Duration(100000000000), +// CcvTimeoutPeriod: time.Duration(100000000000), +// TransferTimeoutPeriod: time.Duration(100000000000), +// ConsumerRedistributionFraction: "0.75", +// BlocksPerDistributionTransmission: 10, +// HistoricalEntries: 10000, +// } +// addPropWithDeposit := ConsumerAdditionProposalWithDeposit{ +// ConsumerAdditionProposal: *addProp, +// Deposit: "1000uatom", +// } + +// removeProp := &ccvprovider.ConsumerRemovalProposal{ +// Title: "Remove consumer chain", +// Description: "Removing consumer chain", +// ChainId: consumerChainID, +// StopTime: time.Now(), +// } + +// removePropWithDeposit := ConsumerRemovalProposalWithDeposit{ +// ConsumerRemovalProposal: *removeProp, +// Deposit: "1000uatom", +// } + +// consumerAddBody, err := json.MarshalIndent(addPropWithDeposit, "", " ") +// s.Require().NoError(err) + +// consumerRemoveBody, err := json.MarshalIndent(removePropWithDeposit, "", " ") +// s.Require().NoError(err) + +// err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalAddConsumerChainFilename), consumerAddBody) +// s.Require().NoError(err) +// err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalRemoveConsumerChainFilename), consumerRemoveBody) +// s.Require().NoError(err) +// } + +// func configFile(filename string) string { +// filepath := filepath.Join(gaiaConfigPath, filename) +// return filepath +// } diff --git a/tests/e2e/e2e_slashing_test.go b/tests/e2e/e2e_slashing_test.go index 8974495187..614e2c2768 100644 --- a/tests/e2e/e2e_slashing_test.go +++ b/tests/e2e/e2e_slashing_test.go @@ -1,23 +1,24 @@ package e2e -const jailedValidatorKey = "jailed" - -func (s *IntegrationTestSuite) testSlashing(chainEndpoint string) { - s.Run("test unjail validator", func() { - validators, err := queryValidators(chainEndpoint) - s.Require().NoError(err) - - for _, val := range validators { - if val.Jailed { - s.execUnjail( - s.chainA, - withKeyValue(flagFrom, jailedValidatorKey), - ) - - valQ, err := queryValidator(chainEndpoint, val.OperatorAddress) - s.Require().NoError(err) - s.Require().False(valQ.Jailed) - } - } - }) -} +// +// const jailedValidatorKey = "jailed" +// +// func (s *IntegrationTestSuite) testSlashing(chainEndpoint string) { +// s.Run("test unjail validator", func() { +// validators, err := queryValidators(chainEndpoint) +// s.Require().NoError(err) +// +// for _, val := range validators { +// if val.Jailed { +// s.execUnjail( +// s.chainA, +// withKeyValue(flagFrom, jailedValidatorKey), +// ) +// +// valQ, err := queryValidator(chainEndpoint, val.OperatorAddress) +// s.Require().NoError(err) +// s.Require().False(valQ.Jailed) +// } +// } +// }) +//} diff --git a/tests/e2e/e2e_staking_test.go b/tests/e2e/e2e_staking_test.go index b4a7b78a4d..10f62fca4f 100644 --- a/tests/e2e/e2e_staking_test.go +++ b/tests/e2e/e2e_staking_test.go @@ -1,59 +1,60 @@ package e2e -import ( - "fmt" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -func (s *IntegrationTestSuite) testStaking() { - chainEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) - - validatorA := s.chainA.validators[0] - validatorB := s.chainA.validators[1] - validatorAAddr := validatorA.keyInfo.GetAddress() - validatorBAddr := validatorB.keyInfo.GetAddress() - - validatorAddressA := sdk.ValAddress(validatorAAddr).String() - validatorAddressB := sdk.ValAddress(validatorBAddr).String() - - delegatorAddress := s.chainA.genesisAccounts[2].keyInfo.GetAddress().String() - - fees := sdk.NewCoin(uatomDenom, sdk.NewInt(1)) - - delegationAmount := sdk.NewInt(500000000) - delegation := sdk.NewCoin(uatomDenom, delegationAmount) // 500 atom - - // Alice delegate uatom to Validator A - s.executeDelegate(s.chainA, 0, delegation.String(), validatorAddressA, delegatorAddress, gaiaHomePath, fees.String()) - - // Validate delegation successful - s.Require().Eventually( - func() bool { - res, err := queryDelegation(chainEndpoint, validatorAddressA, delegatorAddress) - amt := res.GetDelegationResponse().GetDelegation().GetShares() - s.Require().NoError(err) - - return amt.Equal(sdk.NewDecFromInt(delegationAmount)) - }, - 20*time.Second, - 5*time.Second, - ) - - // Alice re-delegate uatom from Validator A to Validator B - s.executeRedelegate(s.chainA, 0, delegation.String(), validatorAddressA, validatorAddressB, delegatorAddress, gaiaHomePath, fees.String()) - - // Validate re-delegation successful - s.Require().Eventually( - func() bool { - res, err := queryDelegation(chainEndpoint, validatorAddressB, delegatorAddress) - amt := res.GetDelegationResponse().GetDelegation().GetShares() - s.Require().NoError(err) - - return amt.Equal(sdk.NewDecFromInt(delegationAmount)) - }, - 20*time.Second, - 5*time.Second, - ) -} +// +// import ( +// "fmt" +// "time" +// +// sdk "github.com/cosmos/cosmos-sdk/types" +//) +// +// func (s *IntegrationTestSuite) testStaking() { +// chainEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) +// +// validatorA := s.chainA.validators[0] +// validatorB := s.chainA.validators[1] +// validatorAAddr := validatorA.keyInfo.GetAddress() +// validatorBAddr := validatorB.keyInfo.GetAddress() +// +// validatorAddressA := sdk.ValAddress(validatorAAddr).String() +// validatorAddressB := sdk.ValAddress(validatorBAddr).String() +// +// delegatorAddress := s.chainA.genesisAccounts[2].keyInfo.GetAddress().String() +// +// fees := sdk.NewCoin(uatomDenom, sdk.NewInt(1)) +// +// delegationAmount := sdk.NewInt(500000000) +// delegation := sdk.NewCoin(uatomDenom, delegationAmount) // 500 atom +// +// // Alice delegate uatom to Validator A +// s.executeDelegate(s.chainA, 0, delegation.String(), validatorAddressA, delegatorAddress, gaiaHomePath, fees.String()) +// +// // Validate delegation successful +// s.Require().Eventually( +// func() bool { +// res, err := queryDelegation(chainEndpoint, validatorAddressA, delegatorAddress) +// amt := res.GetDelegationResponse().GetDelegation().GetShares() +// s.Require().NoError(err) +// +// return amt.Equal(sdk.NewDecFromInt(delegationAmount)) +// }, +// 20*time.Second, +// 5*time.Second, +// ) +// +// // Alice re-delegate uatom from Validator A to Validator B +// s.executeRedelegate(s.chainA, 0, delegation.String(), validatorAddressA, validatorAddressB, delegatorAddress, gaiaHomePath, fees.String()) +// +// // Validate re-delegation successful +// s.Require().Eventually( +// func() bool { +// res, err := queryDelegation(chainEndpoint, validatorAddressB, delegatorAddress) +// amt := res.GetDelegationResponse().GetDelegation().GetShares() +// s.Require().NoError(err) +// +// return amt.Equal(sdk.NewDecFromInt(delegationAmount)) +// }, +// 20*time.Second, +// 5*time.Second, +// ) +//} diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go index c2edd641fc..955d5a8bea 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/e2e/e2e_test.go @@ -1,123 +1,123 @@ package e2e -import ( - "fmt" -) +// import ( +// "fmt" +// ) -var ( - runBankTest = true - runBypassMinFeeTest = true - runEncodeTest = true - runEvidenceTest = true - runFeeGrantTest = true - runGlobalFeesTest = true - runGovTest = true - runIBCTest = true - runSlashingTest = true - runStakingAndDistributionTest = true - runVestingTest = true - runRestInterfacesTest = true -) +// var ( +// runBankTest = true +// runBypassMinFeeTest = true +// runEncodeTest = true +// runEvidenceTest = true +// runFeeGrantTest = true +// runGlobalFeesTest = true +// runGovTest = true +// runIBCTest = true +// runSlashingTest = true +// runStakingAndDistributionTest = true +// runVestingTest = true +// runRestInterfacesTest = true +// ) -func (s *IntegrationTestSuite) TestRestInterfaces() { - if !runRestInterfacesTest { - s.T().Skip() - } - s.testRestInterfaces() -} +// func (s *IntegrationTestSuite) TestRestInterfaces() { +// if !runRestInterfacesTest { +// s.T().Skip() +// } +// s.testRestInterfaces() +// } -func (s *IntegrationTestSuite) TestBank() { - if !runBankTest { - s.T().Skip() - } - s.testBankTokenTransfer() -} +// func (s *IntegrationTestSuite) TestBank() { +// if !runBankTest { +// s.T().Skip() +// } +// s.testBankTokenTransfer() +// } -func (s *IntegrationTestSuite) TestByPassMinFee() { - if !runBypassMinFeeTest { - s.T().Skip() - } - chainAPI := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) - s.testBypassMinFeeWithdrawReward(chainAPI) -} +// func (s *IntegrationTestSuite) TestByPassMinFee() { +// if !runBypassMinFeeTest { +// s.T().Skip() +// } +// chainAPI := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) +// s.testBypassMinFeeWithdrawReward(chainAPI) +// } -func (s *IntegrationTestSuite) TestEncode() { - if !runEncodeTest { - s.T().Skip() - } - s.testEncode() - s.testDecode() -} +// func (s *IntegrationTestSuite) TestEncode() { +// if !runEncodeTest { +// s.T().Skip() +// } +// s.testEncode() +// s.testDecode() +// } -func (s *IntegrationTestSuite) TestEvidence() { - if !runEvidenceTest { - s.T().Skip() - } - s.testEvidence() -} +// func (s *IntegrationTestSuite) TestEvidence() { +// if !runEvidenceTest { +// s.T().Skip() +// } +// s.testEvidence() +// } -func (s *IntegrationTestSuite) TestFeeGrant() { - if !runFeeGrantTest { - s.T().Skip() - } - s.testFeeGrant() -} +// func (s *IntegrationTestSuite) TestFeeGrant() { +// if !runFeeGrantTest { +// s.T().Skip() +// } +// s.testFeeGrant() +// } -func (s *IntegrationTestSuite) TestGlobalFees() { - if !runGlobalFeesTest { - s.T().Skip() - } - s.testGlobalFees() - s.testQueryGlobalFeesInGenesis() -} +// func (s *IntegrationTestSuite) TestGlobalFees() { +// if !runGlobalFeesTest { +// s.T().Skip() +// } +// s.testGlobalFees() +// s.testQueryGlobalFeesInGenesis() +// } -func (s *IntegrationTestSuite) TestGov() { - if !runGovTest { - s.T().Skip() - } - s.GovSoftwareUpgrade() - s.GovCancelSoftwareUpgrade() - s.GovCommunityPoolSpend() - s.AddRemoveConsumerChain() -} +// func (s *IntegrationTestSuite) TestGov() { +// if !runGovTest { +// s.T().Skip() +// } +// s.GovSoftwareUpgrade() +// s.GovCancelSoftwareUpgrade() +// s.GovCommunityPoolSpend() +// s.AddRemoveConsumerChain() +// } -func (s *IntegrationTestSuite) TestIBC() { - if !runIBCTest { - s.T().Skip() - } - s.testIBCTokenTransfer() - s.testMultihopIBCTokenTransfer() - s.testFailedMultihopIBCTokenTransfer() +// func (s *IntegrationTestSuite) TestIBC() { +// if !runIBCTest { +// s.T().Skip() +// } +// s.testIBCTokenTransfer() +// s.testMultihopIBCTokenTransfer() +// s.testFailedMultihopIBCTokenTransfer() - // stop hermes0 to prevent hermes0 relaying transactions - s.Require().NoError(s.dkrPool.Purge(s.hermesResource0)) - HermesResource0Purged = true - s.testIBCBypassMsg() -} +// // stop hermes0 to prevent hermes0 relaying transactions +// s.Require().NoError(s.dkrPool.Purge(s.hermesResource0)) +// HermesResource0Purged = true +// s.testIBCBypassMsg() +// } -func (s *IntegrationTestSuite) TestSlashing() { - if !runSlashingTest { - s.T().Skip() - } - chainAPI := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) - s.testSlashing(chainAPI) -} +// func (s *IntegrationTestSuite) TestSlashing() { +// if !runSlashingTest { +// s.T().Skip() +// } +// chainAPI := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) +// s.testSlashing(chainAPI) +// } -// todo add fee test with wrong denom order -func (s *IntegrationTestSuite) TestStakingAndDistribution() { - if !runStakingAndDistributionTest { - s.T().Skip() - } - s.testStaking() - s.testDistribution() -} +// // todo add fee test with wrong denom order +// func (s *IntegrationTestSuite) TestStakingAndDistribution() { +// if !runStakingAndDistributionTest { +// s.T().Skip() +// } +// s.testStaking() +// s.testDistribution() +// } -func (s *IntegrationTestSuite) TestVesting() { - if !runVestingTest { - s.T().Skip() - } - chainAAPI := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) - s.testDelayedVestingAccount(chainAAPI) - s.testContinuousVestingAccount(chainAAPI) - // s.testPeriodicVestingAccount(chainAAPI) TODO: add back when v0.45 adds the missing CLI command. -} +// func (s *IntegrationTestSuite) TestVesting() { +// if !runVestingTest { +// s.T().Skip() +// } +// chainAAPI := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) +// s.testDelayedVestingAccount(chainAAPI) +// s.testContinuousVestingAccount(chainAAPI) +// // s.testPeriodicVestingAccount(chainAAPI) TODO: add back when v0.45 adds the missing CLI command. +// } diff --git a/tests/e2e/e2e_vesting_test.go b/tests/e2e/e2e_vesting_test.go index d2df3476c3..c68a91c54d 100644 --- a/tests/e2e/e2e_vesting_test.go +++ b/tests/e2e/e2e_vesting_test.go @@ -1,336 +1,336 @@ package e2e -import ( - "encoding/json" - "math/rand" - "path/filepath" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/cosmos/gaia/v11/x/globalfee/ante" -) - -const ( - delayedVestingKey = "delayed_vesting" - continuousVestingKey = "continuous_vesting" - lockedVestingKey = "locker_vesting" - periodicVestingKey = "periodic_vesting" - - vestingPeriodFile = "test_period.json" - vestingTxDelay = 5 -) - -type ( - vestingPeriod struct { - StartTime int64 `json:"start_time"` - Periods []period `json:"periods"` - } - period struct { - Coins string `json:"coins"` - Length int64 `json:"length_seconds"` - } -) - -var ( - genesisVestingKeys = []string{continuousVestingKey, delayedVestingKey, lockedVestingKey, periodicVestingKey} - vestingAmountVested = sdk.NewCoin(uatomDenom, sdk.NewInt(99900000000)) - vestingAmount = sdk.NewCoin(uatomDenom, sdk.NewInt(350000)) - vestingBalance = sdk.NewCoins(vestingAmountVested).Add(vestingAmount) - vestingDelegationAmount = sdk.NewCoin(uatomDenom, sdk.NewInt(500000000)) - vestingDelegationFees = sdk.NewCoin(uatomDenom, sdk.NewInt(1)) -) - -func (s *IntegrationTestSuite) testDelayedVestingAccount(api string) { - var ( - valIdx = 0 - chain = s.chainA - val = chain.validators[valIdx] - vestingDelayedAcc = chain.genesisVestingAccounts[delayedVestingKey] - ) - sender := val.keyInfo.GetAddress() - valOpAddr := sdk.ValAddress(sender).String() - - s.Run("test delayed vesting genesis account", func() { - acc, err := queryDelayedVestingAccount(api, vestingDelayedAcc.String()) - s.Require().NoError(err) - - // Check address balance - balance, err := getSpecificBalance(api, vestingDelayedAcc.String(), uatomDenom) - s.Require().NoError(err) - s.Require().Equal(vestingBalance.AmountOf(uatomDenom), balance.Amount) - - // Delegate coins should succeed - s.executeDelegate(chain, valIdx, vestingDelegationAmount.String(), valOpAddr, - vestingDelayedAcc.String(), gaiaHomePath, vestingDelegationFees.String()) - - // Validate delegation successful - s.Require().Eventually( - func() bool { - res, err := queryDelegation(api, valOpAddr, vestingDelayedAcc.String()) - amt := res.GetDelegationResponse().GetDelegation().GetShares() - s.Require().NoError(err) - - return amt.Equal(sdk.NewDecFromInt(vestingDelegationAmount.Amount)) - }, - 20*time.Second, - 5*time.Second, - ) - - waitTime := acc.EndTime - time.Now().Unix() - if waitTime > vestingTxDelay { - // Transfer coins should fail - balance, err := getSpecificBalance(api, vestingDelayedAcc.String(), uatomDenom) - s.Require().NoError(err) - s.execBankSend( - chain, - valIdx, - vestingDelayedAcc.String(), - Address(), - balance.Sub(standardFees).String(), - standardFees.String(), - true, - ) - waitTime = acc.EndTime - time.Now().Unix() + vestingTxDelay - time.Sleep(time.Duration(waitTime) * time.Second) - } - - // Transfer coins should succeed - balance, err = getSpecificBalance(api, vestingDelayedAcc.String(), uatomDenom) - s.Require().NoError(err) - s.execBankSend( - chain, - valIdx, - vestingDelayedAcc.String(), - Address(), - balance.Sub(standardFees).String(), - standardFees.String(), - false, - ) - }) -} - -func (s *IntegrationTestSuite) testContinuousVestingAccount(api string) { - s.Run("test continuous vesting genesis account", func() { - var ( - valIdx = 0 - chain = s.chainA - val = chain.validators[valIdx] - continuousVestingAcc = chain.genesisVestingAccounts[continuousVestingKey] - ) - sender := val.keyInfo.GetAddress() - valOpAddr := sdk.ValAddress(sender).String() - - acc, err := queryContinuousVestingAccount(api, continuousVestingAcc.String()) - s.Require().NoError(err) - - // Check address balance - balance, err := getSpecificBalance(api, continuousVestingAcc.String(), uatomDenom) - s.Require().NoError(err) - s.Require().Equal(vestingBalance.AmountOf(uatomDenom), balance.Amount) - - // Delegate coins should succeed - s.executeDelegate(chain, valIdx, vestingDelegationAmount.String(), - valOpAddr, continuousVestingAcc.String(), gaiaHomePath, vestingDelegationFees.String()) - - // Validate delegation successful - s.Require().Eventually( - func() bool { - res, err := queryDelegation(api, valOpAddr, continuousVestingAcc.String()) - amt := res.GetDelegationResponse().GetDelegation().GetShares() - s.Require().NoError(err) - - return amt.Equal(sdk.NewDecFromInt(vestingDelegationAmount.Amount)) - }, - 20*time.Second, - 5*time.Second, - ) - - waitStartTime := acc.StartTime - time.Now().Unix() - if waitStartTime > vestingTxDelay { - // Transfer coins should fail - balance, err := getSpecificBalance(api, continuousVestingAcc.String(), uatomDenom) - s.Require().NoError(err) - s.execBankSend( - chain, - valIdx, - continuousVestingAcc.String(), - Address(), - balance.Sub(standardFees).String(), - standardFees.String(), - true, - ) - waitStartTime = acc.StartTime - time.Now().Unix() + vestingTxDelay - time.Sleep(time.Duration(waitStartTime) * time.Second) - } - - waitEndTime := acc.EndTime - time.Now().Unix() - if waitEndTime > vestingTxDelay { - // Transfer coins should fail - balance, err := getSpecificBalance(api, continuousVestingAcc.String(), uatomDenom) - s.Require().NoError(err) - s.execBankSend( - chain, - valIdx, - continuousVestingAcc.String(), - Address(), - balance.Sub(standardFees).String(), - standardFees.String(), - true, - ) - waitEndTime = acc.EndTime - time.Now().Unix() + vestingTxDelay - time.Sleep(time.Duration(waitEndTime) * time.Second) - } - - // Transfer coins should succeed - balance, err = getSpecificBalance(api, continuousVestingAcc.String(), uatomDenom) - s.Require().NoError(err) - s.execBankSend( - chain, - valIdx, - continuousVestingAcc.String(), - Address(), - balance.Sub(standardFees).String(), - standardFees.String(), - false, - ) - }) -} - -func (s *IntegrationTestSuite) testPeriodicVestingAccount(api string) { //nolint:unused - s.Run("test periodic vesting genesis account", func() { - var ( - valIdx = 0 - chain = s.chainA - val = chain.validators[valIdx] - periodicVestingAddr = chain.genesisVestingAccounts[periodicVestingKey].String() - ) - sender := val.keyInfo.GetAddress() - valOpAddr := sdk.ValAddress(sender).String() - - s.execCreatePeriodicVestingAccount( - chain, - periodicVestingAddr, - filepath.Join(gaiaHomePath, vestingPeriodFile), - withKeyValue(flagFrom, sender.String()), - ) - - acc, err := queryPeriodicVestingAccount(api, periodicVestingAddr) - s.Require().NoError(err) - - // Check address balance - balance, err := getSpecificBalance(api, periodicVestingAddr, uatomDenom) - s.Require().NoError(err) - - expectedBalance := sdk.NewCoin(uatomDenom, sdk.NewInt(0)) - for _, period := range acc.VestingPeriods { - _, coin := ante.Find(period.Amount, uatomDenom) - expectedBalance = expectedBalance.Add(coin) - } - s.Require().Equal(expectedBalance, balance) - - waitStartTime := acc.StartTime - time.Now().Unix() - if waitStartTime > vestingTxDelay { - // Transfer coins should fail - balance, err = getSpecificBalance(api, periodicVestingAddr, uatomDenom) - s.Require().NoError(err) - s.execBankSend( - chain, - valIdx, - periodicVestingAddr, - Address(), - balance.Sub(standardFees).String(), - standardFees.String(), - true, - ) - waitStartTime = acc.StartTime - time.Now().Unix() + vestingTxDelay - time.Sleep(time.Duration(waitStartTime) * time.Second) - } - - firstPeriod := acc.StartTime + acc.VestingPeriods[0].Length - waitFirstPeriod := firstPeriod - time.Now().Unix() - if waitFirstPeriod > vestingTxDelay { - // Transfer coins should fail - balance, err = getSpecificBalance(api, periodicVestingAddr, uatomDenom) - s.Require().NoError(err) - s.execBankSend( - chain, - valIdx, - periodicVestingAddr, - Address(), - balance.Sub(standardFees).String(), - standardFees.String(), - true, - ) - waitFirstPeriod = firstPeriod - time.Now().Unix() + vestingTxDelay - time.Sleep(time.Duration(waitFirstPeriod) * time.Second) - } - - // Delegate coins should succeed - s.executeDelegate(chain, valIdx, vestingDelegationAmount.String(), valOpAddr, - periodicVestingAddr, gaiaHomePath, vestingDelegationFees.String()) - - // Validate delegation successful - s.Require().Eventually( - func() bool { - res, err := queryDelegation(api, valOpAddr, periodicVestingAddr) - amt := res.GetDelegationResponse().GetDelegation().GetShares() - s.Require().NoError(err) - - return amt.Equal(sdk.NewDecFromInt(vestingDelegationAmount.Amount)) - }, - 20*time.Second, - 5*time.Second, - ) - - // Transfer coins should succeed - balance, err = getSpecificBalance(api, periodicVestingAddr, uatomDenom) - s.Require().NoError(err) - s.execBankSend( - chain, - valIdx, - periodicVestingAddr, - Address(), - balance.Sub(standardFees).String(), - standardFees.String(), - false, - ) - - secondPeriod := firstPeriod + acc.VestingPeriods[1].Length - waitSecondPeriod := secondPeriod - time.Now().Unix() - if waitSecondPeriod > vestingTxDelay { - time.Sleep(time.Duration(waitSecondPeriod) * time.Second) - - // Transfer coins should succeed - balance, err = getSpecificBalance(api, periodicVestingAddr, uatomDenom) - s.Require().NoError(err) - s.execBankSend( - chain, - valIdx, - periodicVestingAddr, - Address(), - balance.Sub(standardFees).String(), - standardFees.String(), - false, - ) - } - }) -} - -// generateVestingPeriod generate the vesting period file -func generateVestingPeriod() ([]byte, error) { - p := vestingPeriod{ - StartTime: time.Now().Add(time.Duration(rand.Intn(20)+95) * time.Second).Unix(), - Periods: []period{ - { - Coins: "850000000" + uatomDenom, - Length: 35, - }, - { - Coins: "2000000000" + uatomDenom, - Length: 35, - }, - }, - } - return json.Marshal(p) -} +// import ( +// "encoding/json" +// "math/rand" +// "path/filepath" +// "time" + +// sdk "github.com/cosmos/cosmos-sdk/types" + +// "github.com/cosmos/gaia/v11/x/globalfee/ante" +// ) + +// const ( +// delayedVestingKey = "delayed_vesting" +// continuousVestingKey = "continuous_vesting" +// lockedVestingKey = "locker_vesting" +// periodicVestingKey = "periodic_vesting" + +// vestingPeriodFile = "test_period.json" +// vestingTxDelay = 5 +// ) + +// type ( +// vestingPeriod struct { +// StartTime int64 `json:"start_time"` +// Periods []period `json:"periods"` +// } +// period struct { +// Coins string `json:"coins"` +// Length int64 `json:"length_seconds"` +// } +// ) + +// var ( +// genesisVestingKeys = []string{continuousVestingKey, delayedVestingKey, lockedVestingKey, periodicVestingKey} +// vestingAmountVested = sdk.NewCoin(uatomDenom, sdk.NewInt(99900000000)) +// vestingAmount = sdk.NewCoin(uatomDenom, sdk.NewInt(350000)) +// vestingBalance = sdk.NewCoins(vestingAmountVested).Add(vestingAmount) +// vestingDelegationAmount = sdk.NewCoin(uatomDenom, sdk.NewInt(500000000)) +// vestingDelegationFees = sdk.NewCoin(uatomDenom, sdk.NewInt(1)) +// ) + +// func (s *IntegrationTestSuite) testDelayedVestingAccount(api string) { +// var ( +// valIdx = 0 +// chain = s.chainA +// val = chain.validators[valIdx] +// vestingDelayedAcc = chain.genesisVestingAccounts[delayedVestingKey] +// ) +// sender := val.keyInfo.GetAddress() +// valOpAddr := sdk.ValAddress(sender).String() + +// s.Run("test delayed vesting genesis account", func() { +// acc, err := queryDelayedVestingAccount(api, vestingDelayedAcc.String()) +// s.Require().NoError(err) + +// // Check address balance +// balance, err := getSpecificBalance(api, vestingDelayedAcc.String(), uatomDenom) +// s.Require().NoError(err) +// s.Require().Equal(vestingBalance.AmountOf(uatomDenom), balance.Amount) + +// // Delegate coins should succeed +// s.executeDelegate(chain, valIdx, vestingDelegationAmount.String(), valOpAddr, +// vestingDelayedAcc.String(), gaiaHomePath, vestingDelegationFees.String()) + +// // Validate delegation successful +// s.Require().Eventually( +// func() bool { +// res, err := queryDelegation(api, valOpAddr, vestingDelayedAcc.String()) +// amt := res.GetDelegationResponse().GetDelegation().GetShares() +// s.Require().NoError(err) + +// return amt.Equal(sdk.NewDecFromInt(vestingDelegationAmount.Amount)) +// }, +// 20*time.Second, +// 5*time.Second, +// ) + +// waitTime := acc.EndTime - time.Now().Unix() +// if waitTime > vestingTxDelay { +// // Transfer coins should fail +// balance, err := getSpecificBalance(api, vestingDelayedAcc.String(), uatomDenom) +// s.Require().NoError(err) +// s.execBankSend( +// chain, +// valIdx, +// vestingDelayedAcc.String(), +// Address(), +// balance.Sub(standardFees).String(), +// standardFees.String(), +// true, +// ) +// waitTime = acc.EndTime - time.Now().Unix() + vestingTxDelay +// time.Sleep(time.Duration(waitTime) * time.Second) +// } + +// // Transfer coins should succeed +// balance, err = getSpecificBalance(api, vestingDelayedAcc.String(), uatomDenom) +// s.Require().NoError(err) +// s.execBankSend( +// chain, +// valIdx, +// vestingDelayedAcc.String(), +// Address(), +// balance.Sub(standardFees).String(), +// standardFees.String(), +// false, +// ) +// }) +// } + +// func (s *IntegrationTestSuite) testContinuousVestingAccount(api string) { +// s.Run("test continuous vesting genesis account", func() { +// var ( +// valIdx = 0 +// chain = s.chainA +// val = chain.validators[valIdx] +// continuousVestingAcc = chain.genesisVestingAccounts[continuousVestingKey] +// ) +// sender := val.keyInfo.GetAddress() +// valOpAddr := sdk.ValAddress(sender).String() + +// acc, err := queryContinuousVestingAccount(api, continuousVestingAcc.String()) +// s.Require().NoError(err) + +// // Check address balance +// balance, err := getSpecificBalance(api, continuousVestingAcc.String(), uatomDenom) +// s.Require().NoError(err) +// s.Require().Equal(vestingBalance.AmountOf(uatomDenom), balance.Amount) + +// // Delegate coins should succeed +// s.executeDelegate(chain, valIdx, vestingDelegationAmount.String(), +// valOpAddr, continuousVestingAcc.String(), gaiaHomePath, vestingDelegationFees.String()) + +// // Validate delegation successful +// s.Require().Eventually( +// func() bool { +// res, err := queryDelegation(api, valOpAddr, continuousVestingAcc.String()) +// amt := res.GetDelegationResponse().GetDelegation().GetShares() +// s.Require().NoError(err) + +// return amt.Equal(sdk.NewDecFromInt(vestingDelegationAmount.Amount)) +// }, +// 20*time.Second, +// 5*time.Second, +// ) + +// waitStartTime := acc.StartTime - time.Now().Unix() +// if waitStartTime > vestingTxDelay { +// // Transfer coins should fail +// balance, err := getSpecificBalance(api, continuousVestingAcc.String(), uatomDenom) +// s.Require().NoError(err) +// s.execBankSend( +// chain, +// valIdx, +// continuousVestingAcc.String(), +// Address(), +// balance.Sub(standardFees).String(), +// standardFees.String(), +// true, +// ) +// waitStartTime = acc.StartTime - time.Now().Unix() + vestingTxDelay +// time.Sleep(time.Duration(waitStartTime) * time.Second) +// } + +// waitEndTime := acc.EndTime - time.Now().Unix() +// if waitEndTime > vestingTxDelay { +// // Transfer coins should fail +// balance, err := getSpecificBalance(api, continuousVestingAcc.String(), uatomDenom) +// s.Require().NoError(err) +// s.execBankSend( +// chain, +// valIdx, +// continuousVestingAcc.String(), +// Address(), +// balance.Sub(standardFees).String(), +// standardFees.String(), +// true, +// ) +// waitEndTime = acc.EndTime - time.Now().Unix() + vestingTxDelay +// time.Sleep(time.Duration(waitEndTime) * time.Second) +// } + +// // Transfer coins should succeed +// balance, err = getSpecificBalance(api, continuousVestingAcc.String(), uatomDenom) +// s.Require().NoError(err) +// s.execBankSend( +// chain, +// valIdx, +// continuousVestingAcc.String(), +// Address(), +// balance.Sub(standardFees).String(), +// standardFees.String(), +// false, +// ) +// }) +// } + +// func (s *IntegrationTestSuite) testPeriodicVestingAccount(api string) { //nolint:unused +// s.Run("test periodic vesting genesis account", func() { +// var ( +// valIdx = 0 +// chain = s.chainA +// val = chain.validators[valIdx] +// periodicVestingAddr = chain.genesisVestingAccounts[periodicVestingKey].String() +// ) +// sender := val.keyInfo.GetAddress() +// valOpAddr := sdk.ValAddress(sender).String() + +// s.execCreatePeriodicVestingAccount( +// chain, +// periodicVestingAddr, +// filepath.Join(gaiaHomePath, vestingPeriodFile), +// withKeyValue(flagFrom, sender.String()), +// ) + +// acc, err := queryPeriodicVestingAccount(api, periodicVestingAddr) +// s.Require().NoError(err) + +// // Check address balance +// balance, err := getSpecificBalance(api, periodicVestingAddr, uatomDenom) +// s.Require().NoError(err) + +// expectedBalance := sdk.NewCoin(uatomDenom, sdk.NewInt(0)) +// for _, period := range acc.VestingPeriods { +// _, coin := ante.Find(period.Amount, uatomDenom) +// expectedBalance = expectedBalance.Add(coin) +// } +// s.Require().Equal(expectedBalance, balance) + +// waitStartTime := acc.StartTime - time.Now().Unix() +// if waitStartTime > vestingTxDelay { +// // Transfer coins should fail +// balance, err = getSpecificBalance(api, periodicVestingAddr, uatomDenom) +// s.Require().NoError(err) +// s.execBankSend( +// chain, +// valIdx, +// periodicVestingAddr, +// Address(), +// balance.Sub(standardFees).String(), +// standardFees.String(), +// true, +// ) +// waitStartTime = acc.StartTime - time.Now().Unix() + vestingTxDelay +// time.Sleep(time.Duration(waitStartTime) * time.Second) +// } + +// firstPeriod := acc.StartTime + acc.VestingPeriods[0].Length +// waitFirstPeriod := firstPeriod - time.Now().Unix() +// if waitFirstPeriod > vestingTxDelay { +// // Transfer coins should fail +// balance, err = getSpecificBalance(api, periodicVestingAddr, uatomDenom) +// s.Require().NoError(err) +// s.execBankSend( +// chain, +// valIdx, +// periodicVestingAddr, +// Address(), +// balance.Sub(standardFees).String(), +// standardFees.String(), +// true, +// ) +// waitFirstPeriod = firstPeriod - time.Now().Unix() + vestingTxDelay +// time.Sleep(time.Duration(waitFirstPeriod) * time.Second) +// } + +// // Delegate coins should succeed +// s.executeDelegate(chain, valIdx, vestingDelegationAmount.String(), valOpAddr, +// periodicVestingAddr, gaiaHomePath, vestingDelegationFees.String()) + +// // Validate delegation successful +// s.Require().Eventually( +// func() bool { +// res, err := queryDelegation(api, valOpAddr, periodicVestingAddr) +// amt := res.GetDelegationResponse().GetDelegation().GetShares() +// s.Require().NoError(err) + +// return amt.Equal(sdk.NewDecFromInt(vestingDelegationAmount.Amount)) +// }, +// 20*time.Second, +// 5*time.Second, +// ) + +// // Transfer coins should succeed +// balance, err = getSpecificBalance(api, periodicVestingAddr, uatomDenom) +// s.Require().NoError(err) +// s.execBankSend( +// chain, +// valIdx, +// periodicVestingAddr, +// Address(), +// balance.Sub(standardFees).String(), +// standardFees.String(), +// false, +// ) + +// secondPeriod := firstPeriod + acc.VestingPeriods[1].Length +// waitSecondPeriod := secondPeriod - time.Now().Unix() +// if waitSecondPeriod > vestingTxDelay { +// time.Sleep(time.Duration(waitSecondPeriod) * time.Second) + +// // Transfer coins should succeed +// balance, err = getSpecificBalance(api, periodicVestingAddr, uatomDenom) +// s.Require().NoError(err) +// s.execBankSend( +// chain, +// valIdx, +// periodicVestingAddr, +// Address(), +// balance.Sub(standardFees).String(), +// standardFees.String(), +// false, +// ) +// } +// }) +// } + +// // generateVestingPeriod generate the vesting period file +// func generateVestingPeriod() ([]byte, error) { +// p := vestingPeriod{ +// StartTime: time.Now().Add(time.Duration(rand.Intn(20)+95) * time.Second).Unix(), +// Periods: []period{ +// { +// Coins: "850000000" + uatomDenom, +// Length: 35, +// }, +// { +// Coins: "2000000000" + uatomDenom, +// Length: 35, +// }, +// }, +// } +// return json.Marshal(p) +// } diff --git a/tests/e2e/genesis.go b/tests/e2e/genesis.go index 685e872cb2..37f50e2e8e 100644 --- a/tests/e2e/genesis.go +++ b/tests/e2e/genesis.go @@ -1,202 +1,202 @@ package e2e -import ( - "encoding/json" - "fmt" - "os" - "time" - - "github.com/cosmos/cosmos-sdk/server" - 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" - "github.com/cosmos/cosmos-sdk/x/genutil" - genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - icatypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/types" - tmtypes "github.com/tendermint/tendermint/types" - - globfeetypes "github.com/cosmos/gaia/v11/x/globalfee/types" -) - -func getGenDoc(path string) (*tmtypes.GenesisDoc, error) { - serverCtx := server.NewDefaultContext() - config := serverCtx.Config - config.SetRoot(path) - - genFile := config.GenesisFile() - doc := &tmtypes.GenesisDoc{} - - if _, err := os.Stat(genFile); err != nil { - if !os.IsNotExist(err) { - return nil, err - } - } else { - var err error - - doc, err = tmtypes.GenesisDocFromFile(genFile) - if err != nil { - return nil, fmt.Errorf("failed to read genesis doc from file: %w", err) - } - } - - return doc, nil -} - -func modifyGenesis(path, moniker, amountStr string, addrAll []sdk.AccAddress, globfees string, denom string) error { - serverCtx := server.NewDefaultContext() - config := serverCtx.Config - config.SetRoot(path) - config.Moniker = moniker - - coins, err := sdk.ParseCoinsNormalized(amountStr) - if err != nil { - return fmt.Errorf("failed to parse coins: %w", err) - } - - var balances []banktypes.Balance - var genAccounts []*authtypes.BaseAccount - for _, addr := range addrAll { - balance := banktypes.Balance{Address: addr.String(), Coins: coins.Sort()} - balances = append(balances, balance) - genAccount := authtypes.NewBaseAccount(addr, nil, 0, 0) - genAccounts = append(genAccounts, genAccount) - } - - 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(cdc, appState) - accs, err := authtypes.UnpackAccounts(authGenState.Accounts) - if err != nil { - return fmt.Errorf("failed to get accounts from any: %w", err) - } - - for _, addr := range addrAll { - if accs.Contains(addr) { - return fmt.Errorf("failed to add account to genesis state; account already exists: %s", addr) - } - } - - // Add the new account to the set of genesis accounts and sanitize the - // accounts afterwards. - for _, genAcct := range genAccounts { - accs = append(accs, genAcct) - 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 := cdc.MarshalJSON(&authGenState) - if err != nil { - return fmt.Errorf("failed to marshal auth genesis state: %w", err) - } - appState[authtypes.ModuleName] = authGenStateBz - - bankGenState := banktypes.GetGenesisStateFromAppState(cdc, appState) - bankGenState.Balances = append(bankGenState.Balances, balances...) - bankGenState.Balances = banktypes.SanitizeGenesisBalances(bankGenState.Balances) - - bankGenStateBz, err := cdc.MarshalJSON(bankGenState) - if err != nil { - return fmt.Errorf("failed to marshal bank genesis state: %w", err) - } - appState[banktypes.ModuleName] = bankGenStateBz - - // add ica host allowed msg types - var icaGenesisState icatypes.GenesisState - - if appState[icatypes.ModuleName] != nil { - cdc.MustUnmarshalJSON(appState[icatypes.ModuleName], &icaGenesisState) - } - - icaGenesisState.HostGenesisState.Params.AllowMessages = []string{ - "/cosmos.authz.v1beta1.MsgExec", - "/cosmos.authz.v1beta1.MsgGrant", - "/cosmos.authz.v1beta1.MsgRevoke", - "/cosmos.bank.v1beta1.MsgSend", - "/cosmos.bank.v1beta1.MsgMultiSend", - "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", - "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", - "/cosmos.distribution.v1beta1.MsgFundCommunityPool", - "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", - "/cosmos.feegrant.v1beta1.MsgGrantAllowance", - "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", - "/cosmos.gov.v1beta1.MsgVoteWeighted", - "/cosmos.gov.v1beta1.MsgSubmitProposal", - "/cosmos.gov.v1beta1.MsgDeposit", - "/cosmos.gov.v1beta1.MsgVote", - "/cosmos.staking.v1beta1.MsgEditValidator", - "/cosmos.staking.v1beta1.MsgDelegate", - "/cosmos.staking.v1beta1.MsgUndelegate", - "/cosmos.staking.v1beta1.MsgBeginRedelegate", - "/cosmos.staking.v1beta1.MsgCreateValidator", - "/cosmos.vesting.v1beta1.MsgCreateVestingAccount", - "/ibc.applications.transfer.v1.MsgTransfer", - "/tendermint.liquidity.v1beta1.MsgCreatePool", - "/tendermint.liquidity.v1beta1.MsgSwapWithinBatch", - "/tendermint.liquidity.v1beta1.MsgDepositWithinBatch", - "/tendermint.liquidity.v1beta1.MsgWithdrawWithinBatch", - } - - icaGenesisStateBz, err := cdc.MarshalJSON(&icaGenesisState) - if err != nil { - return fmt.Errorf("failed to marshal interchain accounts genesis state: %w", err) - } - appState[icatypes.ModuleName] = icaGenesisStateBz - - // setup global fee in genesis - globfeeState := globfeetypes.GetGenesisStateFromAppState(cdc, appState) - minGases, err := sdk.ParseDecCoins(globfees) - if err != nil { - return fmt.Errorf("failed to parse fee coins: %w", err) - } - globfeeState.Params.MinimumGasPrices = minGases - globFeeStateBz, err := cdc.MarshalJSON(globfeeState) - if err != nil { - return fmt.Errorf("failed to marshal global fee genesis state: %w", err) - } - appState[globfeetypes.ModuleName] = globFeeStateBz - - stakingGenState := stakingtypes.GetGenesisStateFromAppState(cdc, appState) - stakingGenState.Params.BondDenom = denom - stakingGenStateBz, err := cdc.MarshalJSON(stakingGenState) - if err != nil { - return fmt.Errorf("failed to marshal staking genesis state: %s", err) - } - appState[stakingtypes.ModuleName] = stakingGenStateBz - - // Refactor to separate method - amnt := sdk.NewInt(10000) - quorum, _ := sdk.NewDecFromStr("0.000000000000000001") - threshold, _ := sdk.NewDecFromStr("0.000000000000000001") - - govState := govtypes.NewGenesisState(1, - govtypes.NewDepositParams(sdk.NewCoins(sdk.NewCoin(denom, amnt)), 10*time.Minute), - govtypes.NewVotingParams(15*time.Second), - govtypes.NewTallyParams(quorum, threshold, govtypes.DefaultVetoThreshold), - ) - - govGenStateBz, err := cdc.MarshalJSON(govState) - if err != nil { - return fmt.Errorf("failed to marshal gov genesis state: %w", err) - } - appState[govtypes.ModuleName] = govGenStateBz - - 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) -} +// import ( +// "encoding/json" +// "fmt" +// "os" +// "time" + +// "github.com/cosmos/cosmos-sdk/server" +// 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" +// "github.com/cosmos/cosmos-sdk/x/genutil" +// genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" +// govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" +// stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" +// icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" +// tmtypes "github.com/tendermint/tendermint/types" + +// globfeetypes "github.com/cosmos/gaia/v11/x/globalfee/types" +// ) + +// func getGenDoc(path string) (*tmtypes.GenesisDoc, error) { +// serverCtx := server.NewDefaultContext() +// config := serverCtx.Config +// config.SetRoot(path) + +// genFile := config.GenesisFile() +// doc := &tmtypes.GenesisDoc{} + +// if _, err := os.Stat(genFile); err != nil { +// if !os.IsNotExist(err) { +// return nil, err +// } +// } else { +// var err error + +// doc, err = tmtypes.GenesisDocFromFile(genFile) +// if err != nil { +// return nil, fmt.Errorf("failed to read genesis doc from file: %w", err) +// } +// } + +// return doc, nil +// } + +// func modifyGenesis(path, moniker, amountStr string, addrAll []sdk.AccAddress, globfees string, denom string) error { +// serverCtx := server.NewDefaultContext() +// config := serverCtx.Config +// config.SetRoot(path) +// config.Moniker = moniker + +// coins, err := sdk.ParseCoinsNormalized(amountStr) +// if err != nil { +// return fmt.Errorf("failed to parse coins: %w", err) +// } + +// var balances []banktypes.Balance +// var genAccounts []*authtypes.BaseAccount +// for _, addr := range addrAll { +// balance := banktypes.Balance{Address: addr.String(), Coins: coins.Sort()} +// balances = append(balances, balance) +// genAccount := authtypes.NewBaseAccount(addr, nil, 0, 0) +// genAccounts = append(genAccounts, genAccount) +// } + +// 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(cdc, appState) +// accs, err := authtypes.UnpackAccounts(authGenState.Accounts) +// if err != nil { +// return fmt.Errorf("failed to get accounts from any: %w", err) +// } + +// for _, addr := range addrAll { +// if accs.Contains(addr) { +// return fmt.Errorf("failed to add account to genesis state; account already exists: %s", addr) +// } +// } + +// // Add the new account to the set of genesis accounts and sanitize the +// // accounts afterwards. +// for _, genAcct := range genAccounts { +// accs = append(accs, genAcct) +// 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 := cdc.MarshalJSON(&authGenState) +// if err != nil { +// return fmt.Errorf("failed to marshal auth genesis state: %w", err) +// } +// appState[authtypes.ModuleName] = authGenStateBz + +// bankGenState := banktypes.GetGenesisStateFromAppState(cdc, appState) +// bankGenState.Balances = append(bankGenState.Balances, balances...) +// bankGenState.Balances = banktypes.SanitizeGenesisBalances(bankGenState.Balances) + +// bankGenStateBz, err := cdc.MarshalJSON(bankGenState) +// if err != nil { +// return fmt.Errorf("failed to marshal bank genesis state: %w", err) +// } +// appState[banktypes.ModuleName] = bankGenStateBz + +// // add ica host allowed msg types +// var icaGenesisState icatypes.GenesisState + +// if appState[icatypes.ModuleName] != nil { +// cdc.MustUnmarshalJSON(appState[icatypes.ModuleName], &icaGenesisState) +// } + +// icaGenesisState.HostGenesisState.Params.AllowMessages = []string{ +// "/cosmos.authz.v1beta1.MsgExec", +// "/cosmos.authz.v1beta1.MsgGrant", +// "/cosmos.authz.v1beta1.MsgRevoke", +// "/cosmos.bank.v1beta1.MsgSend", +// "/cosmos.bank.v1beta1.MsgMultiSend", +// "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", +// "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", +// "/cosmos.distribution.v1beta1.MsgFundCommunityPool", +// "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", +// "/cosmos.feegrant.v1beta1.MsgGrantAllowance", +// "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", +// "/cosmos.gov.v1beta1.MsgVoteWeighted", +// "/cosmos.gov.v1beta1.MsgSubmitProposal", +// "/cosmos.gov.v1beta1.MsgDeposit", +// "/cosmos.gov.v1beta1.MsgVote", +// "/cosmos.staking.v1beta1.MsgEditValidator", +// "/cosmos.staking.v1beta1.MsgDelegate", +// "/cosmos.staking.v1beta1.MsgUndelegate", +// "/cosmos.staking.v1beta1.MsgBeginRedelegate", +// "/cosmos.staking.v1beta1.MsgCreateValidator", +// "/cosmos.vesting.v1beta1.MsgCreateVestingAccount", +// "/ibc.applications.transfer.v1.MsgTransfer", +// "/tendermint.liquidity.v1beta1.MsgCreatePool", +// "/tendermint.liquidity.v1beta1.MsgSwapWithinBatch", +// "/tendermint.liquidity.v1beta1.MsgDepositWithinBatch", +// "/tendermint.liquidity.v1beta1.MsgWithdrawWithinBatch", +// } + +// icaGenesisStateBz, err := cdc.MarshalJSON(&icaGenesisState) +// if err != nil { +// return fmt.Errorf("failed to marshal interchain accounts genesis state: %w", err) +// } +// appState[icatypes.ModuleName] = icaGenesisStateBz + +// // setup global fee in genesis +// globfeeState := globfeetypes.GetGenesisStateFromAppState(cdc, appState) +// minGases, err := sdk.ParseDecCoins(globfees) +// if err != nil { +// return fmt.Errorf("failed to parse fee coins: %w", err) +// } +// globfeeState.Params.MinimumGasPrices = minGases +// globFeeStateBz, err := cdc.MarshalJSON(globfeeState) +// if err != nil { +// return fmt.Errorf("failed to marshal global fee genesis state: %w", err) +// } +// appState[globfeetypes.ModuleName] = globFeeStateBz + +// stakingGenState := stakingtypes.GetGenesisStateFromAppState(cdc, appState) +// stakingGenState.Params.BondDenom = denom +// stakingGenStateBz, err := cdc.MarshalJSON(stakingGenState) +// if err != nil { +// return fmt.Errorf("failed to marshal staking genesis state: %s", err) +// } +// appState[stakingtypes.ModuleName] = stakingGenStateBz + +// // Refactor to separate method +// amnt := sdk.NewInt(10000) +// quorum, _ := sdk.NewDecFromStr("0.000000000000000001") +// threshold, _ := sdk.NewDecFromStr("0.000000000000000001") + +// govState := govtypes.NewGenesisState(1, +// govtypes.NewDepositParams(sdk.NewCoins(sdk.NewCoin(denom, amnt)), 10*time.Minute), +// govtypes.NewVotingParams(15*time.Second), +// govtypes.NewTallyParams(quorum, threshold, govtypes.DefaultVetoThreshold), +// ) + +// govGenStateBz, err := cdc.MarshalJSON(govState) +// if err != nil { +// return fmt.Errorf("failed to marshal gov genesis state: %w", err) +// } +// appState[govtypes.ModuleName] = govGenStateBz + +// 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) +// } diff --git a/tests/e2e/http_util.go b/tests/e2e/http_util.go index 593759ac8b..539eea4dc6 100644 --- a/tests/e2e/http_util.go +++ b/tests/e2e/http_util.go @@ -1,40 +1,40 @@ package e2e -import ( - "encoding/json" - "fmt" - "io" - "net/http" -) - -func httpGet(endpoint string) ([]byte, error) { - resp, err := http.Get(endpoint) //nolint:gosec // this is only used during tests - if err != nil { - return nil, fmt.Errorf("failed to execute HTTP request: %w", err) - } - defer resp.Body.Close() - - body, err := io.ReadAll(resp.Body) - if err != nil { - return nil, err - } - - return body, nil -} - -func readJSON(resp *http.Response) (map[string]interface{}, error) { - defer resp.Body.Close() - - body, readErr := io.ReadAll(resp.Body) - if readErr != nil { - return nil, fmt.Errorf("failed to read Body") - } - - var data map[string]interface{} - err := json.Unmarshal(body, &data) - if err != nil { - return nil, fmt.Errorf("failed to unmarshal response body") - } - - return data, nil -} +// import ( +// "encoding/json" +// "fmt" +// "io" +// "net/http" +// ) + +// func httpGet(endpoint string) ([]byte, error) { +// resp, err := http.Get(endpoint) //nolint:gosec // this is only used during tests +// if err != nil { +// return nil, fmt.Errorf("failed to execute HTTP request: %w", err) +// } +// defer resp.Body.Close() + +// body, err := io.ReadAll(resp.Body) +// if err != nil { +// return nil, err +// } + +// return body, nil +// } + +// func readJSON(resp *http.Response) (map[string]interface{}, error) { +// defer resp.Body.Close() + +// body, readErr := io.ReadAll(resp.Body) +// if readErr != nil { +// return nil, fmt.Errorf("failed to read Body") +// } + +// var data map[string]interface{} +// err := json.Unmarshal(body, &data) +// if err != nil { +// return nil, fmt.Errorf("failed to unmarshal response body") +// } + +// return data, nil +// } diff --git a/tests/e2e/io.go b/tests/e2e/io.go index 40b316bec4..e9b58ab366 100644 --- a/tests/e2e/io.go +++ b/tests/e2e/io.go @@ -1,44 +1,44 @@ package e2e -import ( - "fmt" - "io" - "os" -) - -// copyFile copy file from src to dst -func copyFile(src, dst string) (int64, error) { //nolint:unparam - sourceFileStat, err := os.Stat(src) - if err != nil { - return 0, err - } - - if !sourceFileStat.Mode().IsRegular() { - return 0, fmt.Errorf("%s is not a regular file", src) - } - - source, err := os.Open(src) - if err != nil { - return 0, err - } - defer source.Close() - - destination, err := os.Create(dst) - if err != nil { - return 0, err - } - defer destination.Close() - - nBytes, err := io.Copy(destination, source) - return nBytes, err -} - -// writeFile write a byte slice into a file path -func writeFile(path string, body []byte) error { - _, err := os.Create(path) - if err != nil { - return err - } - - return os.WriteFile(path, body, 0o600) -} +// import ( +// "fmt" +// "io" +// "os" +// ) + +// // copyFile copy file from src to dst +// func copyFile(src, dst string) (int64, error) { +// sourceFileStat, err := os.Stat(src) +// if err != nil { +// return 0, err +// } + +// if !sourceFileStat.Mode().IsRegular() { +// return 0, fmt.Errorf("%s is not a regular file", src) +// } + +// source, err := os.Open(src) +// if err != nil { +// return 0, err +// } +// defer source.Close() + +// destination, err := os.Create(dst) +// if err != nil { +// return 0, err +// } +// defer destination.Close() + +// nBytes, err := io.Copy(destination, source) +// return nBytes, err +// } + +// // writeFile write a byte slice into a file path +// func writeFile(path string, body []byte) error { +// _, err := os.Create(path) +// if err != nil { +// return err +// } + +// return os.WriteFile(path, body, 0o600) +// } diff --git a/tests/e2e/keys.go b/tests/e2e/keys.go index d47a7ce59d..53740d5d71 100644 --- a/tests/e2e/keys.go +++ b/tests/e2e/keys.go @@ -1,20 +1,21 @@ package e2e -import ( - "github.com/cosmos/go-bip39" -) - -// createMnemonic creates a random string mnemonic -func createMnemonic() (string, error) { - entropySeed, err := bip39.NewEntropy(256) - if err != nil { - return "", err - } - - mnemonic, err := bip39.NewMnemonic(entropySeed) - if err != nil { - return "", err - } - - return mnemonic, nil -} +// +// import ( +// "github.com/cosmos/go-bip39" +//) +// +//// createMnemonic creates a random string mnemonic +// func createMnemonic() (string, error) { +// entropySeed, err := bip39.NewEntropy(256) +// if err != nil { +// return "", err +// } +// +// mnemonic, err := bip39.NewMnemonic(entropySeed) +// if err != nil { +// return "", err +// } +// +// return mnemonic, nil +//} diff --git a/tests/e2e/query.go b/tests/e2e/query.go index ccd30a96c8..6aa90e921f 100644 --- a/tests/e2e/query.go +++ b/tests/e2e/query.go @@ -1,289 +1,289 @@ package e2e -import ( - "encoding/json" - "fmt" - "io" - "net/http" - "strings" - - 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" - disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" - - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - - "github.com/cosmos/gaia/v11/x/globalfee/types" -) - -func queryGaiaTx(endpoint, txHash string) error { - resp, err := http.Get(fmt.Sprintf("%s/cosmos/tx/v1beta1/txs/%s", endpoint, txHash)) - if err != nil { - return fmt.Errorf("failed to execute HTTP request: %w", err) - } - - defer resp.Body.Close() - - if resp.StatusCode != 200 { - return fmt.Errorf("tx query returned non-200 status: %d", resp.StatusCode) - } - - var result map[string]interface{} - if err := json.NewDecoder(resp.Body).Decode(&result); err != nil { - return fmt.Errorf("failed to read response body: %w", err) - } - - txResp := result["tx_response"].(map[string]interface{}) - if v := txResp["code"]; v.(float64) != 0 { - return fmt.Errorf("tx %s failed with status code %v", txHash, v) - } - - return nil -} - -// if coin is zero, return empty coin. -func getSpecificBalance(endpoint, addr, denom string) (amt sdk.Coin, err error) { - balances, err := queryGaiaAllBalances(endpoint, addr) - if err != nil { - return amt, err - } - for _, c := range balances { - if strings.Contains(c.Denom, denom) { - amt = c - break - } - } - return amt, nil -} - -func queryGaiaAllBalances(endpoint, addr string) (sdk.Coins, error) { - body, err := httpGet(fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s", endpoint, addr)) - if err != nil { - return nil, fmt.Errorf("failed to execute HTTP request: %w", err) - } - - var balancesResp banktypes.QueryAllBalancesResponse - if err := cdc.UnmarshalJSON(body, &balancesResp); err != nil { - return nil, err - } - - return balancesResp.Balances, nil -} - -func queryGlobalFeeParams(endpoint string) (types.QueryParamsResponse, error) { - body, err := httpGet(fmt.Sprintf("%s/gaia/globalfee/v1beta1/params", endpoint)) - if err != nil { - return types.QueryParamsResponse{}, fmt.Errorf("failed to execute HTTP request: %w", err) - } - - var params types.QueryParamsResponse - if err := cdc.UnmarshalJSON(body, ¶ms); err != nil { - return types.QueryParamsResponse{}, err - } - - return params, nil -} - -func queryGlobalFees(endpoint string) (sdk.DecCoins, error) { - p, err := queryGlobalFeeParams(endpoint) - - return p.Params.MinimumGasPrices, err -} - -func queryBypassMsgs(endpoint string) ([]string, error) { - p, err := queryGlobalFeeParams(endpoint) - - return p.Params.BypassMinFeeMsgTypes, err -} - -func queryMaxTotalBypassMinFeeMsgGasUsage(endpoint string) (uint64, error) { - p, err := queryGlobalFeeParams(endpoint) - - return p.Params.MaxTotalBypassMinFeeMsgGasUsage, err -} - -func queryDelegation(endpoint string, validatorAddr string, delegatorAddr string) (stakingtypes.QueryDelegationResponse, error) { - var res stakingtypes.QueryDelegationResponse - - body, err := httpGet(fmt.Sprintf("%s/cosmos/staking/v1beta1/validators/%s/delegations/%s", endpoint, validatorAddr, delegatorAddr)) - if err != nil { - return res, err - } - - if err = cdc.UnmarshalJSON(body, &res); err != nil { - return res, err - } - return res, nil -} - -func queryDelegatorWithdrawalAddress(endpoint string, delegatorAddr string) (disttypes.QueryDelegatorWithdrawAddressResponse, error) { - var res disttypes.QueryDelegatorWithdrawAddressResponse - - body, err := httpGet(fmt.Sprintf("%s/cosmos/distribution/v1beta1/delegators/%s/withdraw_address", endpoint, delegatorAddr)) - if err != nil { - return res, err - } - - if err = cdc.UnmarshalJSON(body, &res); err != nil { - return res, err - } - return res, nil -} - -func queryDelegatorTotalRewards(endpoint, delegatorAddr string) (disttypes.QueryDelegationTotalRewardsResponse, error) { - var res disttypes.QueryDelegationTotalRewardsResponse - - body, err := httpGet(fmt.Sprintf("%s/cosmos/distribution/v1beta1/delegators/%s/rewards", endpoint, delegatorAddr)) - if err != nil { - return res, err - } - - if err = cdc.UnmarshalJSON(body, &res); err != nil { - return res, err - } - - return res, nil -} - -func queryGovProposal(endpoint string, proposalID int) (govtypes.QueryProposalResponse, error) { - var govProposalResp govtypes.QueryProposalResponse - - path := fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%d", endpoint, proposalID) - - body, err := httpGet(path) - if err != nil { - return govProposalResp, fmt.Errorf("failed to execute HTTP request: %w", err) - } - if err := cdc.UnmarshalJSON(body, &govProposalResp); err != nil { - return govProposalResp, err - } - - return govProposalResp, nil -} - -func queryAccount(endpoint, address string) (acc authtypes.AccountI, err error) { - var res authtypes.QueryAccountResponse - resp, err := http.Get(fmt.Sprintf("%s/cosmos/auth/v1beta1/accounts/%s", endpoint, address)) - if err != nil { - return nil, fmt.Errorf("failed to execute HTTP request: %w", err) - } - defer resp.Body.Close() - - bz, err := io.ReadAll(resp.Body) - if err != nil { - return nil, err - } - if err := cdc.UnmarshalJSON(bz, &res); err != nil { - return nil, err - } - return acc, cdc.UnpackAny(res.Account, &acc) -} - -func queryDelayedVestingAccount(endpoint, address string) (authvesting.DelayedVestingAccount, error) { - baseAcc, err := queryAccount(endpoint, address) - if err != nil { - return authvesting.DelayedVestingAccount{}, err - } - acc, ok := baseAcc.(*authvesting.DelayedVestingAccount) - if !ok { - return authvesting.DelayedVestingAccount{}, - fmt.Errorf("cannot cast %v to DelayedVestingAccount", baseAcc) - } - return *acc, nil -} - -func queryContinuousVestingAccount(endpoint, address string) (authvesting.ContinuousVestingAccount, error) { - baseAcc, err := queryAccount(endpoint, address) - if err != nil { - return authvesting.ContinuousVestingAccount{}, err - } - acc, ok := baseAcc.(*authvesting.ContinuousVestingAccount) - if !ok { - return authvesting.ContinuousVestingAccount{}, - fmt.Errorf("cannot cast %v to ContinuousVestingAccount", baseAcc) - } - return *acc, nil -} - -func queryPermanentLockedAccount(endpoint, address string) (authvesting.PermanentLockedAccount, error) { //nolint:unused // this is called during e2e tests - baseAcc, err := queryAccount(endpoint, address) - if err != nil { - return authvesting.PermanentLockedAccount{}, err - } - acc, ok := baseAcc.(*authvesting.PermanentLockedAccount) - if !ok { - return authvesting.PermanentLockedAccount{}, - fmt.Errorf("cannot cast %v to PermanentLockedAccount", baseAcc) - } - return *acc, nil -} - -func queryPeriodicVestingAccount(endpoint, address string) (authvesting.PeriodicVestingAccount, error) { //nolint:unused // this is called during e2e tests - baseAcc, err := queryAccount(endpoint, address) - if err != nil { - return authvesting.PeriodicVestingAccount{}, err - } - acc, ok := baseAcc.(*authvesting.PeriodicVestingAccount) - if !ok { - return authvesting.PeriodicVestingAccount{}, - fmt.Errorf("cannot cast %v to PeriodicVestingAccount", baseAcc) - } - return *acc, nil -} - -func queryValidator(endpoint, address string) (stakingtypes.Validator, error) { - var res stakingtypes.QueryValidatorResponse - - body, err := httpGet(fmt.Sprintf("%s/cosmos/staking/v1beta1/validators/%s", endpoint, address)) - if err != nil { - return stakingtypes.Validator{}, fmt.Errorf("failed to execute HTTP request: %w", err) - } - - if err := cdc.UnmarshalJSON(body, &res); err != nil { - return stakingtypes.Validator{}, err - } - return res.Validator, nil -} - -func queryValidators(endpoint string) (stakingtypes.Validators, error) { - var res stakingtypes.QueryValidatorsResponse - body, err := httpGet(fmt.Sprintf("%s/cosmos/staking/v1beta1/validators", endpoint)) - if err != nil { - return nil, fmt.Errorf("failed to execute HTTP request: %w", err) - } - - if err := cdc.UnmarshalJSON(body, &res); err != nil { - return nil, err - } - return res.Validators, nil -} - -func queryEvidence(endpoint, hash string) (evidencetypes.QueryEvidenceResponse, error) { //nolint:unused // this is called during e2e tests - var res evidencetypes.QueryEvidenceResponse - body, err := httpGet(fmt.Sprintf("%s/cosmos/evidence/v1beta1/evidence/%s", endpoint, hash)) - if err != nil { - return res, err - } - - if err = cdc.UnmarshalJSON(body, &res); err != nil { - return res, err - } - return res, nil -} - -func queryAllEvidence(endpoint string) (evidencetypes.QueryAllEvidenceResponse, error) { - var res evidencetypes.QueryAllEvidenceResponse - body, err := httpGet(fmt.Sprintf("%s/cosmos/evidence/v1beta1/evidence", endpoint)) - if err != nil { - return res, err - } - - if err = cdc.UnmarshalJSON(body, &res); err != nil { - return res, err - } - return res, nil -} +// import ( +// "encoding/json" +// "fmt" +// "io" +// "net/http" +// "strings" + +// 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" +// disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types" +// evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" + +// govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" +// stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + +// "github.com/cosmos/gaia/v11/x/globalfee/types" +// ) + +// func queryGaiaTx(endpoint, txHash string) error { +// resp, err := http.Get(fmt.Sprintf("%s/cosmos/tx/v1beta1/txs/%s", endpoint, txHash)) +// if err != nil { +// return fmt.Errorf("failed to execute HTTP request: %w", err) +// } + +// defer resp.Body.Close() + +// if resp.StatusCode != 200 { +// return fmt.Errorf("tx query returned non-200 status: %d", resp.StatusCode) +// } + +// var result map[string]interface{} +// if err := json.NewDecoder(resp.Body).Decode(&result); err != nil { +// return fmt.Errorf("failed to read response body: %w", err) +// } + +// txResp := result["tx_response"].(map[string]interface{}) +// if v := txResp["code"]; v.(float64) != 0 { +// return fmt.Errorf("tx %s failed with status code %v", txHash, v) +// } + +// return nil +// } + +// // if coin is zero, return empty coin. +// func getSpecificBalance(endpoint, addr, denom string) (amt sdk.Coin, err error) { +// balances, err := queryGaiaAllBalances(endpoint, addr) +// if err != nil { +// return amt, err +// } +// for _, c := range balances { +// if strings.Contains(c.Denom, denom) { +// amt = c +// break +// } +// } +// return amt, nil +// } + +// func queryGaiaAllBalances(endpoint, addr string) (sdk.Coins, error) { +// body, err := httpGet(fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s", endpoint, addr)) +// if err != nil { +// return nil, fmt.Errorf("failed to execute HTTP request: %w", err) +// } + +// var balancesResp banktypes.QueryAllBalancesResponse +// if err := cdc.UnmarshalJSON(body, &balancesResp); err != nil { +// return nil, err +// } + +// return balancesResp.Balances, nil +// } + +// func queryGlobalFeeParams(endpoint string) (types.QueryParamsResponse, error) { +// body, err := httpGet(fmt.Sprintf("%s/gaia/globalfee/v1beta1/params", endpoint)) +// if err != nil { +// return types.QueryParamsResponse{}, fmt.Errorf("failed to execute HTTP request: %w", err) +// } + +// var params types.QueryParamsResponse +// if err := cdc.UnmarshalJSON(body, ¶ms); err != nil { +// return types.QueryParamsResponse{}, err +// } + +// return params, nil +// } + +// func queryGlobalFees(endpoint string) (sdk.DecCoins, error) { +// p, err := queryGlobalFeeParams(endpoint) + +// return p.Params.MinimumGasPrices, err +// } + +// func queryBypassMsgs(endpoint string) ([]string, error) { +// p, err := queryGlobalFeeParams(endpoint) + +// return p.Params.BypassMinFeeMsgTypes, err +// } + +// func queryMaxTotalBypassMinFeeMsgGasUsage(endpoint string) (uint64, error) { +// p, err := queryGlobalFeeParams(endpoint) + +// return p.Params.MaxTotalBypassMinFeeMsgGasUsage, err +// } + +// func queryDelegation(endpoint string, validatorAddr string, delegatorAddr string) (stakingtypes.QueryDelegationResponse, error) { +// var res stakingtypes.QueryDelegationResponse + +// body, err := httpGet(fmt.Sprintf("%s/cosmos/staking/v1beta1/validators/%s/delegations/%s", endpoint, validatorAddr, delegatorAddr)) +// if err != nil { +// return res, err +// } + +// if err = cdc.UnmarshalJSON(body, &res); err != nil { +// return res, err +// } +// return res, nil +// } + +// func queryDelegatorWithdrawalAddress(endpoint string, delegatorAddr string) (disttypes.QueryDelegatorWithdrawAddressResponse, error) { +// var res disttypes.QueryDelegatorWithdrawAddressResponse + +// body, err := httpGet(fmt.Sprintf("%s/cosmos/distribution/v1beta1/delegators/%s/withdraw_address", endpoint, delegatorAddr)) +// if err != nil { +// return res, err +// } + +// if err = cdc.UnmarshalJSON(body, &res); err != nil { +// return res, err +// } +// return res, nil +// } + +// func queryDelegatorTotalRewards(endpoint, delegatorAddr string) (disttypes.QueryDelegationTotalRewardsResponse, error) { +// var res disttypes.QueryDelegationTotalRewardsResponse + +// body, err := httpGet(fmt.Sprintf("%s/cosmos/distribution/v1beta1/delegators/%s/rewards", endpoint, delegatorAddr)) +// if err != nil { +// return res, err +// } + +// if err = cdc.UnmarshalJSON(body, &res); err != nil { +// return res, err +// } + +// return res, nil +// } + +// func queryGovProposal(endpoint string, proposalID int) (govtypes.QueryProposalResponse, error) { +// var govProposalResp govtypes.QueryProposalResponse + +// path := fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%d", endpoint, proposalID) + +// body, err := httpGet(path) +// if err != nil { +// return govProposalResp, fmt.Errorf("failed to execute HTTP request: %w", err) +// } +// if err := cdc.UnmarshalJSON(body, &govProposalResp); err != nil { +// return govProposalResp, err +// } + +// return govProposalResp, nil +// } + +// func queryAccount(endpoint, address string) (acc authtypes.AccountI, err error) { +// var res authtypes.QueryAccountResponse +// resp, err := http.Get(fmt.Sprintf("%s/cosmos/auth/v1beta1/accounts/%s", endpoint, address)) +// if err != nil { +// return nil, fmt.Errorf("failed to execute HTTP request: %w", err) +// } +// defer resp.Body.Close() + +// bz, err := io.ReadAll(resp.Body) +// if err != nil { +// return nil, err +// } +// if err := cdc.UnmarshalJSON(bz, &res); err != nil { +// return nil, err +// } +// return acc, cdc.UnpackAny(res.Account, &acc) +// } + +// func queryDelayedVestingAccount(endpoint, address string) (authvesting.DelayedVestingAccount, error) { +// baseAcc, err := queryAccount(endpoint, address) +// if err != nil { +// return authvesting.DelayedVestingAccount{}, err +// } +// acc, ok := baseAcc.(*authvesting.DelayedVestingAccount) +// if !ok { +// return authvesting.DelayedVestingAccount{}, +// fmt.Errorf("cannot cast %v to DelayedVestingAccount", baseAcc) +// } +// return *acc, nil +// } + +// func queryContinuousVestingAccount(endpoint, address string) (authvesting.ContinuousVestingAccount, error) { +// baseAcc, err := queryAccount(endpoint, address) +// if err != nil { +// return authvesting.ContinuousVestingAccount{}, err +// } +// acc, ok := baseAcc.(*authvesting.ContinuousVestingAccount) +// if !ok { +// return authvesting.ContinuousVestingAccount{}, +// fmt.Errorf("cannot cast %v to ContinuousVestingAccount", baseAcc) +// } +// return *acc, nil +// } + +// func queryPermanentLockedAccount(endpoint, address string) (authvesting.PermanentLockedAccount, error) { //nolint:unused // this is called during e2e tests +// baseAcc, err := queryAccount(endpoint, address) +// if err != nil { +// return authvesting.PermanentLockedAccount{}, err +// } +// acc, ok := baseAcc.(*authvesting.PermanentLockedAccount) +// if !ok { +// return authvesting.PermanentLockedAccount{}, +// fmt.Errorf("cannot cast %v to PermanentLockedAccount", baseAcc) +// } +// return *acc, nil +// } + +// func queryPeriodicVestingAccount(endpoint, address string) (authvesting.PeriodicVestingAccount, error) { //nolint:unused // this is called during e2e tests +// baseAcc, err := queryAccount(endpoint, address) +// if err != nil { +// return authvesting.PeriodicVestingAccount{}, err +// } +// acc, ok := baseAcc.(*authvesting.PeriodicVestingAccount) +// if !ok { +// return authvesting.PeriodicVestingAccount{}, +// fmt.Errorf("cannot cast %v to PeriodicVestingAccount", baseAcc) +// } +// return *acc, nil +// } + +// func queryValidator(endpoint, address string) (stakingtypes.Validator, error) { +// var res stakingtypes.QueryValidatorResponse + +// body, err := httpGet(fmt.Sprintf("%s/cosmos/staking/v1beta1/validators/%s", endpoint, address)) +// if err != nil { +// return stakingtypes.Validator{}, fmt.Errorf("failed to execute HTTP request: %w", err) +// } + +// if err := cdc.UnmarshalJSON(body, &res); err != nil { +// return stakingtypes.Validator{}, err +// } +// return res.Validator, nil +// } + +// func queryValidators(endpoint string) (stakingtypes.Validators, error) { +// var res stakingtypes.QueryValidatorsResponse +// body, err := httpGet(fmt.Sprintf("%s/cosmos/staking/v1beta1/validators", endpoint)) +// if err != nil { +// return nil, fmt.Errorf("failed to execute HTTP request: %w", err) +// } + +// if err := cdc.UnmarshalJSON(body, &res); err != nil { +// return nil, err +// } +// return res.Validators, nil +// } + +// func queryEvidence(endpoint, hash string) (evidencetypes.QueryEvidenceResponse, error) { //nolint:unused // this is called during e2e tests +// var res evidencetypes.QueryEvidenceResponse +// body, err := httpGet(fmt.Sprintf("%s/cosmos/evidence/v1beta1/evidence/%s", endpoint, hash)) +// if err != nil { +// return res, err +// } + +// if err = cdc.UnmarshalJSON(body, &res); err != nil { +// return res, err +// } +// return res, nil +// } + +// func queryAllEvidence(endpoint string) (evidencetypes.QueryAllEvidenceResponse, error) { +// var res evidencetypes.QueryAllEvidenceResponse +// body, err := httpGet(fmt.Sprintf("%s/cosmos/evidence/v1beta1/evidence", endpoint)) +// if err != nil { +// return res, err +// } + +// if err = cdc.UnmarshalJSON(body, &res); err != nil { +// return res, err +// } +// return res, nil +// } diff --git a/tests/e2e/util.go b/tests/e2e/util.go index ae136313e3..aae773f18e 100644 --- a/tests/e2e/util.go +++ b/tests/e2e/util.go @@ -1,52 +1,53 @@ package e2e -import ( - "fmt" - - "github.com/cosmos/cosmos-sdk/codec/unknownproto" - sdktx "github.com/cosmos/cosmos-sdk/types/tx" -) - -func decodeTx(txBytes []byte) (*sdktx.Tx, error) { - var raw sdktx.TxRaw - - // reject all unknown proto fields in the root TxRaw - err := unknownproto.RejectUnknownFieldsStrict(txBytes, &raw, encodingConfig.InterfaceRegistry) - if err != nil { - return nil, fmt.Errorf("failed to reject unknown fields: %w", err) - } - - if err := cdc.Unmarshal(txBytes, &raw); err != nil { - return nil, err - } - - var body sdktx.TxBody - if err := cdc.Unmarshal(raw.BodyBytes, &body); err != nil { - return nil, fmt.Errorf("failed to decode tx: %w", err) - } - - var authInfo sdktx.AuthInfo - - // reject all unknown proto fields in AuthInfo - err = unknownproto.RejectUnknownFieldsStrict(raw.AuthInfoBytes, &authInfo, encodingConfig.InterfaceRegistry) - if err != nil { - return nil, fmt.Errorf("failed to reject unknown fields: %w", err) - } - - if err := cdc.Unmarshal(raw.AuthInfoBytes, &authInfo); err != nil { - return nil, fmt.Errorf("failed to decode auth info: %w", err) - } - - return &sdktx.Tx{ - Body: &body, - AuthInfo: &authInfo, - Signatures: raw.Signatures, - }, nil -} - -func concatFlags(originalCollection []string, commandFlags []string, generalFlags []string) []string { - originalCollection = append(originalCollection, commandFlags...) - originalCollection = append(originalCollection, generalFlags...) - - return originalCollection -} +// +// import ( +// "fmt" +// +// "github.com/cosmos/cosmos-sdk/codec/unknownproto" +// sdktx "github.com/cosmos/cosmos-sdk/types/tx" +//) +// +// func decodeTx(txBytes []byte) (*sdktx.Tx, error) { +// var raw sdktx.TxRaw +// +// // reject all unknown proto fields in the root TxRaw +// err := unknownproto.RejectUnknownFieldsStrict(txBytes, &raw, encodingConfig.InterfaceRegistry) +// if err != nil { +// return nil, fmt.Errorf("failed to reject unknown fields: %w", err) +// } +// +// if err := cdc.Unmarshal(txBytes, &raw); err != nil { +// return nil, err +// } +// +// var body sdktx.TxBody +// if err := cdc.Unmarshal(raw.BodyBytes, &body); err != nil { +// return nil, fmt.Errorf("failed to decode tx: %w", err) +// } +// +// var authInfo sdktx.AuthInfo +// +// // reject all unknown proto fields in AuthInfo +// err = unknownproto.RejectUnknownFieldsStrict(raw.AuthInfoBytes, &authInfo, encodingConfig.InterfaceRegistry) +// if err != nil { +// return nil, fmt.Errorf("failed to reject unknown fields: %w", err) +// } +// +// if err := cdc.Unmarshal(raw.AuthInfoBytes, &authInfo); err != nil { +// return nil, fmt.Errorf("failed to decode auth info: %w", err) +// } +// +// return &sdktx.Tx{ +// Body: &body, +// AuthInfo: &authInfo, +// Signatures: raw.Signatures, +// }, nil +//} +// +// func concatFlags(originalCollection []string, commandFlags []string, generalFlags []string) []string { +// originalCollection = append(originalCollection, commandFlags...) +// originalCollection = append(originalCollection, generalFlags...) +// +// return originalCollection +//} diff --git a/tests/e2e/validator.go b/tests/e2e/validator.go index e6ac398b50..2e81c1251b 100644 --- a/tests/e2e/validator.go +++ b/tests/e2e/validator.go @@ -1,319 +1,319 @@ package e2e -import ( - "encoding/json" - "fmt" - "os" - "path" - "path/filepath" - - sdkcrypto "github.com/cosmos/cosmos-sdk/crypto" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - "github.com/cosmos/cosmos-sdk/crypto/hd" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - "github.com/cosmos/cosmos-sdk/server" - 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" - tmcfg "github.com/tendermint/tendermint/config" - tmos "github.com/tendermint/tendermint/libs/os" - "github.com/tendermint/tendermint/p2p" - "github.com/tendermint/tendermint/privval" - - gaia "github.com/cosmos/gaia/v11/app" -) - -//nolint:unused -type validator struct { - chain *chain - index int - moniker string - mnemonic string - keyInfo keyring.Info - privateKey cryptotypes.PrivKey - consensusKey privval.FilePVKey - consensusPrivKey cryptotypes.PrivKey - nodeKey p2p.NodeKey -} - -type account struct { - moniker string //nolint:unused - mnemonic string - keyInfo keyring.Info - privateKey cryptotypes.PrivKey -} - -func (v *validator) instanceName() string { - return fmt.Sprintf("%s%d", v.moniker, v.index) -} - -func (v *validator) configDir() string { - return fmt.Sprintf("%s/%s", v.chain.configDir(), v.instanceName()) -} - -func (v *validator) createConfig() error { - p := path.Join(v.configDir(), "config") - return os.MkdirAll(p, 0o755) -} - -func (v *validator) init() error { - if err := v.createConfig(); err != nil { - return err - } - - serverCtx := server.NewDefaultContext() - config := serverCtx.Config - - config.SetRoot(v.configDir()) - config.Moniker = v.moniker - - genDoc, err := getGenDoc(v.configDir()) - if err != nil { - return err - } - - appState, err := json.MarshalIndent(gaia.ModuleBasics.DefaultGenesis(cdc), "", " ") - if err != nil { - return fmt.Errorf("failed to JSON encode app genesis state: %w", err) - } - - genDoc.ChainID = v.chain.id - genDoc.Validators = nil - genDoc.AppState = appState - - if err = genutil.ExportGenesisFile(genDoc, config.GenesisFile()); err != nil { - return fmt.Errorf("failed to export app genesis state: %w", err) - } - - tmcfg.WriteConfigFile(filepath.Join(config.RootDir, "config", "config.toml"), config) - return nil -} - -func (v *validator) createNodeKey() error { - serverCtx := server.NewDefaultContext() - config := serverCtx.Config - - config.SetRoot(v.configDir()) - config.Moniker = v.moniker - - nodeKey, err := p2p.LoadOrGenNodeKey(config.NodeKeyFile()) - if err != nil { - return err - } - - v.nodeKey = *nodeKey - return nil -} - -func (v *validator) createConsensusKey() error { - serverCtx := server.NewDefaultContext() - config := serverCtx.Config - - config.SetRoot(v.configDir()) - config.Moniker = v.moniker - - pvKeyFile := config.PrivValidatorKeyFile() - if err := tmos.EnsureDir(filepath.Dir(pvKeyFile), 0o777); err != nil { - return err - } - - pvStateFile := config.PrivValidatorStateFile() - if err := tmos.EnsureDir(filepath.Dir(pvStateFile), 0o777); err != nil { - return err - } - - filePV := privval.LoadOrGenFilePV(pvKeyFile, pvStateFile) - v.consensusKey = filePV.Key - - return nil -} - -func (v *validator) createKeyFromMnemonic(name, mnemonic string) error { - dir := v.configDir() - kb, err := keyring.New(keyringAppName, keyring.BackendTest, dir, nil) - if err != nil { - return err - } - - keyringAlgos, _ := kb.SupportedAlgorithms() - algo, err := keyring.NewSigningAlgoFromString(string(hd.Secp256k1Type), keyringAlgos) - if err != nil { - return err - } - - info, err := kb.NewAccount(name, mnemonic, "", sdk.FullFundraiserPath, algo) - if err != nil { - return err - } - - privKeyArmor, err := kb.ExportPrivKeyArmor(name, keyringPassphrase) - if err != nil { - return err - } - - privKey, _, err := sdkcrypto.UnarmorDecryptPrivKey(privKeyArmor, keyringPassphrase) - if err != nil { - return err - } - - v.keyInfo = info - v.mnemonic = mnemonic - v.privateKey = privKey - - return nil -} - -func (c *chain) addAccountFromMnemonic(counts int) error { - val0ConfigDir := c.validators[0].configDir() - kb, err := keyring.New(keyringAppName, keyring.BackendTest, val0ConfigDir, nil) - if err != nil { - return err - } - - keyringAlgos, _ := kb.SupportedAlgorithms() - algo, err := keyring.NewSigningAlgoFromString(string(hd.Secp256k1Type), keyringAlgos) - if err != nil { - return err - } - - for i := 0; i < counts; i++ { - name := fmt.Sprintf("acct-%d", i) - mnemonic, err := createMnemonic() - if err != nil { - return err - } - info, err := kb.NewAccount(name, mnemonic, "", sdk.FullFundraiserPath, algo) - if err != nil { - return err - } - - privKeyArmor, err := kb.ExportPrivKeyArmor(name, keyringPassphrase) - if err != nil { - return err - } - - privKey, _, err := sdkcrypto.UnarmorDecryptPrivKey(privKeyArmor, keyringPassphrase) - if err != nil { - return err - } - acct := account{} - acct.keyInfo = info - acct.mnemonic = mnemonic - acct.privateKey = privKey - c.genesisAccounts = append(c.genesisAccounts, &acct) - } - - return nil -} - -func (v *validator) createKey(name string) error { - mnemonic, err := createMnemonic() - if err != nil { - return err - } - - return v.createKeyFromMnemonic(name, mnemonic) -} - -func (v *validator) buildCreateValidatorMsg(amount sdk.Coin) (sdk.Msg, error) { - description := stakingtypes.NewDescription(v.moniker, "", "", "", "") - commissionRates := stakingtypes.CommissionRates{ - Rate: sdk.MustNewDecFromStr("0.1"), - MaxRate: sdk.MustNewDecFromStr("0.2"), - MaxChangeRate: sdk.MustNewDecFromStr("0.01"), - } - - // get the initial validator min self delegation - minSelfDelegation := sdk.OneInt() - - valPubKey, err := cryptocodec.FromTmPubKeyInterface(v.consensusKey.PubKey) - if err != nil { - return nil, err - } - - return stakingtypes.NewMsgCreateValidator( - sdk.ValAddress(v.keyInfo.GetAddress()), - valPubKey, - amount, - description, - commissionRates, - minSelfDelegation, - ) -} - -func (v *validator) signMsg(msgs ...sdk.Msg) (*sdktx.Tx, error) { - txBuilder := encodingConfig.TxConfig.NewTxBuilder() - - if err := txBuilder.SetMsgs(msgs...); err != nil { - return nil, err - } - - txBuilder.SetMemo(fmt.Sprintf("%s@%s:26656", v.nodeKey.ID(), v.instanceName())) - txBuilder.SetFeeAmount(sdk.NewCoins()) - txBuilder.SetGasLimit(200000) - - signerData := authsigning.SignerData{ - ChainID: v.chain.id, - AccountNumber: 0, - Sequence: 0, - } - - // For SIGN_MODE_DIRECT, calling SetSignatures calls setSignerInfos on - // TxBuilder under the hood, and SignerInfos is needed to generate the sign - // bytes. This is the reason for setting SetSignatures here, with a nil - // signature. - // - // Note: This line is not needed for SIGN_MODE_LEGACY_AMINO, but putting it - // also doesn't affect its generated sign bytes, so for code's simplicity - // sake, we put it here. - sig := txsigning.SignatureV2{ - PubKey: v.keyInfo.GetPubKey(), - Data: &txsigning.SingleSignatureData{ - SignMode: txsigning.SignMode_SIGN_MODE_DIRECT, - Signature: nil, - }, - Sequence: 0, - } - - if err := txBuilder.SetSignatures(sig); err != nil { - return nil, err - } - - bytesToSign, err := encodingConfig.TxConfig.SignModeHandler().GetSignBytes( - txsigning.SignMode_SIGN_MODE_DIRECT, - signerData, - txBuilder.GetTx(), - ) - if err != nil { - return nil, err - } - - sigBytes, err := v.privateKey.Sign(bytesToSign) - if err != nil { - return nil, err - } - - sig = txsigning.SignatureV2{ - PubKey: v.keyInfo.GetPubKey(), - Data: &txsigning.SingleSignatureData{ - SignMode: txsigning.SignMode_SIGN_MODE_DIRECT, - Signature: sigBytes, - }, - Sequence: 0, - } - if err := txBuilder.SetSignatures(sig); err != nil { - return nil, err - } - - signedTx := txBuilder.GetTx() - bz, err := encodingConfig.TxConfig.TxEncoder()(signedTx) - if err != nil { - return nil, err - } - - return decodeTx(bz) -} +// import ( +// "encoding/json" +// "fmt" +// "os" +// "path" +// "path/filepath" + +// sdkcrypto "github.com/cosmos/cosmos-sdk/crypto" +// cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" +// "github.com/cosmos/cosmos-sdk/crypto/hd" +// "github.com/cosmos/cosmos-sdk/crypto/keyring" +// cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" +// "github.com/cosmos/cosmos-sdk/server" +// 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" +// tmcfg "github.com/tendermint/tendermint/config" +// tmos "github.com/tendermint/tendermint/libs/os" +// "github.com/tendermint/tendermint/p2p" +// "github.com/tendermint/tendermint/privval" + +// gaia "github.com/cosmos/gaia/v11/app" +// ) + +// //nolint:unused +// type validator struct { +// chain *chain +// index int +// moniker string +// mnemonic string +// keyInfo keyring.Info +// privateKey cryptotypes.PrivKey +// consensusKey privval.FilePVKey +// consensusPrivKey cryptotypes.PrivKey +// nodeKey p2p.NodeKey +// } + +// type account struct { +// moniker string //nolint:unused +// mnemonic string +// keyInfo keyring.Info +// privateKey cryptotypes.PrivKey +// } + +// func (v *validator) instanceName() string { +// return fmt.Sprintf("%s%d", v.moniker, v.index) +// } + +// func (v *validator) configDir() string { +// return fmt.Sprintf("%s/%s", v.chain.configDir(), v.instanceName()) +// } + +// func (v *validator) createConfig() error { +// p := path.Join(v.configDir(), "config") +// return os.MkdirAll(p, 0o755) +// } + +// func (v *validator) init() error { +// if err := v.createConfig(); err != nil { +// return err +// } + +// serverCtx := server.NewDefaultContext() +// config := serverCtx.Config + +// config.SetRoot(v.configDir()) +// config.Moniker = v.moniker + +// genDoc, err := getGenDoc(v.configDir()) +// if err != nil { +// return err +// } + +// appState, err := json.MarshalIndent(gaia.ModuleBasics.DefaultGenesis(cdc), "", " ") +// if err != nil { +// return fmt.Errorf("failed to JSON encode app genesis state: %w", err) +// } + +// genDoc.ChainID = v.chain.id +// genDoc.Validators = nil +// genDoc.AppState = appState + +// if err = genutil.ExportGenesisFile(genDoc, config.GenesisFile()); err != nil { +// return fmt.Errorf("failed to export app genesis state: %w", err) +// } + +// tmcfg.WriteConfigFile(filepath.Join(config.RootDir, "config", "config.toml"), config) +// return nil +// } + +// func (v *validator) createNodeKey() error { +// serverCtx := server.NewDefaultContext() +// config := serverCtx.Config + +// config.SetRoot(v.configDir()) +// config.Moniker = v.moniker + +// nodeKey, err := p2p.LoadOrGenNodeKey(config.NodeKeyFile()) +// if err != nil { +// return err +// } + +// v.nodeKey = *nodeKey +// return nil +// } + +// func (v *validator) createConsensusKey() error { +// serverCtx := server.NewDefaultContext() +// config := serverCtx.Config + +// config.SetRoot(v.configDir()) +// config.Moniker = v.moniker + +// pvKeyFile := config.PrivValidatorKeyFile() +// if err := tmos.EnsureDir(filepath.Dir(pvKeyFile), 0o777); err != nil { +// return err +// } + +// pvStateFile := config.PrivValidatorStateFile() +// if err := tmos.EnsureDir(filepath.Dir(pvStateFile), 0o777); err != nil { +// return err +// } + +// filePV := privval.LoadOrGenFilePV(pvKeyFile, pvStateFile) +// v.consensusKey = filePV.Key + +// return nil +// } + +// func (v *validator) createKeyFromMnemonic(name, mnemonic string) error { +// dir := v.configDir() +// kb, err := keyring.New(keyringAppName, keyring.BackendTest, dir, nil) +// if err != nil { +// return err +// } + +// keyringAlgos, _ := kb.SupportedAlgorithms() +// algo, err := keyring.NewSigningAlgoFromString(string(hd.Secp256k1Type), keyringAlgos) +// if err != nil { +// return err +// } + +// info, err := kb.NewAccount(name, mnemonic, "", sdk.FullFundraiserPath, algo) +// if err != nil { +// return err +// } + +// privKeyArmor, err := kb.ExportPrivKeyArmor(name, keyringPassphrase) +// if err != nil { +// return err +// } + +// privKey, _, err := sdkcrypto.UnarmorDecryptPrivKey(privKeyArmor, keyringPassphrase) +// if err != nil { +// return err +// } + +// v.keyInfo = info +// v.mnemonic = mnemonic +// v.privateKey = privKey + +// return nil +// } + +// func (c *chain) addAccountFromMnemonic(counts int) error { +// val0ConfigDir := c.validators[0].configDir() +// kb, err := keyring.New(keyringAppName, keyring.BackendTest, val0ConfigDir, nil) +// if err != nil { +// return err +// } + +// keyringAlgos, _ := kb.SupportedAlgorithms() +// algo, err := keyring.NewSigningAlgoFromString(string(hd.Secp256k1Type), keyringAlgos) +// if err != nil { +// return err +// } + +// for i := 0; i < counts; i++ { +// name := fmt.Sprintf("acct-%d", i) +// mnemonic, err := createMnemonic() +// if err != nil { +// return err +// } +// info, err := kb.NewAccount(name, mnemonic, "", sdk.FullFundraiserPath, algo) +// if err != nil { +// return err +// } + +// privKeyArmor, err := kb.ExportPrivKeyArmor(name, keyringPassphrase) +// if err != nil { +// return err +// } + +// privKey, _, err := sdkcrypto.UnarmorDecryptPrivKey(privKeyArmor, keyringPassphrase) +// if err != nil { +// return err +// } +// acct := account{} +// acct.keyInfo = info +// acct.mnemonic = mnemonic +// acct.privateKey = privKey +// c.genesisAccounts = append(c.genesisAccounts, &acct) +// } + +// return nil +// } + +// func (v *validator) createKey(name string) error { +// mnemonic, err := createMnemonic() +// if err != nil { +// return err +// } + +// return v.createKeyFromMnemonic(name, mnemonic) +// } + +// func (v *validator) buildCreateValidatorMsg(amount sdk.Coin) (sdk.Msg, error) { +// description := stakingtypes.NewDescription(v.moniker, "", "", "", "") +// commissionRates := stakingtypes.CommissionRates{ +// Rate: sdk.MustNewDecFromStr("0.1"), +// MaxRate: sdk.MustNewDecFromStr("0.2"), +// MaxChangeRate: sdk.MustNewDecFromStr("0.01"), +// } + +// // get the initial validator min self delegation +// minSelfDelegation := sdk.OneInt() + +// valPubKey, err := cryptocodec.FromTmPubKeyInterface(v.consensusKey.PubKey) +// if err != nil { +// return nil, err +// } + +// return stakingtypes.NewMsgCreateValidator( +// sdk.ValAddress(v.keyInfo.GetAddress()), +// valPubKey, +// amount, +// description, +// commissionRates, +// minSelfDelegation, +// ) +// } + +// func (v *validator) signMsg(msgs ...sdk.Msg) (*sdktx.Tx, error) { +// txBuilder := encodingConfig.TxConfig.NewTxBuilder() + +// if err := txBuilder.SetMsgs(msgs...); err != nil { +// return nil, err +// } + +// txBuilder.SetMemo(fmt.Sprintf("%s@%s:26656", v.nodeKey.ID(), v.instanceName())) +// txBuilder.SetFeeAmount(sdk.NewCoins()) +// txBuilder.SetGasLimit(200000) + +// signerData := authsigning.SignerData{ +// ChainID: v.chain.id, +// AccountNumber: 0, +// Sequence: 0, +// } + +// // For SIGN_MODE_DIRECT, calling SetSignatures calls setSignerInfos on +// // TxBuilder under the hood, and SignerInfos is needed to generate the sign +// // bytes. This is the reason for setting SetSignatures here, with a nil +// // signature. +// // +// // Note: This line is not needed for SIGN_MODE_LEGACY_AMINO, but putting it +// // also doesn't affect its generated sign bytes, so for code's simplicity +// // sake, we put it here. +// sig := txsigning.SignatureV2{ +// PubKey: v.keyInfo.GetPubKey(), +// Data: &txsigning.SingleSignatureData{ +// SignMode: txsigning.SignMode_SIGN_MODE_DIRECT, +// Signature: nil, +// }, +// Sequence: 0, +// } + +// if err := txBuilder.SetSignatures(sig); err != nil { +// return nil, err +// } + +// bytesToSign, err := encodingConfig.TxConfig.SignModeHandler().GetSignBytes( +// txsigning.SignMode_SIGN_MODE_DIRECT, +// signerData, +// txBuilder.GetTx(), +// ) +// if err != nil { +// return nil, err +// } + +// sigBytes, err := v.privateKey.Sign(bytesToSign) +// if err != nil { +// return nil, err +// } + +// sig = txsigning.SignatureV2{ +// PubKey: v.keyInfo.GetPubKey(), +// Data: &txsigning.SingleSignatureData{ +// SignMode: txsigning.SignMode_SIGN_MODE_DIRECT, +// Signature: sigBytes, +// }, +// Sequence: 0, +// } +// if err := txBuilder.SetSignatures(sig); err != nil { +// return nil, err +// } + +// signedTx := txBuilder.GetTx() +// bz, err := encodingConfig.TxConfig.TxEncoder()(signedTx) +// if err != nil { +// return nil, err +// } + +// return decodeTx(bz) +// } diff --git a/tests/ics/interchain_security_test.go b/tests/ics/interchain_security_test.go index c6572711b0..5a5179b701 100644 --- a/tests/ics/interchain_security_test.go +++ b/tests/ics/interchain_security_test.go @@ -4,14 +4,14 @@ import ( "encoding/json" "testing" - appConsumer "github.com/cosmos/interchain-security/v2/app/consumer" - "github.com/cosmos/interchain-security/v2/tests/integration" - icstestingutils "github.com/cosmos/interchain-security/v2/testutil/ibc_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" - ibctesting "github.com/cosmos/interchain-security/v2/legacy_ibc_testing/testing" - "github.com/tendermint/tendermint/libs/log" - tmdb "github.com/tendermint/tm-db" + cmdb "github.com/cometbft/cometbft-db" + "github.com/cometbft/cometbft/libs/log" + ibctesting "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/testing" gaiaApp "github.com/cosmos/gaia/v11/app" ) @@ -30,9 +30,17 @@ func TestCCVTestSuite(t *testing.T) { // GaiaAppIniter implements ibctesting.AppIniter for the gaia app func GaiaAppIniter() (ibctesting.TestingApp, map[string]json.RawMessage) { - encoding := gaiaApp.MakeTestEncodingConfig() - app := gaiaApp.NewGaiaApp(log.NewNopLogger(), tmdb.NewMemDB(), nil, true, map[int64]bool{}, - gaiaApp.DefaultNodeHome, 5, encoding, gaiaApp.EmptyAppOptions{}) + encoding := gaiaApp.RegisterEncodingConfig() + app := gaiaApp.NewGaiaApp( + log.NewNopLogger(), + cmdb.NewMemDB(), + nil, + true, + map[int64]bool{}, + gaiaApp.DefaultNodeHome, + encoding, + gaiaApp.EmptyAppOptions{}) + testApp := ibctesting.TestingApp(app) - return testApp, gaiaApp.NewDefaultGenesisState() + return testApp, gaiaApp.NewDefaultGenesisState(encoding) } diff --git a/third_party/proto/cosmos/auth/v1beta1/auth.proto b/third_party/proto/cosmos/auth/v1beta1/auth.proto deleted file mode 100644 index 72e1d9ec28..0000000000 --- a/third_party/proto/cosmos/auth/v1beta1/auth.proto +++ /dev/null @@ -1,50 +0,0 @@ -syntax = "proto3"; -package cosmos.auth.v1beta1; - -import "cosmos_proto/cosmos.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; - -// BaseAccount defines a base account type. It contains all the necessary fields -// for basic account functionality. Any custom account type should extend this -// type for additional functionality (e.g. vesting). -message BaseAccount { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.equal) = false; - - option (cosmos_proto.implements_interface) = "AccountI"; - - string address = 1; - google.protobuf.Any pub_key = 2 - [(gogoproto.jsontag) = "public_key,omitempty", (gogoproto.moretags) = "yaml:\"public_key\""]; - uint64 account_number = 3 [(gogoproto.moretags) = "yaml:\"account_number\""]; - uint64 sequence = 4; -} - -// ModuleAccount defines an account for modules that holds coins on a pool. -message ModuleAccount { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - option (cosmos_proto.implements_interface) = "ModuleAccountI"; - - BaseAccount base_account = 1 [(gogoproto.embed) = true, (gogoproto.moretags) = "yaml:\"base_account\""]; - string name = 2; - repeated string permissions = 3; -} - -// Params defines the parameters for the auth module. -message Params { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - uint64 max_memo_characters = 1 [(gogoproto.moretags) = "yaml:\"max_memo_characters\""]; - uint64 tx_sig_limit = 2 [(gogoproto.moretags) = "yaml:\"tx_sig_limit\""]; - uint64 tx_size_cost_per_byte = 3 [(gogoproto.moretags) = "yaml:\"tx_size_cost_per_byte\""]; - uint64 sig_verify_cost_ed25519 = 4 - [(gogoproto.customname) = "SigVerifyCostED25519", (gogoproto.moretags) = "yaml:\"sig_verify_cost_ed25519\""]; - uint64 sig_verify_cost_secp256k1 = 5 - [(gogoproto.customname) = "SigVerifyCostSecp256k1", (gogoproto.moretags) = "yaml:\"sig_verify_cost_secp256k1\""]; -} diff --git a/third_party/proto/cosmos/auth/v1beta1/genesis.proto b/third_party/proto/cosmos/auth/v1beta1/genesis.proto deleted file mode 100644 index c88b94ee4e..0000000000 --- a/third_party/proto/cosmos/auth/v1beta1/genesis.proto +++ /dev/null @@ -1,17 +0,0 @@ -syntax = "proto3"; -package cosmos.auth.v1beta1; - -import "google/protobuf/any.proto"; -import "gogoproto/gogo.proto"; -import "cosmos/auth/v1beta1/auth.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; - -// GenesisState defines the auth module's genesis state. -message GenesisState { - // params defines all the paramaters of the module. - Params params = 1 [(gogoproto.nullable) = false]; - - // accounts are the accounts present at genesis. - repeated google.protobuf.Any accounts = 2; -} diff --git a/third_party/proto/cosmos/auth/v1beta1/query.proto b/third_party/proto/cosmos/auth/v1beta1/query.proto deleted file mode 100644 index 79799a4b71..0000000000 --- a/third_party/proto/cosmos/auth/v1beta1/query.proto +++ /dev/null @@ -1,89 +0,0 @@ -syntax = "proto3"; -package cosmos.auth.v1beta1; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "google/api/annotations.proto"; -import "cosmos/auth/v1beta1/auth.proto"; -import "cosmos_proto/cosmos.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; - -// Query defines the gRPC querier service. -service Query { - // Accounts returns all the existing accounts - // - // Since: cosmos-sdk 0.43 - rpc Accounts(QueryAccountsRequest) returns (QueryAccountsResponse) { - option (google.api.http).get = "/cosmos/auth/v1beta1/accounts"; - } - - // Account returns account details based on address. - rpc Account(QueryAccountRequest) returns (QueryAccountResponse) { - option (google.api.http).get = "/cosmos/auth/v1beta1/accounts/{address}"; - } - - // Params queries all parameters. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/auth/v1beta1/params"; - } - - // ModuleAccountByName returns the module account info by module name - rpc ModuleAccountByName(QueryModuleAccountByNameRequest) returns (QueryModuleAccountByNameResponse) { - option (google.api.http).get = "/cosmos/auth/v1beta1/module_accounts/{name}"; - } -} - -// QueryAccountsRequest is the request type for the Query/Accounts RPC method. -// -// Since: cosmos-sdk 0.43 -message QueryAccountsRequest { - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QueryAccountsResponse is the response type for the Query/Accounts RPC method. -// -// Since: cosmos-sdk 0.43 -message QueryAccountsResponse { - // accounts are the existing accounts - repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "AccountI"]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryAccountRequest is the request type for the Query/Account RPC method. -message QueryAccountRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // address defines the address to query for. - string address = 1; -} - -// QueryAccountResponse is the response type for the Query/Account RPC method. -message QueryAccountResponse { - // account defines the account of the corresponding address. - google.protobuf.Any account = 1 [(cosmos_proto.accepts_interface) = "AccountI"]; -} - -// QueryParamsRequest is the request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is the response type for the Query/Params RPC method. -message QueryParamsResponse { - // params defines the parameters of the module. - Params params = 1 [(gogoproto.nullable) = false]; -} - -// QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. -message QueryModuleAccountByNameRequest { - string name = 1; -} - -// QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. -message QueryModuleAccountByNameResponse { - google.protobuf.Any account = 1 [(cosmos_proto.accepts_interface) = "ModuleAccountI"]; -} \ No newline at end of file diff --git a/third_party/proto/cosmos/authz/v1beta1/authz.proto b/third_party/proto/cosmos/authz/v1beta1/authz.proto deleted file mode 100644 index 05b1feefa4..0000000000 --- a/third_party/proto/cosmos/authz/v1beta1/authz.proto +++ /dev/null @@ -1,39 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.authz.v1beta1; - -import "cosmos_proto/cosmos.proto"; -import "google/protobuf/timestamp.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; -option (gogoproto.goproto_getters_all) = false; - -// GenericAuthorization gives the grantee unrestricted permissions to execute -// the provided method on behalf of the granter's account. -message GenericAuthorization { - option (cosmos_proto.implements_interface) = "Authorization"; - - // Msg, identified by it's type URL, to grant unrestricted permissions to execute - string msg = 1; -} - -// Grant gives permissions to execute -// the provide method with expiration time. -message Grant { - google.protobuf.Any authorization = 1 [(cosmos_proto.accepts_interface) = "Authorization"]; - google.protobuf.Timestamp expiration = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; -} - -// GrantAuthorization extends a grant with both the addresses of the grantee and granter. -// It is used in genesis.proto and query.proto -// -// Since: cosmos-sdk 0.45.2 -message GrantAuthorization { - string granter = 1; - string grantee = 2; - - google.protobuf.Any authorization = 3 [(cosmos_proto.accepts_interface) = "Authorization"]; - google.protobuf.Timestamp expiration = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; -} diff --git a/third_party/proto/cosmos/authz/v1beta1/event.proto b/third_party/proto/cosmos/authz/v1beta1/event.proto deleted file mode 100644 index 7a3cf7c8cf..0000000000 --- a/third_party/proto/cosmos/authz/v1beta1/event.proto +++ /dev/null @@ -1,25 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.authz.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; - -// EventGrant is emitted on Msg/Grant -message EventGrant { - // Msg type URL for which an autorization is granted - string msg_type_url = 2; - // Granter account address - string granter = 3; - // Grantee account address - string grantee = 4; -} - -// EventRevoke is emitted on Msg/Revoke -message EventRevoke { - // Msg type URL for which an autorization is revoked - string msg_type_url = 2; - // Granter account address - string granter = 3; - // Grantee account address - string grantee = 4; -} diff --git a/third_party/proto/cosmos/authz/v1beta1/genesis.proto b/third_party/proto/cosmos/authz/v1beta1/genesis.proto deleted file mode 100644 index 310f62656f..0000000000 --- a/third_party/proto/cosmos/authz/v1beta1/genesis.proto +++ /dev/null @@ -1,13 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.authz.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/authz/v1beta1/authz.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; - -// GenesisState defines the authz module's genesis state. -message GenesisState { - repeated GrantAuthorization authorization = 1 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/cosmos/authz/v1beta1/query.proto b/third_party/proto/cosmos/authz/v1beta1/query.proto deleted file mode 100644 index f668309bed..0000000000 --- a/third_party/proto/cosmos/authz/v1beta1/query.proto +++ /dev/null @@ -1,81 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.authz.v1beta1; - -import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "cosmos/authz/v1beta1/authz.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; - -// Query defines the gRPC querier service. -service Query { - // Returns list of `Authorization`, granted to the grantee by the granter. - rpc Grants(QueryGrantsRequest) returns (QueryGrantsResponse) { - option (google.api.http).get = "/cosmos/authz/v1beta1/grants"; - } - - // GranterGrants returns list of `GrantAuthorization`, granted by granter. - // - // Since: cosmos-sdk 0.45.2 - rpc GranterGrants(QueryGranterGrantsRequest) returns (QueryGranterGrantsResponse) { - option (google.api.http).get = "/cosmos/authz/v1beta1/grants/granter/{granter}"; - } - - // GranteeGrants returns a list of `GrantAuthorization` by grantee. - // - // Since: cosmos-sdk 0.45.2 - rpc GranteeGrants(QueryGranteeGrantsRequest) returns (QueryGranteeGrantsResponse) { - option (google.api.http).get = "/cosmos/authz/v1beta1/grants/grantee/{grantee}"; - } -} - -// QueryGrantsRequest is the request type for the Query/Grants RPC method. -message QueryGrantsRequest { - string granter = 1; - string grantee = 2; - // Optional, msg_type_url, when set, will query only grants matching given msg type. - string msg_type_url = 3; - // pagination defines an pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 4; -} - -// QueryGrantsResponse is the response type for the Query/Authorizations RPC method. -message QueryGrantsResponse { - // authorizations is a list of grants granted for grantee by granter. - repeated Grant grants = 1; - // pagination defines an pagination for the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. -message QueryGranterGrantsRequest { - string granter = 1; - - // pagination defines an pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. -message QueryGranterGrantsResponse { - // grants is a list of grants granted by the granter. - repeated GrantAuthorization grants = 1; - // pagination defines an pagination for the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. -message QueryGranteeGrantsRequest { - string grantee = 1; - - // pagination defines an pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. -message QueryGranteeGrantsResponse { - // grants is a list of grants granted to the grantee. - repeated GrantAuthorization grants = 1; - // pagination defines an pagination for the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} diff --git a/third_party/proto/cosmos/authz/v1beta1/tx.proto b/third_party/proto/cosmos/authz/v1beta1/tx.proto deleted file mode 100644 index 457f0d662a..0000000000 --- a/third_party/proto/cosmos/authz/v1beta1/tx.proto +++ /dev/null @@ -1,70 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.authz.v1beta1; - -import "cosmos_proto/cosmos.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/any.proto"; -import "cosmos/base/abci/v1beta1/abci.proto"; -import "cosmos/authz/v1beta1/authz.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; -option (gogoproto.goproto_getters_all) = false; - -// Msg defines the authz Msg service. -service Msg { - // Grant grants the provided authorization to the grantee on the granter's - // account with the provided expiration time. If there is already a grant - // for the given (granter, grantee, Authorization) triple, then the grant - // will be overwritten. - rpc Grant(MsgGrant) returns (MsgGrantResponse); - - // Exec attempts to execute the provided messages using - // authorizations granted to the grantee. Each message should have only - // one signer corresponding to the granter of the authorization. - rpc Exec(MsgExec) returns (MsgExecResponse); - - // Revoke revokes any authorization corresponding to the provided method name on the - // granter's account that has been granted to the grantee. - rpc Revoke(MsgRevoke) returns (MsgRevokeResponse); -} - -// MsgGrant is a request type for Grant method. It declares authorization to the grantee -// on behalf of the granter with the provided expiration time. -message MsgGrant { - string granter = 1; - string grantee = 2; - - cosmos.authz.v1beta1.Grant grant = 3 [(gogoproto.nullable) = false]; -} - -// MsgExecResponse defines the Msg/MsgExecResponse response type. -message MsgExecResponse { - repeated bytes results = 1; -} - -// MsgExec attempts to execute the provided messages using -// authorizations granted to the grantee. Each message should have only -// one signer corresponding to the granter of the authorization. -message MsgExec { - string grantee = 1; - // Authorization Msg requests to execute. Each msg must implement Authorization interface - // The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) - // triple and validate it. - repeated google.protobuf.Any msgs = 2 [(cosmos_proto.accepts_interface) = "sdk.Msg, authz.Authorization"]; -} - -// MsgGrantResponse defines the Msg/MsgGrant response type. -message MsgGrantResponse {} - -// MsgRevoke revokes any authorization with the provided sdk.Msg type on the -// granter's account with that has been granted to the grantee. -message MsgRevoke { - string granter = 1; - string grantee = 2; - string msg_type_url = 3; -} - -// MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. -message MsgRevokeResponse {} diff --git a/third_party/proto/cosmos/bank/v1beta1/authz.proto b/third_party/proto/cosmos/bank/v1beta1/authz.proto deleted file mode 100644 index 4f58b15e49..0000000000 --- a/third_party/proto/cosmos/bank/v1beta1/authz.proto +++ /dev/null @@ -1,19 +0,0 @@ -syntax = "proto3"; -package cosmos.bank.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/base/v1beta1/coin.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; - -// SendAuthorization allows the grantee to spend up to spend_limit coins from -// the granter's account. -// -// Since: cosmos-sdk 0.43 -message SendAuthorization { - option (cosmos_proto.implements_interface) = "Authorization"; - - repeated cosmos.base.v1beta1.Coin spend_limit = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; -} diff --git a/third_party/proto/cosmos/bank/v1beta1/bank.proto b/third_party/proto/cosmos/bank/v1beta1/bank.proto deleted file mode 100644 index df91008df6..0000000000 --- a/third_party/proto/cosmos/bank/v1beta1/bank.proto +++ /dev/null @@ -1,96 +0,0 @@ -syntax = "proto3"; -package cosmos.bank.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/base/v1beta1/coin.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; - -// Params defines the parameters for the bank module. -message Params { - option (gogoproto.goproto_stringer) = false; - repeated SendEnabled send_enabled = 1 [(gogoproto.moretags) = "yaml:\"send_enabled,omitempty\""]; - bool default_send_enabled = 2 [(gogoproto.moretags) = "yaml:\"default_send_enabled,omitempty\""]; -} - -// SendEnabled maps coin denom to a send_enabled status (whether a denom is -// sendable). -message SendEnabled { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - string denom = 1; - bool enabled = 2; -} - -// Input models transaction input. -message Input { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string address = 1; - repeated cosmos.base.v1beta1.Coin coins = 2 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; -} - -// Output models transaction outputs. -message Output { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string address = 1; - repeated cosmos.base.v1beta1.Coin coins = 2 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; -} - -// Supply represents a struct that passively keeps track of the total supply -// amounts in the network. -// This message is deprecated now that supply is indexed by denom. -message Supply { - option deprecated = true; - - option (gogoproto.equal) = true; - option (gogoproto.goproto_getters) = false; - - option (cosmos_proto.implements_interface) = "*github.com/cosmos/cosmos-sdk/x/bank/legacy/v040.SupplyI"; - - repeated cosmos.base.v1beta1.Coin total = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; -} - -// DenomUnit represents a struct that describes a given -// denomination unit of the basic token. -message DenomUnit { - // denom represents the string name of the given denom unit (e.g uatom). - string denom = 1; - // exponent represents power of 10 exponent that one must - // raise the base_denom to in order to equal the given DenomUnit's denom - // 1 denom = 1^exponent base_denom - // (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with - // exponent = 6, thus: 1 atom = 10^6 uatom). - uint32 exponent = 2; - // aliases is a list of string aliases for the given denom - repeated string aliases = 3; -} - -// Metadata represents a struct that describes -// a basic token. -message Metadata { - string description = 1; - // denom_units represents the list of DenomUnit's for a given coin - repeated DenomUnit denom_units = 2; - // base represents the base denom (should be the DenomUnit with exponent = 0). - string base = 3; - // display indicates the suggested denom that should be - // displayed in clients. - string display = 4; - // name defines the name of the token (eg: Cosmos Atom) - // - // Since: cosmos-sdk 0.43 - string name = 5; - // symbol is the token symbol usually shown on exchanges (eg: ATOM). This can - // be the same as the display. - // - // Since: cosmos-sdk 0.43 - string symbol = 6; -} diff --git a/third_party/proto/cosmos/bank/v1beta1/genesis.proto b/third_party/proto/cosmos/bank/v1beta1/genesis.proto deleted file mode 100644 index 8fd7329a0a..0000000000 --- a/third_party/proto/cosmos/bank/v1beta1/genesis.proto +++ /dev/null @@ -1,39 +0,0 @@ -syntax = "proto3"; -package cosmos.bank.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/bank/v1beta1/bank.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; - -// GenesisState defines the bank module's genesis state. -message GenesisState { - // params defines all the paramaters of the module. - Params params = 1 [(gogoproto.nullable) = false]; - - // balances is an array containing the balances of all the accounts. - repeated Balance balances = 2 [(gogoproto.nullable) = false]; - - // supply represents the total supply. If it is left empty, then supply will be calculated based on the provided - // balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. - repeated cosmos.base.v1beta1.Coin supply = 3 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; - - // denom_metadata defines the metadata of the differents coins. - repeated Metadata denom_metadata = 4 [(gogoproto.moretags) = "yaml:\"denom_metadata\"", (gogoproto.nullable) = false]; -} - -// Balance defines an account address and balance pair used in the bank module's -// genesis state. -message Balance { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // address is the address of the balance holder. - string address = 1; - - // coins defines the different coins this balance holds. - repeated cosmos.base.v1beta1.Coin coins = 2 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; -} diff --git a/third_party/proto/cosmos/bank/v1beta1/query.proto b/third_party/proto/cosmos/bank/v1beta1/query.proto deleted file mode 100644 index a567e073f3..0000000000 --- a/third_party/proto/cosmos/bank/v1beta1/query.proto +++ /dev/null @@ -1,193 +0,0 @@ -syntax = "proto3"; -package cosmos.bank.v1beta1; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/bank/v1beta1/bank.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; - -// Query defines the gRPC querier service. -service Query { - // Balance queries the balance of a single coin for a single account. - rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}/by_denom"; - } - - // AllBalances queries the balance of all coins for a single account. - rpc AllBalances(QueryAllBalancesRequest) returns (QueryAllBalancesResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}"; - } - - // SpendableBalances queries the spenable balance of all coins for a single - // account. - rpc SpendableBalances(QuerySpendableBalancesRequest) returns (QuerySpendableBalancesResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/spendable_balances/{address}"; - } - - // TotalSupply queries the total supply of all coins. - rpc TotalSupply(QueryTotalSupplyRequest) returns (QueryTotalSupplyResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/supply"; - } - - // SupplyOf queries the supply of a single coin. - rpc SupplyOf(QuerySupplyOfRequest) returns (QuerySupplyOfResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/supply/{denom}"; - } - - // Params queries the parameters of x/bank module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/params"; - } - - // DenomsMetadata queries the client metadata of a given coin denomination. - rpc DenomMetadata(QueryDenomMetadataRequest) returns (QueryDenomMetadataResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata/{denom}"; - } - - // DenomsMetadata queries the client metadata for all registered coin denominations. - rpc DenomsMetadata(QueryDenomsMetadataRequest) returns (QueryDenomsMetadataResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata"; - } -} - -// QueryBalanceRequest is the request type for the Query/Balance RPC method. -message QueryBalanceRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // address is the address to query balances for. - string address = 1; - - // denom is the coin denom to query balances for. - string denom = 2; -} - -// QueryBalanceResponse is the response type for the Query/Balance RPC method. -message QueryBalanceResponse { - // balance is the balance of the coin. - cosmos.base.v1beta1.Coin balance = 1; -} - -// QueryBalanceRequest is the request type for the Query/AllBalances RPC method. -message QueryAllBalancesRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // address is the address to query balances for. - string address = 1; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryAllBalancesResponse is the response type for the Query/AllBalances RPC -// method. -message QueryAllBalancesResponse { - // balances is the balances of all the coins. - repeated cosmos.base.v1beta1.Coin balances = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QuerySpendableBalancesRequest defines the gRPC request structure for querying -// an account's spendable balances. -message QuerySpendableBalancesRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // address is the address to query spendable balances for. - string address = 1; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QuerySpendableBalancesResponse defines the gRPC response structure for querying -// an account's spendable balances. -message QuerySpendableBalancesResponse { - // balances is the spendable balances of all the coins. - repeated cosmos.base.v1beta1.Coin balances = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC -// method. -message QueryTotalSupplyRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // pagination defines an optional pagination for the request. - // - // Since: cosmos-sdk 0.43 - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC -// method -message QueryTotalSupplyResponse { - // supply is the supply of the coins - repeated cosmos.base.v1beta1.Coin supply = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - - // pagination defines the pagination in the response. - // - // Since: cosmos-sdk 0.43 - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. -message QuerySupplyOfRequest { - // denom is the coin denom to query balances for. - string denom = 1; -} - -// QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. -message QuerySupplyOfResponse { - // amount is the supply of the coin. - cosmos.base.v1beta1.Coin amount = 1 [(gogoproto.nullable) = false]; -} - -// QueryParamsRequest defines the request type for querying x/bank parameters. -message QueryParamsRequest {} - -// QueryParamsResponse defines the response type for querying x/bank parameters. -message QueryParamsResponse { - Params params = 1 [(gogoproto.nullable) = false]; -} - -// QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. -message QueryDenomsMetadataRequest { - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC -// method. -message QueryDenomsMetadataResponse { - // metadata provides the client information for all the registered tokens. - repeated Metadata metadatas = 1 [(gogoproto.nullable) = false]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. -message QueryDenomMetadataRequest { - // denom is the coin denom to query the metadata for. - string denom = 1; -} - -// QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC -// method. -message QueryDenomMetadataResponse { - // metadata describes and provides all the client information for the requested token. - Metadata metadata = 1 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/cosmos/bank/v1beta1/tx.proto b/third_party/proto/cosmos/bank/v1beta1/tx.proto deleted file mode 100644 index 26b2ab41f4..0000000000 --- a/third_party/proto/cosmos/bank/v1beta1/tx.proto +++ /dev/null @@ -1,42 +0,0 @@ -syntax = "proto3"; -package cosmos.bank.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/bank/v1beta1/bank.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; - -// Msg defines the bank Msg service. -service Msg { - // Send defines a method for sending coins from one account to another account. - rpc Send(MsgSend) returns (MsgSendResponse); - - // MultiSend defines a method for sending coins from some accounts to other accounts. - rpc MultiSend(MsgMultiSend) returns (MsgMultiSendResponse); -} - -// MsgSend represents a message to send coins from one account to another. -message MsgSend { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string from_address = 1 [(gogoproto.moretags) = "yaml:\"from_address\""]; - string to_address = 2 [(gogoproto.moretags) = "yaml:\"to_address\""]; - repeated cosmos.base.v1beta1.Coin amount = 3 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; -} - -// MsgSendResponse defines the Msg/Send response type. -message MsgSendResponse {} - -// MsgMultiSend represents an arbitrary multi-in, multi-out send message. -message MsgMultiSend { - option (gogoproto.equal) = false; - - repeated Input inputs = 1 [(gogoproto.nullable) = false]; - repeated Output outputs = 2 [(gogoproto.nullable) = false]; -} - -// MsgMultiSendResponse defines the Msg/MultiSend response type. -message MsgMultiSendResponse {} diff --git a/third_party/proto/cosmos/base/abci/v1beta1/abci.proto b/third_party/proto/cosmos/base/abci/v1beta1/abci.proto deleted file mode 100644 index e24ae7bd5e..0000000000 --- a/third_party/proto/cosmos/base/abci/v1beta1/abci.proto +++ /dev/null @@ -1,144 +0,0 @@ -syntax = "proto3"; -package cosmos.base.abci.v1beta1; - -import "gogoproto/gogo.proto"; -import "tendermint/abci/types.proto"; -import "google/protobuf/any.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/types"; -option (gogoproto.goproto_stringer_all) = false; - -// TxResponse defines a structure containing relevant tx data and metadata. The -// tags are stringified and the log is JSON decoded. -message TxResponse { - option (gogoproto.goproto_getters) = false; - // The block height - int64 height = 1; - // The transaction hash. - string txhash = 2 [(gogoproto.customname) = "TxHash"]; - // Namespace for the Code - string codespace = 3; - // Response code. - uint32 code = 4; - // Result bytes, if any. - string data = 5; - // The output of the application's logger (raw string). May be - // non-deterministic. - string raw_log = 6; - // The output of the application's logger (typed). May be non-deterministic. - repeated ABCIMessageLog logs = 7 [(gogoproto.castrepeated) = "ABCIMessageLogs", (gogoproto.nullable) = false]; - // Additional information. May be non-deterministic. - string info = 8; - // Amount of gas requested for transaction. - int64 gas_wanted = 9; - // Amount of gas consumed by transaction. - int64 gas_used = 10; - // The request transaction bytes. - google.protobuf.Any tx = 11; - // Time of the previous block. For heights > 1, it's the weighted median of - // the timestamps of the valid votes in the block.LastCommit. For height == 1, - // it's genesis time. - string timestamp = 12; - // Events defines all the events emitted by processing a transaction. Note, - // these events include those emitted by processing all the messages and those - // emitted from the ante handler. Whereas Logs contains the events, with - // additional metadata, emitted only by processing the messages. - // - // Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 - repeated tendermint.abci.Event events = 13 [(gogoproto.nullable) = false]; -} - -// ABCIMessageLog defines a structure containing an indexed tx ABCI message log. -message ABCIMessageLog { - option (gogoproto.stringer) = true; - - uint32 msg_index = 1; - string log = 2; - - // Events contains a slice of Event objects that were emitted during some - // execution. - repeated StringEvent events = 3 [(gogoproto.castrepeated) = "StringEvents", (gogoproto.nullable) = false]; -} - -// StringEvent defines en Event object wrapper where all the attributes -// contain key/value pairs that are strings instead of raw bytes. -message StringEvent { - option (gogoproto.stringer) = true; - - string type = 1; - repeated Attribute attributes = 2 [(gogoproto.nullable) = false]; -} - -// Attribute defines an attribute wrapper where the key and value are -// strings instead of raw bytes. -message Attribute { - string key = 1; - string value = 2; -} - -// GasInfo defines tx execution gas context. -message GasInfo { - // GasWanted is the maximum units of work we allow this tx to perform. - uint64 gas_wanted = 1 [(gogoproto.moretags) = "yaml:\"gas_wanted\""]; - - // GasUsed is the amount of gas actually consumed. - uint64 gas_used = 2 [(gogoproto.moretags) = "yaml:\"gas_used\""]; -} - -// Result is the union of ResponseFormat and ResponseCheckTx. -message Result { - option (gogoproto.goproto_getters) = false; - - // Data is any data returned from message or handler execution. It MUST be - // length prefixed in order to separate data from multiple message executions. - bytes data = 1; - - // Log contains the log information from message or handler execution. - string log = 2; - - // Events contains a slice of Event objects that were emitted during message - // or handler execution. - repeated tendermint.abci.Event events = 3 [(gogoproto.nullable) = false]; -} - -// SimulationResponse defines the response generated when a transaction is -// successfully simulated. -message SimulationResponse { - GasInfo gas_info = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; - Result result = 2; -} - -// MsgData defines the data returned in a Result object during message -// execution. -message MsgData { - option (gogoproto.stringer) = true; - - string msg_type = 1; - bytes data = 2; -} - -// TxMsgData defines a list of MsgData. A transaction will have a MsgData object -// for each message. -message TxMsgData { - option (gogoproto.stringer) = true; - - repeated MsgData data = 1; -} - -// SearchTxsResult defines a structure for querying txs pageable -message SearchTxsResult { - option (gogoproto.stringer) = true; - - // Count of all txs - uint64 total_count = 1 [(gogoproto.moretags) = "yaml:\"total_count\"", (gogoproto.jsontag) = "total_count"]; - // Count of txs in current page - uint64 count = 2; - // Index of current page, start from 1 - uint64 page_number = 3 [(gogoproto.moretags) = "yaml:\"page_number\"", (gogoproto.jsontag) = "page_number"]; - // Count of total pages - uint64 page_total = 4 [(gogoproto.moretags) = "yaml:\"page_total\"", (gogoproto.jsontag) = "page_total"]; - // Max count txs per page - uint64 limit = 5; - // List of txs in current page - repeated TxResponse txs = 6; -} diff --git a/third_party/proto/cosmos/base/kv/v1beta1/kv.proto b/third_party/proto/cosmos/base/kv/v1beta1/kv.proto deleted file mode 100644 index 4e9b8d2850..0000000000 --- a/third_party/proto/cosmos/base/kv/v1beta1/kv.proto +++ /dev/null @@ -1,17 +0,0 @@ -syntax = "proto3"; -package cosmos.base.kv.v1beta1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/types/kv"; - -// Pairs defines a repeated slice of Pair objects. -message Pairs { - repeated Pair pairs = 1 [(gogoproto.nullable) = false]; -} - -// Pair defines a key/value bytes tuple. -message Pair { - bytes key = 1; - bytes value = 2; -} diff --git a/third_party/proto/cosmos/base/node/v1beta1/query.proto b/third_party/proto/cosmos/base/node/v1beta1/query.proto deleted file mode 100644 index 8070f7b904..0000000000 --- a/third_party/proto/cosmos/base/node/v1beta1/query.proto +++ /dev/null @@ -1,22 +0,0 @@ -syntax = "proto3"; -package cosmos.base.node.v1beta1; - -import "google/api/annotations.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/node"; - -// Service defines the gRPC querier service for node related queries. -service Service { - // Config queries for the operator configuration. - rpc Config(ConfigRequest) returns (ConfigResponse) { - option (google.api.http).get = "/cosmos/base/node/v1beta1/config"; - } -} - -// ConfigRequest defines the request structure for the Config gRPC query. -message ConfigRequest {} - -// ConfigResponse defines the response structure for the Config gRPC query. -message ConfigResponse { - string minimum_gas_price = 1; -} diff --git a/third_party/proto/cosmos/base/query/v1beta1/pagination.proto b/third_party/proto/cosmos/base/query/v1beta1/pagination.proto deleted file mode 100644 index cd5eb066d3..0000000000 --- a/third_party/proto/cosmos/base/query/v1beta1/pagination.proto +++ /dev/null @@ -1,55 +0,0 @@ -syntax = "proto3"; -package cosmos.base.query.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/types/query"; - -// PageRequest is to be embedded in gRPC request messages for efficient -// pagination. Ex: -// -// message SomeRequest { -// Foo some_parameter = 1; -// PageRequest pagination = 2; -// } -message PageRequest { - // key is a value returned in PageResponse.next_key to begin - // querying the next page most efficiently. Only one of offset or key - // should be set. - bytes key = 1; - - // offset is a numeric offset that can be used when key is unavailable. - // It is less efficient than using key. Only one of offset or key should - // be set. - uint64 offset = 2; - - // limit is the total number of results to be returned in the result page. - // If left empty it will default to a value to be set by each app. - uint64 limit = 3; - - // count_total is set to true to indicate that the result set should include - // a count of the total number of items available for pagination in UIs. - // count_total is only respected when offset is used. It is ignored when key - // is set. - bool count_total = 4; - - // reverse is set to true if results are to be returned in the descending order. - // - // Since: cosmos-sdk 0.43 - bool reverse = 5; -} - -// PageResponse is to be embedded in gRPC response messages where the -// corresponding request message has used PageRequest. -// -// message SomeResponse { -// repeated Bar results = 1; -// PageResponse page = 2; -// } -message PageResponse { - // next_key is the key to be passed to PageRequest.key to - // query the next page most efficiently - bytes next_key = 1; - - // total is total number of results available if PageRequest.count_total - // was set, its value is undefined otherwise - uint64 total = 2; -} diff --git a/third_party/proto/cosmos/base/reflection/v1beta1/reflection.proto b/third_party/proto/cosmos/base/reflection/v1beta1/reflection.proto deleted file mode 100644 index 22670e72b8..0000000000 --- a/third_party/proto/cosmos/base/reflection/v1beta1/reflection.proto +++ /dev/null @@ -1,44 +0,0 @@ -syntax = "proto3"; -package cosmos.base.reflection.v1beta1; - -import "google/api/annotations.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/reflection"; - -// ReflectionService defines a service for interface reflection. -service ReflectionService { - // ListAllInterfaces lists all the interfaces registered in the interface - // registry. - rpc ListAllInterfaces(ListAllInterfacesRequest) returns (ListAllInterfacesResponse) { - option (google.api.http).get = "/cosmos/base/reflection/v1beta1/interfaces"; - }; - - // ListImplementations list all the concrete types that implement a given - // interface. - rpc ListImplementations(ListImplementationsRequest) returns (ListImplementationsResponse) { - option (google.api.http).get = "/cosmos/base/reflection/v1beta1/interfaces/" - "{interface_name}/implementations"; - }; -} - -// ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC. -message ListAllInterfacesRequest {} - -// ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC. -message ListAllInterfacesResponse { - // interface_names is an array of all the registered interfaces. - repeated string interface_names = 1; -} - -// ListImplementationsRequest is the request type of the ListImplementations -// RPC. -message ListImplementationsRequest { - // interface_name defines the interface to query the implementations for. - string interface_name = 1; -} - -// ListImplementationsResponse is the response type of the ListImplementations -// RPC. -message ListImplementationsResponse { - repeated string implementation_message_names = 1; -} diff --git a/third_party/proto/cosmos/base/reflection/v2alpha1/reflection.proto b/third_party/proto/cosmos/base/reflection/v2alpha1/reflection.proto deleted file mode 100644 index d5b048558f..0000000000 --- a/third_party/proto/cosmos/base/reflection/v2alpha1/reflection.proto +++ /dev/null @@ -1,218 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.base.reflection.v2alpha1; - -import "google/api/annotations.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/server/grpc/reflection/v2alpha1"; - -// AppDescriptor describes a cosmos-sdk based application -message AppDescriptor { - // AuthnDescriptor provides information on how to authenticate transactions on the application - // NOTE: experimental and subject to change in future releases. - AuthnDescriptor authn = 1; - // chain provides the chain descriptor - ChainDescriptor chain = 2; - // codec provides metadata information regarding codec related types - CodecDescriptor codec = 3; - // configuration provides metadata information regarding the sdk.Config type - ConfigurationDescriptor configuration = 4; - // query_services provides metadata information regarding the available queriable endpoints - QueryServicesDescriptor query_services = 5; - // tx provides metadata information regarding how to send transactions to the given application - TxDescriptor tx = 6; -} - -// TxDescriptor describes the accepted transaction type -message TxDescriptor { - // fullname is the protobuf fullname of the raw transaction type (for instance the tx.Tx type) - // it is not meant to support polymorphism of transaction types, it is supposed to be used by - // reflection clients to understand if they can handle a specific transaction type in an application. - string fullname = 1; - // msgs lists the accepted application messages (sdk.Msg) - repeated MsgDescriptor msgs = 2; -} - -// AuthnDescriptor provides information on how to sign transactions without relying -// on the online RPCs GetTxMetadata and CombineUnsignedTxAndSignatures -message AuthnDescriptor { - // sign_modes defines the supported signature algorithm - repeated SigningModeDescriptor sign_modes = 1; -} - -// SigningModeDescriptor provides information on a signing flow of the application -// NOTE(fdymylja): here we could go as far as providing an entire flow on how -// to sign a message given a SigningModeDescriptor, but it's better to think about -// this another time -message SigningModeDescriptor { - // name defines the unique name of the signing mode - string name = 1; - // number is the unique int32 identifier for the sign_mode enum - int32 number = 2; - // authn_info_provider_method_fullname defines the fullname of the method to call to get - // the metadata required to authenticate using the provided sign_modes - string authn_info_provider_method_fullname = 3; -} - -// ChainDescriptor describes chain information of the application -message ChainDescriptor { - // id is the chain id - string id = 1; -} - -// CodecDescriptor describes the registered interfaces and provides metadata information on the types -message CodecDescriptor { - // interfaces is a list of the registerted interfaces descriptors - repeated InterfaceDescriptor interfaces = 1; -} - -// InterfaceDescriptor describes the implementation of an interface -message InterfaceDescriptor { - // fullname is the name of the interface - string fullname = 1; - // interface_accepting_messages contains information regarding the proto messages which contain the interface as - // google.protobuf.Any field - repeated InterfaceAcceptingMessageDescriptor interface_accepting_messages = 2; - // interface_implementers is a list of the descriptors of the interface implementers - repeated InterfaceImplementerDescriptor interface_implementers = 3; -} - -// InterfaceImplementerDescriptor describes an interface implementer -message InterfaceImplementerDescriptor { - // fullname is the protobuf queryable name of the interface implementer - string fullname = 1; - // type_url defines the type URL used when marshalling the type as any - // this is required so we can provide type safe google.protobuf.Any marshalling and - // unmarshalling, making sure that we don't accept just 'any' type - // in our interface fields - string type_url = 2; -} - -// InterfaceAcceptingMessageDescriptor describes a protobuf message which contains -// an interface represented as a google.protobuf.Any -message InterfaceAcceptingMessageDescriptor { - // fullname is the protobuf fullname of the type containing the interface - string fullname = 1; - // field_descriptor_names is a list of the protobuf name (not fullname) of the field - // which contains the interface as google.protobuf.Any (the interface is the same, but - // it can be in multiple fields of the same proto message) - repeated string field_descriptor_names = 2; -} - -// ConfigurationDescriptor contains metadata information on the sdk.Config -message ConfigurationDescriptor { - // bech32_account_address_prefix is the account address prefix - string bech32_account_address_prefix = 1; -} - -// MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction -message MsgDescriptor { - // msg_type_url contains the TypeURL of a sdk.Msg. - string msg_type_url = 1; -} - -// ReflectionService defines a service for application reflection. -service ReflectionService { - // GetAuthnDescriptor returns information on how to authenticate transactions in the application - // NOTE: this RPC is still experimental and might be subject to breaking changes or removal in - // future releases of the cosmos-sdk. - rpc GetAuthnDescriptor(GetAuthnDescriptorRequest) returns (GetAuthnDescriptorResponse) { - option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/authn"; - } - // GetChainDescriptor returns the description of the chain - rpc GetChainDescriptor(GetChainDescriptorRequest) returns (GetChainDescriptorResponse) { - option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/chain"; - }; - // GetCodecDescriptor returns the descriptor of the codec of the application - rpc GetCodecDescriptor(GetCodecDescriptorRequest) returns (GetCodecDescriptorResponse) { - option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/codec"; - } - // GetConfigurationDescriptor returns the descriptor for the sdk.Config of the application - rpc GetConfigurationDescriptor(GetConfigurationDescriptorRequest) returns (GetConfigurationDescriptorResponse) { - option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/configuration"; - } - // GetQueryServicesDescriptor returns the available gRPC queryable services of the application - rpc GetQueryServicesDescriptor(GetQueryServicesDescriptorRequest) returns (GetQueryServicesDescriptorResponse) { - option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/query_services"; - } - // GetTxDescriptor returns information on the used transaction object and available msgs that can be used - rpc GetTxDescriptor(GetTxDescriptorRequest) returns (GetTxDescriptorResponse) { - option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/tx_descriptor"; - } -} - -// GetAuthnDescriptorRequest is the request used for the GetAuthnDescriptor RPC -message GetAuthnDescriptorRequest {} -// GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC -message GetAuthnDescriptorResponse { - // authn describes how to authenticate to the application when sending transactions - AuthnDescriptor authn = 1; -} - -// GetChainDescriptorRequest is the request used for the GetChainDescriptor RPC -message GetChainDescriptorRequest {} -// GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC -message GetChainDescriptorResponse { - // chain describes application chain information - ChainDescriptor chain = 1; -} - -// GetCodecDescriptorRequest is the request used for the GetCodecDescriptor RPC -message GetCodecDescriptorRequest {} -// GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC -message GetCodecDescriptorResponse { - // codec describes the application codec such as registered interfaces and implementations - CodecDescriptor codec = 1; -} - -// GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC -message GetConfigurationDescriptorRequest {} -// GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC -message GetConfigurationDescriptorResponse { - // config describes the application's sdk.Config - ConfigurationDescriptor config = 1; -} - -// GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC -message GetQueryServicesDescriptorRequest {} -// GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC -message GetQueryServicesDescriptorResponse { - // queries provides information on the available queryable services - QueryServicesDescriptor queries = 1; -} - -// GetTxDescriptorRequest is the request used for the GetTxDescriptor RPC -message GetTxDescriptorRequest {} -// GetTxDescriptorResponse is the response returned by the GetTxDescriptor RPC -message GetTxDescriptorResponse { - // tx provides information on msgs that can be forwarded to the application - // alongside the accepted transaction protobuf type - TxDescriptor tx = 1; -} - -// QueryServicesDescriptor contains the list of cosmos-sdk queriable services -message QueryServicesDescriptor { - // query_services is a list of cosmos-sdk QueryServiceDescriptor - repeated QueryServiceDescriptor query_services = 1; -} - -// QueryServiceDescriptor describes a cosmos-sdk queryable service -message QueryServiceDescriptor { - // fullname is the protobuf fullname of the service descriptor - string fullname = 1; - // is_module describes if this service is actually exposed by an application's module - bool is_module = 2; - // methods provides a list of query service methods - repeated QueryMethodDescriptor methods = 3; -} - -// QueryMethodDescriptor describes a queryable method of a query service -// no other info is provided beside method name and tendermint queryable path -// because it would be redundant with the grpc reflection service -message QueryMethodDescriptor { - // name is the protobuf name (not fullname) of the method - string name = 1; - // full_query_path is the path that can be used to query - // this method via tendermint abci.Query - string full_query_path = 2; -} diff --git a/third_party/proto/cosmos/base/snapshots/v1beta1/snapshot.proto b/third_party/proto/cosmos/base/snapshots/v1beta1/snapshot.proto deleted file mode 100644 index 6dcc4a933a..0000000000 --- a/third_party/proto/cosmos/base/snapshots/v1beta1/snapshot.proto +++ /dev/null @@ -1,57 +0,0 @@ -syntax = "proto3"; -package cosmos.base.snapshots.v1beta1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/snapshots/types"; - -// Snapshot contains Tendermint state sync snapshot info. -message Snapshot { - uint64 height = 1; - uint32 format = 2; - uint32 chunks = 3; - bytes hash = 4; - Metadata metadata = 5 [(gogoproto.nullable) = false]; -} - -// Metadata contains SDK-specific snapshot metadata. -message Metadata { - repeated bytes chunk_hashes = 1; // SHA-256 chunk hashes -} - -// SnapshotItem is an item contained in a rootmulti.Store snapshot. -message SnapshotItem { - // item is the specific type of snapshot item. - oneof item { - SnapshotStoreItem store = 1; - SnapshotIAVLItem iavl = 2 [(gogoproto.customname) = "IAVL"]; - SnapshotExtensionMeta extension = 3; - SnapshotExtensionPayload extension_payload = 4; - } -} - -// SnapshotStoreItem contains metadata about a snapshotted store. -message SnapshotStoreItem { - string name = 1; -} - -// SnapshotIAVLItem is an exported IAVL node. -message SnapshotIAVLItem { - bytes key = 1; - bytes value = 2; - // version is block height - int64 version = 3; - // height is depth of the tree. - int32 height = 4; -} - -// SnapshotExtensionMeta contains metadata about an external snapshotter. -message SnapshotExtensionMeta { - string name = 1; - uint32 format = 2; -} - -// SnapshotExtensionPayload contains payloads of an external snapshotter. -message SnapshotExtensionPayload { - bytes payload = 1; -} diff --git a/third_party/proto/cosmos/base/store/v1beta1/commit_info.proto b/third_party/proto/cosmos/base/store/v1beta1/commit_info.proto deleted file mode 100644 index 98a33d30e7..0000000000 --- a/third_party/proto/cosmos/base/store/v1beta1/commit_info.proto +++ /dev/null @@ -1,29 +0,0 @@ -syntax = "proto3"; -package cosmos.base.store.v1beta1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/store/types"; - -// CommitInfo defines commit information used by the multi-store when committing -// a version/height. -message CommitInfo { - int64 version = 1; - repeated StoreInfo store_infos = 2 [(gogoproto.nullable) = false]; -} - -// StoreInfo defines store-specific commit information. It contains a reference -// between a store name and the commit ID. -message StoreInfo { - string name = 1; - CommitID commit_id = 2 [(gogoproto.nullable) = false]; -} - -// CommitID defines the committment information when a specific store is -// committed. -message CommitID { - option (gogoproto.goproto_stringer) = false; - - int64 version = 1; - bytes hash = 2; -} diff --git a/third_party/proto/cosmos/base/store/v1beta1/listening.proto b/third_party/proto/cosmos/base/store/v1beta1/listening.proto deleted file mode 100644 index 359997109c..0000000000 --- a/third_party/proto/cosmos/base/store/v1beta1/listening.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; -package cosmos.base.store.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/store/types"; - -// StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes) -// It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and -// Deletes -// -// Since: cosmos-sdk 0.43 -message StoreKVPair { - string store_key = 1; // the store key for the KVStore this pair originates from - bool delete = 2; // true indicates a delete operation, false indicates a set operation - bytes key = 3; - bytes value = 4; -} diff --git a/third_party/proto/cosmos/base/tendermint/v1beta1/query.proto b/third_party/proto/cosmos/base/tendermint/v1beta1/query.proto deleted file mode 100644 index 98542d23db..0000000000 --- a/third_party/proto/cosmos/base/tendermint/v1beta1/query.proto +++ /dev/null @@ -1,138 +0,0 @@ -syntax = "proto3"; -package cosmos.base.tendermint.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "google/api/annotations.proto"; -import "tendermint/p2p/types.proto"; -import "tendermint/types/block.proto"; -import "tendermint/types/types.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/tmservice"; - -// Service defines the gRPC querier service for tendermint queries. -service Service { - // GetNodeInfo queries the current node info. - rpc GetNodeInfo(GetNodeInfoRequest) returns (GetNodeInfoResponse) { - option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/node_info"; - } - // GetSyncing queries node syncing. - rpc GetSyncing(GetSyncingRequest) returns (GetSyncingResponse) { - option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/syncing"; - } - // GetLatestBlock returns the latest block. - rpc GetLatestBlock(GetLatestBlockRequest) returns (GetLatestBlockResponse) { - option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/blocks/latest"; - } - // GetBlockByHeight queries block for given height. - rpc GetBlockByHeight(GetBlockByHeightRequest) returns (GetBlockByHeightResponse) { - option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/blocks/{height}"; - } - - // GetLatestValidatorSet queries latest validator-set. - rpc GetLatestValidatorSet(GetLatestValidatorSetRequest) returns (GetLatestValidatorSetResponse) { - option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/validatorsets/latest"; - } - // GetValidatorSetByHeight queries validator-set at a given height. - rpc GetValidatorSetByHeight(GetValidatorSetByHeightRequest) returns (GetValidatorSetByHeightResponse) { - option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/validatorsets/{height}"; - } -} - -// GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. -message GetValidatorSetByHeightRequest { - int64 height = 1; - // pagination defines an pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. -message GetValidatorSetByHeightResponse { - int64 block_height = 1; - repeated Validator validators = 2; - // pagination defines an pagination for the response. - cosmos.base.query.v1beta1.PageResponse pagination = 3; -} - -// GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. -message GetLatestValidatorSetRequest { - // pagination defines an pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. -message GetLatestValidatorSetResponse { - int64 block_height = 1; - repeated Validator validators = 2; - // pagination defines an pagination for the response. - cosmos.base.query.v1beta1.PageResponse pagination = 3; -} - -// Validator is the type for the validator-set. -message Validator { - string address = 1; - google.protobuf.Any pub_key = 2; - int64 voting_power = 3; - int64 proposer_priority = 4; -} - -// GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. -message GetBlockByHeightRequest { - int64 height = 1; -} - -// GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. -message GetBlockByHeightResponse { - .tendermint.types.BlockID block_id = 1; - .tendermint.types.Block block = 2; -} - -// GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. -message GetLatestBlockRequest {} - -// GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. -message GetLatestBlockResponse { - .tendermint.types.BlockID block_id = 1; - .tendermint.types.Block block = 2; -} - -// GetSyncingRequest is the request type for the Query/GetSyncing RPC method. -message GetSyncingRequest {} - -// GetSyncingResponse is the response type for the Query/GetSyncing RPC method. -message GetSyncingResponse { - bool syncing = 1; -} - -// GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. -message GetNodeInfoRequest {} - -// GetNodeInfoResponse is the request type for the Query/GetNodeInfo RPC method. -message GetNodeInfoResponse { - .tendermint.p2p.DefaultNodeInfo default_node_info = 1; - VersionInfo application_version = 2; -} - -// VersionInfo is the type for the GetNodeInfoResponse message. -message VersionInfo { - string name = 1; - string app_name = 2; - string version = 3; - string git_commit = 4; - string build_tags = 5; - string go_version = 6; - repeated Module build_deps = 7; - // Since: cosmos-sdk 0.43 - string cosmos_sdk_version = 8; -} - -// Module is the type for VersionInfo -message Module { - // module path - string path = 1; - // module version - string version = 2; - // checksum - string sum = 3; -} diff --git a/third_party/proto/cosmos/base/v1beta1/coin.proto b/third_party/proto/cosmos/base/v1beta1/coin.proto deleted file mode 100644 index fab75284b7..0000000000 --- a/third_party/proto/cosmos/base/v1beta1/coin.proto +++ /dev/null @@ -1,40 +0,0 @@ -syntax = "proto3"; -package cosmos.base.v1beta1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/types"; -option (gogoproto.goproto_stringer_all) = false; -option (gogoproto.stringer_all) = false; - -// Coin defines a token with a denomination and an amount. -// -// NOTE: The amount field is an Int which implements the custom method -// signatures required by gogoproto. -message Coin { - option (gogoproto.equal) = true; - - string denom = 1; - string amount = 2 [(gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; -} - -// DecCoin defines a token with a denomination and a decimal amount. -// -// NOTE: The amount field is an Dec which implements the custom method -// signatures required by gogoproto. -message DecCoin { - option (gogoproto.equal) = true; - - string denom = 1; - string amount = 2 [(gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; -} - -// IntProto defines a Protobuf wrapper around an Int object. -message IntProto { - string int = 1 [(gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; -} - -// DecProto defines a Protobuf wrapper around a Dec object. -message DecProto { - string dec = 1 [(gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; -} diff --git a/third_party/proto/cosmos/capability/v1beta1/capability.proto b/third_party/proto/cosmos/capability/v1beta1/capability.proto deleted file mode 100644 index 1c8332f341..0000000000 --- a/third_party/proto/cosmos/capability/v1beta1/capability.proto +++ /dev/null @@ -1,30 +0,0 @@ -syntax = "proto3"; -package cosmos.capability.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/capability/types"; - -import "gogoproto/gogo.proto"; - -// Capability defines an implementation of an object capability. The index -// provided to a Capability must be globally unique. -message Capability { - option (gogoproto.goproto_stringer) = false; - - uint64 index = 1 [(gogoproto.moretags) = "yaml:\"index\""]; -} - -// Owner defines a single capability owner. An owner is defined by the name of -// capability and the module name. -message Owner { - option (gogoproto.goproto_stringer) = false; - option (gogoproto.goproto_getters) = false; - - string module = 1 [(gogoproto.moretags) = "yaml:\"module\""]; - string name = 2 [(gogoproto.moretags) = "yaml:\"name\""]; -} - -// CapabilityOwners defines a set of owners of a single Capability. The set of -// owners must be unique. -message CapabilityOwners { - repeated Owner owners = 1 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/cosmos/capability/v1beta1/genesis.proto b/third_party/proto/cosmos/capability/v1beta1/genesis.proto deleted file mode 100644 index 05bb0afc4a..0000000000 --- a/third_party/proto/cosmos/capability/v1beta1/genesis.proto +++ /dev/null @@ -1,26 +0,0 @@ -syntax = "proto3"; -package cosmos.capability.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/capability/v1beta1/capability.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/capability/types"; - -// GenesisOwners defines the capability owners with their corresponding index. -message GenesisOwners { - // index is the index of the capability owner. - uint64 index = 1; - - // index_owners are the owners at the given index. - CapabilityOwners index_owners = 2 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"index_owners\""]; -} - -// GenesisState defines the capability module's genesis state. -message GenesisState { - // index is the capability global index. - uint64 index = 1; - - // owners represents a map from index to owners of the capability index - // index key is string to allow amino marshalling. - repeated GenesisOwners owners = 2 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/cosmos/crisis/v1beta1/genesis.proto b/third_party/proto/cosmos/crisis/v1beta1/genesis.proto deleted file mode 100644 index 5b0ff7ec72..0000000000 --- a/third_party/proto/cosmos/crisis/v1beta1/genesis.proto +++ /dev/null @@ -1,15 +0,0 @@ -syntax = "proto3"; -package cosmos.crisis.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/crisis/types"; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; - -// GenesisState defines the crisis module's genesis state. -message GenesisState { - // constant_fee is the fee used to verify the invariant in the crisis - // module. - cosmos.base.v1beta1.Coin constant_fee = 3 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"constant_fee\""]; -} diff --git a/third_party/proto/cosmos/crisis/v1beta1/tx.proto b/third_party/proto/cosmos/crisis/v1beta1/tx.proto deleted file mode 100644 index 26457ad6d5..0000000000 --- a/third_party/proto/cosmos/crisis/v1beta1/tx.proto +++ /dev/null @@ -1,25 +0,0 @@ -syntax = "proto3"; -package cosmos.crisis.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/crisis/types"; - -import "gogoproto/gogo.proto"; - -// Msg defines the bank Msg service. -service Msg { - // VerifyInvariant defines a method to verify a particular invariance. - rpc VerifyInvariant(MsgVerifyInvariant) returns (MsgVerifyInvariantResponse); -} - -// MsgVerifyInvariant represents a message to verify a particular invariance. -message MsgVerifyInvariant { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string sender = 1; - string invariant_module_name = 2 [(gogoproto.moretags) = "yaml:\"invariant_module_name\""]; - string invariant_route = 3 [(gogoproto.moretags) = "yaml:\"invariant_route\""]; -} - -// MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. -message MsgVerifyInvariantResponse {} diff --git a/third_party/proto/cosmos/crypto/ed25519/keys.proto b/third_party/proto/cosmos/crypto/ed25519/keys.proto deleted file mode 100644 index 6ffec34483..0000000000 --- a/third_party/proto/cosmos/crypto/ed25519/keys.proto +++ /dev/null @@ -1,23 +0,0 @@ -syntax = "proto3"; -package cosmos.crypto.ed25519; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"; - -// PubKey is an ed25519 public key for handling Tendermint keys in SDK. -// It's needed for Any serialization and SDK compatibility. -// It must not be used in a non Tendermint key context because it doesn't implement -// ADR-28. Nevertheless, you will like to use ed25519 in app user level -// then you must create a new proto message and follow ADR-28 for Address construction. -message PubKey { - option (gogoproto.goproto_stringer) = false; - - bytes key = 1 [(gogoproto.casttype) = "crypto/ed25519.PublicKey"]; -} - -// Deprecated: PrivKey defines a ed25519 private key. -// NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. -message PrivKey { - bytes key = 1 [(gogoproto.casttype) = "crypto/ed25519.PrivateKey"]; -} diff --git a/third_party/proto/cosmos/crypto/multisig/keys.proto b/third_party/proto/cosmos/crypto/multisig/keys.proto deleted file mode 100644 index f8398e8052..0000000000 --- a/third_party/proto/cosmos/crypto/multisig/keys.proto +++ /dev/null @@ -1,18 +0,0 @@ -syntax = "proto3"; -package cosmos.crypto.multisig; - -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/multisig"; - -// LegacyAminoPubKey specifies a public key type -// which nests multiple public keys and a threshold, -// it uses legacy amino address rules. -message LegacyAminoPubKey { - option (gogoproto.goproto_getters) = false; - - uint32 threshold = 1 [(gogoproto.moretags) = "yaml:\"threshold\""]; - repeated google.protobuf.Any public_keys = 2 - [(gogoproto.customname) = "PubKeys", (gogoproto.moretags) = "yaml:\"pubkeys\""]; -} diff --git a/third_party/proto/cosmos/crypto/multisig/v1beta1/multisig.proto b/third_party/proto/cosmos/crypto/multisig/v1beta1/multisig.proto deleted file mode 100644 index bf671f1711..0000000000 --- a/third_party/proto/cosmos/crypto/multisig/v1beta1/multisig.proto +++ /dev/null @@ -1,25 +0,0 @@ -syntax = "proto3"; -package cosmos.crypto.multisig.v1beta1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/crypto/types"; - -// MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. -// See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers -// signed and with which modes. -message MultiSignature { - option (gogoproto.goproto_unrecognized) = true; - repeated bytes signatures = 1; -} - -// CompactBitArray is an implementation of a space efficient bit array. -// This is used to ensure that the encoded data takes up a minimal amount of -// space after proto encoding. -// This is not thread safe, and is not intended for concurrent usage. -message CompactBitArray { - option (gogoproto.goproto_stringer) = false; - - uint32 extra_bits_stored = 1; - bytes elems = 2; -} diff --git a/third_party/proto/cosmos/crypto/secp256k1/keys.proto b/third_party/proto/cosmos/crypto/secp256k1/keys.proto deleted file mode 100644 index a22725713a..0000000000 --- a/third_party/proto/cosmos/crypto/secp256k1/keys.proto +++ /dev/null @@ -1,22 +0,0 @@ -syntax = "proto3"; -package cosmos.crypto.secp256k1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"; - -// PubKey defines a secp256k1 public key -// Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte -// if the y-coordinate is the lexicographically largest of the two associated with -// the x-coordinate. Otherwise the first byte is a 0x03. -// This prefix is followed with the x-coordinate. -message PubKey { - option (gogoproto.goproto_stringer) = false; - - bytes key = 1; -} - -// PrivKey defines a secp256k1 private key. -message PrivKey { - bytes key = 1; -} diff --git a/third_party/proto/cosmos/crypto/secp256r1/keys.proto b/third_party/proto/cosmos/crypto/secp256r1/keys.proto deleted file mode 100644 index 2e96c6e3c6..0000000000 --- a/third_party/proto/cosmos/crypto/secp256r1/keys.proto +++ /dev/null @@ -1,23 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.crypto.secp256r1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/secp256r1"; -option (gogoproto.messagename_all) = true; -option (gogoproto.goproto_stringer_all) = false; -option (gogoproto.goproto_getters_all) = false; - -// PubKey defines a secp256r1 ECDSA public key. -message PubKey { - // Point on secp256r1 curve in a compressed representation as specified in section - // 4.3.6 of ANSI X9.62: https://webstore.ansi.org/standards/ascx9/ansix9621998 - bytes key = 1 [(gogoproto.customtype) = "ecdsaPK"]; -} - -// PrivKey defines a secp256r1 ECDSA private key. -message PrivKey { - // secret number serialized using big-endian encoding - bytes secret = 1 [(gogoproto.customtype) = "ecdsaSK"]; -} diff --git a/third_party/proto/cosmos/distribution/v1beta1/distribution.proto b/third_party/proto/cosmos/distribution/v1beta1/distribution.proto deleted file mode 100644 index ae98ec0b98..0000000000 --- a/third_party/proto/cosmos/distribution/v1beta1/distribution.proto +++ /dev/null @@ -1,157 +0,0 @@ -syntax = "proto3"; -package cosmos.distribution.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; -option (gogoproto.equal_all) = true; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; - -// Params defines the set of params for the distribution module. -message Params { - option (gogoproto.goproto_stringer) = false; - string community_tax = 1 [ - (gogoproto.moretags) = "yaml:\"community_tax\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - string base_proposer_reward = 2 [ - (gogoproto.moretags) = "yaml:\"base_proposer_reward\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - string bonus_proposer_reward = 3 [ - (gogoproto.moretags) = "yaml:\"bonus_proposer_reward\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - bool withdraw_addr_enabled = 4 [(gogoproto.moretags) = "yaml:\"withdraw_addr_enabled\""]; -} - -// ValidatorHistoricalRewards represents historical rewards for a validator. -// Height is implicit within the store key. -// Cumulative reward ratio is the sum from the zeroeth period -// until this period of rewards / tokens, per the spec. -// The reference count indicates the number of objects -// which might need to reference this historical entry at any point. -// ReferenceCount = -// number of outstanding delegations which ended the associated period (and -// might need to read that record) -// + number of slashes which ended the associated period (and might need to -// read that record) -// + one per validator for the zeroeth period, set on initialization -message ValidatorHistoricalRewards { - repeated cosmos.base.v1beta1.DecCoin cumulative_reward_ratio = 1 [ - (gogoproto.moretags) = "yaml:\"cumulative_reward_ratio\"", - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", - (gogoproto.nullable) = false - ]; - uint32 reference_count = 2 [(gogoproto.moretags) = "yaml:\"reference_count\""]; -} - -// ValidatorCurrentRewards represents current rewards and current -// period for a validator kept as a running counter and incremented -// each block as long as the validator's tokens remain constant. -message ValidatorCurrentRewards { - repeated cosmos.base.v1beta1.DecCoin rewards = 1 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; - uint64 period = 2; -} - -// ValidatorAccumulatedCommission represents accumulated commission -// for a validator kept as a running counter, can be withdrawn at any time. -message ValidatorAccumulatedCommission { - repeated cosmos.base.v1beta1.DecCoin commission = 1 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; -} - -// ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards -// for a validator inexpensive to track, allows simple sanity checks. -message ValidatorOutstandingRewards { - repeated cosmos.base.v1beta1.DecCoin rewards = 1 [ - (gogoproto.moretags) = "yaml:\"rewards\"", - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", - (gogoproto.nullable) = false - ]; -} - -// ValidatorSlashEvent represents a validator slash event. -// Height is implicit within the store key. -// This is needed to calculate appropriate amount of staking tokens -// for delegations which are withdrawn after a slash has occurred. -message ValidatorSlashEvent { - uint64 validator_period = 1 [(gogoproto.moretags) = "yaml:\"validator_period\""]; - string fraction = 2 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; -} - -// ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. -message ValidatorSlashEvents { - option (gogoproto.goproto_stringer) = false; - repeated ValidatorSlashEvent validator_slash_events = 1 - [(gogoproto.moretags) = "yaml:\"validator_slash_events\"", (gogoproto.nullable) = false]; -} - -// FeePool is the global fee pool for distribution. -message FeePool { - repeated cosmos.base.v1beta1.DecCoin community_pool = 1 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", - (gogoproto.moretags) = "yaml:\"community_pool\"" - ]; -} - -// CommunityPoolSpendProposal details a proposal for use of community funds, -// together with how many coins are proposed to be spent, and to which -// recipient account. -message CommunityPoolSpendProposal { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - string title = 1; - string description = 2; - string recipient = 3; - repeated cosmos.base.v1beta1.Coin amount = 4 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; -} - -// DelegatorStartingInfo represents the starting info for a delegator reward -// period. It tracks the previous validator period, the delegation's amount of -// staking token, and the creation height (to check later on if any slashes have -// occurred). NOTE: Even though validators are slashed to whole staking tokens, -// the delegators within the validator may be left with less than a full token, -// thus sdk.Dec is used. -message DelegatorStartingInfo { - uint64 previous_period = 1 [(gogoproto.moretags) = "yaml:\"previous_period\""]; - string stake = 2 [ - (gogoproto.moretags) = "yaml:\"stake\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - uint64 height = 3 [(gogoproto.moretags) = "yaml:\"creation_height\"", (gogoproto.jsontag) = "creation_height"]; -} - -// DelegationDelegatorReward represents the properties -// of a delegator's delegation reward. -message DelegationDelegatorReward { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = true; - - string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; - - repeated cosmos.base.v1beta1.DecCoin reward = 2 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; -} - -// CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal -// with a deposit -message CommunityPoolSpendProposalWithDeposit { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = true; - - string title = 1 [(gogoproto.moretags) = "yaml:\"title\""]; - string description = 2 [(gogoproto.moretags) = "yaml:\"description\""]; - string recipient = 3 [(gogoproto.moretags) = "yaml:\"recipient\""]; - string amount = 4 [(gogoproto.moretags) = "yaml:\"amount\""]; - string deposit = 5 [(gogoproto.moretags) = "yaml:\"deposit\""]; -} diff --git a/third_party/proto/cosmos/distribution/v1beta1/genesis.proto b/third_party/proto/cosmos/distribution/v1beta1/genesis.proto deleted file mode 100644 index c0b17cdf11..0000000000 --- a/third_party/proto/cosmos/distribution/v1beta1/genesis.proto +++ /dev/null @@ -1,155 +0,0 @@ -syntax = "proto3"; -package cosmos.distribution.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; -option (gogoproto.equal_all) = true; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/distribution/v1beta1/distribution.proto"; - -// DelegatorWithdrawInfo is the address for where distributions rewards are -// withdrawn to by default this struct is only used at genesis to feed in -// default withdraw addresses. -message DelegatorWithdrawInfo { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // delegator_address is the address of the delegator. - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - - // withdraw_address is the address to withdraw the delegation rewards to. - string withdraw_address = 2 [(gogoproto.moretags) = "yaml:\"withdraw_address\""]; -} - -// ValidatorOutstandingRewardsRecord is used for import/export via genesis json. -message ValidatorOutstandingRewardsRecord { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // validator_address is the address of the validator. - string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; - - // outstanding_rewards represents the oustanding rewards of a validator. - repeated cosmos.base.v1beta1.DecCoin outstanding_rewards = 2 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"outstanding_rewards\"" - ]; -} - -// ValidatorAccumulatedCommissionRecord is used for import / export via genesis -// json. -message ValidatorAccumulatedCommissionRecord { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // validator_address is the address of the validator. - string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; - - // accumulated is the accumulated commission of a validator. - ValidatorAccumulatedCommission accumulated = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"accumulated\""]; -} - -// ValidatorHistoricalRewardsRecord is used for import / export via genesis -// json. -message ValidatorHistoricalRewardsRecord { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // validator_address is the address of the validator. - string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; - - // period defines the period the historical rewards apply to. - uint64 period = 2; - - // rewards defines the historical rewards of a validator. - ValidatorHistoricalRewards rewards = 3 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"rewards\""]; -} - -// ValidatorCurrentRewardsRecord is used for import / export via genesis json. -message ValidatorCurrentRewardsRecord { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // validator_address is the address of the validator. - string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; - - // rewards defines the current rewards of a validator. - ValidatorCurrentRewards rewards = 2 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"rewards\""]; -} - -// DelegatorStartingInfoRecord used for import / export via genesis json. -message DelegatorStartingInfoRecord { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // delegator_address is the address of the delegator. - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - - // validator_address is the address of the validator. - string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; - - // starting_info defines the starting info of a delegator. - DelegatorStartingInfo starting_info = 3 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"starting_info\""]; -} - -// ValidatorSlashEventRecord is used for import / export via genesis json. -message ValidatorSlashEventRecord { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // validator_address is the address of the validator. - string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; - // height defines the block height at which the slash event occured. - uint64 height = 2; - // period is the period of the slash event. - uint64 period = 3; - // validator_slash_event describes the slash event. - ValidatorSlashEvent validator_slash_event = 4 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"event\""]; -} - -// GenesisState defines the distribution module's genesis state. -message GenesisState { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // params defines all the paramaters of the module. - Params params = 1 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"params\""]; - - // fee_pool defines the fee pool at genesis. - FeePool fee_pool = 2 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"fee_pool\""]; - - // fee_pool defines the delegator withdraw infos at genesis. - repeated DelegatorWithdrawInfo delegator_withdraw_infos = 3 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"delegator_withdraw_infos\""]; - - // fee_pool defines the previous proposer at genesis. - string previous_proposer = 4 [(gogoproto.moretags) = "yaml:\"previous_proposer\""]; - - // fee_pool defines the outstanding rewards of all validators at genesis. - repeated ValidatorOutstandingRewardsRecord outstanding_rewards = 5 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"outstanding_rewards\""]; - - // fee_pool defines the accumulated commisions of all validators at genesis. - repeated ValidatorAccumulatedCommissionRecord validator_accumulated_commissions = 6 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"validator_accumulated_commissions\""]; - - // fee_pool defines the historical rewards of all validators at genesis. - repeated ValidatorHistoricalRewardsRecord validator_historical_rewards = 7 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"validator_historical_rewards\""]; - - // fee_pool defines the current rewards of all validators at genesis. - repeated ValidatorCurrentRewardsRecord validator_current_rewards = 8 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"validator_current_rewards\""]; - - // fee_pool defines the delegator starting infos at genesis. - repeated DelegatorStartingInfoRecord delegator_starting_infos = 9 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"delegator_starting_infos\""]; - - // fee_pool defines the validator slash events at genesis. - repeated ValidatorSlashEventRecord validator_slash_events = 10 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"validator_slash_events\""]; -} diff --git a/third_party/proto/cosmos/distribution/v1beta1/query.proto b/third_party/proto/cosmos/distribution/v1beta1/query.proto deleted file mode 100644 index 2991218d80..0000000000 --- a/third_party/proto/cosmos/distribution/v1beta1/query.proto +++ /dev/null @@ -1,218 +0,0 @@ -syntax = "proto3"; -package cosmos.distribution.v1beta1; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/distribution/v1beta1/distribution.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; - -// Query defines the gRPC querier service for distribution module. -service Query { - // Params queries params of the distribution module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/distribution/v1beta1/params"; - } - - // ValidatorOutstandingRewards queries rewards of a validator address. - rpc ValidatorOutstandingRewards(QueryValidatorOutstandingRewardsRequest) - returns (QueryValidatorOutstandingRewardsResponse) { - option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/" - "{validator_address}/outstanding_rewards"; - } - - // ValidatorCommission queries accumulated commission for a validator. - rpc ValidatorCommission(QueryValidatorCommissionRequest) returns (QueryValidatorCommissionResponse) { - option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/" - "{validator_address}/commission"; - } - - // ValidatorSlashes queries slash events of a validator. - rpc ValidatorSlashes(QueryValidatorSlashesRequest) returns (QueryValidatorSlashesResponse) { - option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/{validator_address}/slashes"; - } - - // DelegationRewards queries the total rewards accrued by a delegation. - rpc DelegationRewards(QueryDelegationRewardsRequest) returns (QueryDelegationRewardsResponse) { - option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/" - "{validator_address}"; - } - - // DelegationTotalRewards queries the total rewards accrued by a each - // validator. - rpc DelegationTotalRewards(QueryDelegationTotalRewardsRequest) returns (QueryDelegationTotalRewardsResponse) { - option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards"; - } - - // DelegatorValidators queries the validators of a delegator. - rpc DelegatorValidators(QueryDelegatorValidatorsRequest) returns (QueryDelegatorValidatorsResponse) { - option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/" - "{delegator_address}/validators"; - } - - // DelegatorWithdrawAddress queries withdraw address of a delegator. - rpc DelegatorWithdrawAddress(QueryDelegatorWithdrawAddressRequest) returns (QueryDelegatorWithdrawAddressResponse) { - option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/" - "{delegator_address}/withdraw_address"; - } - - // CommunityPool queries the community pool coins. - rpc CommunityPool(QueryCommunityPoolRequest) returns (QueryCommunityPoolResponse) { - option (google.api.http).get = "/cosmos/distribution/v1beta1/community_pool"; - } -} - -// QueryParamsRequest is the request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is the response type for the Query/Params RPC method. -message QueryParamsResponse { - // params defines the parameters of the module. - Params params = 1 [(gogoproto.nullable) = false]; -} - -// QueryValidatorOutstandingRewardsRequest is the request type for the -// Query/ValidatorOutstandingRewards RPC method. -message QueryValidatorOutstandingRewardsRequest { - // validator_address defines the validator address to query for. - string validator_address = 1; -} - -// QueryValidatorOutstandingRewardsResponse is the response type for the -// Query/ValidatorOutstandingRewards RPC method. -message QueryValidatorOutstandingRewardsResponse { - ValidatorOutstandingRewards rewards = 1 [(gogoproto.nullable) = false]; -} - -// QueryValidatorCommissionRequest is the request type for the -// Query/ValidatorCommission RPC method -message QueryValidatorCommissionRequest { - // validator_address defines the validator address to query for. - string validator_address = 1; -} - -// QueryValidatorCommissionResponse is the response type for the -// Query/ValidatorCommission RPC method -message QueryValidatorCommissionResponse { - // commission defines the commision the validator received. - ValidatorAccumulatedCommission commission = 1 [(gogoproto.nullable) = false]; -} - -// QueryValidatorSlashesRequest is the request type for the -// Query/ValidatorSlashes RPC method -message QueryValidatorSlashesRequest { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = true; - - // validator_address defines the validator address to query for. - string validator_address = 1; - // starting_height defines the optional starting height to query the slashes. - uint64 starting_height = 2; - // starting_height defines the optional ending height to query the slashes. - uint64 ending_height = 3; - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 4; -} - -// QueryValidatorSlashesResponse is the response type for the -// Query/ValidatorSlashes RPC method. -message QueryValidatorSlashesResponse { - // slashes defines the slashes the validator received. - repeated ValidatorSlashEvent slashes = 1 [(gogoproto.nullable) = false]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryDelegationRewardsRequest is the request type for the -// Query/DelegationRewards RPC method. -message QueryDelegationRewardsRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // delegator_address defines the delegator address to query for. - string delegator_address = 1; - // validator_address defines the validator address to query for. - string validator_address = 2; -} - -// QueryDelegationRewardsResponse is the response type for the -// Query/DelegationRewards RPC method. -message QueryDelegationRewardsResponse { - // rewards defines the rewards accrued by a delegation. - repeated cosmos.base.v1beta1.DecCoin rewards = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"]; -} - -// QueryDelegationTotalRewardsRequest is the request type for the -// Query/DelegationTotalRewards RPC method. -message QueryDelegationTotalRewardsRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - // delegator_address defines the delegator address to query for. - string delegator_address = 1; -} - -// QueryDelegationTotalRewardsResponse is the response type for the -// Query/DelegationTotalRewards RPC method. -message QueryDelegationTotalRewardsResponse { - // rewards defines all the rewards accrued by a delegator. - repeated DelegationDelegatorReward rewards = 1 [(gogoproto.nullable) = false]; - // total defines the sum of all the rewards. - repeated cosmos.base.v1beta1.DecCoin total = 2 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"]; -} - -// QueryDelegatorValidatorsRequest is the request type for the -// Query/DelegatorValidators RPC method. -message QueryDelegatorValidatorsRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // delegator_address defines the delegator address to query for. - string delegator_address = 1; -} - -// QueryDelegatorValidatorsResponse is the response type for the -// Query/DelegatorValidators RPC method. -message QueryDelegatorValidatorsResponse { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // validators defines the validators a delegator is delegating for. - repeated string validators = 1; -} - -// QueryDelegatorWithdrawAddressRequest is the request type for the -// Query/DelegatorWithdrawAddress RPC method. -message QueryDelegatorWithdrawAddressRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // delegator_address defines the delegator address to query for. - string delegator_address = 1; -} - -// QueryDelegatorWithdrawAddressResponse is the response type for the -// Query/DelegatorWithdrawAddress RPC method. -message QueryDelegatorWithdrawAddressResponse { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // withdraw_address defines the delegator address to query for. - string withdraw_address = 1; -} - -// QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC -// method. -message QueryCommunityPoolRequest {} - -// QueryCommunityPoolResponse is the response type for the Query/CommunityPool -// RPC method. -message QueryCommunityPoolResponse { - // pool defines community pool's coins. - repeated cosmos.base.v1beta1.DecCoin pool = 1 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; -} diff --git a/third_party/proto/cosmos/distribution/v1beta1/tx.proto b/third_party/proto/cosmos/distribution/v1beta1/tx.proto deleted file mode 100644 index e6ce478bcd..0000000000 --- a/third_party/proto/cosmos/distribution/v1beta1/tx.proto +++ /dev/null @@ -1,79 +0,0 @@ -syntax = "proto3"; -package cosmos.distribution.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; -option (gogoproto.equal_all) = true; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; - -// Msg defines the distribution Msg service. -service Msg { - // SetWithdrawAddress defines a method to change the withdraw address - // for a delegator (or validator self-delegation). - rpc SetWithdrawAddress(MsgSetWithdrawAddress) returns (MsgSetWithdrawAddressResponse); - - // WithdrawDelegatorReward defines a method to withdraw rewards of delegator - // from a single validator. - rpc WithdrawDelegatorReward(MsgWithdrawDelegatorReward) returns (MsgWithdrawDelegatorRewardResponse); - - // WithdrawValidatorCommission defines a method to withdraw the - // full commission to the validator address. - rpc WithdrawValidatorCommission(MsgWithdrawValidatorCommission) returns (MsgWithdrawValidatorCommissionResponse); - - // FundCommunityPool defines a method to allow an account to directly - // fund the community pool. - rpc FundCommunityPool(MsgFundCommunityPool) returns (MsgFundCommunityPoolResponse); -} - -// MsgSetWithdrawAddress sets the withdraw address for -// a delegator (or validator self-delegation). -message MsgSetWithdrawAddress { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - string withdraw_address = 2 [(gogoproto.moretags) = "yaml:\"withdraw_address\""]; -} - -// MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. -message MsgSetWithdrawAddressResponse {} - -// MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator -// from a single validator. -message MsgWithdrawDelegatorReward { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; -} - -// MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. -message MsgWithdrawDelegatorRewardResponse {} - -// MsgWithdrawValidatorCommission withdraws the full commission to the validator -// address. -message MsgWithdrawValidatorCommission { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; -} - -// MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. -message MsgWithdrawValidatorCommissionResponse {} - -// MsgFundCommunityPool allows an account to directly -// fund the community pool. -message MsgFundCommunityPool { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - repeated cosmos.base.v1beta1.Coin amount = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - string depositor = 2; -} - -// MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. -message MsgFundCommunityPoolResponse {} diff --git a/third_party/proto/cosmos/evidence/v1beta1/evidence.proto b/third_party/proto/cosmos/evidence/v1beta1/evidence.proto deleted file mode 100644 index 14612c314f..0000000000 --- a/third_party/proto/cosmos/evidence/v1beta1/evidence.proto +++ /dev/null @@ -1,21 +0,0 @@ -syntax = "proto3"; -package cosmos.evidence.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; -option (gogoproto.equal_all) = true; - -import "gogoproto/gogo.proto"; -import "google/protobuf/timestamp.proto"; - -// Equivocation implements the Evidence interface and defines evidence of double -// signing misbehavior. -message Equivocation { - option (gogoproto.goproto_stringer) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.equal) = false; - - int64 height = 1; - google.protobuf.Timestamp time = 2 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - int64 power = 3; - string consensus_address = 4 [(gogoproto.moretags) = "yaml:\"consensus_address\""]; -} \ No newline at end of file diff --git a/third_party/proto/cosmos/evidence/v1beta1/genesis.proto b/third_party/proto/cosmos/evidence/v1beta1/genesis.proto deleted file mode 100644 index 199f446f7e..0000000000 --- a/third_party/proto/cosmos/evidence/v1beta1/genesis.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; -package cosmos.evidence.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; - -import "google/protobuf/any.proto"; - -// GenesisState defines the evidence module's genesis state. -message GenesisState { - // evidence defines all the evidence at genesis. - repeated google.protobuf.Any evidence = 1; -} diff --git a/third_party/proto/cosmos/evidence/v1beta1/query.proto b/third_party/proto/cosmos/evidence/v1beta1/query.proto deleted file mode 100644 index eda00544c7..0000000000 --- a/third_party/proto/cosmos/evidence/v1beta1/query.proto +++ /dev/null @@ -1,51 +0,0 @@ -syntax = "proto3"; -package cosmos.evidence.v1beta1; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "google/api/annotations.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; - -// Query defines the gRPC querier service. -service Query { - // Evidence queries evidence based on evidence hash. - rpc Evidence(QueryEvidenceRequest) returns (QueryEvidenceResponse) { - option (google.api.http).get = "/cosmos/evidence/v1beta1/evidence/{evidence_hash}"; - } - - // AllEvidence queries all evidence. - rpc AllEvidence(QueryAllEvidenceRequest) returns (QueryAllEvidenceResponse) { - option (google.api.http).get = "/cosmos/evidence/v1beta1/evidence"; - } -} - -// QueryEvidenceRequest is the request type for the Query/Evidence RPC method. -message QueryEvidenceRequest { - // evidence_hash defines the hash of the requested evidence. - bytes evidence_hash = 1 [(gogoproto.casttype) = "github.com/tendermint/tendermint/libs/bytes.HexBytes"]; -} - -// QueryEvidenceResponse is the response type for the Query/Evidence RPC method. -message QueryEvidenceResponse { - // evidence returns the requested evidence. - google.protobuf.Any evidence = 1; -} - -// QueryEvidenceRequest is the request type for the Query/AllEvidence RPC -// method. -message QueryAllEvidenceRequest { - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QueryAllEvidenceResponse is the response type for the Query/AllEvidence RPC -// method. -message QueryAllEvidenceResponse { - // evidence returns all evidences. - repeated google.protobuf.Any evidence = 1; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} diff --git a/third_party/proto/cosmos/evidence/v1beta1/tx.proto b/third_party/proto/cosmos/evidence/v1beta1/tx.proto deleted file mode 100644 index 38795f25d4..0000000000 --- a/third_party/proto/cosmos/evidence/v1beta1/tx.proto +++ /dev/null @@ -1,32 +0,0 @@ -syntax = "proto3"; -package cosmos.evidence.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; -option (gogoproto.equal_all) = true; - -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "cosmos_proto/cosmos.proto"; - -// Msg defines the evidence Msg service. -service Msg { - // SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or - // counterfactual signing. - rpc SubmitEvidence(MsgSubmitEvidence) returns (MsgSubmitEvidenceResponse); -} - -// MsgSubmitEvidence represents a message that supports submitting arbitrary -// Evidence of misbehavior such as equivocation or counterfactual signing. -message MsgSubmitEvidence { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string submitter = 1; - google.protobuf.Any evidence = 2 [(cosmos_proto.accepts_interface) = "Evidence"]; -} - -// MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. -message MsgSubmitEvidenceResponse { - // hash defines the hash of the evidence. - bytes hash = 4; -} diff --git a/third_party/proto/cosmos/feegrant/v1beta1/feegrant.proto b/third_party/proto/cosmos/feegrant/v1beta1/feegrant.proto deleted file mode 100644 index a86691f912..0000000000 --- a/third_party/proto/cosmos/feegrant/v1beta1/feegrant.proto +++ /dev/null @@ -1,78 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.feegrant.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/duration.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; - -// BasicAllowance implements Allowance with a one-time grant of tokens -// that optionally expires. The grantee can use up to SpendLimit to cover fees. -message BasicAllowance { - option (cosmos_proto.implements_interface) = "FeeAllowanceI"; - - // spend_limit specifies the maximum amount of tokens that can be spent - // by this allowance and will be updated as tokens are spent. If it is - // empty, there is no spend limit and any amount of coins can be spent. - repeated cosmos.base.v1beta1.Coin spend_limit = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - - // expiration specifies an optional time when this allowance expires - google.protobuf.Timestamp expiration = 2 [(gogoproto.stdtime) = true]; -} - -// PeriodicAllowance extends Allowance to allow for both a maximum cap, -// as well as a limit per time period. -message PeriodicAllowance { - option (cosmos_proto.implements_interface) = "FeeAllowanceI"; - - // basic specifies a struct of `BasicAllowance` - BasicAllowance basic = 1 [(gogoproto.nullable) = false]; - - // period specifies the time duration in which period_spend_limit coins can - // be spent before that allowance is reset - google.protobuf.Duration period = 2 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; - - // period_spend_limit specifies the maximum number of coins that can be spent - // in the period - repeated cosmos.base.v1beta1.Coin period_spend_limit = 3 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - - // period_can_spend is the number of coins left to be spent before the period_reset time - repeated cosmos.base.v1beta1.Coin period_can_spend = 4 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - - // period_reset is the time at which this period resets and a new one begins, - // it is calculated from the start time of the first transaction after the - // last period ended - google.protobuf.Timestamp period_reset = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; -} - -// AllowedMsgAllowance creates allowance only for specified message types. -message AllowedMsgAllowance { - option (gogoproto.goproto_getters) = false; - option (cosmos_proto.implements_interface) = "FeeAllowanceI"; - - // allowance can be any of basic and filtered fee allowance. - google.protobuf.Any allowance = 1 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"]; - - // allowed_messages are the messages for which the grantee has the access. - repeated string allowed_messages = 2; -} - -// Grant is stored in the KVStore to record a grant with full context -message Grant { - // granter is the address of the user granting an allowance of their funds. - string granter = 1; - - // grantee is the address of the user being granted an allowance of another user's funds. - string grantee = 2; - - // allowance can be any of basic and filtered fee allowance. - google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"]; -} diff --git a/third_party/proto/cosmos/feegrant/v1beta1/genesis.proto b/third_party/proto/cosmos/feegrant/v1beta1/genesis.proto deleted file mode 100644 index 5b1ac4ca55..0000000000 --- a/third_party/proto/cosmos/feegrant/v1beta1/genesis.proto +++ /dev/null @@ -1,13 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.feegrant.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/feegrant/v1beta1/feegrant.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; - -// GenesisState contains a set of fee allowances, persisted from the store -message GenesisState { - repeated Grant allowances = 1 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/cosmos/feegrant/v1beta1/query.proto b/third_party/proto/cosmos/feegrant/v1beta1/query.proto deleted file mode 100644 index 42d7a842de..0000000000 --- a/third_party/proto/cosmos/feegrant/v1beta1/query.proto +++ /dev/null @@ -1,78 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.feegrant.v1beta1; - -import "cosmos/feegrant/v1beta1/feegrant.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "google/api/annotations.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; - -// Query defines the gRPC querier service. -service Query { - - // Allowance returns fee granted to the grantee by the granter. - rpc Allowance(QueryAllowanceRequest) returns (QueryAllowanceResponse) { - option (google.api.http).get = "/cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}"; - } - - // Allowances returns all the grants for address. - rpc Allowances(QueryAllowancesRequest) returns (QueryAllowancesResponse) { - option (google.api.http).get = "/cosmos/feegrant/v1beta1/allowances/{grantee}"; - } - - // AllowancesByGranter returns all the grants given by an address - // Since v0.46 - rpc AllowancesByGranter(QueryAllowancesByGranterRequest) returns (QueryAllowancesByGranterResponse) { - option (google.api.http).get = "/cosmos/feegrant/v1beta1/issued/{granter}"; - } -} - -// QueryAllowanceRequest is the request type for the Query/Allowance RPC method. -message QueryAllowanceRequest { - // granter is the address of the user granting an allowance of their funds. - string granter = 1; - - // grantee is the address of the user being granted an allowance of another user's funds. - string grantee = 2; -} - -// QueryAllowanceResponse is the response type for the Query/Allowance RPC method. -message QueryAllowanceResponse { - // allowance is a allowance granted for grantee by granter. - cosmos.feegrant.v1beta1.Grant allowance = 1; -} - -// QueryAllowancesRequest is the request type for the Query/Allowances RPC method. -message QueryAllowancesRequest { - string grantee = 1; - - // pagination defines an pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryAllowancesResponse is the response type for the Query/Allowances RPC method. -message QueryAllowancesResponse { - // allowances are allowance's granted for grantee by granter. - repeated cosmos.feegrant.v1beta1.Grant allowances = 1; - - // pagination defines an pagination for the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. -message QueryAllowancesByGranterRequest { - string granter = 1; - - // pagination defines an pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. -message QueryAllowancesByGranterResponse { - // allowances that have been issued by the granter. - repeated cosmos.feegrant.v1beta1.Grant allowances = 1; - - // pagination defines an pagination for the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} diff --git a/third_party/proto/cosmos/feegrant/v1beta1/tx.proto b/third_party/proto/cosmos/feegrant/v1beta1/tx.proto deleted file mode 100644 index 2d875e9224..0000000000 --- a/third_party/proto/cosmos/feegrant/v1beta1/tx.proto +++ /dev/null @@ -1,49 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.feegrant.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "cosmos_proto/cosmos.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; - -// Msg defines the feegrant msg service. -service Msg { - - // GrantAllowance grants fee allowance to the grantee on the granter's - // account with the provided expiration time. - rpc GrantAllowance(MsgGrantAllowance) returns (MsgGrantAllowanceResponse); - - // RevokeAllowance revokes any fee allowance of granter's account that - // has been granted to the grantee. - rpc RevokeAllowance(MsgRevokeAllowance) returns (MsgRevokeAllowanceResponse); -} - -// MsgGrantAllowance adds permission for Grantee to spend up to Allowance -// of fees from the account of Granter. -message MsgGrantAllowance { - // granter is the address of the user granting an allowance of their funds. - string granter = 1; - - // grantee is the address of the user being granted an allowance of another user's funds. - string grantee = 2; - - // allowance can be any of basic and filtered fee allowance. - google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"]; -} - -// MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. -message MsgGrantAllowanceResponse {} - -// MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. -message MsgRevokeAllowance { - // granter is the address of the user granting an allowance of their funds. - string granter = 1; - - // grantee is the address of the user being granted an allowance of another user's funds. - string grantee = 2; -} - -// MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. -message MsgRevokeAllowanceResponse {} diff --git a/third_party/proto/cosmos/genutil/v1beta1/genesis.proto b/third_party/proto/cosmos/genutil/v1beta1/genesis.proto deleted file mode 100644 index a0207793d9..0000000000 --- a/third_party/proto/cosmos/genutil/v1beta1/genesis.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; -package cosmos.genutil.v1beta1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/genutil/types"; - -// GenesisState defines the raw genesis transaction in JSON. -message GenesisState { - // gen_txs defines the genesis transactions. - repeated bytes gen_txs = 1 [ - (gogoproto.casttype) = "encoding/json.RawMessage", - (gogoproto.jsontag) = "gentxs", - (gogoproto.moretags) = "yaml:\"gentxs\"" - ]; -} diff --git a/third_party/proto/cosmos/gov/v1beta1/genesis.proto b/third_party/proto/cosmos/gov/v1beta1/genesis.proto deleted file mode 100644 index a999500449..0000000000 --- a/third_party/proto/cosmos/gov/v1beta1/genesis.proto +++ /dev/null @@ -1,26 +0,0 @@ -syntax = "proto3"; - -package cosmos.gov.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/gov/v1beta1/gov.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; - -// GenesisState defines the gov module's genesis state. -message GenesisState { - // starting_proposal_id is the ID of the starting proposal. - uint64 starting_proposal_id = 1 [(gogoproto.moretags) = "yaml:\"starting_proposal_id\""]; - // deposits defines all the deposits present at genesis. - repeated Deposit deposits = 2 [(gogoproto.castrepeated) = "Deposits", (gogoproto.nullable) = false]; - // votes defines all the votes present at genesis. - repeated Vote votes = 3 [(gogoproto.castrepeated) = "Votes", (gogoproto.nullable) = false]; - // proposals defines all the proposals present at genesis. - repeated Proposal proposals = 4 [(gogoproto.castrepeated) = "Proposals", (gogoproto.nullable) = false]; - // params defines all the paramaters of related to deposit. - DepositParams deposit_params = 5 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"deposit_params\""]; - // params defines all the paramaters of related to voting. - VotingParams voting_params = 6 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"voting_params\""]; - // params defines all the paramaters of related to tally. - TallyParams tally_params = 7 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"tally_params\""]; -} diff --git a/third_party/proto/cosmos/gov/v1beta1/gov.proto b/third_party/proto/cosmos/gov/v1beta1/gov.proto deleted file mode 100644 index 01aebf950c..0000000000 --- a/third_party/proto/cosmos/gov/v1beta1/gov.proto +++ /dev/null @@ -1,200 +0,0 @@ -syntax = "proto3"; -package cosmos.gov.v1beta1; - -import "cosmos/base/v1beta1/coin.proto"; -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/any.proto"; -import "google/protobuf/duration.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; -option (gogoproto.goproto_stringer_all) = false; -option (gogoproto.stringer_all) = false; -option (gogoproto.goproto_getters_all) = false; - -// VoteOption enumerates the valid vote options for a given governance proposal. -enum VoteOption { - option (gogoproto.goproto_enum_prefix) = false; - - // VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - VOTE_OPTION_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "OptionEmpty"]; - // VOTE_OPTION_YES defines a yes vote option. - VOTE_OPTION_YES = 1 [(gogoproto.enumvalue_customname) = "OptionYes"]; - // VOTE_OPTION_ABSTAIN defines an abstain vote option. - VOTE_OPTION_ABSTAIN = 2 [(gogoproto.enumvalue_customname) = "OptionAbstain"]; - // VOTE_OPTION_NO defines a no vote option. - VOTE_OPTION_NO = 3 [(gogoproto.enumvalue_customname) = "OptionNo"]; - // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - VOTE_OPTION_NO_WITH_VETO = 4 [(gogoproto.enumvalue_customname) = "OptionNoWithVeto"]; -} - -// WeightedVoteOption defines a unit of vote for vote split. -// -// Since: cosmos-sdk 0.43 -message WeightedVoteOption { - VoteOption option = 1; - string weight = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"weight\"" - ]; -} - -// TextProposal defines a standard text proposal whose changes need to be -// manually updated in case of approval. -message TextProposal { - option (cosmos_proto.implements_interface) = "Content"; - - option (gogoproto.equal) = true; - - string title = 1; - string description = 2; -} - -// Deposit defines an amount deposited by an account address to an active -// proposal. -message Deposit { - option (gogoproto.goproto_getters) = false; - option (gogoproto.equal) = false; - - uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""]; - string depositor = 2; - repeated cosmos.base.v1beta1.Coin amount = 3 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; -} - -// Proposal defines the core field members of a governance proposal. -message Proposal { - option (gogoproto.equal) = true; - - uint64 proposal_id = 1 [(gogoproto.jsontag) = "id", (gogoproto.moretags) = "yaml:\"id\""]; - google.protobuf.Any content = 2 [(cosmos_proto.accepts_interface) = "Content"]; - ProposalStatus status = 3 [(gogoproto.moretags) = "yaml:\"proposal_status\""]; - TallyResult final_tally_result = 4 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"final_tally_result\""]; - google.protobuf.Timestamp submit_time = 5 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"submit_time\""]; - google.protobuf.Timestamp deposit_end_time = 6 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"deposit_end_time\""]; - repeated cosmos.base.v1beta1.Coin total_deposit = 7 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.moretags) = "yaml:\"total_deposit\"" - ]; - google.protobuf.Timestamp voting_start_time = 8 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"voting_start_time\""]; - google.protobuf.Timestamp voting_end_time = 9 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"voting_end_time\""]; -} - -// ProposalStatus enumerates the valid statuses of a proposal. -enum ProposalStatus { - option (gogoproto.goproto_enum_prefix) = false; - - // PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. - PROPOSAL_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "StatusNil"]; - // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - // period. - PROPOSAL_STATUS_DEPOSIT_PERIOD = 1 [(gogoproto.enumvalue_customname) = "StatusDepositPeriod"]; - // PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - // period. - PROPOSAL_STATUS_VOTING_PERIOD = 2 [(gogoproto.enumvalue_customname) = "StatusVotingPeriod"]; - // PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - // passed. - PROPOSAL_STATUS_PASSED = 3 [(gogoproto.enumvalue_customname) = "StatusPassed"]; - // PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - // been rejected. - PROPOSAL_STATUS_REJECTED = 4 [(gogoproto.enumvalue_customname) = "StatusRejected"]; - // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - // failed. - PROPOSAL_STATUS_FAILED = 5 [(gogoproto.enumvalue_customname) = "StatusFailed"]; -} - -// TallyResult defines a standard tally for a governance proposal. -message TallyResult { - option (gogoproto.equal) = true; - - string yes = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; - string abstain = 2 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; - string no = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; - string no_with_veto = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"no_with_veto\"" - ]; -} - -// Vote defines a vote on a governance proposal. -// A Vote consists of a proposal ID, the voter, and the vote option. -message Vote { - option (gogoproto.goproto_stringer) = false; - option (gogoproto.equal) = false; - - uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""]; - string voter = 2; - // Deprecated: Prefer to use `options` instead. This field is set in queries - // if and only if `len(options) == 1` and that option has weight 1. In all - // other cases, this field will default to VOTE_OPTION_UNSPECIFIED. - VoteOption option = 3 [deprecated = true]; - // Since: cosmos-sdk 0.43 - repeated WeightedVoteOption options = 4 [(gogoproto.nullable) = false]; -} - -// DepositParams defines the params for deposits on governance proposals. -message DepositParams { - // Minimum deposit for a proposal to enter voting period. - repeated cosmos.base.v1beta1.Coin min_deposit = 1 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.moretags) = "yaml:\"min_deposit\"", - (gogoproto.jsontag) = "min_deposit,omitempty" - ]; - - // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - // months. - google.protobuf.Duration max_deposit_period = 2 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.jsontag) = "max_deposit_period,omitempty", - (gogoproto.moretags) = "yaml:\"max_deposit_period\"" - ]; -} - -// VotingParams defines the params for voting on governance proposals. -message VotingParams { - // Length of the voting period. - google.protobuf.Duration voting_period = 1 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.jsontag) = "voting_period,omitempty", - (gogoproto.moretags) = "yaml:\"voting_period\"" - ]; -} - -// TallyParams defines the params for tallying votes on governance proposals. -message TallyParams { - // Minimum percentage of total stake needed to vote for a result to be - // considered valid. - bytes quorum = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "quorum,omitempty" - ]; - - // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. - bytes threshold = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "threshold,omitempty" - ]; - - // Minimum value of Veto votes to Total votes ratio for proposal to be - // vetoed. Default value: 1/3. - bytes veto_threshold = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "veto_threshold,omitempty", - (gogoproto.moretags) = "yaml:\"veto_threshold\"" - ]; -} diff --git a/third_party/proto/cosmos/gov/v1beta1/query.proto b/third_party/proto/cosmos/gov/v1beta1/query.proto deleted file mode 100644 index da62bdbad1..0000000000 --- a/third_party/proto/cosmos/gov/v1beta1/query.proto +++ /dev/null @@ -1,190 +0,0 @@ -syntax = "proto3"; -package cosmos.gov.v1beta1; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/gov/v1beta1/gov.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; - -// Query defines the gRPC querier service for gov module -service Query { - // Proposal queries proposal details based on ProposalID. - rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}"; - } - - // Proposals queries all proposals based on given status. - rpc Proposals(QueryProposalsRequest) returns (QueryProposalsResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/proposals"; - } - - // Vote queries voted information based on proposalID, voterAddr. - rpc Vote(QueryVoteRequest) returns (QueryVoteResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}"; - } - - // Votes queries votes of a given proposal. - rpc Votes(QueryVotesRequest) returns (QueryVotesResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/votes"; - } - - // Params queries all parameters of the gov module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/params/{params_type}"; - } - - // Deposit queries single deposit information based proposalID, depositAddr. - rpc Deposit(QueryDepositRequest) returns (QueryDepositResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}"; - } - - // Deposits queries all deposits of a single proposal. - rpc Deposits(QueryDepositsRequest) returns (QueryDepositsResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits"; - } - - // TallyResult queries the tally of a proposal vote. - rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/tally"; - } -} - -// QueryProposalRequest is the request type for the Query/Proposal RPC method. -message QueryProposalRequest { - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1; -} - -// QueryProposalResponse is the response type for the Query/Proposal RPC method. -message QueryProposalResponse { - Proposal proposal = 1 [(gogoproto.nullable) = false]; -} - -// QueryProposalsRequest is the request type for the Query/Proposals RPC method. -message QueryProposalsRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // proposal_status defines the status of the proposals. - ProposalStatus proposal_status = 1; - - // voter defines the voter address for the proposals. - string voter = 2; - - // depositor defines the deposit addresses from the proposals. - string depositor = 3; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 4; -} - -// QueryProposalsResponse is the response type for the Query/Proposals RPC -// method. -message QueryProposalsResponse { - repeated Proposal proposals = 1 [(gogoproto.nullable) = false]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryVoteRequest is the request type for the Query/Vote RPC method. -message QueryVoteRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1; - - // voter defines the oter address for the proposals. - string voter = 2; -} - -// QueryVoteResponse is the response type for the Query/Vote RPC method. -message QueryVoteResponse { - // vote defined the queried vote. - Vote vote = 1 [(gogoproto.nullable) = false]; -} - -// QueryVotesRequest is the request type for the Query/Votes RPC method. -message QueryVotesRequest { - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryVotesResponse is the response type for the Query/Votes RPC method. -message QueryVotesResponse { - // votes defined the queried votes. - repeated Vote votes = 1 [(gogoproto.nullable) = false]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryParamsRequest is the request type for the Query/Params RPC method. -message QueryParamsRequest { - // params_type defines which parameters to query for, can be one of "voting", - // "tallying" or "deposit". - string params_type = 1; -} - -// QueryParamsResponse is the response type for the Query/Params RPC method. -message QueryParamsResponse { - // voting_params defines the parameters related to voting. - VotingParams voting_params = 1 [(gogoproto.nullable) = false]; - // deposit_params defines the parameters related to deposit. - DepositParams deposit_params = 2 [(gogoproto.nullable) = false]; - // tally_params defines the parameters related to tally. - TallyParams tally_params = 3 [(gogoproto.nullable) = false]; -} - -// QueryDepositRequest is the request type for the Query/Deposit RPC method. -message QueryDepositRequest { - option (gogoproto.goproto_getters) = false; - option (gogoproto.equal) = false; - - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1; - - // depositor defines the deposit addresses from the proposals. - string depositor = 2; -} - -// QueryDepositResponse is the response type for the Query/Deposit RPC method. -message QueryDepositResponse { - // deposit defines the requested deposit. - Deposit deposit = 1 [(gogoproto.nullable) = false]; -} - -// QueryDepositsRequest is the request type for the Query/Deposits RPC method. -message QueryDepositsRequest { - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryDepositsResponse is the response type for the Query/Deposits RPC method. -message QueryDepositsResponse { - repeated Deposit deposits = 1 [(gogoproto.nullable) = false]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryTallyResultRequest is the request type for the Query/Tally RPC method. -message QueryTallyResultRequest { - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1; -} - -// QueryTallyResultResponse is the response type for the Query/Tally RPC method. -message QueryTallyResultResponse { - // tally defines the requested tally. - TallyResult tally = 1 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/cosmos/gov/v1beta1/tx.proto b/third_party/proto/cosmos/gov/v1beta1/tx.proto deleted file mode 100644 index 36c0a95d27..0000000000 --- a/third_party/proto/cosmos/gov/v1beta1/tx.proto +++ /dev/null @@ -1,99 +0,0 @@ -syntax = "proto3"; -package cosmos.gov.v1beta1; - -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/gov/v1beta1/gov.proto"; -import "cosmos_proto/cosmos.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; - -// Msg defines the bank Msg service. -service Msg { - // SubmitProposal defines a method to create new proposal given a content. - rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse); - - // Vote defines a method to add a vote on a specific proposal. - rpc Vote(MsgVote) returns (MsgVoteResponse); - - // VoteWeighted defines a method to add a weighted vote on a specific proposal. - // - // Since: cosmos-sdk 0.43 - rpc VoteWeighted(MsgVoteWeighted) returns (MsgVoteWeightedResponse); - - // Deposit defines a method to add deposit on a specific proposal. - rpc Deposit(MsgDeposit) returns (MsgDepositResponse); -} - -// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary -// proposal Content. -message MsgSubmitProposal { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "Content"]; - repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.moretags) = "yaml:\"initial_deposit\"" - ]; - string proposer = 3; -} - -// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. -message MsgSubmitProposalResponse { - uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""]; -} - -// MsgVote defines a message to cast a vote. -message MsgVote { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""]; - string voter = 2; - VoteOption option = 3; -} - -// MsgVoteResponse defines the Msg/Vote response type. -message MsgVoteResponse {} - -// MsgVoteWeighted defines a message to cast a vote. -// -// Since: cosmos-sdk 0.43 -message MsgVoteWeighted { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""]; - string voter = 2; - repeated WeightedVoteOption options = 3 [(gogoproto.nullable) = false]; -} - -// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. -// -// Since: cosmos-sdk 0.43 -message MsgVoteWeightedResponse {} - -// MsgDeposit defines a message to submit a deposit to an existing proposal. -message MsgDeposit { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""]; - string depositor = 2; - repeated cosmos.base.v1beta1.Coin amount = 3 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; -} - -// MsgDepositResponse defines the Msg/Deposit response type. -message MsgDepositResponse {} diff --git a/third_party/proto/cosmos/mint/v1beta1/genesis.proto b/third_party/proto/cosmos/mint/v1beta1/genesis.proto deleted file mode 100644 index 4e783fb544..0000000000 --- a/third_party/proto/cosmos/mint/v1beta1/genesis.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; -package cosmos.mint.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/mint/v1beta1/mint.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; - -// GenesisState defines the mint module's genesis state. -message GenesisState { - // minter is a space for holding current inflation information. - Minter minter = 1 [(gogoproto.nullable) = false]; - - // params defines all the paramaters of the module. - Params params = 2 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/cosmos/mint/v1beta1/mint.proto b/third_party/proto/cosmos/mint/v1beta1/mint.proto deleted file mode 100644 index f94d4ae2e8..0000000000 --- a/third_party/proto/cosmos/mint/v1beta1/mint.proto +++ /dev/null @@ -1,53 +0,0 @@ -syntax = "proto3"; -package cosmos.mint.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; - -import "gogoproto/gogo.proto"; - -// Minter represents the minting state. -message Minter { - // current annual inflation rate - string inflation = 1 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; - // current annual expected provisions - string annual_provisions = 2 [ - (gogoproto.moretags) = "yaml:\"annual_provisions\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; -} - -// Params holds parameters for the mint module. -message Params { - option (gogoproto.goproto_stringer) = false; - - // type of coin to mint - string mint_denom = 1; - // maximum annual change in inflation rate - string inflation_rate_change = 2 [ - (gogoproto.moretags) = "yaml:\"inflation_rate_change\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - // maximum inflation rate - string inflation_max = 3 [ - (gogoproto.moretags) = "yaml:\"inflation_max\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - // minimum inflation rate - string inflation_min = 4 [ - (gogoproto.moretags) = "yaml:\"inflation_min\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - // goal of percent bonded atoms - string goal_bonded = 5 [ - (gogoproto.moretags) = "yaml:\"goal_bonded\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - // expected blocks per year - uint64 blocks_per_year = 6 [(gogoproto.moretags) = "yaml:\"blocks_per_year\""]; -} diff --git a/third_party/proto/cosmos/mint/v1beta1/query.proto b/third_party/proto/cosmos/mint/v1beta1/query.proto deleted file mode 100644 index acd341d777..0000000000 --- a/third_party/proto/cosmos/mint/v1beta1/query.proto +++ /dev/null @@ -1,57 +0,0 @@ -syntax = "proto3"; -package cosmos.mint.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/mint/v1beta1/mint.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; - -// Query provides defines the gRPC querier service. -service Query { - // Params returns the total set of minting parameters. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/mint/v1beta1/params"; - } - - // Inflation returns the current minting inflation value. - rpc Inflation(QueryInflationRequest) returns (QueryInflationResponse) { - option (google.api.http).get = "/cosmos/mint/v1beta1/inflation"; - } - - // AnnualProvisions current minting annual provisions value. - rpc AnnualProvisions(QueryAnnualProvisionsRequest) returns (QueryAnnualProvisionsResponse) { - option (google.api.http).get = "/cosmos/mint/v1beta1/annual_provisions"; - } -} - -// QueryParamsRequest is the request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is the response type for the Query/Params RPC method. -message QueryParamsResponse { - // params defines the parameters of the module. - Params params = 1 [(gogoproto.nullable) = false]; -} - -// QueryInflationRequest is the request type for the Query/Inflation RPC method. -message QueryInflationRequest {} - -// QueryInflationResponse is the response type for the Query/Inflation RPC -// method. -message QueryInflationResponse { - // inflation is the current minting inflation value. - bytes inflation = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; -} - -// QueryAnnualProvisionsRequest is the request type for the -// Query/AnnualProvisions RPC method. -message QueryAnnualProvisionsRequest {} - -// QueryAnnualProvisionsResponse is the response type for the -// Query/AnnualProvisions RPC method. -message QueryAnnualProvisionsResponse { - // annual_provisions is the current minting annual provisions value. - bytes annual_provisions = 1 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; -} diff --git a/third_party/proto/cosmos/params/v1beta1/params.proto b/third_party/proto/cosmos/params/v1beta1/params.proto deleted file mode 100644 index 5382fd7999..0000000000 --- a/third_party/proto/cosmos/params/v1beta1/params.proto +++ /dev/null @@ -1,27 +0,0 @@ -syntax = "proto3"; -package cosmos.params.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/params/types/proposal"; -option (gogoproto.equal_all) = true; - -import "gogoproto/gogo.proto"; - -// ParameterChangeProposal defines a proposal to change one or more parameters. -message ParameterChangeProposal { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - string title = 1; - string description = 2; - repeated ParamChange changes = 3 [(gogoproto.nullable) = false]; -} - -// ParamChange defines an individual parameter change, for use in -// ParameterChangeProposal. -message ParamChange { - option (gogoproto.goproto_stringer) = false; - - string subspace = 1; - string key = 2; - string value = 3; -} diff --git a/third_party/proto/cosmos/params/v1beta1/query.proto b/third_party/proto/cosmos/params/v1beta1/query.proto deleted file mode 100644 index 1078e02ae3..0000000000 --- a/third_party/proto/cosmos/params/v1beta1/query.proto +++ /dev/null @@ -1,32 +0,0 @@ -syntax = "proto3"; -package cosmos.params.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/params/v1beta1/params.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/params/types/proposal"; - -// Query defines the gRPC querier service. -service Query { - // Params queries a specific parameter of a module, given its subspace and - // key. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/params/v1beta1/params"; - } -} - -// QueryParamsRequest is request type for the Query/Params RPC method. -message QueryParamsRequest { - // subspace defines the module to query the parameter for. - string subspace = 1; - - // key defines the key of the parameter in the subspace. - string key = 2; -} - -// QueryParamsResponse is response type for the Query/Params RPC method. -message QueryParamsResponse { - // param defines the queried parameter. - ParamChange param = 1 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/cosmos/slashing/v1beta1/genesis.proto b/third_party/proto/cosmos/slashing/v1beta1/genesis.proto deleted file mode 100644 index a7aebcfbad..0000000000 --- a/third_party/proto/cosmos/slashing/v1beta1/genesis.proto +++ /dev/null @@ -1,50 +0,0 @@ -syntax = "proto3"; -package cosmos.slashing.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; - -import "gogoproto/gogo.proto"; -import "cosmos/slashing/v1beta1/slashing.proto"; - -// GenesisState defines the slashing module's genesis state. -message GenesisState { - // params defines all the paramaters of related to deposit. - Params params = 1 [(gogoproto.nullable) = false]; - - // signing_infos represents a map between validator addresses and their - // signing infos. - repeated SigningInfo signing_infos = 2 - [(gogoproto.moretags) = "yaml:\"signing_infos\"", (gogoproto.nullable) = false]; - - // missed_blocks represents a map between validator addresses and their - // missed blocks. - repeated ValidatorMissedBlocks missed_blocks = 3 - [(gogoproto.moretags) = "yaml:\"missed_blocks\"", (gogoproto.nullable) = false]; -} - -// SigningInfo stores validator signing info of corresponding address. -message SigningInfo { - // address is the validator address. - string address = 1; - // validator_signing_info represents the signing info of this validator. - ValidatorSigningInfo validator_signing_info = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"validator_signing_info\""]; -} - -// ValidatorMissedBlocks contains array of missed blocks of corresponding -// address. -message ValidatorMissedBlocks { - // address is the validator address. - string address = 1; - // missed_blocks is an array of missed blocks by the validator. - repeated MissedBlock missed_blocks = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"missed_blocks\""]; -} - -// MissedBlock contains height and missed status as boolean. -message MissedBlock { - // index is the height at which the block was missed. - int64 index = 1; - // missed is the missed status. - bool missed = 2; -} diff --git a/third_party/proto/cosmos/slashing/v1beta1/query.proto b/third_party/proto/cosmos/slashing/v1beta1/query.proto deleted file mode 100644 index 869049a0ed..0000000000 --- a/third_party/proto/cosmos/slashing/v1beta1/query.proto +++ /dev/null @@ -1,63 +0,0 @@ -syntax = "proto3"; -package cosmos.slashing.v1beta1; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/slashing/v1beta1/slashing.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; - -// Query provides defines the gRPC querier service -service Query { - // Params queries the parameters of slashing module - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/slashing/v1beta1/params"; - } - - // SigningInfo queries the signing info of given cons address - rpc SigningInfo(QuerySigningInfoRequest) returns (QuerySigningInfoResponse) { - option (google.api.http).get = "/cosmos/slashing/v1beta1/signing_infos/{cons_address}"; - } - - // SigningInfos queries signing info of all validators - rpc SigningInfos(QuerySigningInfosRequest) returns (QuerySigningInfosResponse) { - option (google.api.http).get = "/cosmos/slashing/v1beta1/signing_infos"; - } -} - -// QueryParamsRequest is the request type for the Query/Params RPC method -message QueryParamsRequest {} - -// QueryParamsResponse is the response type for the Query/Params RPC method -message QueryParamsResponse { - Params params = 1 [(gogoproto.nullable) = false]; -} - -// QuerySigningInfoRequest is the request type for the Query/SigningInfo RPC -// method -message QuerySigningInfoRequest { - // cons_address is the address to query signing info of - string cons_address = 1; -} - -// QuerySigningInfoResponse is the response type for the Query/SigningInfo RPC -// method -message QuerySigningInfoResponse { - // val_signing_info is the signing info of requested val cons address - ValidatorSigningInfo val_signing_info = 1 [(gogoproto.nullable) = false]; -} - -// QuerySigningInfosRequest is the request type for the Query/SigningInfos RPC -// method -message QuerySigningInfosRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QuerySigningInfosResponse is the response type for the Query/SigningInfos RPC -// method -message QuerySigningInfosResponse { - // info is the signing info of all validators - repeated cosmos.slashing.v1beta1.ValidatorSigningInfo info = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} diff --git a/third_party/proto/cosmos/slashing/v1beta1/slashing.proto b/third_party/proto/cosmos/slashing/v1beta1/slashing.proto deleted file mode 100644 index 882a0fb60c..0000000000 --- a/third_party/proto/cosmos/slashing/v1beta1/slashing.proto +++ /dev/null @@ -1,58 +0,0 @@ -syntax = "proto3"; -package cosmos.slashing.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; -option (gogoproto.equal_all) = true; - -import "gogoproto/gogo.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -// ValidatorSigningInfo defines a validator's signing info for monitoring their -// liveness activity. -message ValidatorSigningInfo { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - string address = 1; - // Height at which validator was first a candidate OR was unjailed - int64 start_height = 2 [(gogoproto.moretags) = "yaml:\"start_height\""]; - // Index which is incremented each time the validator was a bonded - // in a block and may have signed a precommit or not. This in conjunction with the - // `SignedBlocksWindow` param determines the index in the `MissedBlocksBitArray`. - int64 index_offset = 3 [(gogoproto.moretags) = "yaml:\"index_offset\""]; - // Timestamp until which the validator is jailed due to liveness downtime. - google.protobuf.Timestamp jailed_until = 4 - [(gogoproto.moretags) = "yaml:\"jailed_until\"", (gogoproto.stdtime) = true, (gogoproto.nullable) = false]; - // Whether or not a validator has been tombstoned (killed out of validator set). It is set - // once the validator commits an equivocation or for any other configured misbehiavor. - bool tombstoned = 5; - // A counter kept to avoid unnecessary array reads. - // Note that `Sum(MissedBlocksBitArray)` always equals `MissedBlocksCounter`. - int64 missed_blocks_counter = 6 [(gogoproto.moretags) = "yaml:\"missed_blocks_counter\""]; -} - -// Params represents the parameters used for by the slashing module. -message Params { - int64 signed_blocks_window = 1 [(gogoproto.moretags) = "yaml:\"signed_blocks_window\""]; - bytes min_signed_per_window = 2 [ - (gogoproto.moretags) = "yaml:\"min_signed_per_window\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - google.protobuf.Duration downtime_jail_duration = 3 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.moretags) = "yaml:\"downtime_jail_duration\"" - ]; - bytes slash_fraction_double_sign = 4 [ - (gogoproto.moretags) = "yaml:\"slash_fraction_double_sign\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - bytes slash_fraction_downtime = 5 [ - (gogoproto.moretags) = "yaml:\"slash_fraction_downtime\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; -} diff --git a/third_party/proto/cosmos/slashing/v1beta1/tx.proto b/third_party/proto/cosmos/slashing/v1beta1/tx.proto deleted file mode 100644 index 4d63370ecc..0000000000 --- a/third_party/proto/cosmos/slashing/v1beta1/tx.proto +++ /dev/null @@ -1,26 +0,0 @@ -syntax = "proto3"; -package cosmos.slashing.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; -option (gogoproto.equal_all) = true; - -import "gogoproto/gogo.proto"; - -// Msg defines the slashing Msg service. -service Msg { - // Unjail defines a method for unjailing a jailed validator, thus returning - // them into the bonded validator set, so they can begin receiving provisions - // and rewards again. - rpc Unjail(MsgUnjail) returns (MsgUnjailResponse); -} - -// MsgUnjail defines the Msg/Unjail request type -message MsgUnjail { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = true; - - string validator_addr = 1 [(gogoproto.moretags) = "yaml:\"address\"", (gogoproto.jsontag) = "address"]; -} - -// MsgUnjailResponse defines the Msg/Unjail response type -message MsgUnjailResponse {} \ No newline at end of file diff --git a/third_party/proto/cosmos/staking/v1beta1/authz.proto b/third_party/proto/cosmos/staking/v1beta1/authz.proto deleted file mode 100644 index d50c329c91..0000000000 --- a/third_party/proto/cosmos/staking/v1beta1/authz.proto +++ /dev/null @@ -1,47 +0,0 @@ -syntax = "proto3"; -package cosmos.staking.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/base/v1beta1/coin.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; - -// StakeAuthorization defines authorization for delegate/undelegate/redelegate. -// -// Since: cosmos-sdk 0.43 -message StakeAuthorization { - option (cosmos_proto.implements_interface) = "Authorization"; - - // max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is - // empty, there is no spend limit and any amount of coins can be delegated. - cosmos.base.v1beta1.Coin max_tokens = 1 [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin"]; - // validators is the oneof that represents either allow_list or deny_list - oneof validators { - // allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's - // account. - Validators allow_list = 2; - // deny_list specifies list of validator addresses to whom grantee can not delegate tokens. - Validators deny_list = 3; - } - // Validators defines list of validator addresses. - message Validators { - repeated string address = 1; - } - // authorization_type defines one of AuthorizationType. - AuthorizationType authorization_type = 4; -} - -// AuthorizationType defines the type of staking module authorization type -// -// Since: cosmos-sdk 0.43 -enum AuthorizationType { - // AUTHORIZATION_TYPE_UNSPECIFIED specifies an unknown authorization type - AUTHORIZATION_TYPE_UNSPECIFIED = 0; - // AUTHORIZATION_TYPE_DELEGATE defines an authorization type for Msg/Delegate - AUTHORIZATION_TYPE_DELEGATE = 1; - // AUTHORIZATION_TYPE_UNDELEGATE defines an authorization type for Msg/Undelegate - AUTHORIZATION_TYPE_UNDELEGATE = 2; - // AUTHORIZATION_TYPE_REDELEGATE defines an authorization type for Msg/BeginRedelegate - AUTHORIZATION_TYPE_REDELEGATE = 3; -} diff --git a/third_party/proto/cosmos/staking/v1beta1/genesis.proto b/third_party/proto/cosmos/staking/v1beta1/genesis.proto deleted file mode 100644 index d1563dbc54..0000000000 --- a/third_party/proto/cosmos/staking/v1beta1/genesis.proto +++ /dev/null @@ -1,53 +0,0 @@ -syntax = "proto3"; -package cosmos.staking.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; - -import "gogoproto/gogo.proto"; -import "cosmos/staking/v1beta1/staking.proto"; - -// GenesisState defines the staking module's genesis state. -message GenesisState { - // params defines all the paramaters of related to deposit. - Params params = 1 [(gogoproto.nullable) = false]; - - // last_total_power tracks the total amounts of bonded tokens recorded during - // the previous end block. - bytes last_total_power = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"last_total_power\"", - (gogoproto.nullable) = false - ]; - - // last_validator_powers is a special index that provides a historical list - // of the last-block's bonded validators. - repeated LastValidatorPower last_validator_powers = 3 - [(gogoproto.moretags) = "yaml:\"last_validator_powers\"", (gogoproto.nullable) = false]; - - // delegations defines the validator set at genesis. - repeated Validator validators = 4 [(gogoproto.nullable) = false]; - - // delegations defines the delegations active at genesis. - repeated Delegation delegations = 5 [(gogoproto.nullable) = false]; - - // unbonding_delegations defines the unbonding delegations active at genesis. - repeated UnbondingDelegation unbonding_delegations = 6 - [(gogoproto.moretags) = "yaml:\"unbonding_delegations\"", (gogoproto.nullable) = false]; - - // redelegations defines the redelegations active at genesis. - repeated Redelegation redelegations = 7 [(gogoproto.nullable) = false]; - - bool exported = 8; -} - -// LastValidatorPower required for validator set update logic. -message LastValidatorPower { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // address is the address of the validator. - string address = 1; - - // power defines the power of the validator. - int64 power = 2; -} diff --git a/third_party/proto/cosmos/staking/v1beta1/query.proto b/third_party/proto/cosmos/staking/v1beta1/query.proto deleted file mode 100644 index 4852c53535..0000000000 --- a/third_party/proto/cosmos/staking/v1beta1/query.proto +++ /dev/null @@ -1,348 +0,0 @@ -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 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 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 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/third_party/proto/cosmos/staking/v1beta1/staking.proto b/third_party/proto/cosmos/staking/v1beta1/staking.proto deleted file mode 100644 index 76e9599e2d..0000000000 --- a/third_party/proto/cosmos/staking/v1beta1/staking.proto +++ /dev/null @@ -1,334 +0,0 @@ -syntax = "proto3"; -package cosmos.staking.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -import "cosmos_proto/cosmos.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "tendermint/types/types.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; - -// HistoricalInfo contains header and validator information for a given block. -// It is stored as part of staking module's state, which persists the `n` most -// recent HistoricalInfo -// (`n` is set by the staking module's `historical_entries` parameter). -message HistoricalInfo { - tendermint.types.Header header = 1 [(gogoproto.nullable) = false]; - repeated Validator valset = 2 [(gogoproto.nullable) = false]; -} - -// CommissionRates defines the initial commission rates to be used for creating -// a validator. -message CommissionRates { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - // rate is the commission rate charged to delegators, as a fraction. - string rate = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; - // max_rate defines the maximum commission rate which validator can ever charge, as a fraction. - string max_rate = 2 [ - (gogoproto.moretags) = "yaml:\"max_rate\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - // max_change_rate defines the maximum daily increase of the validator commission, as a fraction. - string max_change_rate = 3 [ - (gogoproto.moretags) = "yaml:\"max_change_rate\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; -} - -// Commission defines commission parameters for a given validator. -message Commission { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - // commission_rates defines the initial commission rates to be used for creating a validator. - CommissionRates commission_rates = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; - // update_time is the last time the commission rate was changed. - google.protobuf.Timestamp update_time = 2 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"update_time\""]; -} - -// Description defines a validator description. -message Description { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - // moniker defines a human-readable name for the validator. - string moniker = 1; - // identity defines an optional identity signature (ex. UPort or Keybase). - string identity = 2; - // website defines an optional website link. - string website = 3; - // security_contact defines an optional email for security contact. - string security_contact = 4 [(gogoproto.moretags) = "yaml:\"security_contact\""]; - // details define other optional details. - string details = 5; -} - -// Validator defines a validator, together with the total amount of the -// Validator's bond shares and their exchange rate to coins. Slashing results in -// a decrease in the exchange rate, allowing correct calculation of future -// undelegations without iterating over delegators. When coins are delegated to -// this validator, the validator is credited with a delegation whose number of -// bond shares is based on the amount of coins delegated divided by the current -// exchange rate. Voting power can be calculated as total bonded shares -// multiplied by exchange rate. -message Validator { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.goproto_getters) = false; - - // operator_address defines the address of the validator's operator; bech encoded in JSON. - string operator_address = 1 [(gogoproto.moretags) = "yaml:\"operator_address\""]; - // consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. - google.protobuf.Any consensus_pubkey = 2 - [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey", (gogoproto.moretags) = "yaml:\"consensus_pubkey\""]; - // jailed defined whether the validator has been jailed from bonded status or not. - bool jailed = 3; - // status is the validator status (bonded/unbonding/unbonded). - BondStatus status = 4; - // tokens define the delegated tokens (incl. self-delegation). - string tokens = 5 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; - // delegator_shares defines total shares issued to a validator's delegators. - string delegator_shares = 6 [ - (gogoproto.moretags) = "yaml:\"delegator_shares\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - // description defines the description terms for the validator. - Description description = 7 [(gogoproto.nullable) = false]; - // unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. - int64 unbonding_height = 8 [(gogoproto.moretags) = "yaml:\"unbonding_height\""]; - // unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. - google.protobuf.Timestamp unbonding_time = 9 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"unbonding_time\""]; - // commission defines the commission parameters. - Commission commission = 10 [(gogoproto.nullable) = false]; - // min_self_delegation is the validator's self declared minimum self delegation. - string min_self_delegation = 11 [ - (gogoproto.moretags) = "yaml:\"min_self_delegation\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; -} - -// BondStatus is the status of a validator. -enum BondStatus { - option (gogoproto.goproto_enum_prefix) = false; - - // UNSPECIFIED defines an invalid validator status. - BOND_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "Unspecified"]; - // UNBONDED defines a validator that is not bonded. - BOND_STATUS_UNBONDED = 1 [(gogoproto.enumvalue_customname) = "Unbonded"]; - // UNBONDING defines a validator that is unbonding. - BOND_STATUS_UNBONDING = 2 [(gogoproto.enumvalue_customname) = "Unbonding"]; - // BONDED defines a validator that is bonded. - BOND_STATUS_BONDED = 3 [(gogoproto.enumvalue_customname) = "Bonded"]; -} - -// ValAddresses defines a repeated set of validator addresses. -message ValAddresses { - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = true; - - repeated string addresses = 1; -} - -// DVPair is struct that just has a delegator-validator pair with no other data. -// It is intended to be used as a marshalable pointer. For example, a DVPair can -// be used to construct the key to getting an UnbondingDelegation from state. -message DVPair { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; -} - -// DVPairs defines an array of DVPair objects. -message DVPairs { - repeated DVPair pairs = 1 [(gogoproto.nullable) = false]; -} - -// DVVTriplet is struct that just has a delegator-validator-validator triplet -// with no other data. It is intended to be used as a marshalable pointer. For -// example, a DVVTriplet can be used to construct the key to getting a -// Redelegation from state. -message DVVTriplet { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - string validator_src_address = 2 [(gogoproto.moretags) = "yaml:\"validator_src_address\""]; - string validator_dst_address = 3 [(gogoproto.moretags) = "yaml:\"validator_dst_address\""]; -} - -// DVVTriplets defines an array of DVVTriplet objects. -message DVVTriplets { - repeated DVVTriplet triplets = 1 [(gogoproto.nullable) = false]; -} - -// Delegation represents the bond with tokens held by an account. It is -// owned by one delegator, and is associated with the voting power of one -// validator. -message Delegation { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - // delegator_address is the bech32-encoded address of the delegator. - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - // validator_address is the bech32-encoded address of the validator. - string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; - // shares define the delegation shares received. - string shares = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; -} - -// UnbondingDelegation stores all of a single delegator's unbonding bonds -// for a single validator in an time-ordered list. -message UnbondingDelegation { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - // delegator_address is the bech32-encoded address of the delegator. - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - // validator_address is the bech32-encoded address of the validator. - string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; - // entries are the unbonding delegation entries. - repeated UnbondingDelegationEntry entries = 3 [(gogoproto.nullable) = false]; // unbonding delegation entries -} - -// UnbondingDelegationEntry defines an unbonding object with relevant metadata. -message UnbondingDelegationEntry { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - // creation_height is the height which the unbonding took place. - int64 creation_height = 1 [(gogoproto.moretags) = "yaml:\"creation_height\""]; - // completion_time is the unix time for unbonding completion. - google.protobuf.Timestamp completion_time = 2 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"completion_time\""]; - // initial_balance defines the tokens initially scheduled to receive at completion. - string initial_balance = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"initial_balance\"" - ]; - // balance defines the tokens to receive at completion. - string balance = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; -} - -// RedelegationEntry defines a redelegation object with relevant metadata. -message RedelegationEntry { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - // creation_height defines the height which the redelegation took place. - int64 creation_height = 1 [(gogoproto.moretags) = "yaml:\"creation_height\""]; - // completion_time defines the unix time for redelegation completion. - google.protobuf.Timestamp completion_time = 2 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"completion_time\""]; - // initial_balance defines the initial balance when redelegation started. - string initial_balance = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"initial_balance\"" - ]; - // shares_dst is the amount of destination-validator shares created by redelegation. - string shares_dst = 4 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; -} - -// Redelegation contains the list of a particular delegator's redelegating bonds -// from a particular source validator to a particular destination validator. -message Redelegation { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - // delegator_address is the bech32-encoded address of the delegator. - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - // validator_src_address is the validator redelegation source operator address. - string validator_src_address = 2 [(gogoproto.moretags) = "yaml:\"validator_src_address\""]; - // validator_dst_address is the validator redelegation destination operator address. - string validator_dst_address = 3 [(gogoproto.moretags) = "yaml:\"validator_dst_address\""]; - // entries are the redelegation entries. - repeated RedelegationEntry entries = 4 [(gogoproto.nullable) = false]; // redelegation entries -} - -// Params defines the parameters for the staking module. -message Params { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - // unbonding_time is the time duration of unbonding. - google.protobuf.Duration unbonding_time = 1 - [(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.moretags) = "yaml:\"unbonding_time\""]; - // max_validators is the maximum number of validators. - uint32 max_validators = 2 [(gogoproto.moretags) = "yaml:\"max_validators\""]; - // max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). - uint32 max_entries = 3 [(gogoproto.moretags) = "yaml:\"max_entries\""]; - // historical_entries is the number of historical entries to persist. - uint32 historical_entries = 4 [(gogoproto.moretags) = "yaml:\"historical_entries\""]; - // bond_denom defines the bondable coin denomination. - string bond_denom = 5 [(gogoproto.moretags) = "yaml:\"bond_denom\""]; -} - -// DelegationResponse is equivalent to Delegation except that it contains a -// balance in addition to shares which is more suitable for client responses. -message DelegationResponse { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - - Delegation delegation = 1 [(gogoproto.nullable) = false]; - - cosmos.base.v1beta1.Coin balance = 2 [(gogoproto.nullable) = false]; -} - -// RedelegationEntryResponse is equivalent to a RedelegationEntry except that it -// contains a balance in addition to shares which is more suitable for client -// responses. -message RedelegationEntryResponse { - option (gogoproto.equal) = true; - - RedelegationEntry redelegation_entry = 1 [(gogoproto.nullable) = false]; - string balance = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; -} - -// RedelegationResponse is equivalent to a Redelegation except that its entries -// contain a balance in addition to shares which is more suitable for client -// responses. -message RedelegationResponse { - option (gogoproto.equal) = false; - - Redelegation redelegation = 1 [(gogoproto.nullable) = false]; - repeated RedelegationEntryResponse entries = 2 [(gogoproto.nullable) = false]; -} - -// Pool is used for tracking bonded and not-bonded token supply of the bond -// denomination. -message Pool { - option (gogoproto.description) = true; - option (gogoproto.equal) = true; - string not_bonded_tokens = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.jsontag) = "not_bonded_tokens", - (gogoproto.nullable) = false - ]; - string bonded_tokens = 2 [ - (gogoproto.jsontag) = "bonded_tokens", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"bonded_tokens\"" - ]; -} diff --git a/third_party/proto/cosmos/staking/v1beta1/tx.proto b/third_party/proto/cosmos/staking/v1beta1/tx.proto deleted file mode 100644 index d074fe010e..0000000000 --- a/third_party/proto/cosmos/staking/v1beta1/tx.proto +++ /dev/null @@ -1,123 +0,0 @@ -syntax = "proto3"; -package cosmos.staking.v1beta1; - -import "google/protobuf/any.proto"; -import "google/protobuf/timestamp.proto"; -import "gogoproto/gogo.proto"; - -import "cosmos_proto/cosmos.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/staking/v1beta1/staking.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; - -// Msg defines the staking Msg service. -service Msg { - // CreateValidator defines a method for creating a new validator. - rpc CreateValidator(MsgCreateValidator) returns (MsgCreateValidatorResponse); - - // EditValidator defines a method for editing an existing validator. - rpc EditValidator(MsgEditValidator) returns (MsgEditValidatorResponse); - - // Delegate defines a method for performing a delegation of coins - // from a delegator to a validator. - rpc Delegate(MsgDelegate) returns (MsgDelegateResponse); - - // BeginRedelegate defines a method for performing a redelegation - // of coins from a delegator and source validator to a destination validator. - rpc BeginRedelegate(MsgBeginRedelegate) returns (MsgBeginRedelegateResponse); - - // Undelegate defines a method for performing an undelegation from a - // delegate and a validator. - rpc Undelegate(MsgUndelegate) returns (MsgUndelegateResponse); -} - -// MsgCreateValidator defines a SDK message for creating a new validator. -message MsgCreateValidator { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - Description description = 1 [(gogoproto.nullable) = false]; - CommissionRates commission = 2 [(gogoproto.nullable) = false]; - string min_self_delegation = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"min_self_delegation\"", - (gogoproto.nullable) = false - ]; - string delegator_address = 4 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - string validator_address = 5 [(gogoproto.moretags) = "yaml:\"validator_address\""]; - google.protobuf.Any pubkey = 6 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; - cosmos.base.v1beta1.Coin value = 7 [(gogoproto.nullable) = false]; -} - -// MsgCreateValidatorResponse defines the Msg/CreateValidator response type. -message MsgCreateValidatorResponse {} - -// MsgEditValidator defines a SDK message for editing an existing validator. -message MsgEditValidator { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - Description description = 1 [(gogoproto.nullable) = false]; - string validator_address = 2 [(gogoproto.moretags) = "yaml:\"address\""]; - - // We pass a reference to the new commission rate and min self delegation as - // it's not mandatory to update. If not updated, the deserialized rate will be - // zero with no way to distinguish if an update was intended. - // REF: #2373 - string commission_rate = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.moretags) = "yaml:\"commission_rate\"" - ]; - string min_self_delegation = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"min_self_delegation\"" - ]; -} - -// MsgEditValidatorResponse defines the Msg/EditValidator response type. -message MsgEditValidatorResponse {} - -// MsgDelegate defines a SDK message for performing a delegation of coins -// from a delegator to a validator. -message MsgDelegate { - option (gogoproto.equal) = false; - - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; - cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false]; -} - -// MsgDelegateResponse defines the Msg/Delegate response type. -message MsgDelegateResponse {} - -// MsgBeginRedelegate defines a SDK message for performing a redelegation -// of coins from a delegator and source validator to a destination validator. -message MsgBeginRedelegate { - option (gogoproto.equal) = false; - - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - string validator_src_address = 2 [(gogoproto.moretags) = "yaml:\"validator_src_address\""]; - string validator_dst_address = 3 [(gogoproto.moretags) = "yaml:\"validator_dst_address\""]; - cosmos.base.v1beta1.Coin amount = 4 [(gogoproto.nullable) = false]; -} - -// MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. -message MsgBeginRedelegateResponse { - google.protobuf.Timestamp completion_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; -} - -// MsgUndelegate defines a SDK message for performing an undelegation from a -// delegate and a validator. -message MsgUndelegate { - option (gogoproto.equal) = false; - - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; - cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false]; -} - -// MsgUndelegateResponse defines the Msg/Undelegate response type. -message MsgUndelegateResponse { - google.protobuf.Timestamp completion_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; -} diff --git a/third_party/proto/cosmos/tx/signing/v1beta1/signing.proto b/third_party/proto/cosmos/tx/signing/v1beta1/signing.proto deleted file mode 100644 index 50de89c8fc..0000000000 --- a/third_party/proto/cosmos/tx/signing/v1beta1/signing.proto +++ /dev/null @@ -1,91 +0,0 @@ -syntax = "proto3"; -package cosmos.tx.signing.v1beta1; - -import "cosmos/crypto/multisig/v1beta1/multisig.proto"; -import "google/protobuf/any.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/types/tx/signing"; - -// SignMode represents a signing mode with its own security guarantees. -enum SignMode { - // SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be - // rejected - SIGN_MODE_UNSPECIFIED = 0; - - // SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is - // verified with raw bytes from Tx - SIGN_MODE_DIRECT = 1; - - // SIGN_MODE_TEXTUAL is a future signing mode that will verify some - // human-readable textual representation on top of the binary representation - // from SIGN_MODE_DIRECT - SIGN_MODE_TEXTUAL = 2; - - // SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses - // Amino JSON and will be removed in the future - SIGN_MODE_LEGACY_AMINO_JSON = 127; - - // SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos - // SDK. Ref: https://eips.ethereum.org/EIPS/eip-191 - // - // Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant, - // but is not implemented on the SDK by default. To enable EIP-191, you need - // to pass a custom `TxConfig` that has an implementation of - // `SignModeHandler` for EIP-191. The SDK may decide to fully support - // EIP-191 in the future. - // - // Since: cosmos-sdk 0.45.2 - SIGN_MODE_EIP_191 = 191; -} - -// SignatureDescriptors wraps multiple SignatureDescriptor's. -message SignatureDescriptors { - // signatures are the signature descriptors - repeated SignatureDescriptor signatures = 1; -} - -// SignatureDescriptor is a convenience type which represents the full data for -// a signature including the public key of the signer, signing modes and the -// signature itself. It is primarily used for coordinating signatures between -// clients. -message SignatureDescriptor { - // public_key is the public key of the signer - google.protobuf.Any public_key = 1; - - Data data = 2; - - // sequence is the sequence of the account, which describes the - // number of committed transactions signed by a given address. It is used to prevent - // replay attacks. - uint64 sequence = 3; - - // Data represents signature data - message Data { - // sum is the oneof that specifies whether this represents single or multi-signature data - oneof sum { - // single represents a single signer - Single single = 1; - - // multi represents a multisig signer - Multi multi = 2; - } - - // Single is the signature data for a single signer - message Single { - // mode is the signing mode of the single signer - SignMode mode = 1; - - // signature is the raw signature bytes - bytes signature = 2; - } - - // Multi is the signature data for a multisig public key - message Multi { - // bitarray specifies which keys within the multisig are signing - cosmos.crypto.multisig.v1beta1.CompactBitArray bitarray = 1; - - // signatures is the signatures of the multi-signature - repeated Data signatures = 2; - } - } -} diff --git a/third_party/proto/cosmos/tx/v1beta1/service.proto b/third_party/proto/cosmos/tx/v1beta1/service.proto deleted file mode 100644 index d9f828f763..0000000000 --- a/third_party/proto/cosmos/tx/v1beta1/service.proto +++ /dev/null @@ -1,165 +0,0 @@ -syntax = "proto3"; -package cosmos.tx.v1beta1; - -import "google/api/annotations.proto"; -import "cosmos/base/abci/v1beta1/abci.proto"; -import "cosmos/tx/v1beta1/tx.proto"; -import "gogoproto/gogo.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "tendermint/types/block.proto"; -import "tendermint/types/types.proto"; - -option (gogoproto.goproto_registration) = true; -option go_package = "github.com/cosmos/cosmos-sdk/types/tx"; - -// Service defines a gRPC service for interacting with transactions. -service Service { - // Simulate simulates executing a transaction for estimating gas usage. - rpc Simulate(SimulateRequest) returns (SimulateResponse) { - option (google.api.http) = { - post: "/cosmos/tx/v1beta1/simulate" - body: "*" - }; - } - // GetTx fetches a tx by hash. - rpc GetTx(GetTxRequest) returns (GetTxResponse) { - option (google.api.http).get = "/cosmos/tx/v1beta1/txs/{hash}"; - } - // BroadcastTx broadcast transaction. - rpc BroadcastTx(BroadcastTxRequest) returns (BroadcastTxResponse) { - option (google.api.http) = { - post: "/cosmos/tx/v1beta1/txs" - body: "*" - }; - } - // GetTxsEvent fetches txs by event. - rpc GetTxsEvent(GetTxsEventRequest) returns (GetTxsEventResponse) { - option (google.api.http).get = "/cosmos/tx/v1beta1/txs"; - } - // GetBlockWithTxs fetches a block with decoded txs. - // - // Since: cosmos-sdk 0.45.2 - rpc GetBlockWithTxs(GetBlockWithTxsRequest) returns (GetBlockWithTxsResponse) { - option (google.api.http).get = "/cosmos/tx/v1beta1/txs/block/{height}"; - } -} - -// GetTxsEventRequest is the request type for the Service.TxsByEvents -// RPC method. -message GetTxsEventRequest { - // events is the list of transaction event type. - repeated string events = 1; - // pagination defines a pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; - OrderBy order_by = 3; -} - -// OrderBy defines the sorting order -enum OrderBy { - // ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. - ORDER_BY_UNSPECIFIED = 0; - // ORDER_BY_ASC defines ascending order - ORDER_BY_ASC = 1; - // ORDER_BY_DESC defines descending order - ORDER_BY_DESC = 2; -} - -// GetTxsEventResponse is the response type for the Service.TxsByEvents -// RPC method. -message GetTxsEventResponse { - // txs is the list of queried transactions. - repeated cosmos.tx.v1beta1.Tx txs = 1; - // tx_responses is the list of queried TxResponses. - repeated cosmos.base.abci.v1beta1.TxResponse tx_responses = 2; - // pagination defines a pagination for the response. - cosmos.base.query.v1beta1.PageResponse pagination = 3; -} - -// BroadcastTxRequest is the request type for the Service.BroadcastTxRequest -// RPC method. -message BroadcastTxRequest { - // tx_bytes is the raw transaction. - bytes tx_bytes = 1; - BroadcastMode mode = 2; -} - -// BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. -enum BroadcastMode { - // zero-value for mode ordering - BROADCAST_MODE_UNSPECIFIED = 0; - // BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for - // the tx to be committed in a block. - BROADCAST_MODE_BLOCK = 1; - // BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for - // a CheckTx execution response only. - BROADCAST_MODE_SYNC = 2; - // BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns - // immediately. - BROADCAST_MODE_ASYNC = 3; -} - -// BroadcastTxResponse is the response type for the -// Service.BroadcastTx method. -message BroadcastTxResponse { - // tx_response is the queried TxResponses. - cosmos.base.abci.v1beta1.TxResponse tx_response = 1; -} - -// SimulateRequest is the request type for the Service.Simulate -// RPC method. -message SimulateRequest { - // tx is the transaction to simulate. - // Deprecated. Send raw tx bytes instead. - cosmos.tx.v1beta1.Tx tx = 1 [deprecated = true]; - // tx_bytes is the raw transaction. - // - // Since: cosmos-sdk 0.43 - bytes tx_bytes = 2; -} - -// SimulateResponse is the response type for the -// Service.SimulateRPC method. -message SimulateResponse { - // gas_info is the information about gas used in the simulation. - cosmos.base.abci.v1beta1.GasInfo gas_info = 1; - // result is the result of the simulation. - cosmos.base.abci.v1beta1.Result result = 2; -} - -// GetTxRequest is the request type for the Service.GetTx -// RPC method. -message GetTxRequest { - // hash is the tx hash to query, encoded as a hex string. - string hash = 1; -} - -// GetTxResponse is the response type for the Service.GetTx method. -message GetTxResponse { - // tx is the queried transaction. - cosmos.tx.v1beta1.Tx tx = 1; - // tx_response is the queried TxResponses. - cosmos.base.abci.v1beta1.TxResponse tx_response = 2; -} - -// GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs -// RPC method. -// -// Since: cosmos-sdk 0.45.2 -message GetBlockWithTxsRequest { - // height is the height of the block to query. - int64 height = 1; - // pagination defines a pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. -// -// Since: cosmos-sdk 0.45.2 -message GetBlockWithTxsResponse { - // txs are the transactions in the block. - repeated cosmos.tx.v1beta1.Tx txs = 1; - .tendermint.types.BlockID block_id = 2; - .tendermint.types.Block block = 3; - // pagination defines a pagination for the response. - cosmos.base.query.v1beta1.PageResponse pagination = 4; -} \ No newline at end of file diff --git a/third_party/proto/cosmos/tx/v1beta1/tx.proto b/third_party/proto/cosmos/tx/v1beta1/tx.proto deleted file mode 100644 index 6d5caf12c7..0000000000 --- a/third_party/proto/cosmos/tx/v1beta1/tx.proto +++ /dev/null @@ -1,183 +0,0 @@ -syntax = "proto3"; -package cosmos.tx.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/crypto/multisig/v1beta1/multisig.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/tx/signing/v1beta1/signing.proto"; -import "google/protobuf/any.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/types/tx"; - -// Tx is the standard type used for broadcasting transactions. -message Tx { - // body is the processable content of the transaction - TxBody body = 1; - - // auth_info is the authorization related content of the transaction, - // specifically signers, signer modes and fee - AuthInfo auth_info = 2; - - // signatures is a list of signatures that matches the length and order of - // AuthInfo's signer_infos to allow connecting signature meta information like - // public key and signing mode by position. - repeated bytes signatures = 3; -} - -// TxRaw is a variant of Tx that pins the signer's exact binary representation -// of body and auth_info. This is used for signing, broadcasting and -// verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and -// the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used -// as the transaction ID. -message TxRaw { - // body_bytes is a protobuf serialization of a TxBody that matches the - // representation in SignDoc. - bytes body_bytes = 1; - - // auth_info_bytes is a protobuf serialization of an AuthInfo that matches the - // representation in SignDoc. - bytes auth_info_bytes = 2; - - // signatures is a list of signatures that matches the length and order of - // AuthInfo's signer_infos to allow connecting signature meta information like - // public key and signing mode by position. - repeated bytes signatures = 3; -} - -// SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. -message SignDoc { - // body_bytes is protobuf serialization of a TxBody that matches the - // representation in TxRaw. - bytes body_bytes = 1; - - // auth_info_bytes is a protobuf serialization of an AuthInfo that matches the - // representation in TxRaw. - bytes auth_info_bytes = 2; - - // chain_id is the unique identifier of the chain this transaction targets. - // It prevents signed transactions from being used on another chain by an - // attacker - string chain_id = 3; - - // account_number is the account number of the account in state - uint64 account_number = 4; -} - -// TxBody is the body of a transaction that all signers sign over. -message TxBody { - // messages is a list of messages to be executed. The required signers of - // those messages define the number and order of elements in AuthInfo's - // signer_infos and Tx's signatures. Each required signer address is added to - // the list only the first time it occurs. - // By convention, the first required signer (usually from the first message) - // is referred to as the primary signer and pays the fee for the whole - // transaction. - repeated google.protobuf.Any messages = 1; - - // memo is any arbitrary note/comment to be added to the transaction. - // WARNING: in clients, any publicly exposed text should not be called memo, - // but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). - string memo = 2; - - // timeout is the block height after which this transaction will not - // be processed by the chain - uint64 timeout_height = 3; - - // extension_options are arbitrary options that can be added by chains - // when the default options are not sufficient. If any of these are present - // and can't be handled, the transaction will be rejected - repeated google.protobuf.Any extension_options = 1023; - - // extension_options are arbitrary options that can be added by chains - // when the default options are not sufficient. If any of these are present - // and can't be handled, they will be ignored - repeated google.protobuf.Any non_critical_extension_options = 2047; -} - -// AuthInfo describes the fee and signer modes that are used to sign a -// transaction. -message AuthInfo { - // signer_infos defines the signing modes for the required signers. The number - // and order of elements must match the required signers from TxBody's - // messages. The first element is the primary signer and the one which pays - // the fee. - repeated SignerInfo signer_infos = 1; - - // Fee is the fee and gas limit for the transaction. The first signer is the - // primary signer and the one which pays the fee. The fee can be calculated - // based on the cost of evaluating the body and doing signature verification - // of the signers. This can be estimated via simulation. - Fee fee = 2; -} - -// SignerInfo describes the public key and signing mode of a single top-level -// signer. -message SignerInfo { - // public_key is the public key of the signer. It is optional for accounts - // that already exist in state. If unset, the verifier can use the required \ - // signer address for this position and lookup the public key. - google.protobuf.Any public_key = 1; - - // mode_info describes the signing mode of the signer and is a nested - // structure to support nested multisig pubkey's - ModeInfo mode_info = 2; - - // sequence is the sequence of the account, which describes the - // number of committed transactions signed by a given address. It is used to - // prevent replay attacks. - uint64 sequence = 3; -} - -// ModeInfo describes the signing mode of a single or nested multisig signer. -message ModeInfo { - // sum is the oneof that specifies whether this represents a single or nested - // multisig signer - oneof sum { - // single represents a single signer - Single single = 1; - - // multi represents a nested multisig signer - Multi multi = 2; - } - - // Single is the mode info for a single signer. It is structured as a message - // to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the - // future - message Single { - // mode is the signing mode of the single signer - cosmos.tx.signing.v1beta1.SignMode mode = 1; - } - - // Multi is the mode info for a multisig public key - message Multi { - // bitarray specifies which keys within the multisig are signing - cosmos.crypto.multisig.v1beta1.CompactBitArray bitarray = 1; - - // mode_infos is the corresponding modes of the signers of the multisig - // which could include nested multisig public keys - repeated ModeInfo mode_infos = 2; - } -} - -// Fee includes the amount of coins paid in fees and the maximum -// gas to be used by the transaction. The ratio yields an effective "gasprice", -// which must be above some miminum to be accepted into the mempool. -message Fee { - // amount is the amount of coins to be paid as a fee - repeated cosmos.base.v1beta1.Coin amount = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - - // gas_limit is the maximum gas that can be used in transaction processing - // before an out of gas error occurs - uint64 gas_limit = 2; - - // if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. - // the payer must be a tx signer (and thus have signed this field in AuthInfo). - // setting this field does *not* change the ordering of required signers for the transaction. - string payer = 3; - - // if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used - // to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does - // not support fee grants, this will fail - string granter = 4; -} diff --git a/third_party/proto/cosmos/upgrade/v1beta1/query.proto b/third_party/proto/cosmos/upgrade/v1beta1/query.proto deleted file mode 100644 index dd14ba6401..0000000000 --- a/third_party/proto/cosmos/upgrade/v1beta1/query.proto +++ /dev/null @@ -1,104 +0,0 @@ -syntax = "proto3"; -package cosmos.upgrade.v1beta1; - -import "google/protobuf/any.proto"; -import "google/api/annotations.proto"; -import "cosmos/upgrade/v1beta1/upgrade.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/upgrade/types"; - -// Query defines the gRPC upgrade querier service. -service Query { - // CurrentPlan queries the current upgrade plan. - rpc CurrentPlan(QueryCurrentPlanRequest) returns (QueryCurrentPlanResponse) { - option (google.api.http).get = "/cosmos/upgrade/v1beta1/current_plan"; - } - - // AppliedPlan queries a previously applied upgrade plan by its name. - rpc AppliedPlan(QueryAppliedPlanRequest) returns (QueryAppliedPlanResponse) { - option (google.api.http).get = "/cosmos/upgrade/v1beta1/applied_plan/{name}"; - } - - // UpgradedConsensusState queries the consensus state that will serve - // as a trusted kernel for the next version of this chain. It will only be - // stored at the last height of this chain. - // UpgradedConsensusState RPC not supported with legacy querier - // This rpc is deprecated now that IBC has its own replacement - // (https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54) - rpc UpgradedConsensusState(QueryUpgradedConsensusStateRequest) returns (QueryUpgradedConsensusStateResponse) { - option deprecated = true; - option (google.api.http).get = "/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}"; - } - - // ModuleVersions queries the list of module versions from state. - // - // Since: cosmos-sdk 0.43 - rpc ModuleVersions(QueryModuleVersionsRequest) returns (QueryModuleVersionsResponse) { - option (google.api.http).get = "/cosmos/upgrade/v1beta1/module_versions"; - } -} - -// QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC -// method. -message QueryCurrentPlanRequest {} - -// QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC -// method. -message QueryCurrentPlanResponse { - // plan is the current upgrade plan. - Plan plan = 1; -} - -// QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC -// method. -message QueryAppliedPlanRequest { - // name is the name of the applied plan to query for. - string name = 1; -} - -// QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC -// method. -message QueryAppliedPlanResponse { - // height is the block height at which the plan was applied. - int64 height = 1; -} - -// QueryUpgradedConsensusStateRequest is the request type for the Query/UpgradedConsensusState -// RPC method. -message QueryUpgradedConsensusStateRequest { - option deprecated = true; - - // last height of the current chain must be sent in request - // as this is the height under which next consensus state is stored - int64 last_height = 1; -} - -// QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState -// RPC method. -message QueryUpgradedConsensusStateResponse { - option deprecated = true; - reserved 1; - - // Since: cosmos-sdk 0.43 - bytes upgraded_consensus_state = 2; -} - -// QueryModuleVersionsRequest is the request type for the Query/ModuleVersions -// RPC method. -// -// Since: cosmos-sdk 0.43 -message QueryModuleVersionsRequest { - // module_name is a field to query a specific module - // consensus version from state. Leaving this empty will - // fetch the full list of module versions from state - string module_name = 1; -} - -// QueryModuleVersionsResponse is the response type for the Query/ModuleVersions -// RPC method. -// -// Since: cosmos-sdk 0.43 -message QueryModuleVersionsResponse { - // module_versions is a list of module names with their consensus versions. - repeated ModuleVersion module_versions = 1; -} diff --git a/third_party/proto/cosmos/upgrade/v1beta1/upgrade.proto b/third_party/proto/cosmos/upgrade/v1beta1/upgrade.proto deleted file mode 100644 index e888b393d6..0000000000 --- a/third_party/proto/cosmos/upgrade/v1beta1/upgrade.proto +++ /dev/null @@ -1,78 +0,0 @@ -syntax = "proto3"; -package cosmos.upgrade.v1beta1; - -import "google/protobuf/any.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/upgrade/types"; -option (gogoproto.goproto_getters_all) = false; - -// Plan specifies information about a planned upgrade and when it should occur. -message Plan { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - // Sets the name for the upgrade. This name will be used by the upgraded - // version of the software to apply any special "on-upgrade" commands during - // the first BeginBlock method after the upgrade is applied. It is also used - // to detect whether a software version can handle a given upgrade. If no - // upgrade handler with this name has been set in the software, it will be - // assumed that the software is out-of-date when the upgrade Time or Height is - // reached and the software will exit. - string name = 1; - - // Deprecated: Time based upgrades have been deprecated. Time based upgrade logic - // has been removed from the SDK. - // If this field is not empty, an error will be thrown. - google.protobuf.Timestamp time = 2 [deprecated = true, (gogoproto.stdtime) = true, (gogoproto.nullable) = false]; - - // The height at which the upgrade must be performed. - // Only used if Time is not set. - int64 height = 3; - - // Any application specific upgrade info to be included on-chain - // such as a git commit that validators could automatically upgrade to - string info = 4; - - // Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been - // moved to the IBC module in the sub module 02-client. - // If this field is not empty, an error will be thrown. - google.protobuf.Any upgraded_client_state = 5 - [deprecated = true, (gogoproto.moretags) = "yaml:\"upgraded_client_state\""]; -} - -// SoftwareUpgradeProposal is a gov Content type for initiating a software -// upgrade. -message SoftwareUpgradeProposal { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - string title = 1; - string description = 2; - Plan plan = 3 [(gogoproto.nullable) = false]; -} - -// CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software -// upgrade. -message CancelSoftwareUpgradeProposal { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - string title = 1; - string description = 2; -} - -// ModuleVersion specifies a module and its consensus version. -// -// Since: cosmos-sdk 0.43 -message ModuleVersion { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = true; - - // name of the app module - string name = 1; - - // consensus version of the app module - uint64 version = 2; -} diff --git a/third_party/proto/cosmos/vesting/v1beta1/tx.proto b/third_party/proto/cosmos/vesting/v1beta1/tx.proto deleted file mode 100644 index c49be802a7..0000000000 --- a/third_party/proto/cosmos/vesting/v1beta1/tx.proto +++ /dev/null @@ -1,31 +0,0 @@ -syntax = "proto3"; -package cosmos.vesting.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"; - -// Msg defines the bank Msg service. -service Msg { - // CreateVestingAccount defines a method that enables creating a vesting - // account. - rpc CreateVestingAccount(MsgCreateVestingAccount) returns (MsgCreateVestingAccountResponse); -} - -// MsgCreateVestingAccount defines a message that enables creating a vesting -// account. -message MsgCreateVestingAccount { - option (gogoproto.equal) = true; - - string from_address = 1 [(gogoproto.moretags) = "yaml:\"from_address\""]; - string to_address = 2 [(gogoproto.moretags) = "yaml:\"to_address\""]; - repeated cosmos.base.v1beta1.Coin amount = 3 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - - int64 end_time = 4 [(gogoproto.moretags) = "yaml:\"end_time\""]; - bool delayed = 5; -} - -// MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. -message MsgCreateVestingAccountResponse {} \ No newline at end of file diff --git a/third_party/proto/cosmos/vesting/v1beta1/vesting.proto b/third_party/proto/cosmos/vesting/v1beta1/vesting.proto deleted file mode 100644 index e9f661f93c..0000000000 --- a/third_party/proto/cosmos/vesting/v1beta1/vesting.proto +++ /dev/null @@ -1,85 +0,0 @@ -syntax = "proto3"; -package cosmos.vesting.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/auth/v1beta1/auth.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"; - -// BaseVestingAccount implements the VestingAccount interface. It contains all -// the necessary fields needed for any vesting account implementation. -message BaseVestingAccount { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - cosmos.auth.v1beta1.BaseAccount base_account = 1 [(gogoproto.embed) = true]; - repeated cosmos.base.v1beta1.Coin original_vesting = 2 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.moretags) = "yaml:\"original_vesting\"" - ]; - repeated cosmos.base.v1beta1.Coin delegated_free = 3 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.moretags) = "yaml:\"delegated_free\"" - ]; - repeated cosmos.base.v1beta1.Coin delegated_vesting = 4 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.moretags) = "yaml:\"delegated_vesting\"" - ]; - int64 end_time = 5 [(gogoproto.moretags) = "yaml:\"end_time\""]; -} - -// ContinuousVestingAccount implements the VestingAccount interface. It -// continuously vests by unlocking coins linearly with respect to time. -message ContinuousVestingAccount { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; - int64 start_time = 2 [(gogoproto.moretags) = "yaml:\"start_time\""]; -} - -// DelayedVestingAccount implements the VestingAccount interface. It vests all -// coins after a specific time, but non prior. In other words, it keeps them -// locked until a specified time. -message DelayedVestingAccount { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; -} - -// Period defines a length of time and amount of coins that will vest. -message Period { - option (gogoproto.goproto_stringer) = false; - - int64 length = 1; - repeated cosmos.base.v1beta1.Coin amount = 2 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; -} - -// PeriodicVestingAccount implements the VestingAccount interface. It -// periodically vests by unlocking coins during each specified period. -message PeriodicVestingAccount { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; - int64 start_time = 2 [(gogoproto.moretags) = "yaml:\"start_time\""]; - repeated Period vesting_periods = 3 [(gogoproto.moretags) = "yaml:\"vesting_periods\"", (gogoproto.nullable) = false]; -} - -// PermanentLockedAccount implements the VestingAccount interface. It does -// not ever release coins, locking them indefinitely. Coins in this account can -// still be used for delegating and for governance votes even while locked. -// -// Since: cosmos-sdk 0.43 -message PermanentLockedAccount { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; -} diff --git a/third_party/proto/cosmos_proto/cosmos.proto b/third_party/proto/cosmos_proto/cosmos.proto deleted file mode 100644 index 167b170757..0000000000 --- a/third_party/proto/cosmos_proto/cosmos.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; -package cosmos_proto; - -import "google/protobuf/descriptor.proto"; - -option go_package = "github.com/regen-network/cosmos-proto"; - -extend google.protobuf.MessageOptions { - string interface_type = 93001; - - string implements_interface = 93002; -} - -extend google.protobuf.FieldOptions { - string accepts_interface = 93001; -} diff --git a/third_party/proto/gogoproto/gogo.proto b/third_party/proto/gogoproto/gogo.proto deleted file mode 100644 index 49e78f99fe..0000000000 --- a/third_party/proto/gogoproto/gogo.proto +++ /dev/null @@ -1,145 +0,0 @@ -// Protocol Buffers for Go with Gadgets -// -// Copyright (c) 2013, The GoGo Authors. All rights reserved. -// http://github.com/gogo/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto2"; -package gogoproto; - -import "google/protobuf/descriptor.proto"; - -option java_package = "com.google.protobuf"; -option java_outer_classname = "GoGoProtos"; -option go_package = "github.com/gogo/protobuf/gogoproto"; - -extend google.protobuf.EnumOptions { - optional bool goproto_enum_prefix = 62001; - optional bool goproto_enum_stringer = 62021; - optional bool enum_stringer = 62022; - optional string enum_customname = 62023; - optional bool enumdecl = 62024; -} - -extend google.protobuf.EnumValueOptions { - optional string enumvalue_customname = 66001; -} - -extend google.protobuf.FileOptions { - optional bool goproto_getters_all = 63001; - optional bool goproto_enum_prefix_all = 63002; - optional bool goproto_stringer_all = 63003; - optional bool verbose_equal_all = 63004; - optional bool face_all = 63005; - optional bool gostring_all = 63006; - optional bool populate_all = 63007; - optional bool stringer_all = 63008; - optional bool onlyone_all = 63009; - - optional bool equal_all = 63013; - optional bool description_all = 63014; - optional bool testgen_all = 63015; - optional bool benchgen_all = 63016; - optional bool marshaler_all = 63017; - optional bool unmarshaler_all = 63018; - optional bool stable_marshaler_all = 63019; - - optional bool sizer_all = 63020; - - optional bool goproto_enum_stringer_all = 63021; - optional bool enum_stringer_all = 63022; - - optional bool unsafe_marshaler_all = 63023; - optional bool unsafe_unmarshaler_all = 63024; - - optional bool goproto_extensions_map_all = 63025; - optional bool goproto_unrecognized_all = 63026; - optional bool gogoproto_import = 63027; - optional bool protosizer_all = 63028; - optional bool compare_all = 63029; - optional bool typedecl_all = 63030; - optional bool enumdecl_all = 63031; - - optional bool goproto_registration = 63032; - optional bool messagename_all = 63033; - - optional bool goproto_sizecache_all = 63034; - optional bool goproto_unkeyed_all = 63035; -} - -extend google.protobuf.MessageOptions { - optional bool goproto_getters = 64001; - optional bool goproto_stringer = 64003; - optional bool verbose_equal = 64004; - optional bool face = 64005; - optional bool gostring = 64006; - optional bool populate = 64007; - optional bool stringer = 67008; - optional bool onlyone = 64009; - - optional bool equal = 64013; - optional bool description = 64014; - optional bool testgen = 64015; - optional bool benchgen = 64016; - optional bool marshaler = 64017; - optional bool unmarshaler = 64018; - optional bool stable_marshaler = 64019; - - optional bool sizer = 64020; - - optional bool unsafe_marshaler = 64023; - optional bool unsafe_unmarshaler = 64024; - - optional bool goproto_extensions_map = 64025; - optional bool goproto_unrecognized = 64026; - - optional bool protosizer = 64028; - optional bool compare = 64029; - - optional bool typedecl = 64030; - - optional bool messagename = 64033; - - optional bool goproto_sizecache = 64034; - optional bool goproto_unkeyed = 64035; -} - -extend google.protobuf.FieldOptions { - optional bool nullable = 65001; - optional bool embed = 65002; - optional string customtype = 65003; - optional string customname = 65004; - optional string jsontag = 65005; - optional string moretags = 65006; - optional string casttype = 65007; - optional string castkey = 65008; - optional string castvalue = 65009; - - optional bool stdtime = 65010; - optional bool stdduration = 65011; - optional bool wktpointer = 65012; - - optional string castrepeated = 65013; -} diff --git a/third_party/proto/google/api/annotations.proto b/third_party/proto/google/api/annotations.proto deleted file mode 100644 index 85c361b47f..0000000000 --- a/third_party/proto/google/api/annotations.proto +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) 2015, Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.api; - -import "google/api/http.proto"; -import "google/protobuf/descriptor.proto"; - -option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; -option java_multiple_files = true; -option java_outer_classname = "AnnotationsProto"; -option java_package = "com.google.api"; -option objc_class_prefix = "GAPI"; - -extend google.protobuf.MethodOptions { - // See `HttpRule`. - HttpRule http = 72295728; -} diff --git a/third_party/proto/google/api/http.proto b/third_party/proto/google/api/http.proto deleted file mode 100644 index 2bd3a19bfa..0000000000 --- a/third_party/proto/google/api/http.proto +++ /dev/null @@ -1,318 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.api; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; -option java_multiple_files = true; -option java_outer_classname = "HttpProto"; -option java_package = "com.google.api"; -option objc_class_prefix = "GAPI"; - - -// Defines the HTTP configuration for an API service. It contains a list of -// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method -// to one or more HTTP REST API methods. -message Http { - // A list of HTTP configuration rules that apply to individual API methods. - // - // **NOTE:** All service configuration rules follow "last one wins" order. - repeated HttpRule rules = 1; - - // When set to true, URL path parmeters will be fully URI-decoded except in - // cases of single segment matches in reserved expansion, where "%2F" will be - // left encoded. - // - // The default behavior is to not decode RFC 6570 reserved characters in multi - // segment matches. - bool fully_decode_reserved_expansion = 2; -} - -// `HttpRule` defines the mapping of an RPC method to one or more HTTP -// REST API methods. The mapping specifies how different portions of the RPC -// request message are mapped to URL path, URL query parameters, and -// HTTP request body. The mapping is typically specified as an -// `google.api.http` annotation on the RPC method, -// see "google/api/annotations.proto" for details. -// -// The mapping consists of a field specifying the path template and -// method kind. The path template can refer to fields in the request -// message, as in the example below which describes a REST GET -// operation on a resource collection of messages: -// -// -// service Messaging { -// rpc GetMessage(GetMessageRequest) returns (Message) { -// option (google.api.http).get = "/v1/messages/{message_id}/{sub.subfield}"; -// } -// } -// message GetMessageRequest { -// message SubMessage { -// string subfield = 1; -// } -// string message_id = 1; // mapped to the URL -// SubMessage sub = 2; // `sub.subfield` is url-mapped -// } -// message Message { -// string text = 1; // content of the resource -// } -// -// The same http annotation can alternatively be expressed inside the -// `GRPC API Configuration` YAML file. -// -// http: -// rules: -// - selector: .Messaging.GetMessage -// get: /v1/messages/{message_id}/{sub.subfield} -// -// This definition enables an automatic, bidrectional mapping of HTTP -// JSON to RPC. Example: -// -// HTTP | RPC -// -----|----- -// `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub: SubMessage(subfield: "foo"))` -// -// In general, not only fields but also field paths can be referenced -// from a path pattern. Fields mapped to the path pattern cannot be -// repeated and must have a primitive (non-message) type. -// -// Any fields in the request message which are not bound by the path -// pattern automatically become (optional) HTTP query -// parameters. Assume the following definition of the request message: -// -// -// service Messaging { -// rpc GetMessage(GetMessageRequest) returns (Message) { -// option (google.api.http).get = "/v1/messages/{message_id}"; -// } -// } -// message GetMessageRequest { -// message SubMessage { -// string subfield = 1; -// } -// string message_id = 1; // mapped to the URL -// int64 revision = 2; // becomes a parameter -// SubMessage sub = 3; // `sub.subfield` becomes a parameter -// } -// -// -// This enables a HTTP JSON to RPC mapping as below: -// -// HTTP | RPC -// -----|----- -// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: "foo"))` -// -// Note that fields which are mapped to HTTP parameters must have a -// primitive type or a repeated primitive type. Message types are not -// allowed. In the case of a repeated type, the parameter can be -// repeated in the URL, as in `...?param=A¶m=B`. -// -// For HTTP method kinds which allow a request body, the `body` field -// specifies the mapping. Consider a REST update method on the -// message resource collection: -// -// -// service Messaging { -// rpc UpdateMessage(UpdateMessageRequest) returns (Message) { -// option (google.api.http) = { -// put: "/v1/messages/{message_id}" -// body: "message" -// }; -// } -// } -// message UpdateMessageRequest { -// string message_id = 1; // mapped to the URL -// Message message = 2; // mapped to the body -// } -// -// -// The following HTTP JSON to RPC mapping is enabled, where the -// representation of the JSON in the request body is determined by -// protos JSON encoding: -// -// HTTP | RPC -// -----|----- -// `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" message { text: "Hi!" })` -// -// The special name `*` can be used in the body mapping to define that -// every field not bound by the path template should be mapped to the -// request body. This enables the following alternative definition of -// the update method: -// -// service Messaging { -// rpc UpdateMessage(Message) returns (Message) { -// option (google.api.http) = { -// put: "/v1/messages/{message_id}" -// body: "*" -// }; -// } -// } -// message Message { -// string message_id = 1; -// string text = 2; -// } -// -// -// The following HTTP JSON to RPC mapping is enabled: -// -// HTTP | RPC -// -----|----- -// `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" text: "Hi!")` -// -// Note that when using `*` in the body mapping, it is not possible to -// have HTTP parameters, as all fields not bound by the path end in -// the body. This makes this option more rarely used in practice of -// defining REST APIs. The common usage of `*` is in custom methods -// which don't use the URL at all for transferring data. -// -// It is possible to define multiple HTTP methods for one RPC by using -// the `additional_bindings` option. Example: -// -// service Messaging { -// rpc GetMessage(GetMessageRequest) returns (Message) { -// option (google.api.http) = { -// get: "/v1/messages/{message_id}" -// additional_bindings { -// get: "/v1/users/{user_id}/messages/{message_id}" -// } -// }; -// } -// } -// message GetMessageRequest { -// string message_id = 1; -// string user_id = 2; -// } -// -// -// This enables the following two alternative HTTP JSON to RPC -// mappings: -// -// HTTP | RPC -// -----|----- -// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` -// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: "123456")` -// -// # Rules for HTTP mapping -// -// The rules for mapping HTTP path, query parameters, and body fields -// to the request message are as follows: -// -// 1. The `body` field specifies either `*` or a field path, or is -// omitted. If omitted, it indicates there is no HTTP request body. -// 2. Leaf fields (recursive expansion of nested messages in the -// request) can be classified into three types: -// (a) Matched in the URL template. -// (b) Covered by body (if body is `*`, everything except (a) fields; -// else everything under the body field) -// (c) All other fields. -// 3. URL query parameters found in the HTTP request are mapped to (c) fields. -// 4. Any body sent with an HTTP request can contain only (b) fields. -// -// The syntax of the path template is as follows: -// -// Template = "/" Segments [ Verb ] ; -// Segments = Segment { "/" Segment } ; -// Segment = "*" | "**" | LITERAL | Variable ; -// Variable = "{" FieldPath [ "=" Segments ] "}" ; -// FieldPath = IDENT { "." IDENT } ; -// Verb = ":" LITERAL ; -// -// The syntax `*` matches a single path segment. The syntax `**` matches zero -// or more path segments, which must be the last part of the path except the -// `Verb`. The syntax `LITERAL` matches literal text in the path. -// -// The syntax `Variable` matches part of the URL path as specified by its -// template. A variable template must not contain other variables. If a variable -// matches a single path segment, its template may be omitted, e.g. `{var}` -// is equivalent to `{var=*}`. -// -// If a variable contains exactly one path segment, such as `"{var}"` or -// `"{var=*}"`, when such a variable is expanded into a URL path, all characters -// except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the -// Discovery Document as `{var}`. -// -// If a variable contains one or more path segments, such as `"{var=foo/*}"` -// or `"{var=**}"`, when such a variable is expanded into a URL path, all -// characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables -// show up in the Discovery Document as `{+var}`. -// -// NOTE: While the single segment variable matches the semantics of -// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 -// Simple String Expansion, the multi segment variable **does not** match -// RFC 6570 Reserved Expansion. The reason is that the Reserved Expansion -// does not expand special characters like `?` and `#`, which would lead -// to invalid URLs. -// -// NOTE: the field paths in variables and in the `body` must not refer to -// repeated fields or map fields. -message HttpRule { - // Selects methods to which this rule applies. - // - // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. - string selector = 1; - - // Determines the URL pattern is matched by this rules. This pattern can be - // used with any of the {get|put|post|delete|patch} methods. A custom method - // can be defined using the 'custom' field. - oneof pattern { - // Used for listing and getting information about resources. - string get = 2; - - // Used for updating a resource. - string put = 3; - - // Used for creating a resource. - string post = 4; - - // Used for deleting a resource. - string delete = 5; - - // Used for updating a resource. - string patch = 6; - - // The custom pattern is used for specifying an HTTP method that is not - // included in the `pattern` field, such as HEAD, or "*" to leave the - // HTTP method unspecified for this rule. The wild-card rule is useful - // for services that provide content to Web (HTML) clients. - CustomHttpPattern custom = 8; - } - - // The name of the request field whose value is mapped to the HTTP body, or - // `*` for mapping all fields not captured by the path pattern to the HTTP - // body. NOTE: the referred field must not be a repeated field and must be - // present at the top-level of request message type. - string body = 7; - - // Optional. The name of the response field whose value is mapped to the HTTP - // body of response. Other response fields are ignored. When - // not set, the response message will be used as HTTP body of response. - string response_body = 12; - - // Additional HTTP bindings for the selector. Nested bindings must - // not contain an `additional_bindings` field themselves (that is, - // the nesting may only be one level deep). - repeated HttpRule additional_bindings = 11; -} - -// A custom pattern is used for defining custom HTTP verb. -message CustomHttpPattern { - // The name of this custom HTTP verb. - string kind = 1; - - // The path matched by this custom verb. - string path = 2; -} diff --git a/third_party/proto/google/api/httpbody.proto b/third_party/proto/google/api/httpbody.proto deleted file mode 100644 index 4428515c12..0000000000 --- a/third_party/proto/google/api/httpbody.proto +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2018 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.api; - -import "google/protobuf/any.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/api/httpbody;httpbody"; -option java_multiple_files = true; -option java_outer_classname = "HttpBodyProto"; -option java_package = "com.google.api"; -option objc_class_prefix = "GAPI"; - -// Message that represents an arbitrary HTTP body. It should only be used for -// payload formats that can't be represented as JSON, such as raw binary or -// an HTML page. -// -// -// This message can be used both in streaming and non-streaming API methods in -// the request as well as the response. -// -// It can be used as a top-level request field, which is convenient if one -// wants to extract parameters from either the URL or HTTP template into the -// request fields and also want access to the raw HTTP body. -// -// Example: -// -// message GetResourceRequest { -// // A unique request id. -// string request_id = 1; -// -// // The raw HTTP body is bound to this field. -// google.api.HttpBody http_body = 2; -// } -// -// service ResourceService { -// rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); -// rpc UpdateResource(google.api.HttpBody) returns -// (google.protobuf.Empty); -// } -// -// Example with streaming methods: -// -// service CaldavService { -// rpc GetCalendar(stream google.api.HttpBody) -// returns (stream google.api.HttpBody); -// rpc UpdateCalendar(stream google.api.HttpBody) -// returns (stream google.api.HttpBody); -// } -// -// Use of this type only changes how the request and response bodies are -// handled, all other features will continue to work unchanged. -message HttpBody { - // The HTTP Content-Type header value specifying the content type of the body. - string content_type = 1; - - // The HTTP request/response body as raw binary. - bytes data = 2; - - // Application specific response metadata. Must be set in the first response - // for streaming APIs. - repeated google.protobuf.Any extensions = 3; -} \ No newline at end of file diff --git a/third_party/proto/google/protobuf/any.proto b/third_party/proto/google/protobuf/any.proto deleted file mode 100644 index 58b511583a..0000000000 --- a/third_party/proto/google/protobuf/any.proto +++ /dev/null @@ -1,164 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package google.protobuf; - -import "gogoproto/gogo.proto"; - -option csharp_namespace = "Google.Protobuf.WellKnownTypes"; -option go_package = "types"; -option java_package = "com.google.protobuf"; -option java_outer_classname = "AnyProto"; -option java_multiple_files = true; -option objc_class_prefix = "GPB"; - -// `Any` contains an arbitrary serialized protocol buffer message along with a -// URL that describes the type of the serialized message. -// -// Protobuf library provides support to pack/unpack Any values in the form -// of utility functions or additional generated methods of the Any type. -// -// Example 1: Pack and unpack a message in C++. -// -// Foo foo = ...; -// Any any; -// any.PackFrom(foo); -// ... -// if (any.UnpackTo(&foo)) { -// ... -// } -// -// Example 2: Pack and unpack a message in Java. -// -// Foo foo = ...; -// Any any = Any.pack(foo); -// ... -// if (any.is(Foo.class)) { -// foo = any.unpack(Foo.class); -// } -// -// Example 3: Pack and unpack a message in Python. -// -// foo = Foo(...) -// any = Any() -// any.Pack(foo) -// ... -// if any.Is(Foo.DESCRIPTOR): -// any.Unpack(foo) -// ... -// -// Example 4: Pack and unpack a message in Go -// -// foo := &pb.Foo{...} -// any, err := ptypes.MarshalAny(foo) -// ... -// foo := &pb.Foo{} -// if err := ptypes.UnmarshalAny(any, foo); err != nil { -// ... -// } -// -// The pack methods provided by protobuf library will by default use -// 'type.googleapis.com/full.type.name' as the type URL and the unpack -// methods only use the fully qualified type name after the last '/' -// in the type URL, for example "foo.bar.com/x/y.z" will yield type -// name "y.z". -// -// -// JSON -// ==== -// The JSON representation of an `Any` value uses the regular -// representation of the deserialized, embedded message, with an -// additional field `@type` which contains the type URL. Example: -// -// package google.profile; -// message Person { -// string first_name = 1; -// string last_name = 2; -// } -// -// { -// "@type": "type.googleapis.com/google.profile.Person", -// "firstName": , -// "lastName": -// } -// -// If the embedded message type is well-known and has a custom JSON -// representation, that representation will be embedded adding a field -// `value` which holds the custom JSON in addition to the `@type` -// field. Example (for message [google.protobuf.Duration][]): -// -// { -// "@type": "type.googleapis.com/google.protobuf.Duration", -// "value": "1.212s" -// } -// -message Any { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - // - string type_url = 1; - - // Must be a valid serialized protocol buffer of the above specified type. - bytes value = 2; - - option (gogoproto.typedecl) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.gostring) = false; - option (gogoproto.stringer) = false; -} - -option (gogoproto.goproto_registration) = false; diff --git a/x/globalfee/alias.go b/x/globalfee/alias.go index 594fce105e..11458c0b8d 100644 --- a/x/globalfee/alias.go +++ b/x/globalfee/alias.go @@ -1,9 +1,9 @@ package globalfee -import ( - "github.com/cosmos/gaia/v11/x/globalfee/types" -) +// import ( +// "github.com/cosmos/gaia/v11/x/globalfee/types" +// ) -const ( - ModuleName = types.ModuleName -) +// const ( +// ModuleName = types.ModuleName +// ) diff --git a/x/globalfee/ante/antetest/fee_test.go b/x/globalfee/ante/antetest/fee_test.go index 5ba974e13e..662bc61be5 100644 --- a/x/globalfee/ante/antetest/fee_test.go +++ b/x/globalfee/ante/antetest/fee_test.go @@ -1,815 +1,815 @@ package antetest -import ( - "testing" - - 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/v4/modules/core/02-client/types" - ibcchanneltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" - "github.com/stretchr/testify/suite" - - gaiafeeante "github.com/cosmos/gaia/v11/x/globalfee/ante" - globfeetypes "github.com/cosmos/gaia/v11/x/globalfee/types" -) - -var testGasLimit uint64 = 200_000 - -func TestIntegrationTestSuite(t *testing.T) { - suite.Run(t, new(IntegrationTestSuite)) -} - -func (s *IntegrationTestSuite) TestGetDefaultGlobalFees() { - // set globalfees and min gas price - feeDecorator, _ := s.SetupTestGlobalFeeStoreAndMinGasPrice([]sdk.DecCoin{}, &globfeetypes.Params{}) - defaultGlobalFees, err := feeDecorator.DefaultZeroGlobalFee(s.ctx) - s.Require().NoError(err) - s.Require().Greater(len(defaultGlobalFees), 0) - - if defaultGlobalFees[0].Denom != testBondDenom { - s.T().Fatalf("bond denom: %s, default global fee denom: %s", testBondDenom, defaultGlobalFees[0].Denom) - } -} - -// Test global fees and min_gas_price with bypass msg types. -// Please note even globalfee=0, min_gas_price=0, we do not let fee=0random_denom pass. -// Paid fees are already sanitized by removing zero coins(through feeFlag parsing), so use sdk.NewCoins() to create it. -func (s *IntegrationTestSuite) TestGlobalFeeMinimumGasFeeAnteHandler() { - s.txBuilder = s.clientCtx.TxConfig.NewTxBuilder() - priv1, _, addr1 := testdata.KeyTestPubAddr() - privs, accNums, accSeqs := []cryptotypes.PrivKey{priv1}, []uint64{0}, []uint64{0} - - denominator := int64(100000) - high := sdk.NewDec(400).Quo(sdk.NewDec(denominator)) // 0.004 - med := sdk.NewDec(200).Quo(sdk.NewDec(denominator)) // 0.002 - low := sdk.NewDec(100).Quo(sdk.NewDec(denominator)) // 0.001 - - highFeeAmt := sdk.NewInt(high.MulInt64(int64(2) * denominator).RoundInt64()) - medFeeAmt := sdk.NewInt(med.MulInt64(int64(2) * denominator).RoundInt64()) - lowFeeAmt := sdk.NewInt(low.MulInt64(int64(2) * denominator).RoundInt64()) - - globalfeeParamsEmpty := []sdk.DecCoin{} - minGasPriceEmpty := []sdk.DecCoin{} - globalfeeParams0 := []sdk.DecCoin{ - sdk.NewDecCoinFromDec("photon", sdk.NewDec(0)), - sdk.NewDecCoinFromDec("uatom", sdk.NewDec(0)), - } - globalfeeParamsContain0 := []sdk.DecCoin{ - sdk.NewDecCoinFromDec("photon", med), - sdk.NewDecCoinFromDec("uatom", sdk.NewDec(0)), - } - minGasPrice0 := []sdk.DecCoin{ - sdk.NewDecCoinFromDec("stake", sdk.NewDec(0)), - sdk.NewDecCoinFromDec("uatom", sdk.NewDec(0)), - } - globalfeeParamsHigh := []sdk.DecCoin{ - sdk.NewDecCoinFromDec("uatom", high), - } - minGasPrice := []sdk.DecCoin{ - sdk.NewDecCoinFromDec("uatom", med), - sdk.NewDecCoinFromDec("stake", med), - } - globalfeeParamsLow := []sdk.DecCoin{ - sdk.NewDecCoinFromDec("uatom", low), - } - // global fee must be sorted in denom - globalfeeParamsNewDenom := []sdk.DecCoin{ - sdk.NewDecCoinFromDec("photon", high), - sdk.NewDecCoinFromDec("quark", high), - } - - testCases := map[string]struct { - minGasPrice []sdk.DecCoin - globalFee []sdk.DecCoin - gasPrice sdk.Coins - gasLimit sdk.Gas - txMsg sdk.Msg - txCheck bool - expErr bool - }{ - // test fees - // empty min_gas_price or empty global fee - "empty min_gas_price, nonempty global fee, fee higher/equal than global_fee": { - minGasPrice: minGasPriceEmpty, - globalFee: globalfeeParamsHigh, - // sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()) - gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", highFeeAmt)), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: false, - }, - "empty min_gas_price, nonempty global fee, fee lower than global_fee": { - minGasPrice: minGasPriceEmpty, - globalFee: globalfeeParamsHigh, - gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: true, - }, - "nonempty min_gas_price with defaultGlobalFee denom, empty global fee, fee higher/equal than min_gas_price": { - minGasPrice: minGasPrice, - globalFee: globalfeeParamsEmpty, // default 0uatom - gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", medFeeAmt)), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: false, - }, - "nonempty min_gas_price with defaultGlobalFee denom, empty global fee, fee lower than min_gas_price": { - minGasPrice: minGasPrice, - globalFee: globalfeeParamsEmpty, - gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: true, - }, - "empty min_gas_price, empty global fee, empty fee": { - minGasPrice: minGasPriceEmpty, - globalFee: globalfeeParamsEmpty, - gasPrice: sdk.Coins{}, - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: false, - }, - // zero min_gas_price or zero global fee - "zero min_gas_price, zero global fee, zero fee in global fee denom": { - minGasPrice: minGasPrice0, - globalFee: globalfeeParams0, - gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt()), sdk.NewCoin("photon", sdk.ZeroInt())), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: false, - }, - "zero min_gas_price, zero global fee, empty fee": { - minGasPrice: minGasPrice0, - globalFee: globalfeeParams0, - gasPrice: sdk.Coins{}, - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: false, - }, - // zero global fee - "zero min_gas_price, zero global fee, zero fee not in globalfee denom": { - minGasPrice: minGasPrice0, - globalFee: globalfeeParams0, - gasPrice: sdk.NewCoins(sdk.NewCoin("stake", sdk.ZeroInt())), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: false, - }, - "zero min_gas_price, zero global fee, zero fees one in, one not in globalfee denom": { - minGasPrice: minGasPrice0, - globalFee: globalfeeParams0, - gasPrice: sdk.NewCoins( - sdk.NewCoin("stake", sdk.ZeroInt()), - sdk.NewCoin("uatom", sdk.ZeroInt())), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: false, - }, - // zero min_gas_price and empty global fee - "zero min_gas_price, empty global fee, zero fee in min_gas_price_denom": { - minGasPrice: minGasPrice0, - globalFee: globalfeeParamsEmpty, - gasPrice: sdk.NewCoins(sdk.NewCoin("stake", sdk.ZeroInt())), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: false, - }, - "zero min_gas_price, empty global fee, zero fee not in min_gas_price denom, not in defaultZeroGlobalFee denom": { - minGasPrice: minGasPrice0, - globalFee: globalfeeParamsEmpty, - gasPrice: sdk.NewCoins(sdk.NewCoin("quark", sdk.ZeroInt())), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: false, - }, - "zero min_gas_price, empty global fee, zero fee in defaultZeroGlobalFee denom": { - minGasPrice: minGasPrice0, - globalFee: globalfeeParamsEmpty, - gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: false, - }, - "zero min_gas_price, empty global fee, nonzero fee in defaultZeroGlobalFee denom": { - minGasPrice: minGasPrice0, - globalFee: globalfeeParamsEmpty, - gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: false, - }, - "zero min_gas_price, empty global fee, nonzero fee not in defaultZeroGlobalFee denom": { - minGasPrice: minGasPrice0, - globalFee: globalfeeParamsEmpty, - gasPrice: sdk.NewCoins(sdk.NewCoin("quark", highFeeAmt)), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: true, - }, - // empty min_gas_price, zero global fee - "empty min_gas_price, zero global fee, zero fee in global fee denom": { - minGasPrice: minGasPriceEmpty, - globalFee: globalfeeParams0, - gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: false, - }, - "empty min_gas_price, zero global fee, zero fee not in global fee denom": { - minGasPrice: minGasPriceEmpty, - globalFee: globalfeeParams0, - gasPrice: sdk.NewCoins(sdk.NewCoin("stake", sdk.ZeroInt())), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: false, - }, - "empty min_gas_price, zero global fee, nonzero fee in global fee denom": { - minGasPrice: minGasPriceEmpty, - globalFee: globalfeeParams0, - gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: false, - }, - "empty min_gas_price, zero global fee, nonzero fee not in global fee denom": { - minGasPrice: minGasPriceEmpty, - globalFee: globalfeeParams0, - gasPrice: sdk.NewCoins(sdk.NewCoin("stake", highFeeAmt)), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: true, - }, - // zero min_gas_price, nonzero global fee - "zero min_gas_price, nonzero global fee, fee is higher than global fee": { - minGasPrice: minGasPrice0, - globalFee: globalfeeParamsLow, - gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: false, - }, - // nonzero min_gas_price, nonzero global fee - "fee higher/equal than globalfee and min_gas_price": { - minGasPrice: minGasPrice, - globalFee: globalfeeParamsHigh, - gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", highFeeAmt)), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: false, - }, - "fee lower than globalfee and min_gas_price": { - minGasPrice: minGasPrice, - globalFee: globalfeeParamsHigh, - gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: true, - }, - "fee with one denom higher/equal, one denom lower than globalfee and min_gas_price": { - minGasPrice: minGasPrice, - globalFee: globalfeeParamsNewDenom, - gasPrice: sdk.NewCoins( - sdk.NewCoin("photon", lowFeeAmt), - sdk.NewCoin("quark", highFeeAmt)), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: false, - }, - "globalfee > min_gas_price, fee higher/equal than min_gas_price, lower than globalfee": { - minGasPrice: minGasPrice, - globalFee: globalfeeParamsHigh, - gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", medFeeAmt)), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: true, - }, - "globalfee < min_gas_price, fee higher/equal than globalfee and lower than min_gas_price": { - minGasPrice: minGasPrice, - globalFee: globalfeeParamsLow, - gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: true, - }, - // nonzero min_gas_price, zero global fee - "nonzero min_gas_price, zero global fee, fee is in global fee denom and lower than min_gas_price": { - minGasPrice: minGasPrice, - globalFee: globalfeeParams0, - gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: true, - }, - "nonzero min_gas_price, zero global fee, fee is in global fee denom and higher/equal than min_gas_price": { - minGasPrice: minGasPrice, - globalFee: globalfeeParams0, - gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", medFeeAmt)), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: false, - }, - "nonzero min_gas_price, zero global fee, fee is in min_gas_price denom which is not in global fee default, but higher/equal than min_gas_price": { - minGasPrice: minGasPrice, - globalFee: globalfeeParams0, - gasPrice: sdk.NewCoins(sdk.NewCoin("stake", highFeeAmt)), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: true, - }, - // fee denom tests - "min_gas_price denom is not subset of global fee denom , fee paying in global fee denom": { - minGasPrice: minGasPrice, - globalFee: globalfeeParamsNewDenom, - gasPrice: sdk.NewCoins(sdk.NewCoin("photon", highFeeAmt)), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: false, - }, - "min_gas_price denom is not subset of global fee denom, fee paying in min_gas_price denom": { - minGasPrice: minGasPrice, - globalFee: globalfeeParamsNewDenom, - gasPrice: sdk.NewCoins(sdk.NewCoin("stake", highFeeAmt)), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: true, - }, - "fees contain denom not in globalfee": { - minGasPrice: minGasPrice, - globalFee: globalfeeParamsLow, - gasPrice: sdk.NewCoins( - sdk.NewCoin("uatom", highFeeAmt), - sdk.NewCoin("quark", highFeeAmt)), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: true, - }, - "fees contain denom not in globalfee with zero amount": { - minGasPrice: minGasPrice, - globalFee: globalfeeParamsLow, - gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", highFeeAmt), - sdk.NewCoin("quark", sdk.ZeroInt())), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: false, - }, - // cases from https://github.com/cosmos/gaia/pull/1570#issuecomment-1190524402 - // note: this is kind of a silly scenario but technically correct - // if there is a zero coin in the globalfee, the user could pay 0fees - // if the user includes any fee at all in the non-zero denom, it must be higher than that non-zero fee - // unlikely we will ever see zero and non-zero together but technically possible - "globalfee contains zero coin and non-zero coin, fee is lower than the nonzero coin": { - minGasPrice: minGasPrice0, - globalFee: globalfeeParamsContain0, - gasPrice: sdk.NewCoins(sdk.NewCoin("photon", lowFeeAmt)), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: true, - }, - "globalfee contains zero coin, fee contains zero coins of the same denom and a lower fee of the other denom in global fee": { - minGasPrice: minGasPrice0, - globalFee: globalfeeParamsContain0, - gasPrice: sdk.NewCoins( - sdk.NewCoin("photon", lowFeeAmt), - sdk.NewCoin("uatom", sdk.ZeroInt())), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: true, - }, - "globalfee contains zero coin, fee is empty": { - minGasPrice: minGasPrice0, - globalFee: globalfeeParamsContain0, - gasPrice: sdk.Coins{}, - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: false, - }, - "globalfee contains zero coin, fee contains lower fee of zero coins's denom, globalfee also contains nonzero coin,fee contains higher fee of nonzero coins's denom, ": { - minGasPrice: minGasPrice0, - globalFee: globalfeeParamsContain0, - gasPrice: sdk.NewCoins( - sdk.NewCoin("photon", lowFeeAmt), - sdk.NewCoin("uatom", highFeeAmt)), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: false, - }, - "globalfee contains zero coin, fee is all zero coins but in global fee's denom": { - minGasPrice: minGasPrice0, - globalFee: globalfeeParamsContain0, - gasPrice: sdk.NewCoins( - sdk.NewCoin("photon", sdk.ZeroInt()), - sdk.NewCoin("uatom", sdk.ZeroInt()), - ), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: false, - }, - "globalfee contains zero coin, fee is higher than the nonzero coin": { - minGasPrice: minGasPrice0, - globalFee: globalfeeParamsContain0, - gasPrice: sdk.NewCoins(sdk.NewCoin("photon", highFeeAmt)), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: false, - }, - "bypass msg type: ibc.core.channel.v1.MsgRecvPacket": { - minGasPrice: minGasPrice, - globalFee: globalfeeParamsLow, - gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), - gasLimit: testGasLimit, - txMsg: ibcchanneltypes.NewMsgRecvPacket( - ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), - txCheck: true, - expErr: false, - }, - "bypass msg type: ibc.core.channel.v1.MsgTimeout": { - minGasPrice: minGasPrice, - globalFee: globalfeeParamsLow, - gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), - gasLimit: testGasLimit, - txMsg: ibcchanneltypes.NewMsgTimeout( - // todo check here - ibcchanneltypes.Packet{}, 1, nil, ibcclienttypes.Height{}, ""), - txCheck: true, - expErr: false, - }, - "bypass msg type: ibc.core.channel.v1.MsgTimeoutOnClose": { - minGasPrice: minGasPrice, - globalFee: globalfeeParamsLow, - gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), - gasLimit: testGasLimit, - txMsg: ibcchanneltypes.NewMsgTimeout( - ibcchanneltypes.Packet{}, 2, nil, ibcclienttypes.Height{}, ""), - txCheck: true, - expErr: false, - }, - "bypass msg gas usage exceeds maxTotalBypassMinFeeMsgGasUsage": { - minGasPrice: minGasPrice, - globalFee: globalfeeParamsLow, - gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), - gasLimit: 2 * globfeetypes.DefaultmaxTotalBypassMinFeeMsgGasUsage, - txMsg: ibcchanneltypes.NewMsgTimeout( - ibcchanneltypes.Packet{}, 2, nil, ibcclienttypes.Height{}, ""), - txCheck: true, - expErr: true, - }, - "bypass msg gas usage equals to maxTotalBypassMinFeeMsgGasUsage": { - minGasPrice: minGasPrice, - globalFee: globalfeeParamsLow, - gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), - gasLimit: globfeetypes.DefaultmaxTotalBypassMinFeeMsgGasUsage, - txMsg: ibcchanneltypes.NewMsgTimeout( - ibcchanneltypes.Packet{}, 3, nil, ibcclienttypes.Height{}, ""), - txCheck: true, - expErr: false, - }, - "msg type ibc, zero fee not in globalfee denom": { - minGasPrice: minGasPrice, - globalFee: globalfeeParamsLow, - gasPrice: sdk.NewCoins(sdk.NewCoin("photon", sdk.ZeroInt())), - gasLimit: testGasLimit, - txMsg: ibcchanneltypes.NewMsgRecvPacket( - ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), - txCheck: true, - expErr: false, - }, - "msg type ibc, nonzero fee in globalfee denom": { - minGasPrice: minGasPrice, - globalFee: globalfeeParamsLow, - gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", highFeeAmt)), - gasLimit: testGasLimit, - txMsg: ibcchanneltypes.NewMsgRecvPacket( - ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), - txCheck: true, - expErr: false, - }, - "msg type ibc, nonzero fee not in globalfee denom": { - minGasPrice: minGasPrice, - globalFee: globalfeeParamsLow, - gasPrice: sdk.NewCoins(sdk.NewCoin("photon", highFeeAmt)), - gasLimit: testGasLimit, - txMsg: ibcchanneltypes.NewMsgRecvPacket( - ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), - txCheck: true, - expErr: true, - }, - "msg type ibc, empty fee": { - minGasPrice: minGasPrice, - globalFee: globalfeeParamsLow, - gasPrice: sdk.Coins{}, - gasLimit: testGasLimit, - txMsg: ibcchanneltypes.NewMsgRecvPacket( - ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), - txCheck: true, - expErr: false, - }, - "msg type non-ibc, nonzero fee in globalfee denom": { - minGasPrice: minGasPrice, - globalFee: globalfeeParamsLow, - gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", highFeeAmt)), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: false, - }, - "msg type non-ibc, empty fee": { - minGasPrice: minGasPrice, - globalFee: globalfeeParamsLow, - gasPrice: sdk.Coins{}, - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: true, - }, - "msg type non-ibc, nonzero fee not in globalfee denom": { - minGasPrice: minGasPrice, - globalFee: globalfeeParamsLow, - gasPrice: sdk.NewCoins(sdk.NewCoin("photon", highFeeAmt)), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: true, - expErr: true, - }, - "disable checkTx: min_gas_price is medium, global fee is low, tx fee is low": { - minGasPrice: minGasPrice, - globalFee: globalfeeParamsLow, - gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: false, - expErr: false, - }, - "disable checkTx: min_gas_price is medium, global fee is low, tx is zero": { - minGasPrice: minGasPrice, - globalFee: globalfeeParamsLow, - gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: false, - expErr: true, - }, - "disable checkTx: min_gas_price is low, global fee is low, tx fee's denom is not in global fees denoms set": { - minGasPrice: minGasPrice, - globalFee: globalfeeParamsLow, - gasPrice: sdk.NewCoins(sdk.NewCoin("quark", sdk.ZeroInt())), - gasLimit: testGasLimit, - txMsg: testdata.NewTestMsg(addr1), - txCheck: false, - expErr: true, - }, - } - - globalfeeParams := &globfeetypes.Params{ - BypassMinFeeMsgTypes: globfeetypes.DefaultBypassMinFeeMsgTypes, - MaxTotalBypassMinFeeMsgGasUsage: globfeetypes.DefaultmaxTotalBypassMinFeeMsgGasUsage, - } - - for name, tc := range testCases { - s.Run(name, func() { - // set globalfees and min gas price - globalfeeParams.MinimumGasPrices = tc.globalFee - _, antehandler := s.SetupTestGlobalFeeStoreAndMinGasPrice(tc.minGasPrice, globalfeeParams) - - // set fee decorator to ante handler - - s.Require().NoError(s.txBuilder.SetMsgs(tc.txMsg)) - s.txBuilder.SetFeeAmount(tc.gasPrice) - s.txBuilder.SetGasLimit(tc.gasLimit) - tx, err := s.CreateTestTx(privs, accNums, accSeqs, s.ctx.ChainID()) - s.Require().NoError(err) - - s.ctx = s.ctx.WithIsCheckTx(tc.txCheck) - _, err = antehandler(s.ctx, tx, false) - if !tc.expErr { - s.Require().NoError(err) - } else { - s.Require().Error(err) - } - }) - } -} - -// Test how the operator fees are determined using various min gas prices. -// -// Note that in a real Gaia deployment all zero coins can be removed from minGasPrice. -// This sanitizing happens when the minGasPrice is set into the context. -// (see baseapp.SetMinGasPrices in gaia/cmd/root.go line 221) -func (s *IntegrationTestSuite) TestGetMinGasPrice() { - expCoins := sdk.Coins{ - sdk.NewCoin("photon", sdk.NewInt(2000)), - sdk.NewCoin("uatom", sdk.NewInt(3000)), - } - - testCases := []struct { - name string - minGasPrice []sdk.DecCoin - feeTxGasLimit uint64 - expCoins sdk.Coins - }{ - { - "empty min gas price should return empty coins", - []sdk.DecCoin{}, - uint64(1000), - sdk.Coins{}, - }, - { - "zero coins min gas price should return empty coins", - []sdk.DecCoin{ - sdk.NewDecCoinFromDec("stake", sdk.NewDec(0)), - sdk.NewDecCoinFromDec("uatom", sdk.NewDec(0)), - }, - uint64(1000), - sdk.Coins{}, - }, - { - "zero coins, non-zero coins mix should return zero coin and non-zero coins", - []sdk.DecCoin{ - sdk.NewDecCoinFromDec("stake", sdk.NewDec(0)), - sdk.NewDecCoinFromDec("uatom", sdk.NewDec(1)), - }, - uint64(1000), - sdk.Coins{ - sdk.NewCoin("stake", sdk.NewInt(0)), - sdk.NewCoin("uatom", sdk.NewInt(1000)), - }, - }, - - { - "unsorted min gas price should return sorted coins", - []sdk.DecCoin{ - sdk.NewDecCoinFromDec("uatom", sdk.NewDec(3)), - sdk.NewDecCoinFromDec("photon", sdk.NewDec(2)), - }, - uint64(1000), - expCoins, - }, - { - "sorted min gas price should return same conins", - []sdk.DecCoin{ - sdk.NewDecCoinFromDec("photon", sdk.NewDec(2)), - sdk.NewDecCoinFromDec("uatom", sdk.NewDec(3)), - }, - uint64(1000), - expCoins, - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - s.SetupTestGlobalFeeStoreAndMinGasPrice(tc.minGasPrice, &globfeetypes.Params{}) - - fees := gaiafeeante.GetMinGasPrice(s.ctx, int64(tc.feeTxGasLimit)) - s.Require().True(tc.expCoins.Sort().IsEqual(fees)) - }) - } -} - -func (s *IntegrationTestSuite) TestContainsOnlyBypassMinFeeMsgs() { - // set globalfees params and min gas price - globalfeeParams := &globfeetypes.Params{ - BypassMinFeeMsgTypes: globfeetypes.DefaultBypassMinFeeMsgTypes, - MaxTotalBypassMinFeeMsgGasUsage: globfeetypes.DefaultmaxTotalBypassMinFeeMsgGasUsage, - } - feeDecorator, _ := s.SetupTestGlobalFeeStoreAndMinGasPrice([]sdk.DecCoin{}, globalfeeParams) - testCases := []struct { - name string - msgs []sdk.Msg - expPass bool - }{ - { - "expect empty msgs to pass", - []sdk.Msg{}, - true, - }, - { - "expect default bypass msg to pass", - []sdk.Msg{ - ibcchanneltypes.NewMsgRecvPacket(ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), - ibcchanneltypes.NewMsgAcknowledgement(ibcchanneltypes.Packet{}, []byte{1}, []byte{1}, ibcclienttypes.Height{}, ""), - }, - true, - }, - { - "expect default bypass msgs to pass", - []sdk.Msg{ - ibcchanneltypes.NewMsgRecvPacket(ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), - ibcchanneltypes.NewMsgAcknowledgement(ibcchanneltypes.Packet{}, []byte{1}, []byte{1}, ibcclienttypes.Height{}, ""), - }, - true, - }, - { - "msgs contain non-bypass msg - should not pass", - []sdk.Msg{ - ibcchanneltypes.NewMsgRecvPacket(ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), - stakingtypes.NewMsgDelegate(sdk.AccAddress{}, sdk.ValAddress{}, sdk.Coin{}), - }, - false, - }, - { - "msgs contain only non-bypass msgs - should not pass", - []sdk.Msg{ - stakingtypes.NewMsgDelegate(sdk.AccAddress{}, sdk.ValAddress{}, sdk.Coin{}), - }, - false, - }, - } - - for _, tc := range testCases { - s.Run(tc.name, func() { - res := feeDecorator.ContainsOnlyBypassMinFeeMsgs(s.ctx, tc.msgs) - s.Require().True(tc.expPass == res) - }) - } -} - -func (s *IntegrationTestSuite) TestGetTxFeeRequired() { - // create global fee params - globalfeeParamsEmpty := &globfeetypes.Params{MinimumGasPrices: []sdk.DecCoin{}} - - // setup tests with default global fee i.e. "0uatom" and empty local min gas prices - feeDecorator, _ := s.SetupTestGlobalFeeStoreAndMinGasPrice([]sdk.DecCoin{}, globalfeeParamsEmpty) - - // set a subspace that doesn't have the stakingtypes.KeyBondDenom key registred - feeDecorator.StakingSubspace = s.app.GetSubspace(globfeetypes.ModuleName) - - // check that an error is returned when staking bond denom is empty - _, err := feeDecorator.GetTxFeeRequired(s.ctx, nil) - s.Require().Equal(err.Error(), "empty staking bond denomination") - - // set non-zero local min gas prices - localMinGasPrices := sdk.NewCoins(sdk.NewCoin("uatom", sdk.NewInt(1))) - - // setup tests with non-empty local min gas prices - feeDecorator, _ = s.SetupTestGlobalFeeStoreAndMinGasPrice( - sdk.NewDecCoinsFromCoins(localMinGasPrices...), - globalfeeParamsEmpty, - ) - - // mock tx data - s.txBuilder = s.clientCtx.TxConfig.NewTxBuilder() - priv1, _, addr1 := testdata.KeyTestPubAddr() - privs, accNums, accSeqs := []cryptotypes.PrivKey{priv1}, []uint64{0}, []uint64{0} - - s.Require().NoError(s.txBuilder.SetMsgs(testdata.NewTestMsg(addr1))) - s.txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt()))) - - s.txBuilder.SetGasLimit(uint64(1)) - tx, err := s.CreateTestTx(privs, accNums, accSeqs, s.ctx.ChainID()) - s.Require().NoError(err) - - // check that the required fees returned in CheckTx mode are equal to - // local min gas prices since they're greater than the default global fee values. - s.Require().True(s.ctx.IsCheckTx()) - res, err := feeDecorator.GetTxFeeRequired(s.ctx, tx) - s.Require().True(res.IsEqual(localMinGasPrices)) - s.Require().NoError(err) - - // check that the global fee is returned in DeliverTx mode. - globalFee, err := feeDecorator.GetGlobalFee(s.ctx, tx) - s.Require().NoError(err) - - ctx := s.ctx.WithIsCheckTx(false) - res, err = feeDecorator.GetTxFeeRequired(ctx, tx) - s.Require().NoError(err) - s.Require().True(res.IsEqual(globalFee)) -} +// import ( +// "testing" + +// 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" +// "github.com/stretchr/testify/suite" + +// gaiafeeante "github.com/cosmos/gaia/v11/x/globalfee/ante" +// globfeetypes "github.com/cosmos/gaia/v11/x/globalfee/types" +// ) + +// var testGasLimit uint64 = 200_000 + +// func TestIntegrationTestSuite(t *testing.T) { +// suite.Run(t, new(IntegrationTestSuite)) +// } + +// func (s *IntegrationTestSuite) TestGetDefaultGlobalFees() { +// // set globalfees and min gas price +// feeDecorator, _ := s.SetupTestGlobalFeeStoreAndMinGasPrice([]sdk.DecCoin{}, &globfeetypes.Params{}) +// defaultGlobalFees, err := feeDecorator.DefaultZeroGlobalFee(s.ctx) +// s.Require().NoError(err) +// s.Require().Greater(len(defaultGlobalFees), 0) + +// if defaultGlobalFees[0].Denom != testBondDenom { +// s.T().Fatalf("bond denom: %s, default global fee denom: %s", testBondDenom, defaultGlobalFees[0].Denom) +// } +// } + +// // Test global fees and min_gas_price with bypass msg types. +// // Please note even globalfee=0, min_gas_price=0, we do not let fee=0random_denom pass. +// // Paid fees are already sanitized by removing zero coins(through feeFlag parsing), so use sdk.NewCoins() to create it. +// func (s *IntegrationTestSuite) TestGlobalFeeMinimumGasFeeAnteHandler() { +// s.txBuilder = s.clientCtx.TxConfig.NewTxBuilder() +// priv1, _, addr1 := testdata.KeyTestPubAddr() +// privs, accNums, accSeqs := []cryptotypes.PrivKey{priv1}, []uint64{0}, []uint64{0} + +// denominator := int64(100000) +// high := sdk.NewDec(400).Quo(sdk.NewDec(denominator)) // 0.004 +// med := sdk.NewDec(200).Quo(sdk.NewDec(denominator)) // 0.002 +// low := sdk.NewDec(100).Quo(sdk.NewDec(denominator)) // 0.001 + +// highFeeAmt := sdk.NewInt(high.MulInt64(int64(2) * denominator).RoundInt64()) +// medFeeAmt := sdk.NewInt(med.MulInt64(int64(2) * denominator).RoundInt64()) +// lowFeeAmt := sdk.NewInt(low.MulInt64(int64(2) * denominator).RoundInt64()) + +// globalfeeParamsEmpty := []sdk.DecCoin{} +// minGasPriceEmpty := []sdk.DecCoin{} +// globalfeeParams0 := []sdk.DecCoin{ +// sdk.NewDecCoinFromDec("photon", sdk.NewDec(0)), +// sdk.NewDecCoinFromDec("uatom", sdk.NewDec(0)), +// } +// globalfeeParamsContain0 := []sdk.DecCoin{ +// sdk.NewDecCoinFromDec("photon", med), +// sdk.NewDecCoinFromDec("uatom", sdk.NewDec(0)), +// } +// minGasPrice0 := []sdk.DecCoin{ +// sdk.NewDecCoinFromDec("stake", sdk.NewDec(0)), +// sdk.NewDecCoinFromDec("uatom", sdk.NewDec(0)), +// } +// globalfeeParamsHigh := []sdk.DecCoin{ +// sdk.NewDecCoinFromDec("uatom", high), +// } +// minGasPrice := []sdk.DecCoin{ +// sdk.NewDecCoinFromDec("uatom", med), +// sdk.NewDecCoinFromDec("stake", med), +// } +// globalfeeParamsLow := []sdk.DecCoin{ +// sdk.NewDecCoinFromDec("uatom", low), +// } +// // global fee must be sorted in denom +// globalfeeParamsNewDenom := []sdk.DecCoin{ +// sdk.NewDecCoinFromDec("photon", high), +// sdk.NewDecCoinFromDec("quark", high), +// } + +// testCases := map[string]struct { +// minGasPrice []sdk.DecCoin +// globalFee []sdk.DecCoin +// gasPrice sdk.Coins +// gasLimit sdk.Gas +// txMsg sdk.Msg +// txCheck bool +// expErr bool +// }{ +// // test fees +// // empty min_gas_price or empty global fee +// "empty min_gas_price, nonempty global fee, fee higher/equal than global_fee": { +// minGasPrice: minGasPriceEmpty, +// globalFee: globalfeeParamsHigh, +// // sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()) +// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", highFeeAmt)), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: false, +// }, +// "empty min_gas_price, nonempty global fee, fee lower than global_fee": { +// minGasPrice: minGasPriceEmpty, +// globalFee: globalfeeParamsHigh, +// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: true, +// }, +// "nonempty min_gas_price with defaultGlobalFee denom, empty global fee, fee higher/equal than min_gas_price": { +// minGasPrice: minGasPrice, +// globalFee: globalfeeParamsEmpty, // default 0uatom +// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", medFeeAmt)), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: false, +// }, +// "nonempty min_gas_price with defaultGlobalFee denom, empty global fee, fee lower than min_gas_price": { +// minGasPrice: minGasPrice, +// globalFee: globalfeeParamsEmpty, +// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: true, +// }, +// "empty min_gas_price, empty global fee, empty fee": { +// minGasPrice: minGasPriceEmpty, +// globalFee: globalfeeParamsEmpty, +// gasPrice: sdk.Coins{}, +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: false, +// }, +// // zero min_gas_price or zero global fee +// "zero min_gas_price, zero global fee, zero fee in global fee denom": { +// minGasPrice: minGasPrice0, +// globalFee: globalfeeParams0, +// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt()), sdk.NewCoin("photon", sdk.ZeroInt())), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: false, +// }, +// "zero min_gas_price, zero global fee, empty fee": { +// minGasPrice: minGasPrice0, +// globalFee: globalfeeParams0, +// gasPrice: sdk.Coins{}, +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: false, +// }, +// // zero global fee +// "zero min_gas_price, zero global fee, zero fee not in globalfee denom": { +// minGasPrice: minGasPrice0, +// globalFee: globalfeeParams0, +// gasPrice: sdk.NewCoins(sdk.NewCoin("stake", sdk.ZeroInt())), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: false, +// }, +// "zero min_gas_price, zero global fee, zero fees one in, one not in globalfee denom": { +// minGasPrice: minGasPrice0, +// globalFee: globalfeeParams0, +// gasPrice: sdk.NewCoins( +// sdk.NewCoin("stake", sdk.ZeroInt()), +// sdk.NewCoin("uatom", sdk.ZeroInt())), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: false, +// }, +// // zero min_gas_price and empty global fee +// "zero min_gas_price, empty global fee, zero fee in min_gas_price_denom": { +// minGasPrice: minGasPrice0, +// globalFee: globalfeeParamsEmpty, +// gasPrice: sdk.NewCoins(sdk.NewCoin("stake", sdk.ZeroInt())), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: false, +// }, +// "zero min_gas_price, empty global fee, zero fee not in min_gas_price denom, not in defaultZeroGlobalFee denom": { +// minGasPrice: minGasPrice0, +// globalFee: globalfeeParamsEmpty, +// gasPrice: sdk.NewCoins(sdk.NewCoin("quark", sdk.ZeroInt())), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: false, +// }, +// "zero min_gas_price, empty global fee, zero fee in defaultZeroGlobalFee denom": { +// minGasPrice: minGasPrice0, +// globalFee: globalfeeParamsEmpty, +// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: false, +// }, +// "zero min_gas_price, empty global fee, nonzero fee in defaultZeroGlobalFee denom": { +// minGasPrice: minGasPrice0, +// globalFee: globalfeeParamsEmpty, +// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: false, +// }, +// "zero min_gas_price, empty global fee, nonzero fee not in defaultZeroGlobalFee denom": { +// minGasPrice: minGasPrice0, +// globalFee: globalfeeParamsEmpty, +// gasPrice: sdk.NewCoins(sdk.NewCoin("quark", highFeeAmt)), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: true, +// }, +// // empty min_gas_price, zero global fee +// "empty min_gas_price, zero global fee, zero fee in global fee denom": { +// minGasPrice: minGasPriceEmpty, +// globalFee: globalfeeParams0, +// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: false, +// }, +// "empty min_gas_price, zero global fee, zero fee not in global fee denom": { +// minGasPrice: minGasPriceEmpty, +// globalFee: globalfeeParams0, +// gasPrice: sdk.NewCoins(sdk.NewCoin("stake", sdk.ZeroInt())), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: false, +// }, +// "empty min_gas_price, zero global fee, nonzero fee in global fee denom": { +// minGasPrice: minGasPriceEmpty, +// globalFee: globalfeeParams0, +// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: false, +// }, +// "empty min_gas_price, zero global fee, nonzero fee not in global fee denom": { +// minGasPrice: minGasPriceEmpty, +// globalFee: globalfeeParams0, +// gasPrice: sdk.NewCoins(sdk.NewCoin("stake", highFeeAmt)), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: true, +// }, +// // zero min_gas_price, nonzero global fee +// "zero min_gas_price, nonzero global fee, fee is higher than global fee": { +// minGasPrice: minGasPrice0, +// globalFee: globalfeeParamsLow, +// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: false, +// }, +// // nonzero min_gas_price, nonzero global fee +// "fee higher/equal than globalfee and min_gas_price": { +// minGasPrice: minGasPrice, +// globalFee: globalfeeParamsHigh, +// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", highFeeAmt)), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: false, +// }, +// "fee lower than globalfee and min_gas_price": { +// minGasPrice: minGasPrice, +// globalFee: globalfeeParamsHigh, +// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: true, +// }, +// "fee with one denom higher/equal, one denom lower than globalfee and min_gas_price": { +// minGasPrice: minGasPrice, +// globalFee: globalfeeParamsNewDenom, +// gasPrice: sdk.NewCoins( +// sdk.NewCoin("photon", lowFeeAmt), +// sdk.NewCoin("quark", highFeeAmt)), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: false, +// }, +// "globalfee > min_gas_price, fee higher/equal than min_gas_price, lower than globalfee": { +// minGasPrice: minGasPrice, +// globalFee: globalfeeParamsHigh, +// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", medFeeAmt)), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: true, +// }, +// "globalfee < min_gas_price, fee higher/equal than globalfee and lower than min_gas_price": { +// minGasPrice: minGasPrice, +// globalFee: globalfeeParamsLow, +// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: true, +// }, +// // nonzero min_gas_price, zero global fee +// "nonzero min_gas_price, zero global fee, fee is in global fee denom and lower than min_gas_price": { +// minGasPrice: minGasPrice, +// globalFee: globalfeeParams0, +// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: true, +// }, +// "nonzero min_gas_price, zero global fee, fee is in global fee denom and higher/equal than min_gas_price": { +// minGasPrice: minGasPrice, +// globalFee: globalfeeParams0, +// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", medFeeAmt)), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: false, +// }, +// "nonzero min_gas_price, zero global fee, fee is in min_gas_price denom which is not in global fee default, but higher/equal than min_gas_price": { +// minGasPrice: minGasPrice, +// globalFee: globalfeeParams0, +// gasPrice: sdk.NewCoins(sdk.NewCoin("stake", highFeeAmt)), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: true, +// }, +// // fee denom tests +// "min_gas_price denom is not subset of global fee denom , fee paying in global fee denom": { +// minGasPrice: minGasPrice, +// globalFee: globalfeeParamsNewDenom, +// gasPrice: sdk.NewCoins(sdk.NewCoin("photon", highFeeAmt)), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: false, +// }, +// "min_gas_price denom is not subset of global fee denom, fee paying in min_gas_price denom": { +// minGasPrice: minGasPrice, +// globalFee: globalfeeParamsNewDenom, +// gasPrice: sdk.NewCoins(sdk.NewCoin("stake", highFeeAmt)), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: true, +// }, +// "fees contain denom not in globalfee": { +// minGasPrice: minGasPrice, +// globalFee: globalfeeParamsLow, +// gasPrice: sdk.NewCoins( +// sdk.NewCoin("uatom", highFeeAmt), +// sdk.NewCoin("quark", highFeeAmt)), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: true, +// }, +// "fees contain denom not in globalfee with zero amount": { +// minGasPrice: minGasPrice, +// globalFee: globalfeeParamsLow, +// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", highFeeAmt), +// sdk.NewCoin("quark", sdk.ZeroInt())), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: false, +// }, +// // cases from https://github.com/cosmos/gaia/pull/1570#issuecomment-1190524402 +// // note: this is kind of a silly scenario but technically correct +// // if there is a zero coin in the globalfee, the user could pay 0fees +// // if the user includes any fee at all in the non-zero denom, it must be higher than that non-zero fee +// // unlikely we will ever see zero and non-zero together but technically possible +// "globalfee contains zero coin and non-zero coin, fee is lower than the nonzero coin": { +// minGasPrice: minGasPrice0, +// globalFee: globalfeeParamsContain0, +// gasPrice: sdk.NewCoins(sdk.NewCoin("photon", lowFeeAmt)), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: true, +// }, +// "globalfee contains zero coin, fee contains zero coins of the same denom and a lower fee of the other denom in global fee": { +// minGasPrice: minGasPrice0, +// globalFee: globalfeeParamsContain0, +// gasPrice: sdk.NewCoins( +// sdk.NewCoin("photon", lowFeeAmt), +// sdk.NewCoin("uatom", sdk.ZeroInt())), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: true, +// }, +// "globalfee contains zero coin, fee is empty": { +// minGasPrice: minGasPrice0, +// globalFee: globalfeeParamsContain0, +// gasPrice: sdk.Coins{}, +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: false, +// }, +// "globalfee contains zero coin, fee contains lower fee of zero coins's denom, globalfee also contains nonzero coin,fee contains higher fee of nonzero coins's denom, ": { +// minGasPrice: minGasPrice0, +// globalFee: globalfeeParamsContain0, +// gasPrice: sdk.NewCoins( +// sdk.NewCoin("photon", lowFeeAmt), +// sdk.NewCoin("uatom", highFeeAmt)), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: false, +// }, +// "globalfee contains zero coin, fee is all zero coins but in global fee's denom": { +// minGasPrice: minGasPrice0, +// globalFee: globalfeeParamsContain0, +// gasPrice: sdk.NewCoins( +// sdk.NewCoin("photon", sdk.ZeroInt()), +// sdk.NewCoin("uatom", sdk.ZeroInt()), +// ), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: false, +// }, +// "globalfee contains zero coin, fee is higher than the nonzero coin": { +// minGasPrice: minGasPrice0, +// globalFee: globalfeeParamsContain0, +// gasPrice: sdk.NewCoins(sdk.NewCoin("photon", highFeeAmt)), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: false, +// }, +// "bypass msg type: ibc.core.channel.v1.MsgRecvPacket": { +// minGasPrice: minGasPrice, +// globalFee: globalfeeParamsLow, +// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), +// gasLimit: testGasLimit, +// txMsg: ibcchanneltypes.NewMsgRecvPacket( +// ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), +// txCheck: true, +// expErr: false, +// }, +// "bypass msg type: ibc.core.channel.v1.MsgTimeout": { +// minGasPrice: minGasPrice, +// globalFee: globalfeeParamsLow, +// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), +// gasLimit: testGasLimit, +// txMsg: ibcchanneltypes.NewMsgTimeout( +// // todo check here +// ibcchanneltypes.Packet{}, 1, nil, ibcclienttypes.Height{}, ""), +// txCheck: true, +// expErr: false, +// }, +// "bypass msg type: ibc.core.channel.v1.MsgTimeoutOnClose": { +// minGasPrice: minGasPrice, +// globalFee: globalfeeParamsLow, +// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), +// gasLimit: testGasLimit, +// txMsg: ibcchanneltypes.NewMsgTimeout( +// ibcchanneltypes.Packet{}, 2, nil, ibcclienttypes.Height{}, ""), +// txCheck: true, +// expErr: false, +// }, +// "bypass msg gas usage exceeds maxTotalBypassMinFeeMsgGasUsage": { +// minGasPrice: minGasPrice, +// globalFee: globalfeeParamsLow, +// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), +// gasLimit: 2 * globfeetypes.DefaultmaxTotalBypassMinFeeMsgGasUsage, +// txMsg: ibcchanneltypes.NewMsgTimeout( +// ibcchanneltypes.Packet{}, 2, nil, ibcclienttypes.Height{}, ""), +// txCheck: true, +// expErr: true, +// }, +// "bypass msg gas usage equals to maxTotalBypassMinFeeMsgGasUsage": { +// minGasPrice: minGasPrice, +// globalFee: globalfeeParamsLow, +// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), +// gasLimit: globfeetypes.DefaultmaxTotalBypassMinFeeMsgGasUsage, +// txMsg: ibcchanneltypes.NewMsgTimeout( +// ibcchanneltypes.Packet{}, 3, nil, ibcclienttypes.Height{}, ""), +// txCheck: true, +// expErr: false, +// }, +// "msg type ibc, zero fee not in globalfee denom": { +// minGasPrice: minGasPrice, +// globalFee: globalfeeParamsLow, +// gasPrice: sdk.NewCoins(sdk.NewCoin("photon", sdk.ZeroInt())), +// gasLimit: testGasLimit, +// txMsg: ibcchanneltypes.NewMsgRecvPacket( +// ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), +// txCheck: true, +// expErr: false, +// }, +// "msg type ibc, nonzero fee in globalfee denom": { +// minGasPrice: minGasPrice, +// globalFee: globalfeeParamsLow, +// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", highFeeAmt)), +// gasLimit: testGasLimit, +// txMsg: ibcchanneltypes.NewMsgRecvPacket( +// ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), +// txCheck: true, +// expErr: false, +// }, +// "msg type ibc, nonzero fee not in globalfee denom": { +// minGasPrice: minGasPrice, +// globalFee: globalfeeParamsLow, +// gasPrice: sdk.NewCoins(sdk.NewCoin("photon", highFeeAmt)), +// gasLimit: testGasLimit, +// txMsg: ibcchanneltypes.NewMsgRecvPacket( +// ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), +// txCheck: true, +// expErr: true, +// }, +// "msg type ibc, empty fee": { +// minGasPrice: minGasPrice, +// globalFee: globalfeeParamsLow, +// gasPrice: sdk.Coins{}, +// gasLimit: testGasLimit, +// txMsg: ibcchanneltypes.NewMsgRecvPacket( +// ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), +// txCheck: true, +// expErr: false, +// }, +// "msg type non-ibc, nonzero fee in globalfee denom": { +// minGasPrice: minGasPrice, +// globalFee: globalfeeParamsLow, +// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", highFeeAmt)), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: false, +// }, +// "msg type non-ibc, empty fee": { +// minGasPrice: minGasPrice, +// globalFee: globalfeeParamsLow, +// gasPrice: sdk.Coins{}, +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: true, +// }, +// "msg type non-ibc, nonzero fee not in globalfee denom": { +// minGasPrice: minGasPrice, +// globalFee: globalfeeParamsLow, +// gasPrice: sdk.NewCoins(sdk.NewCoin("photon", highFeeAmt)), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: true, +// expErr: true, +// }, +// "disable checkTx: min_gas_price is medium, global fee is low, tx fee is low": { +// minGasPrice: minGasPrice, +// globalFee: globalfeeParamsLow, +// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: false, +// expErr: false, +// }, +// "disable checkTx: min_gas_price is medium, global fee is low, tx is zero": { +// minGasPrice: minGasPrice, +// globalFee: globalfeeParamsLow, +// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: false, +// expErr: true, +// }, +// "disable checkTx: min_gas_price is low, global fee is low, tx fee's denom is not in global fees denoms set": { +// minGasPrice: minGasPrice, +// globalFee: globalfeeParamsLow, +// gasPrice: sdk.NewCoins(sdk.NewCoin("quark", sdk.ZeroInt())), +// gasLimit: testGasLimit, +// txMsg: testdata.NewTestMsg(addr1), +// txCheck: false, +// expErr: true, +// }, +// } + +// globalfeeParams := &globfeetypes.Params{ +// BypassMinFeeMsgTypes: globfeetypes.DefaultBypassMinFeeMsgTypes, +// MaxTotalBypassMinFeeMsgGasUsage: globfeetypes.DefaultmaxTotalBypassMinFeeMsgGasUsage, +// } + +// for name, tc := range testCases { +// s.Run(name, func() { +// // set globalfees and min gas price +// globalfeeParams.MinimumGasPrices = tc.globalFee +// _, antehandler := s.SetupTestGlobalFeeStoreAndMinGasPrice(tc.minGasPrice, globalfeeParams) + +// // set fee decorator to ante handler + +// s.Require().NoError(s.txBuilder.SetMsgs(tc.txMsg)) +// s.txBuilder.SetFeeAmount(tc.gasPrice) +// s.txBuilder.SetGasLimit(tc.gasLimit) +// tx, err := s.CreateTestTx(privs, accNums, accSeqs, s.ctx.ChainID()) +// s.Require().NoError(err) + +// s.ctx = s.ctx.WithIsCheckTx(tc.txCheck) +// _, err = antehandler(s.ctx, tx, false) +// if !tc.expErr { +// s.Require().NoError(err) +// } else { +// s.Require().Error(err) +// } +// }) +// } +// } + +// // Test how the operator fees are determined using various min gas prices. +// // +// // Note that in a real Gaia deployment all zero coins can be removed from minGasPrice. +// // This sanitizing happens when the minGasPrice is set into the context. +// // (see baseapp.SetMinGasPrices in gaia/cmd/root.go line 221) +// func (s *IntegrationTestSuite) TestGetMinGasPrice() { +// expCoins := sdk.Coins{ +// sdk.NewCoin("photon", sdk.NewInt(2000)), +// sdk.NewCoin("uatom", sdk.NewInt(3000)), +// } + +// testCases := []struct { +// name string +// minGasPrice []sdk.DecCoin +// feeTxGasLimit uint64 +// expCoins sdk.Coins +// }{ +// { +// "empty min gas price should return empty coins", +// []sdk.DecCoin{}, +// uint64(1000), +// sdk.Coins{}, +// }, +// { +// "zero coins min gas price should return empty coins", +// []sdk.DecCoin{ +// sdk.NewDecCoinFromDec("stake", sdk.NewDec(0)), +// sdk.NewDecCoinFromDec("uatom", sdk.NewDec(0)), +// }, +// uint64(1000), +// sdk.Coins{}, +// }, +// { +// "zero coins, non-zero coins mix should return zero coin and non-zero coins", +// []sdk.DecCoin{ +// sdk.NewDecCoinFromDec("stake", sdk.NewDec(0)), +// sdk.NewDecCoinFromDec("uatom", sdk.NewDec(1)), +// }, +// uint64(1000), +// sdk.Coins{ +// sdk.NewCoin("stake", sdk.NewInt(0)), +// sdk.NewCoin("uatom", sdk.NewInt(1000)), +// }, +// }, + +// { +// "unsorted min gas price should return sorted coins", +// []sdk.DecCoin{ +// sdk.NewDecCoinFromDec("uatom", sdk.NewDec(3)), +// sdk.NewDecCoinFromDec("photon", sdk.NewDec(2)), +// }, +// uint64(1000), +// expCoins, +// }, +// { +// "sorted min gas price should return same conins", +// []sdk.DecCoin{ +// sdk.NewDecCoinFromDec("photon", sdk.NewDec(2)), +// sdk.NewDecCoinFromDec("uatom", sdk.NewDec(3)), +// }, +// uint64(1000), +// expCoins, +// }, +// } + +// for _, tc := range testCases { +// s.Run(tc.name, func() { +// s.SetupTestGlobalFeeStoreAndMinGasPrice(tc.minGasPrice, &globfeetypes.Params{}) + +// fees := gaiafeeante.GetMinGasPrice(s.ctx, int64(tc.feeTxGasLimit)) +// s.Require().True(tc.expCoins.Sort().IsEqual(fees)) +// }) +// } +// } + +// func (s *IntegrationTestSuite) TestContainsOnlyBypassMinFeeMsgs() { +// // set globalfees params and min gas price +// globalfeeParams := &globfeetypes.Params{ +// BypassMinFeeMsgTypes: globfeetypes.DefaultBypassMinFeeMsgTypes, +// MaxTotalBypassMinFeeMsgGasUsage: globfeetypes.DefaultmaxTotalBypassMinFeeMsgGasUsage, +// } +// feeDecorator, _ := s.SetupTestGlobalFeeStoreAndMinGasPrice([]sdk.DecCoin{}, globalfeeParams) +// testCases := []struct { +// name string +// msgs []sdk.Msg +// expPass bool +// }{ +// { +// "expect empty msgs to pass", +// []sdk.Msg{}, +// true, +// }, +// { +// "expect default bypass msg to pass", +// []sdk.Msg{ +// ibcchanneltypes.NewMsgRecvPacket(ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), +// ibcchanneltypes.NewMsgAcknowledgement(ibcchanneltypes.Packet{}, []byte{1}, []byte{1}, ibcclienttypes.Height{}, ""), +// }, +// true, +// }, +// { +// "expect default bypass msgs to pass", +// []sdk.Msg{ +// ibcchanneltypes.NewMsgRecvPacket(ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), +// ibcchanneltypes.NewMsgAcknowledgement(ibcchanneltypes.Packet{}, []byte{1}, []byte{1}, ibcclienttypes.Height{}, ""), +// }, +// true, +// }, +// { +// "msgs contain non-bypass msg - should not pass", +// []sdk.Msg{ +// ibcchanneltypes.NewMsgRecvPacket(ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), +// stakingtypes.NewMsgDelegate(sdk.AccAddress{}, sdk.ValAddress{}, sdk.Coin{}), +// }, +// false, +// }, +// { +// "msgs contain only non-bypass msgs - should not pass", +// []sdk.Msg{ +// stakingtypes.NewMsgDelegate(sdk.AccAddress{}, sdk.ValAddress{}, sdk.Coin{}), +// }, +// false, +// }, +// } + +// for _, tc := range testCases { +// s.Run(tc.name, func() { +// res := feeDecorator.ContainsOnlyBypassMinFeeMsgs(s.ctx, tc.msgs) +// s.Require().True(tc.expPass == res) +// }) +// } +// } + +// func (s *IntegrationTestSuite) TestGetTxFeeRequired() { +// // create global fee params +// globalfeeParamsEmpty := &globfeetypes.Params{MinimumGasPrices: []sdk.DecCoin{}} + +// // setup tests with default global fee i.e. "0uatom" and empty local min gas prices +// feeDecorator, _ := s.SetupTestGlobalFeeStoreAndMinGasPrice([]sdk.DecCoin{}, globalfeeParamsEmpty) + +// // set a subspace that doesn't have the stakingtypes.KeyBondDenom key registred +// feeDecorator.StakingSubspace = s.app.GetSubspace(globfeetypes.ModuleName) + +// // check that an error is returned when staking bond denom is empty +// _, err := feeDecorator.GetTxFeeRequired(s.ctx, nil) +// s.Require().Equal(err.Error(), "empty staking bond denomination") + +// // set non-zero local min gas prices +// localMinGasPrices := sdk.NewCoins(sdk.NewCoin("uatom", sdk.NewInt(1))) + +// // setup tests with non-empty local min gas prices +// feeDecorator, _ = s.SetupTestGlobalFeeStoreAndMinGasPrice( +// sdk.NewDecCoinsFromCoins(localMinGasPrices...), +// globalfeeParamsEmpty, +// ) + +// // mock tx data +// s.txBuilder = s.clientCtx.TxConfig.NewTxBuilder() +// priv1, _, addr1 := testdata.KeyTestPubAddr() +// privs, accNums, accSeqs := []cryptotypes.PrivKey{priv1}, []uint64{0}, []uint64{0} + +// s.Require().NoError(s.txBuilder.SetMsgs(testdata.NewTestMsg(addr1))) +// s.txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt()))) + +// s.txBuilder.SetGasLimit(uint64(1)) +// tx, err := s.CreateTestTx(privs, accNums, accSeqs, s.ctx.ChainID()) +// s.Require().NoError(err) + +// // check that the required fees returned in CheckTx mode are equal to +// // local min gas prices since they're greater than the default global fee values. +// s.Require().True(s.ctx.IsCheckTx()) +// res, err := feeDecorator.GetTxFeeRequired(s.ctx, tx) +// s.Require().True(res.IsEqual(localMinGasPrices)) +// s.Require().NoError(err) + +// // check that the global fee is returned in DeliverTx mode. +// globalFee, err := feeDecorator.GetGlobalFee(s.ctx, tx) +// s.Require().NoError(err) + +// ctx := s.ctx.WithIsCheckTx(false) +// res, err = feeDecorator.GetTxFeeRequired(ctx, tx) +// s.Require().NoError(err) +// s.Require().True(res.IsEqual(globalFee)) +// } diff --git a/x/globalfee/ante/antetest/fee_test_setup.go b/x/globalfee/ante/antetest/fee_test_setup.go index df381f4cac..f0c8904348 100644 --- a/x/globalfee/ante/antetest/fee_test_setup.go +++ b/x/globalfee/ante/antetest/fee_test_setup.go @@ -1,125 +1,125 @@ package antetest -import ( - "fmt" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/tx" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - "github.com/cosmos/cosmos-sdk/testutil/testdata" - 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/cosmos/cosmos-sdk/x/params/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/stretchr/testify/suite" - tmrand "github.com/tendermint/tendermint/libs/rand" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - - gaiahelpers "github.com/cosmos/gaia/v11/app/helpers" - gaiafeeante "github.com/cosmos/gaia/v11/x/globalfee/ante" - - gaiaapp "github.com/cosmos/gaia/v11/app" - "github.com/cosmos/gaia/v11/x/globalfee" - globfeetypes "github.com/cosmos/gaia/v11/x/globalfee/types" -) - -type IntegrationTestSuite struct { - suite.Suite - - app *gaiaapp.GaiaApp - ctx sdk.Context - clientCtx client.Context - txBuilder client.TxBuilder -} - -var testBondDenom = "uatom" - -func (s *IntegrationTestSuite) SetupTest() { - app := gaiahelpers.Setup(s.T()) - ctx := app.BaseApp.NewContext(false, tmproto.Header{ - ChainID: fmt.Sprintf("test-chain-%s", tmrand.Str(4)), - Height: 1, - }) - - encodingConfig := gaiaapp.MakeTestEncodingConfig() - encodingConfig.Amino.RegisterConcrete(&testdata.TestMsg{}, "testdata.TestMsg", nil) - testdata.RegisterInterfaces(encodingConfig.InterfaceRegistry) - - s.app = app - s.ctx = ctx - s.clientCtx = client.Context{}.WithTxConfig(encodingConfig.TxConfig) -} - -func (s *IntegrationTestSuite) SetupTestGlobalFeeStoreAndMinGasPrice(minGasPrice []sdk.DecCoin, globalFeeParams *globfeetypes.Params) (gaiafeeante.FeeDecorator, sdk.AnteHandler) { - subspace := s.app.GetSubspace(globalfee.ModuleName) - subspace.SetParamSet(s.ctx, globalFeeParams) - s.ctx = s.ctx.WithMinGasPrices(minGasPrice).WithIsCheckTx(true) - - // set staking params - stakingParam := stakingtypes.DefaultParams() - stakingParam.BondDenom = testBondDenom - stakingSubspace := s.SetupTestStakingSubspace(stakingParam) - - // build fee decorator - feeDecorator := gaiafeeante.NewFeeDecorator(subspace, stakingSubspace) - - // chain fee decorator to antehandler - antehandler := sdk.ChainAnteDecorators(feeDecorator) - - return feeDecorator, antehandler -} - -// SetupTestStakingSubspace sets uatom as bond denom for the fee tests. -func (s *IntegrationTestSuite) SetupTestStakingSubspace(params stakingtypes.Params) types.Subspace { - s.app.GetSubspace(stakingtypes.ModuleName).SetParamSet(s.ctx, ¶ms) - return s.app.GetSubspace(stakingtypes.ModuleName) -} - -func (s *IntegrationTestSuite) CreateTestTx(privs []cryptotypes.PrivKey, accNums []uint64, accSeqs []uint64, chainID string) (xauthsigning.Tx, error) { - var sigsV2 []signing.SignatureV2 - for i, priv := range privs { - sigV2 := signing.SignatureV2{ - PubKey: priv.PubKey(), - Data: &signing.SingleSignatureData{ - SignMode: s.clientCtx.TxConfig.SignModeHandler().DefaultMode(), - Signature: nil, - }, - Sequence: accSeqs[i], - } - - sigsV2 = append(sigsV2, sigV2) - } - - if err := s.txBuilder.SetSignatures(sigsV2...); err != nil { - return nil, err - } - - sigsV2 = []signing.SignatureV2{} - for i, priv := range privs { - signerData := xauthsigning.SignerData{ - ChainID: chainID, - AccountNumber: accNums[i], - Sequence: accSeqs[i], - } - sigV2, err := tx.SignWithPrivKey( - s.clientCtx.TxConfig.SignModeHandler().DefaultMode(), - signerData, - s.txBuilder, - priv, - s.clientCtx.TxConfig, - accSeqs[i], - ) - if err != nil { - return nil, err - } - - sigsV2 = append(sigsV2, sigV2) - } - - if err := s.txBuilder.SetSignatures(sigsV2...); err != nil { - return nil, err - } - - return s.txBuilder.GetTx(), nil -} +// import ( +// "fmt" + +// "github.com/cosmos/cosmos-sdk/client" +// "github.com/cosmos/cosmos-sdk/client/tx" +// cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" +// "github.com/cosmos/cosmos-sdk/testutil/testdata" +// 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/cosmos/cosmos-sdk/x/params/types" +// stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" +// "github.com/stretchr/testify/suite" +// tmrand "github.com/tendermint/tendermint/libs/rand" +// tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + +// gaiahelpers "github.com/cosmos/gaia/v11/app/helpers" +// gaiafeeante "github.com/cosmos/gaia/v11/x/globalfee/ante" + +// gaiaapp "github.com/cosmos/gaia/v11/app" +// "github.com/cosmos/gaia/v11/x/globalfee" +// globfeetypes "github.com/cosmos/gaia/v11/x/globalfee/types" +// ) + +// type IntegrationTestSuite struct { +// suite.Suite + +// app *gaiaapp.GaiaApp +// ctx sdk.Context +// clientCtx client.Context +// txBuilder client.TxBuilder +// } + +// var testBondDenom = "uatom" + +// func (s *IntegrationTestSuite) SetupTest() { +// app := gaiahelpers.Setup(s.T()) +// ctx := app.BaseApp.NewContext(false, tmproto.Header{ +// ChainID: fmt.Sprintf("test-chain-%s", tmrand.Str(4)), +// Height: 1, +// }) + +// encodingConfig := gaiaapp.MakeTestEncodingConfig() +// encodingConfig.Amino.RegisterConcrete(&testdata.TestMsg{}, "testdata.TestMsg", nil) +// testdata.RegisterInterfaces(encodingConfig.InterfaceRegistry) + +// s.app = app +// s.ctx = ctx +// s.clientCtx = client.Context{}.WithTxConfig(encodingConfig.TxConfig) +// } + +// func (s *IntegrationTestSuite) SetupTestGlobalFeeStoreAndMinGasPrice(minGasPrice []sdk.DecCoin, globalFeeParams *globfeetypes.Params) (gaiafeeante.FeeDecorator, sdk.AnteHandler) { +// subspace := s.app.GetSubspace(globalfee.ModuleName) +// subspace.SetParamSet(s.ctx, globalFeeParams) +// s.ctx = s.ctx.WithMinGasPrices(minGasPrice).WithIsCheckTx(true) + +// // set staking params +// stakingParam := stakingtypes.DefaultParams() +// stakingParam.BondDenom = testBondDenom +// stakingSubspace := s.SetupTestStakingSubspace(stakingParam) + +// // build fee decorator +// feeDecorator := gaiafeeante.NewFeeDecorator(subspace, stakingSubspace) + +// // chain fee decorator to antehandler +// antehandler := sdk.ChainAnteDecorators(feeDecorator) + +// return feeDecorator, antehandler +// } + +// // SetupTestStakingSubspace sets uatom as bond denom for the fee tests. +// func (s *IntegrationTestSuite) SetupTestStakingSubspace(params stakingtypes.Params) types.Subspace { +// s.app.GetSubspace(stakingtypes.ModuleName).SetParamSet(s.ctx, ¶ms) +// return s.app.GetSubspace(stakingtypes.ModuleName) +// } + +// func (s *IntegrationTestSuite) CreateTestTx(privs []cryptotypes.PrivKey, accNums []uint64, accSeqs []uint64, chainID string) (xauthsigning.Tx, error) { +// var sigsV2 []signing.SignatureV2 +// for i, priv := range privs { +// sigV2 := signing.SignatureV2{ +// PubKey: priv.PubKey(), +// Data: &signing.SingleSignatureData{ +// SignMode: s.clientCtx.TxConfig.SignModeHandler().DefaultMode(), +// Signature: nil, +// }, +// Sequence: accSeqs[i], +// } + +// sigsV2 = append(sigsV2, sigV2) +// } + +// if err := s.txBuilder.SetSignatures(sigsV2...); err != nil { +// return nil, err +// } + +// sigsV2 = []signing.SignatureV2{} +// for i, priv := range privs { +// signerData := xauthsigning.SignerData{ +// ChainID: chainID, +// AccountNumber: accNums[i], +// Sequence: accSeqs[i], +// } +// sigV2, err := tx.SignWithPrivKey( +// s.clientCtx.TxConfig.SignModeHandler().DefaultMode(), +// signerData, +// s.txBuilder, +// priv, +// s.clientCtx.TxConfig, +// accSeqs[i], +// ) +// if err != nil { +// return nil, err +// } + +// sigsV2 = append(sigsV2, sigV2) +// } + +// if err := s.txBuilder.SetSignatures(sigsV2...); err != nil { +// return nil, err +// } + +// return s.txBuilder.GetTx(), nil +// } diff --git a/x/globalfee/ante/fee.go b/x/globalfee/ante/fee.go index 284f863e90..81969e3f85 100644 --- a/x/globalfee/ante/fee.go +++ b/x/globalfee/ante/fee.go @@ -1,278 +1,278 @@ package ante -import ( - "errors" - "fmt" +// import ( +// "errors" +// "fmt" - errorsmod "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - gaiaerrors "github.com/cosmos/gaia/v11/types/errors" - tmstrings "github.com/tendermint/tendermint/libs/strings" +// errorsmod "cosmossdk.io/errors" +// sdk "github.com/cosmos/cosmos-sdk/types" +// paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" +// stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" +// gaiaerrors "github.com/cosmos/gaia/v11/types/errors" +// tmstrings "github.com/tendermint/tendermint/libs/strings" - "github.com/cosmos/gaia/v11/x/globalfee" - "github.com/cosmos/gaia/v11/x/globalfee/types" -) +// "github.com/cosmos/gaia/v11/x/globalfee" +// "github.com/cosmos/gaia/v11/x/globalfee/types" +// ) // FeeWithBypassDecorator checks if the transaction's fee is at least as large // as the local validator's minimum gasFee (defined in validator config) and global fee, and the fee denom should be in the global fees' denoms. // -// If fee is too low, decorator returns error and tx is rejected from mempool. -// Note this only applies when ctx.CheckTx = true. If fee is high enough or not -// CheckTx, then call next AnteHandler. +// import ( +// "errors" +// "fmt" // // CONTRACT: Tx must implement FeeTx to use FeeDecorator // If the tx msg type is one of the bypass msg types, the tx is valid even if the min fee is lower than normally required. // If the bypass tx still carries fees, the fee denom should be the same as global fee required. -var _ sdk.AnteDecorator = FeeDecorator{} +// var _ sdk.AnteDecorator = FeeDecorator{} -type FeeDecorator struct { - GlobalMinFeeParamSource globalfee.ParamSource - StakingSubspace paramtypes.Subspace -} +// type FeeDecorator struct { +// GlobalMinFeeParamSource globalfee.ParamSource +// StakingSubspace paramtypes.Subspace +// } -func NewFeeDecorator(globalfeeSubspace, stakingSubspace paramtypes.Subspace) FeeDecorator { - if !globalfeeSubspace.HasKeyTable() { - panic("global fee paramspace was not set up via module") - } +// func NewFeeDecorator(globalfeeSubspace, stakingSubspace paramtypes.Subspace) FeeDecorator { +// if !globalfeeSubspace.HasKeyTable() { +// panic("global fee paramspace was not set up via module") +// } - if !stakingSubspace.HasKeyTable() { - panic("staking paramspace was not set up via module") - } +// if !stakingSubspace.HasKeyTable() { +// panic("staking paramspace was not set up via module") +// } - return FeeDecorator{ - GlobalMinFeeParamSource: globalfeeSubspace, - StakingSubspace: stakingSubspace, - } -} +// return FeeDecorator{ +// GlobalMinFeeParamSource: globalfeeSubspace, +// StakingSubspace: stakingSubspace, +// } +// } // AnteHandle implements the AnteDecorator interface -func (mfd FeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) { - feeTx, ok := tx.(sdk.FeeTx) - if !ok { - return ctx, errorsmod.Wrap(gaiaerrors.ErrTxDecode, "Tx must implement the sdk.FeeTx interface") - } - - // Do not check minimum-gas-prices and global fees during simulations - if simulate { - return next(ctx, tx, simulate) - } - - // Get the required fees according to the CheckTx or DeliverTx modes - feeRequired, err := mfd.GetTxFeeRequired(ctx, feeTx) - if err != nil { - return ctx, err - } - - // reject the transaction early if the feeCoins have more denoms than the fee requirement - - // feeRequired cannot be empty - if feeTx.GetFee().Len() > feeRequired.Len() { - return ctx, errorsmod.Wrapf(gaiaerrors.ErrInvalidCoins, "fee is not a subset of required fees; got %s, required: %s", feeTx.GetFee().String(), feeRequired.String()) - } - - // Sort fee tx's coins, zero coins in feeCoins are already removed - feeCoins := feeTx.GetFee().Sort() - gas := feeTx.GetGas() - msgs := feeTx.GetMsgs() - - // split feeRequired into zero and non-zero coins(nonZeroCoinFeesReq, zeroCoinFeesDenomReq), split feeCoins according to - // nonZeroCoinFeesReq, zeroCoinFeesDenomReq, - // so that feeCoins can be checked separately against them. - nonZeroCoinFeesReq, zeroCoinFeesDenomReq := getNonZeroFees(feeRequired) - - // feeCoinsNonZeroDenom contains non-zero denominations from the feeRequired - // feeCoinsNonZeroDenom is used to check if the fees meets the requirement imposed by nonZeroCoinFeesReq - // when feeCoins does not contain zero coins' denoms in feeRequired - feeCoinsNonZeroDenom, feeCoinsZeroDenom := splitCoinsByDenoms(feeCoins, zeroCoinFeesDenomReq) - - // Check that the fees are in expected denominations. - // according to splitCoinsByDenoms(), feeCoinsZeroDenom must be in denom subset of zeroCoinFeesDenomReq. - // check if feeCoinsNonZeroDenom is a subset of nonZeroCoinFeesReq. - // special case: if feeCoinsNonZeroDenom=[], DenomsSubsetOf returns true - // special case: if feeCoinsNonZeroDenom is not empty, but nonZeroCoinFeesReq empty, return false - if !feeCoinsNonZeroDenom.DenomsSubsetOf(nonZeroCoinFeesReq) { - return ctx, errorsmod.Wrapf(gaiaerrors.ErrInsufficientFee, "fee is not a subset of required fees; got %s, required: %s", feeCoins.String(), feeRequired.String()) - } - - // If the feeCoins pass the denoms check, check they are bypass-msg types. - // - // Bypass min fee requires: - // - the tx contains only message types that can bypass the minimum fee, - // see BypassMinFeeMsgTypes; - // - the total gas limit per message does not exceed MaxTotalBypassMinFeeMsgGasUsage, - // i.e., totalGas <= MaxTotalBypassMinFeeMsgGasUsage - // Otherwise, minimum fees and global fees are checked to prevent spam. - maxTotalBypassMinFeeMsgGasUsage := mfd.GetMaxTotalBypassMinFeeMsgGasUsage(ctx) - doesNotExceedMaxGasUsage := gas <= maxTotalBypassMinFeeMsgGasUsage - allBypassMsgs := mfd.ContainsOnlyBypassMinFeeMsgs(ctx, msgs) - allowedToBypassMinFee := allBypassMsgs && doesNotExceedMaxGasUsage - - if allowedToBypassMinFee { - return next(ctx, tx, simulate) - } - - // if the msg does not satisfy bypass condition and the feeCoins denoms are subset of feeRequired, - // check the feeCoins amount against feeRequired - // - // when feeCoins=[] - // special case: and there is zero coin in fee requirement, pass, - // otherwise, err - if len(feeCoins) == 0 { - if len(zeroCoinFeesDenomReq) != 0 { - return next(ctx, tx, simulate) - } - return ctx, errorsmod.Wrapf(gaiaerrors.ErrInsufficientFee, "insufficient fees; got: %s required: %s", feeCoins.String(), feeRequired.String()) - } - - // when feeCoins != [] - // special case: if TX has at least one of the zeroCoinFeesDenomReq, then it should pass - if len(feeCoinsZeroDenom) > 0 { - return next(ctx, tx, simulate) - } - - // After all the checks, the tx is confirmed: - // feeCoins denoms subset off feeRequired - // Not bypass - // feeCoins != [] - // Not contain zeroCoinFeesDenomReq's denoms - // - // check if the feeCoins's feeCoinsNonZeroDenom part has coins' amount higher/equal to nonZeroCoinFeesReq - if !feeCoinsNonZeroDenom.IsAnyGTE(nonZeroCoinFeesReq) { - errMsg := fmt.Sprintf("Insufficient fees; got: %s required: %s", feeCoins.String(), feeRequired.String()) - if allBypassMsgs && !doesNotExceedMaxGasUsage { - errMsg = fmt.Sprintf("Insufficient fees; bypass-min-fee-msg-types with gas consumption %v exceeds the maximum allowed gas value of %v.", gas, maxTotalBypassMinFeeMsgGasUsage) - } - - return ctx, errorsmod.Wrap(gaiaerrors.ErrInsufficientFee, errMsg) - } - - return next(ctx, tx, simulate) -} - -// GetTxFeeRequired returns the required fees for the given FeeTx. -// In case the FeeTx's mode is CheckTx, it returns the combined requirements -// of local min gas prices and global fees. Otherwise, in DeliverTx, it returns the global fee. -func (mfd FeeDecorator) GetTxFeeRequired(ctx sdk.Context, tx sdk.FeeTx) (sdk.Coins, error) { - // Get required global fee min gas prices - // Note that it should never be empty since its default value is set to coin={"StakingBondDenom", 0} - globalFees, err := mfd.GetGlobalFee(ctx, tx) - if err != nil { - return sdk.Coins{}, err - } - - // In DeliverTx, the global fee min gas prices are the only tx fee requirements. - if !ctx.IsCheckTx() { - return globalFees, nil - } - - // In CheckTx mode, the local and global fee min gas prices are combined - // to form the tx fee requirements - - // Get local minimum-gas-prices - localFees := GetMinGasPrice(ctx, int64(tx.GetGas())) - - // Return combined fee requirements - return CombinedFeeRequirement(globalFees, localFees) -} - -// GetGlobalFee returns the global fees for a given fee tx's gas -// (might also return 0denom if globalMinGasPrice is 0) -// sorted in ascending order. -// Note that ParamStoreKeyMinGasPrices type requires coins sorted. -func (mfd FeeDecorator) GetGlobalFee(ctx sdk.Context, feeTx sdk.FeeTx) (sdk.Coins, error) { - var ( - globalMinGasPrices sdk.DecCoins - err error - ) - - if mfd.GlobalMinFeeParamSource.Has(ctx, types.ParamStoreKeyMinGasPrices) { - mfd.GlobalMinFeeParamSource.Get(ctx, types.ParamStoreKeyMinGasPrices, &globalMinGasPrices) - } - // global fee is empty set, set global fee to 0uatom - if len(globalMinGasPrices) == 0 { - globalMinGasPrices, err = mfd.DefaultZeroGlobalFee(ctx) - if err != nil { - return sdk.Coins{}, err - } - } - requiredGlobalFees := make(sdk.Coins, len(globalMinGasPrices)) - // Determine the required fees by multiplying each required minimum gas - // price by the gas limit, where fee = ceil(minGasPrice * gasLimit). - glDec := sdk.NewDec(int64(feeTx.GetGas())) - for i, gp := range globalMinGasPrices { - fee := gp.Amount.Mul(glDec) - requiredGlobalFees[i] = sdk.NewCoin(gp.Denom, fee.Ceil().RoundInt()) - } - - return requiredGlobalFees.Sort(), nil -} - -// DefaultZeroGlobalFee returns a zero coin with the staking module bond denom -func (mfd FeeDecorator) DefaultZeroGlobalFee(ctx sdk.Context) ([]sdk.DecCoin, error) { - bondDenom := mfd.getBondDenom(ctx) - if bondDenom == "" { - return nil, errors.New("empty staking bond denomination") - } - - return []sdk.DecCoin{sdk.NewDecCoinFromDec(bondDenom, sdk.NewDec(0))}, nil -} - -func (mfd FeeDecorator) getBondDenom(ctx sdk.Context) (bondDenom string) { - if mfd.StakingSubspace.Has(ctx, stakingtypes.KeyBondDenom) { - mfd.StakingSubspace.Get(ctx, stakingtypes.KeyBondDenom, &bondDenom) - } - - return -} - -func (mfd FeeDecorator) ContainsOnlyBypassMinFeeMsgs(ctx sdk.Context, msgs []sdk.Msg) bool { - bypassMsgTypes := mfd.GetBypassMsgTypes(ctx) - for _, msg := range msgs { - if tmstrings.StringInSlice(sdk.MsgTypeURL(msg), bypassMsgTypes) { - continue - } - return false - } - - return true -} - -func (mfd FeeDecorator) GetBypassMsgTypes(ctx sdk.Context) (res []string) { - if mfd.GlobalMinFeeParamSource.Has(ctx, types.ParamStoreKeyBypassMinFeeMsgTypes) { - mfd.GlobalMinFeeParamSource.Get(ctx, types.ParamStoreKeyBypassMinFeeMsgTypes, &res) - } - - return -} - -func (mfd FeeDecorator) GetMaxTotalBypassMinFeeMsgGasUsage(ctx sdk.Context) (res uint64) { - if mfd.GlobalMinFeeParamSource.Has(ctx, types.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage) { - mfd.GlobalMinFeeParamSource.Get(ctx, types.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage, &res) - } - - return -} - -// GetMinGasPrice returns a nodes's local minimum gas prices -// fees given a gas limit -func GetMinGasPrice(ctx sdk.Context, gasLimit int64) sdk.Coins { - minGasPrices := ctx.MinGasPrices() - // special case: if minGasPrices=[], requiredFees=[] - if minGasPrices.IsZero() { - return sdk.Coins{} - } - - requiredFees := make(sdk.Coins, len(minGasPrices)) - // Determine the required fees by multiplying each required minimum gas - // price by the gas limit, where fee = ceil(minGasPrice * gasLimit). - glDec := sdk.NewDec(gasLimit) - for i, gp := range minGasPrices { - fee := gp.Amount.Mul(glDec) - requiredFees[i] = sdk.NewCoin(gp.Denom, fee.Ceil().RoundInt()) - } - - return requiredFees.Sort() -} +// func (mfd FeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) { +// feeTx, ok := tx.(sdk.FeeTx) +// if !ok { +// return ctx, errorsmod.Wrap(gaiaerrors.ErrTxDecode, "Tx must implement the sdk.FeeTx interface") +// } + +// // Do not check minimum-gas-prices and global fees during simulations +// if simulate { +// return next(ctx, tx, simulate) +// } + +// // Get the required fees according to the CheckTx or DeliverTx modes +// feeRequired, err := mfd.GetTxFeeRequired(ctx, feeTx) +// if err != nil { +// return ctx, err +// } + +// reject the transaction early if the feeCoins have more denoms than the fee requirement + +// feeRequired cannot be empty +// if feeTx.GetFee().Len() > feeRequired.Len() { +// return ctx, errorsmod.Wrapf(gaiaerrors.ErrInvalidCoins, "fee is not a subset of required fees; got %s, required: %s", feeTx.GetFee().String(), feeRequired.String()) +// } + +// // Sort fee tx's coins, zero coins in feeCoins are already removed +// feeCoins := feeTx.GetFee().Sort() +// gas := feeTx.GetGas() +// msgs := feeTx.GetMsgs() + +// // split feeRequired into zero and non-zero coins(nonZeroCoinFeesReq, zeroCoinFeesDenomReq), split feeCoins according to +// // nonZeroCoinFeesReq, zeroCoinFeesDenomReq, +// // so that feeCoins can be checked separately against them. +// nonZeroCoinFeesReq, zeroCoinFeesDenomReq := getNonZeroFees(feeRequired) + +// // feeCoinsNonZeroDenom contains non-zero denominations from the feeRequired +// // feeCoinsNonZeroDenom is used to check if the fees meets the requirement imposed by nonZeroCoinFeesReq +// // when feeCoins does not contain zero coins' denoms in feeRequired +// feeCoinsNonZeroDenom, feeCoinsZeroDenom := splitCoinsByDenoms(feeCoins, zeroCoinFeesDenomReq) + +// Check that the fees are in expected denominations. +// according to splitCoinsByDenoms(), feeCoinsZeroDenom must be in denom subset of zeroCoinFeesDenomReq. +// check if feeCoinsNonZeroDenom is a subset of nonZeroCoinFeesReq. +// special case: if feeCoinsNonZeroDenom=[], DenomsSubsetOf returns true +// special case: if feeCoinsNonZeroDenom is not empty, but nonZeroCoinFeesReq empty, return false +// if !feeCoinsNonZeroDenom.DenomsSubsetOf(nonZeroCoinFeesReq) { +// return ctx, errorsmod.Wrapf(gaiaerrors.ErrInsufficientFee, "fee is not a subset of required fees; got %s, required: %s", feeCoins.String(), feeRequired.String()) +// } + +// // If the feeCoins pass the denoms check, check they are bypass-msg types. +// // +// // Bypass min fee requires: +// // - the tx contains only message types that can bypass the minimum fee, +// // see BypassMinFeeMsgTypes; +// // - the total gas limit per message does not exceed MaxTotalBypassMinFeeMsgGasUsage, +// // i.e., totalGas <= MaxTotalBypassMinFeeMsgGasUsage +// // Otherwise, minimum fees and global fees are checked to prevent spam. +// maxTotalBypassMinFeeMsgGasUsage := mfd.GetMaxTotalBypassMinFeeMsgGasUsage(ctx) +// doesNotExceedMaxGasUsage := gas <= maxTotalBypassMinFeeMsgGasUsage +// allBypassMsgs := mfd.ContainsOnlyBypassMinFeeMsgs(ctx, msgs) +// allowedToBypassMinFee := allBypassMsgs && doesNotExceedMaxGasUsage + +// if allowedToBypassMinFee { +// return next(ctx, tx, simulate) +// } + +// if the msg does not satisfy bypass condition and the feeCoins denoms are subset of feeRequired, +// check the feeCoins amount against feeRequired +// +// when feeCoins=[] +// special case: and there is zero coin in fee requirement, pass, +// otherwise, err +// if len(feeCoins) == 0 { +// if len(zeroCoinFeesDenomReq) != 0 { +// return next(ctx, tx, simulate) +// } +// return ctx, errorsmod.Wrapf(gaiaerrors.ErrInsufficientFee, "insufficient fees; got: %s required: %s", feeCoins.String(), feeRequired.String()) +// } + +// // when feeCoins != [] +// // special case: if TX has at least one of the zeroCoinFeesDenomReq, then it should pass +// if len(feeCoinsZeroDenom) > 0 { +// return next(ctx, tx, simulate) +// } + +// // After all the checks, the tx is confirmed: +// // feeCoins denoms subset off feeRequired +// // Not bypass +// // feeCoins != [] +// // Not contain zeroCoinFeesDenomReq's denoms +// // +// // check if the feeCoins's feeCoinsNonZeroDenom part has coins' amount higher/equal to nonZeroCoinFeesReq +// if !feeCoinsNonZeroDenom.IsAnyGTE(nonZeroCoinFeesReq) { +// errMsg := fmt.Sprintf("Insufficient fees; got: %s required: %s", feeCoins.String(), feeRequired.String()) +// if allBypassMsgs && !doesNotExceedMaxGasUsage { +// errMsg = fmt.Sprintf("Insufficient fees; bypass-min-fee-msg-types with gas consumption %v exceeds the maximum allowed gas value of %v.", gas, maxTotalBypassMinFeeMsgGasUsage) +// } + +// return ctx, errorsmod.Wrap(gaiaerrors.ErrInsufficientFee, errMsg) +// } + +// return next(ctx, tx, simulate) +// } + +// // GetTxFeeRequired returns the required fees for the given FeeTx. +// // In case the FeeTx's mode is CheckTx, it returns the combined requirements +// // of local min gas prices and global fees. Otherwise, in DeliverTx, it returns the global fee. +// func (mfd FeeDecorator) GetTxFeeRequired(ctx sdk.Context, tx sdk.FeeTx) (sdk.Coins, error) { +// // Get required global fee min gas prices +// // Note that it should never be empty since its default value is set to coin={"StakingBondDenom", 0} +// globalFees, err := mfd.GetGlobalFee(ctx, tx) +// if err != nil { +// return sdk.Coins{}, err +// } + +// // In DeliverTx, the global fee min gas prices are the only tx fee requirements. +// if !ctx.IsCheckTx() { +// return globalFees, nil +// } + +// // In CheckTx mode, the local and global fee min gas prices are combined +// // to form the tx fee requirements + +// // Get local minimum-gas-prices +// localFees := GetMinGasPrice(ctx, int64(tx.GetGas())) + +// // Return combined fee requirements +// return CombinedFeeRequirement(globalFees, localFees) +// } + +// // GetGlobalFee returns the global fees for a given fee tx's gas +// // (might also return 0denom if globalMinGasPrice is 0) +// // sorted in ascending order. +// // Note that ParamStoreKeyMinGasPrices type requires coins sorted. +// func (mfd FeeDecorator) GetGlobalFee(ctx sdk.Context, feeTx sdk.FeeTx) (sdk.Coins, error) { +// var ( +// globalMinGasPrices sdk.DecCoins +// err error +// ) + +// if mfd.GlobalMinFeeParamSource.Has(ctx, types.ParamStoreKeyMinGasPrices) { +// mfd.GlobalMinFeeParamSource.Get(ctx, types.ParamStoreKeyMinGasPrices, &globalMinGasPrices) +// } +// // global fee is empty set, set global fee to 0uatom +// if len(globalMinGasPrices) == 0 { +// globalMinGasPrices, err = mfd.DefaultZeroGlobalFee(ctx) +// if err != nil { +// return sdk.Coins{}, err +// } +// } +// requiredGlobalFees := make(sdk.Coins, len(globalMinGasPrices)) +// // Determine the required fees by multiplying each required minimum gas +// // price by the gas limit, where fee = ceil(minGasPrice * gasLimit). +// glDec := sdk.NewDec(int64(feeTx.GetGas())) +// for i, gp := range globalMinGasPrices { +// fee := gp.Amount.Mul(glDec) +// requiredGlobalFees[i] = sdk.NewCoin(gp.Denom, fee.Ceil().RoundInt()) +// } + +// return requiredGlobalFees.Sort(), nil +// } + +// // DefaultZeroGlobalFee returns a zero coin with the staking module bond denom +// func (mfd FeeDecorator) DefaultZeroGlobalFee(ctx sdk.Context) ([]sdk.DecCoin, error) { +// bondDenom := mfd.getBondDenom(ctx) +// if bondDenom == "" { +// return nil, errors.New("empty staking bond denomination") +// } + +// return []sdk.DecCoin{sdk.NewDecCoinFromDec(bondDenom, sdk.NewDec(0))}, nil +// } + +// func (mfd FeeDecorator) getBondDenom(ctx sdk.Context) (bondDenom string) { +// if mfd.StakingSubspace.Has(ctx, stakingtypes.KeyBondDenom) { +// mfd.StakingSubspace.Get(ctx, stakingtypes.KeyBondDenom, &bondDenom) +// } + +// return +// } + +// func (mfd FeeDecorator) ContainsOnlyBypassMinFeeMsgs(ctx sdk.Context, msgs []sdk.Msg) bool { +// bypassMsgTypes := mfd.GetBypassMsgTypes(ctx) +// for _, msg := range msgs { +// if tmstrings.StringInSlice(sdk.MsgTypeURL(msg), bypassMsgTypes) { +// continue +// } +// return false +// } + +// return true +// } + +// func (mfd FeeDecorator) GetBypassMsgTypes(ctx sdk.Context) (res []string) { +// if mfd.GlobalMinFeeParamSource.Has(ctx, types.ParamStoreKeyBypassMinFeeMsgTypes) { +// mfd.GlobalMinFeeParamSource.Get(ctx, types.ParamStoreKeyBypassMinFeeMsgTypes, &res) +// } + +// return +// } + +// func (mfd FeeDecorator) GetMaxTotalBypassMinFeeMsgGasUsage(ctx sdk.Context) (res uint64) { +// if mfd.GlobalMinFeeParamSource.Has(ctx, types.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage) { +// mfd.GlobalMinFeeParamSource.Get(ctx, types.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage, &res) +// } + +// return +// } + +// // GetMinGasPrice returns a nodes's local minimum gas prices +// // fees given a gas limit +// func GetMinGasPrice(ctx sdk.Context, gasLimit int64) sdk.Coins { +// minGasPrices := ctx.MinGasPrices() +// // special case: if minGasPrices=[], requiredFees=[] +// if minGasPrices.IsZero() { +// return sdk.Coins{} +// } + +// requiredFees := make(sdk.Coins, len(minGasPrices)) +// // Determine the required fees by multiplying each required minimum gas +// // price by the gas limit, where fee = ceil(minGasPrice * gasLimit). +// glDec := sdk.NewDec(gasLimit) +// for i, gp := range minGasPrices { +// fee := gp.Amount.Mul(glDec) +// requiredFees[i] = sdk.NewCoin(gp.Denom, fee.Ceil().RoundInt()) +// } + +// return requiredFees.Sort() +// } diff --git a/x/globalfee/ante/fee_utils.go b/x/globalfee/ante/fee_utils.go index 289f45e250..27c5fb3899 100644 --- a/x/globalfee/ante/fee_utils.go +++ b/x/globalfee/ante/fee_utils.go @@ -1,114 +1,114 @@ package ante -import ( - errorsmod "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - gaiaerrors "github.com/cosmos/gaia/v11/types/errors" -) +// import ( +// errorsmod "cosmossdk.io/errors" +// sdk "github.com/cosmos/cosmos-sdk/types" +// gaiaerrors "github.com/cosmos/gaia/v11/types/errors" +// ) // ContainZeroCoins returns true if the given coins are empty or contain zero coins, // Note that the coins denoms must be validated, see sdk.ValidateDenom -func ContainZeroCoins(coins sdk.Coins) bool { - if len(coins) == 0 { - return true - } - for _, coin := range coins { - if coin.IsZero() { - return true - } - } - - return false -} +// func ContainZeroCoins(coins sdk.Coins) bool { +// if len(coins) == 0 { +// return true +// } +// for _, coin := range coins { +// if coin.IsZero() { +// return true +// } +// } + +// return false +// } // CombinedFeeRequirement returns the global fee and min_gas_price combined and sorted. // Both globalFees and minGasPrices must be valid, but CombinedFeeRequirement // does not validate them, so it may return 0denom. // if globalfee is empty, CombinedFeeRequirement return sdk.Coins{} -func CombinedFeeRequirement(globalFees, minGasPrices sdk.Coins) (sdk.Coins, error) { - // global fees should never be empty - // since it has a default value using the staking module's bond denom - if len(globalFees) == 0 { - return sdk.Coins{}, errorsmod.Wrapf(gaiaerrors.ErrNotFound, "global fee cannot be empty") - } - - // empty min_gas_price - if len(minGasPrices) == 0 { - return globalFees, nil - } - - // if min_gas_price denom is in globalfee, and the amount is higher than globalfee, add min_gas_price to allFees - var allFees sdk.Coins - for _, fee := range globalFees { - // min_gas_price denom in global fee - ok, c := Find(minGasPrices, fee.Denom) - if ok && c.Amount.GT(fee.Amount) { - allFees = append(allFees, c) - } else { - allFees = append(allFees, fee) - } - } - - return allFees.Sort(), nil -} - -// Find replaces the functionality of Coins.Find from SDK v0.46.x -func Find(coins sdk.Coins, denom string) (bool, sdk.Coin) { - switch len(coins) { - case 0: - return false, sdk.Coin{} - - case 1: - coin := coins[0] - if coin.Denom == denom { - return true, coin - } - return false, sdk.Coin{} - - default: - midIdx := len(coins) / 2 // 2:1, 3:1, 4:2 - coin := coins[midIdx] - switch { - case denom < coin.Denom: - return Find(coins[:midIdx], denom) - case denom == coin.Denom: - return true, coin - default: - return Find(coins[midIdx+1:], denom) - } - } -} - -// splitCoinsByDenoms returns the given coins split in two whether -// their demon is or isn't found in the given denom map. -func splitCoinsByDenoms(feeCoins sdk.Coins, denomMap map[string]struct{}) (sdk.Coins, sdk.Coins) { - feeCoinsNonZeroDenom, feeCoinsZeroDenom := sdk.Coins{}, sdk.Coins{} - - for _, fc := range feeCoins { - _, found := denomMap[fc.Denom] - if found { - feeCoinsZeroDenom = append(feeCoinsZeroDenom, fc) - } else { - feeCoinsNonZeroDenom = append(feeCoinsNonZeroDenom, fc) - } - } - - return feeCoinsNonZeroDenom.Sort(), feeCoinsZeroDenom.Sort() -} - -// getNonZeroFees returns the given fees nonzero coins -// and a map storing the zero coins's denoms -func getNonZeroFees(fees sdk.Coins) (sdk.Coins, map[string]struct{}) { - requiredFeesNonZero := sdk.Coins{} - requiredFeesZeroDenom := map[string]struct{}{} - - for _, gf := range fees { - if gf.IsZero() { - requiredFeesZeroDenom[gf.Denom] = struct{}{} - } else { - requiredFeesNonZero = append(requiredFeesNonZero, gf) - } - } - - return requiredFeesNonZero.Sort(), requiredFeesZeroDenom -} +// func CombinedFeeRequirement(globalFees, minGasPrices sdk.Coins) (sdk.Coins, error) { +// // global fees should never be empty +// // since it has a default value using the staking module's bond denom +// if len(globalFees) == 0 { +// return sdk.Coins{}, errorsmod.Wrapf(gaiaerrors.ErrNotFound, "global fee cannot be empty") +// } + +// // empty min_gas_price +// if len(minGasPrices) == 0 { +// return globalFees, nil +// } + +// // if min_gas_price denom is in globalfee, and the amount is higher than globalfee, add min_gas_price to allFees +// var allFees sdk.Coins +// for _, fee := range globalFees { +// // min_gas_price denom in global fee +// ok, c := Find(minGasPrices, fee.Denom) +// if ok && c.Amount.GT(fee.Amount) { +// allFees = append(allFees, c) +// } else { +// allFees = append(allFees, fee) +// } +// } + +// return allFees.Sort(), nil +// } + +// // Find replaces the functionality of Coins.Find from SDK v0.46.x +// func Find(coins sdk.Coins, denom string) (bool, sdk.Coin) { +// switch len(coins) { +// case 0: +// return false, sdk.Coin{} + +// case 1: +// coin := coins[0] +// if coin.Denom == denom { +// return true, coin +// } +// return false, sdk.Coin{} + +// default: +// midIdx := len(coins) / 2 // 2:1, 3:1, 4:2 +// coin := coins[midIdx] +// switch { +// case denom < coin.Denom: +// return Find(coins[:midIdx], denom) +// case denom == coin.Denom: +// return true, coin +// default: +// return Find(coins[midIdx+1:], denom) +// } +// } +// } + +// // splitCoinsByDenoms returns the given coins split in two whether +// // their demon is or isn't found in the given denom map. +// func splitCoinsByDenoms(feeCoins sdk.Coins, denomMap map[string]struct{}) (sdk.Coins, sdk.Coins) { +// feeCoinsNonZeroDenom, feeCoinsZeroDenom := sdk.Coins{}, sdk.Coins{} + +// for _, fc := range feeCoins { +// _, found := denomMap[fc.Denom] +// if found { +// feeCoinsZeroDenom = append(feeCoinsZeroDenom, fc) +// } else { +// feeCoinsNonZeroDenom = append(feeCoinsNonZeroDenom, fc) +// } +// } + +// return feeCoinsNonZeroDenom.Sort(), feeCoinsZeroDenom.Sort() +// } + +// // getNonZeroFees returns the given fees nonzero coins +// // and a map storing the zero coins's denoms +// func getNonZeroFees(fees sdk.Coins) (sdk.Coins, map[string]struct{}) { +// requiredFeesNonZero := sdk.Coins{} +// requiredFeesZeroDenom := map[string]struct{}{} + +// for _, gf := range fees { +// if gf.IsZero() { +// requiredFeesZeroDenom[gf.Denom] = struct{}{} +// } else { +// requiredFeesNonZero = append(requiredFeesNonZero, gf) +// } +// } + +// return requiredFeesNonZero.Sort(), requiredFeesZeroDenom +// } diff --git a/x/globalfee/ante/fee_utils_test.go b/x/globalfee/ante/fee_utils_test.go index 8378e46713..3b887003cb 100644 --- a/x/globalfee/ante/fee_utils_test.go +++ b/x/globalfee/ante/fee_utils_test.go @@ -1,298 +1,299 @@ package ante -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" -) - -func TestContainZeroCoins(t *testing.T) { - zeroCoin1 := sdk.NewCoin("photon", sdk.ZeroInt()) - zeroCoin2 := sdk.NewCoin("stake", sdk.ZeroInt()) - coin1 := sdk.NewCoin("photon", sdk.NewInt(1)) - coin2 := sdk.NewCoin("stake", sdk.NewInt(2)) - coin3 := sdk.NewCoin("quark", sdk.NewInt(3)) - // coins must be valid !!! - coinsEmpty := sdk.Coins{} - coinsNonEmpty := sdk.Coins{coin1, coin2} - coinsCointainZero := sdk.Coins{coin1, zeroCoin2} - coinsCointainTwoZero := sdk.Coins{zeroCoin1, zeroCoin2, coin3} - coinsAllZero := sdk.Coins{zeroCoin1, zeroCoin2} - - tests := []struct { - c sdk.Coins - ok bool - }{ - { - coinsEmpty, - true, - }, - { - coinsNonEmpty, - false, - }, - { - coinsCointainZero, - true, - }, - { - coinsCointainTwoZero, - true, - }, - { - coinsAllZero, - true, - }, - } - - for _, test := range tests { - ok := ContainZeroCoins(test.c) - require.Equal(t, test.ok, ok) - } -} - -// Note that in a real Gaia deployment all zero coins can be removed from minGasPrice. -// This sanitizing happens when the minGasPrice is set into the context. -// (see baseapp.SetMinGasPrices in gaia/cmd/root.go line 221) -func TestCombinedFeeRequirement(t *testing.T) { - zeroCoin1 := sdk.NewCoin("photon", sdk.ZeroInt()) - zeroCoin2 := sdk.NewCoin("stake", sdk.ZeroInt()) - zeroCoin3 := sdk.NewCoin("quark", sdk.ZeroInt()) - coin1 := sdk.NewCoin("photon", sdk.NewInt(1)) - coin2 := sdk.NewCoin("stake", sdk.NewInt(2)) - coin1High := sdk.NewCoin("photon", sdk.NewInt(10)) - coin2High := sdk.NewCoin("stake", sdk.NewInt(20)) - coinNewDenom1 := sdk.NewCoin("Newphoton", sdk.NewInt(1)) - coinNewDenom2 := sdk.NewCoin("Newstake", sdk.NewInt(1)) - // coins must be valid !!! and sorted!!! - coinsEmpty := sdk.Coins{} - coinsNonEmpty := sdk.Coins{coin1, coin2}.Sort() - coinsNonEmptyHigh := sdk.Coins{coin1High, coin2High}.Sort() - coinsNonEmptyOneHigh := sdk.Coins{coin1High, coin2}.Sort() - coinsNewDenom := sdk.Coins{coinNewDenom1, coinNewDenom2}.Sort() - coinsNewOldDenom := sdk.Coins{coin1, coinNewDenom1}.Sort() - coinsNewOldDenomHigh := sdk.Coins{coin1High, coinNewDenom1}.Sort() - coinsCointainZero := sdk.Coins{coin1, zeroCoin2}.Sort() - coinsCointainZeroNewDenom := sdk.Coins{coin1, zeroCoin3}.Sort() - coinsAllZero := sdk.Coins{zeroCoin1, zeroCoin2}.Sort() - tests := map[string]struct { - cGlobal sdk.Coins - c sdk.Coins - combined sdk.Coins - }{ - "global fee invalid, return combined fee empty and non-nil error": { - cGlobal: coinsEmpty, - c: coinsEmpty, - combined: coinsEmpty, - }, - "global fee nonempty, min fee empty, combined fee = global fee": { - cGlobal: coinsNonEmpty, - c: coinsNonEmpty, - combined: coinsNonEmpty, - }, - "global fee and min fee have overlapping denom, min fees amounts are all higher": { - cGlobal: coinsNonEmpty, - c: coinsNonEmptyHigh, - combined: coinsNonEmptyHigh, - }, - "global fee and min fee have overlapping denom, one of min fees amounts is higher": { - cGlobal: coinsNonEmpty, - c: coinsNonEmptyOneHigh, - combined: coinsNonEmptyOneHigh, - }, - "global fee and min fee have no overlapping denom, combined fee = global fee": { - cGlobal: coinsNonEmpty, - c: coinsNewDenom, - combined: coinsNonEmpty, - }, - "global fees and min fees have partial overlapping denom, min fee amount <= global fee amount, combined fees = global fees": { - cGlobal: coinsNonEmpty, - c: coinsNewOldDenom, - combined: coinsNonEmpty, - }, - "global fees and min fees have partial overlapping denom, one min fee amount > global fee amount, combined fee = overlapping highest": { - cGlobal: coinsNonEmpty, - c: coinsNewOldDenomHigh, - combined: sdk.Coins{coin1High, coin2}, - }, - "global fees have zero fees, min fees have overlapping non-zero fees, combined fees = overlapping highest": { - cGlobal: coinsCointainZero, - c: coinsNonEmpty, - combined: sdk.Coins{coin1, coin2}, - }, - "global fees have zero fees, min fees have overlapping zero fees": { - cGlobal: coinsCointainZero, - c: coinsCointainZero, - combined: coinsCointainZero, - }, - "global fees have zero fees, min fees have non-overlapping zero fees": { - cGlobal: coinsCointainZero, - c: coinsCointainZeroNewDenom, - combined: coinsCointainZero, - }, - "global fees are all zero fees, min fees have overlapping zero fees": { - cGlobal: coinsAllZero, - c: coinsAllZero, - combined: coinsAllZero, - }, - "global fees are all zero fees, min fees have overlapping non-zero fees, combined fee = overlapping highest": { - cGlobal: coinsAllZero, - c: coinsCointainZeroNewDenom, - combined: sdk.Coins{coin1, zeroCoin2}, - }, - "global fees are all zero fees, fees have one overlapping non-zero fee": { - cGlobal: coinsAllZero, - c: coinsCointainZero, - combined: coinsCointainZero, - }, - } - - for name, test := range tests { - t.Run(name, func(t *testing.T) { - allFees, err := CombinedFeeRequirement(test.cGlobal, test.c) - if len(test.cGlobal) == 0 { - require.Error(t, err) - } else { - require.NoError(t, err) - } - require.Equal(t, test.combined, allFees) - }) - } -} - -func TestSplitCoinsByDenoms(t *testing.T) { - zeroGlobalFeesDenom0 := map[string]struct{}{} - zeroGlobalFeesDenom1 := map[string]struct{}{ - "uatom": {}, - "photon": {}, - } - zeroGlobalFeesDenom2 := map[string]struct{}{ - "uatom": {}, - } - zeroGlobalFeesDenom3 := map[string]struct{}{ - "stake": {}, - } - - photon := sdk.NewCoin("photon", sdk.OneInt()) - uatom := sdk.NewCoin("uatom", sdk.OneInt()) - feeCoins := sdk.NewCoins(photon, uatom) - - tests := map[string]struct { - feeCoins sdk.Coins - zeroGlobalFeesDenom map[string]struct{} - expectedNonZeroCoins sdk.Coins - expectedZeroCoins sdk.Coins - }{ - "no zero coins in global fees": { - feeCoins: feeCoins, - zeroGlobalFeesDenom: zeroGlobalFeesDenom0, - expectedNonZeroCoins: feeCoins, - expectedZeroCoins: sdk.Coins{}, - }, - "no split of fee coins": { - feeCoins: feeCoins, - zeroGlobalFeesDenom: zeroGlobalFeesDenom3, - expectedNonZeroCoins: feeCoins, - expectedZeroCoins: sdk.Coins{}, - }, - "split the fee coins": { - feeCoins: feeCoins, - zeroGlobalFeesDenom: zeroGlobalFeesDenom2, - expectedNonZeroCoins: sdk.NewCoins(photon), - expectedZeroCoins: sdk.NewCoins(uatom), - }, - "remove all of the fee coins": { - feeCoins: feeCoins, - zeroGlobalFeesDenom: zeroGlobalFeesDenom1, - expectedNonZeroCoins: sdk.Coins{}, - expectedZeroCoins: feeCoins, - }, - "fee coins are empty": { - feeCoins: sdk.Coins{}, - zeroGlobalFeesDenom: zeroGlobalFeesDenom1, - expectedNonZeroCoins: sdk.Coins{}, - expectedZeroCoins: sdk.Coins{}, - }, - } - - for name, test := range tests { - t.Run(name, func(t *testing.T) { - feeCoinsNoZeroDenoms, feeCoinsZeroDenoms := splitCoinsByDenoms(test.feeCoins, test.zeroGlobalFeesDenom) - require.Equal(t, test.expectedNonZeroCoins, feeCoinsNoZeroDenoms) - require.Equal(t, test.expectedZeroCoins, feeCoinsZeroDenoms) - }) - } -} - -func TestSplitGlobalFees(t *testing.T) { - photon0 := sdk.NewCoin("photon", sdk.ZeroInt()) - uatom0 := sdk.NewCoin("uatom", sdk.ZeroInt()) - photon1 := sdk.NewCoin("photon", sdk.OneInt()) - uatom1 := sdk.NewCoin("uatom", sdk.OneInt()) - - globalFeesEmpty := sdk.Coins{} - globalFees := sdk.Coins{photon1, uatom1}.Sort() - globalFeesZeroCoins := sdk.Coins{photon0, uatom0}.Sort() - globalFeesMix := sdk.Coins{photon0, uatom1}.Sort() - - tests := map[string]struct { - globalfees sdk.Coins - zeroGlobalFeesDenom map[string]struct{} - globalfeesNonZero sdk.Coins - }{ - "empty global fees": { - globalfees: globalFeesEmpty, - zeroGlobalFeesDenom: map[string]struct{}{}, - globalfeesNonZero: sdk.Coins{}, - }, - "nonzero coins global fees": { - globalfees: globalFees, - zeroGlobalFeesDenom: map[string]struct{}{}, - globalfeesNonZero: globalFees, - }, - "zero coins global fees": { - globalfees: globalFeesZeroCoins, - zeroGlobalFeesDenom: map[string]struct{}{ - "photon": {}, - "uatom": {}, - }, - globalfeesNonZero: sdk.Coins{}, - }, - "mix zero, nonzero coins global fees": { - globalfees: globalFeesMix, - zeroGlobalFeesDenom: map[string]struct{}{ - "photon": {}, - }, - globalfeesNonZero: sdk.NewCoins(uatom1), - }, - } - - for name, test := range tests { - t.Run(name, func(t *testing.T) { - nonZeroCoins, zeroCoinsMap := getNonZeroFees(test.globalfees) - require.True(t, nonZeroCoins.IsEqual(test.globalfeesNonZero)) - require.True(t, equalMap(zeroCoinsMap, test.zeroGlobalFeesDenom)) - }) - } -} - -func equalMap(a, b map[string]struct{}) bool { - if len(a) != len(b) { - return false - } - if len(a) == 0 && len(b) == 0 { - return true - } - if len(a) == 0 { - return false - } - - for k := range a { - if _, ok := b[k]; !ok { - return false - } - } - - return true -} +// +// import ( +// "testing" +// +// sdk "github.com/cosmos/cosmos-sdk/types" +// "github.com/stretchr/testify/require" +//) +// +// func TestContainZeroCoins(t *testing.T) { +// zeroCoin1 := sdk.NewCoin("photon", sdk.ZeroInt()) +// zeroCoin2 := sdk.NewCoin("stake", sdk.ZeroInt()) +// coin1 := sdk.NewCoin("photon", sdk.NewInt(1)) +// coin2 := sdk.NewCoin("stake", sdk.NewInt(2)) +// coin3 := sdk.NewCoin("quark", sdk.NewInt(3)) +// // coins must be valid !!! +// coinsEmpty := sdk.Coins{} +// coinsNonEmpty := sdk.Coins{coin1, coin2} +// coinsCointainZero := sdk.Coins{coin1, zeroCoin2} +// coinsCointainTwoZero := sdk.Coins{zeroCoin1, zeroCoin2, coin3} +// coinsAllZero := sdk.Coins{zeroCoin1, zeroCoin2} +// +// tests := []struct { +// c sdk.Coins +// ok bool +// }{ +// { +// coinsEmpty, +// true, +// }, +// { +// coinsNonEmpty, +// false, +// }, +// { +// coinsCointainZero, +// true, +// }, +// { +// coinsCointainTwoZero, +// true, +// }, +// { +// coinsAllZero, +// true, +// }, +// } +// +// for _, test := range tests { +// ok := ContainZeroCoins(test.c) +// require.Equal(t, test.ok, ok) +// } +//} +// +//// Note that in a real Gaia deployment all zero coins can be removed from minGasPrice. +//// This sanitizing happens when the minGasPrice is set into the context. +//// (see baseapp.SetMinGasPrices in gaia/cmd/root.go line 221) +// func TestCombinedFeeRequirement(t *testing.T) { +// zeroCoin1 := sdk.NewCoin("photon", sdk.ZeroInt()) +// zeroCoin2 := sdk.NewCoin("stake", sdk.ZeroInt()) +// zeroCoin3 := sdk.NewCoin("quark", sdk.ZeroInt()) +// coin1 := sdk.NewCoin("photon", sdk.NewInt(1)) +// coin2 := sdk.NewCoin("stake", sdk.NewInt(2)) +// coin1High := sdk.NewCoin("photon", sdk.NewInt(10)) +// coin2High := sdk.NewCoin("stake", sdk.NewInt(20)) +// coinNewDenom1 := sdk.NewCoin("Newphoton", sdk.NewInt(1)) +// coinNewDenom2 := sdk.NewCoin("Newstake", sdk.NewInt(1)) +// // coins must be valid !!! and sorted!!! +// coinsEmpty := sdk.Coins{} +// coinsNonEmpty := sdk.Coins{coin1, coin2}.Sort() +// coinsNonEmptyHigh := sdk.Coins{coin1High, coin2High}.Sort() +// coinsNonEmptyOneHigh := sdk.Coins{coin1High, coin2}.Sort() +// coinsNewDenom := sdk.Coins{coinNewDenom1, coinNewDenom2}.Sort() +// coinsNewOldDenom := sdk.Coins{coin1, coinNewDenom1}.Sort() +// coinsNewOldDenomHigh := sdk.Coins{coin1High, coinNewDenom1}.Sort() +// coinsCointainZero := sdk.Coins{coin1, zeroCoin2}.Sort() +// coinsCointainZeroNewDenom := sdk.Coins{coin1, zeroCoin3}.Sort() +// coinsAllZero := sdk.Coins{zeroCoin1, zeroCoin2}.Sort() +// tests := map[string]struct { +// cGlobal sdk.Coins +// c sdk.Coins +// combined sdk.Coins +// }{ +// "global fee invalid, return combined fee empty and non-nil error": { +// cGlobal: coinsEmpty, +// c: coinsEmpty, +// combined: coinsEmpty, +// }, +// "global fee nonempty, min fee empty, combined fee = global fee": { +// cGlobal: coinsNonEmpty, +// c: coinsNonEmpty, +// combined: coinsNonEmpty, +// }, +// "global fee and min fee have overlapping denom, min fees amounts are all higher": { +// cGlobal: coinsNonEmpty, +// c: coinsNonEmptyHigh, +// combined: coinsNonEmptyHigh, +// }, +// "global fee and min fee have overlapping denom, one of min fees amounts is higher": { +// cGlobal: coinsNonEmpty, +// c: coinsNonEmptyOneHigh, +// combined: coinsNonEmptyOneHigh, +// }, +// "global fee and min fee have no overlapping denom, combined fee = global fee": { +// cGlobal: coinsNonEmpty, +// c: coinsNewDenom, +// combined: coinsNonEmpty, +// }, +// "global fees and min fees have partial overlapping denom, min fee amount <= global fee amount, combined fees = global fees": { +// cGlobal: coinsNonEmpty, +// c: coinsNewOldDenom, +// combined: coinsNonEmpty, +// }, +// "global fees and min fees have partial overlapping denom, one min fee amount > global fee amount, combined fee = overlapping highest": { +// cGlobal: coinsNonEmpty, +// c: coinsNewOldDenomHigh, +// combined: sdk.Coins{coin1High, coin2}, +// }, +// "global fees have zero fees, min fees have overlapping non-zero fees, combined fees = overlapping highest": { +// cGlobal: coinsCointainZero, +// c: coinsNonEmpty, +// combined: sdk.Coins{coin1, coin2}, +// }, +// "global fees have zero fees, min fees have overlapping zero fees": { +// cGlobal: coinsCointainZero, +// c: coinsCointainZero, +// combined: coinsCointainZero, +// }, +// "global fees have zero fees, min fees have non-overlapping zero fees": { +// cGlobal: coinsCointainZero, +// c: coinsCointainZeroNewDenom, +// combined: coinsCointainZero, +// }, +// "global fees are all zero fees, min fees have overlapping zero fees": { +// cGlobal: coinsAllZero, +// c: coinsAllZero, +// combined: coinsAllZero, +// }, +// "global fees are all zero fees, min fees have overlapping non-zero fees, combined fee = overlapping highest": { +// cGlobal: coinsAllZero, +// c: coinsCointainZeroNewDenom, +// combined: sdk.Coins{coin1, zeroCoin2}, +// }, +// "global fees are all zero fees, fees have one overlapping non-zero fee": { +// cGlobal: coinsAllZero, +// c: coinsCointainZero, +// combined: coinsCointainZero, +// }, +// } +// +// for name, test := range tests { +// t.Run(name, func(t *testing.T) { +// allFees, err := CombinedFeeRequirement(test.cGlobal, test.c) +// if len(test.cGlobal) == 0 { +// require.Error(t, err) +// } else { +// require.NoError(t, err) +// } +// require.Equal(t, test.combined, allFees) +// }) +// } +//} +// +// func TestSplitCoinsByDenoms(t *testing.T) { +// zeroGlobalFeesDenom0 := map[string]struct{}{} +// zeroGlobalFeesDenom1 := map[string]struct{}{ +// "uatom": {}, +// "photon": {}, +// } +// zeroGlobalFeesDenom2 := map[string]struct{}{ +// "uatom": {}, +// } +// zeroGlobalFeesDenom3 := map[string]struct{}{ +// "stake": {}, +// } +// +// photon := sdk.NewCoin("photon", sdk.OneInt()) +// uatom := sdk.NewCoin("uatom", sdk.OneInt()) +// feeCoins := sdk.NewCoins(photon, uatom) +// +// tests := map[string]struct { +// feeCoins sdk.Coins +// zeroGlobalFeesDenom map[string]struct{} +// expectedNonZeroCoins sdk.Coins +// expectedZeroCoins sdk.Coins +// }{ +// "no zero coins in global fees": { +// feeCoins: feeCoins, +// zeroGlobalFeesDenom: zeroGlobalFeesDenom0, +// expectedNonZeroCoins: feeCoins, +// expectedZeroCoins: sdk.Coins{}, +// }, +// "no split of fee coins": { +// feeCoins: feeCoins, +// zeroGlobalFeesDenom: zeroGlobalFeesDenom3, +// expectedNonZeroCoins: feeCoins, +// expectedZeroCoins: sdk.Coins{}, +// }, +// "split the fee coins": { +// feeCoins: feeCoins, +// zeroGlobalFeesDenom: zeroGlobalFeesDenom2, +// expectedNonZeroCoins: sdk.NewCoins(photon), +// expectedZeroCoins: sdk.NewCoins(uatom), +// }, +// "remove all of the fee coins": { +// feeCoins: feeCoins, +// zeroGlobalFeesDenom: zeroGlobalFeesDenom1, +// expectedNonZeroCoins: sdk.Coins{}, +// expectedZeroCoins: feeCoins, +// }, +// "fee coins are empty": { +// feeCoins: sdk.Coins{}, +// zeroGlobalFeesDenom: zeroGlobalFeesDenom1, +// expectedNonZeroCoins: sdk.Coins{}, +// expectedZeroCoins: sdk.Coins{}, +// }, +// } +// +// for name, test := range tests { +// t.Run(name, func(t *testing.T) { +// feeCoinsNoZeroDenoms, feeCoinsZeroDenoms := splitCoinsByDenoms(test.feeCoins, test.zeroGlobalFeesDenom) +// require.Equal(t, test.expectedNonZeroCoins, feeCoinsNoZeroDenoms) +// require.Equal(t, test.expectedZeroCoins, feeCoinsZeroDenoms) +// }) +// } +//} +// +// func TestSplitGlobalFees(t *testing.T) { +// photon0 := sdk.NewCoin("photon", sdk.ZeroInt()) +// uatom0 := sdk.NewCoin("uatom", sdk.ZeroInt()) +// photon1 := sdk.NewCoin("photon", sdk.OneInt()) +// uatom1 := sdk.NewCoin("uatom", sdk.OneInt()) +// +// globalFeesEmpty := sdk.Coins{} +// globalFees := sdk.Coins{photon1, uatom1}.Sort() +// globalFeesZeroCoins := sdk.Coins{photon0, uatom0}.Sort() +// globalFeesMix := sdk.Coins{photon0, uatom1}.Sort() +// +// tests := map[string]struct { +// globalfees sdk.Coins +// zeroGlobalFeesDenom map[string]struct{} +// globalfeesNonZero sdk.Coins +// }{ +// "empty global fees": { +// globalfees: globalFeesEmpty, +// zeroGlobalFeesDenom: map[string]struct{}{}, +// globalfeesNonZero: sdk.Coins{}, +// }, +// "nonzero coins global fees": { +// globalfees: globalFees, +// zeroGlobalFeesDenom: map[string]struct{}{}, +// globalfeesNonZero: globalFees, +// }, +// "zero coins global fees": { +// globalfees: globalFeesZeroCoins, +// zeroGlobalFeesDenom: map[string]struct{}{ +// "photon": {}, +// "uatom": {}, +// }, +// globalfeesNonZero: sdk.Coins{}, +// }, +// "mix zero, nonzero coins global fees": { +// globalfees: globalFeesMix, +// zeroGlobalFeesDenom: map[string]struct{}{ +// "photon": {}, +// }, +// globalfeesNonZero: sdk.NewCoins(uatom1), +// }, +// } +// +// for name, test := range tests { +// t.Run(name, func(t *testing.T) { +// nonZeroCoins, zeroCoinsMap := getNonZeroFees(test.globalfees) +// require.True(t, nonZeroCoins.IsEqual(test.globalfeesNonZero)) +// require.True(t, equalMap(zeroCoinsMap, test.zeroGlobalFeesDenom)) +// }) +// } +//} +// +// func equalMap(a, b map[string]struct{}) bool { +// if len(a) != len(b) { +// return false +// } +// if len(a) == 0 && len(b) == 0 { +// return true +// } +// if len(a) == 0 { +// return false +// } +// +// for k := range a { +// if _, ok := b[k]; !ok { +// return false +// } +// } +// +// return true +//} diff --git a/x/globalfee/client/cli/query.go b/x/globalfee/client/cli/query.go index b3b2056fc3..ebce304ad0 100644 --- a/x/globalfee/client/cli/query.go +++ b/x/globalfee/client/cli/query.go @@ -1,47 +1,47 @@ package cli -import ( - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" +// import ( +// "github.com/cosmos/cosmos-sdk/client" +// "github.com/cosmos/cosmos-sdk/client/flags" +// "github.com/spf13/cobra" - "github.com/cosmos/gaia/v11/x/globalfee/types" -) +// "github.com/cosmos/gaia/v11/x/globalfee/types" +// ) -func GetQueryCmd() *cobra.Command { - queryCmd := &cobra.Command{ - Use: types.ModuleName, - Short: "Querying commands for the global fee module", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - queryCmd.AddCommand( - GetCmdShowGlobalFeeParams(), - ) - return queryCmd -} +// func GetQueryCmd() *cobra.Command { +// queryCmd := &cobra.Command{ +// Use: types.ModuleName, +// Short: "Querying commands for the global fee module", +// DisableFlagParsing: true, +// SuggestionsMinimumDistance: 2, +// RunE: client.ValidateCmd, +// } +// queryCmd.AddCommand( +// GetCmdShowGlobalFeeParams(), +// ) +// return queryCmd +// } -func GetCmdShowGlobalFeeParams() *cobra.Command { - cmd := &cobra.Command{ - Use: "params", - Short: "Show globalfee params", - Long: "Show globalfee requirement: minimum_gas_prices, bypass_min_fee_msg_types, max_total_bypass_minFee_msg_gas_usage", - Args: cobra.ExactArgs(0), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } +// func GetCmdShowGlobalFeeParams() *cobra.Command { +// cmd := &cobra.Command{ +// Use: "params", +// Short: "Show globalfee params", +// Long: "Show globalfee requirement: minimum_gas_prices, bypass_min_fee_msg_types, max_total_bypass_minFee_msg_gas_usage", +// Args: cobra.ExactArgs(0), +// RunE: func(cmd *cobra.Command, args []string) error { +// clientCtx, err := client.GetClientQueryContext(cmd) +// if err != nil { +// return err +// } - queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{}) - if err != nil { - return err - } - return clientCtx.PrintProto(&res.Params) - }, - } - flags.AddQueryFlagsToCmd(cmd) - return cmd -} +// queryClient := types.NewQueryClient(clientCtx) +// res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{}) +// if err != nil { +// return err +// } +// return clientCtx.PrintProto(&res.Params) +// }, +// } +// flags.AddQueryFlagsToCmd(cmd) +// return cmd +// } diff --git a/x/globalfee/genesis_test.go b/x/globalfee/genesis_test.go index 30b84962f1..e073054020 100644 --- a/x/globalfee/genesis_test.go +++ b/x/globalfee/genesis_test.go @@ -1,161 +1,161 @@ package globalfee -import ( - "testing" - "time" +// import ( +// "testing" +// "time" - "github.com/cosmos/cosmos-sdk/simapp" - simappparams "github.com/cosmos/cosmos-sdk/simapp/params" - "github.com/cosmos/cosmos-sdk/store" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/libs/log" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - dbm "github.com/tendermint/tm-db" +// "github.com/cosmos/cosmos-sdk/simapp" +// simappparams "github.com/cosmos/cosmos-sdk/simapp/params" +// "github.com/cosmos/cosmos-sdk/store" +// storetypes "github.com/cosmos/cosmos-sdk/store/types" +// sdk "github.com/cosmos/cosmos-sdk/types" +// paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" +// paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" +// "github.com/stretchr/testify/assert" +// "github.com/stretchr/testify/require" +// "github.com/tendermint/tendermint/libs/log" +// tmproto "github.com/tendermint/tendermint/proto/tendermint/types" +// dbm "github.com/tendermint/tm-db" - "github.com/cosmos/gaia/v11/x/globalfee/types" -) +// "github.com/cosmos/gaia/v11/x/globalfee/types" +// ) -func TestDefaultGenesis(t *testing.T) { - encCfg := simapp.MakeTestEncodingConfig() - gotJSON := AppModuleBasic{}.DefaultGenesis(encCfg.Marshaler) - assert.JSONEq(t, - `{"params":{"minimum_gas_prices":[],"bypass_min_fee_msg_types":["/ibc.core.channel.v1.MsgRecvPacket","/ibc.core.channel.v1.MsgAcknowledgement","/ibc.core.client.v1.MsgUpdateClient","/ibc.core.channel.v1.MsgTimeout","/ibc.core.channel.v1.MsgTimeoutOnClose"], "max_total_bypass_min_fee_msg_gas_usage":"1000000"}}`, - string(gotJSON), string(gotJSON)) -} +// func TestDefaultGenesis(t *testing.T) { +// encCfg := simapp.MakeTestEncodingConfig() +// gotJSON := AppModuleBasic{}.DefaultGenesis(encCfg.Marshaler) +// assert.JSONEq(t, +// `{"params":{"minimum_gas_prices":[],"bypass_min_fee_msg_types":["/ibc.core.channel.v1.MsgRecvPacket","/ibc.core.channel.v1.MsgAcknowledgement","/ibc.core.client.v1.MsgUpdateClient","/ibc.core.channel.v1.MsgTimeout","/ibc.core.channel.v1.MsgTimeoutOnClose"], "max_total_bypass_min_fee_msg_gas_usage":"1000000"}}`, +// string(gotJSON), string(gotJSON)) +// } -func TestValidateGenesis(t *testing.T) { - encCfg := simapp.MakeTestEncodingConfig() - specs := map[string]struct { - src string - expErr bool - }{ - "all good": { - src: `{"params":{"minimum_gas_prices":[{"denom":"ALX", "amount":"1"}], "bypass_min_fee_msg_types":["/ibc.core.channel.v1.MsgRecvPacket"]}}`, - expErr: false, - }, - "empty minimum": { - src: `{"params":{"minimum_gas_prices":[], "bypass_min_fee_msg_types":[]}}`, - expErr: false, - }, - "minimum and bypass not set": { - src: `{"params":{}}`, - expErr: false, - }, - "minimum not set": { - src: `{"params":{"bypass_min_fee_msg_types":[]}}`, - expErr: false, - }, - "bypass not set": { - src: `{"params":{"minimum_gas_prices":[]}}`, - expErr: false, - }, - "zero amount allowed": { - src: `{"params":{"minimum_gas_prices":[{"denom":"ALX", "amount":"0"}]}}`, - expErr: false, - }, - "duplicate denoms not allowed": { - src: `{"params":{"minimum_gas_prices":[{"denom":"ALX", "amount":"1"},{"denom":"ALX", "amount":"2"}]}}`, - expErr: true, - }, - "negative amounts not allowed": { - src: `{"params":{"minimum_gas_prices":[{"denom":"ALX", "amount":"-1"}]}}`, - expErr: true, - }, - "denom must be sorted": { - src: `{"params":{"minimum_gas_prices":[{"denom":"ZLX", "amount":"1"},{"denom":"ALX", "amount":"2"}]}}`, - expErr: true, - }, - "empty bypass msg types not allowed": { - src: `{"params":{"bypass_min_fee_msg_types":[""]}}`, - expErr: true, - }, - "sorted denoms is allowed": { - src: `{"params":{"minimum_gas_prices":[{"denom":"ALX", "amount":"1"},{"denom":"ZLX", "amount":"2"}]}}`, - expErr: false, - }, - } - for name, spec := range specs { - t.Run(name, func(t *testing.T) { - gotErr := AppModuleBasic{}.ValidateGenesis(encCfg.Marshaler, nil, []byte(spec.src)) - if spec.expErr { - require.Error(t, gotErr) - return - } - require.NoError(t, gotErr) - }) - } -} +// func TestValidateGenesis(t *testing.T) { +// encCfg := simapp.MakeTestEncodingConfig() +// specs := map[string]struct { +// src string +// expErr bool +// }{ +// "all good": { +// src: `{"params":{"minimum_gas_prices":[{"denom":"ALX", "amount":"1"}], "bypass_min_fee_msg_types":["/ibc.core.channel.v1.MsgRecvPacket"]}}`, +// expErr: false, +// }, +// "empty minimum": { +// src: `{"params":{"minimum_gas_prices":[], "bypass_min_fee_msg_types":[]}}`, +// expErr: false, +// }, +// "minimum and bypass not set": { +// src: `{"params":{}}`, +// expErr: false, +// }, +// "minimum not set": { +// src: `{"params":{"bypass_min_fee_msg_types":[]}}`, +// expErr: false, +// }, +// "bypass not set": { +// src: `{"params":{"minimum_gas_prices":[]}}`, +// expErr: false, +// }, +// "zero amount allowed": { +// src: `{"params":{"minimum_gas_prices":[{"denom":"ALX", "amount":"0"}]}}`, +// expErr: false, +// }, +// "duplicate denoms not allowed": { +// src: `{"params":{"minimum_gas_prices":[{"denom":"ALX", "amount":"1"},{"denom":"ALX", "amount":"2"}]}}`, +// expErr: true, +// }, +// "negative amounts not allowed": { +// src: `{"params":{"minimum_gas_prices":[{"denom":"ALX", "amount":"-1"}]}}`, +// expErr: true, +// }, +// "denom must be sorted": { +// src: `{"params":{"minimum_gas_prices":[{"denom":"ZLX", "amount":"1"},{"denom":"ALX", "amount":"2"}]}}`, +// expErr: true, +// }, +// "empty bypass msg types not allowed": { +// src: `{"params":{"bypass_min_fee_msg_types":[""]}}`, +// expErr: true, +// }, +// "sorted denoms is allowed": { +// src: `{"params":{"minimum_gas_prices":[{"denom":"ALX", "amount":"1"},{"denom":"ZLX", "amount":"2"}]}}`, +// expErr: false, +// }, +// } +// for name, spec := range specs { +// t.Run(name, func(t *testing.T) { +// gotErr := AppModuleBasic{}.ValidateGenesis(encCfg.Marshaler, nil, []byte(spec.src)) +// if spec.expErr { +// require.Error(t, gotErr) +// return +// } +// require.NoError(t, gotErr) +// }) +// } +// } -func TestInitExportGenesis(t *testing.T) { - specs := map[string]struct { - src string - exp types.GenesisState - }{ - "single fee": { - src: `{"params":{"minimum_gas_prices":[{"denom":"ALX", "amount":"1"}], "bypass_min_fee_msg_types":["/ibc.core.channel.v1.MsgRecvPacket"]}}`, - exp: types.GenesisState{ - Params: types.Params{ - MinimumGasPrices: sdk.NewDecCoins(sdk.NewDecCoin("ALX", sdk.NewInt(1))), - BypassMinFeeMsgTypes: []string{"/ibc.core.channel.v1.MsgRecvPacket"}, - }, - }, - }, - "multiple fee options": { - src: `{"params":{"minimum_gas_prices":[{"denom":"ALX", "amount":"1"}, {"denom":"BLX", "amount":"0.001"}], "bypass_min_fee_msg_types":["/ibc.core.channel.v1.MsgRecvPacket","/ibc.core.channel.v1.MsgTimeoutOnClose"]}}`, - exp: types.GenesisState{ - Params: types.Params{ - MinimumGasPrices: sdk.NewDecCoins(sdk.NewDecCoin("ALX", sdk.NewInt(1)), - sdk.NewDecCoinFromDec("BLX", sdk.NewDecWithPrec(1, 3))), - BypassMinFeeMsgTypes: []string{"/ibc.core.channel.v1.MsgRecvPacket", "/ibc.core.channel.v1.MsgTimeoutOnClose"}, - }, - }, - }, - "no fee set": { - src: `{"params":{}}`, - exp: types.GenesisState{ - Params: types.Params{ - MinimumGasPrices: sdk.DecCoins{}, - BypassMinFeeMsgTypes: []string{}, - }, - }, - }, - } - for name, spec := range specs { - t.Run(name, func(t *testing.T) { - ctx, encCfg, subspace := setupTestStore(t) - m := NewAppModule(subspace) - m.InitGenesis(ctx, encCfg.Marshaler, []byte(spec.src)) - gotJSON := m.ExportGenesis(ctx, encCfg.Marshaler) - var got types.GenesisState - require.NoError(t, encCfg.Marshaler.UnmarshalJSON(gotJSON, &got)) - assert.Equal(t, spec.exp, got, string(gotJSON)) - }) - } -} +// func TestInitExportGenesis(t *testing.T) { +// specs := map[string]struct { +// src string +// exp types.GenesisState +// }{ +// "single fee": { +// src: `{"params":{"minimum_gas_prices":[{"denom":"ALX", "amount":"1"}], "bypass_min_fee_msg_types":["/ibc.core.channel.v1.MsgRecvPacket"]}}`, +// exp: types.GenesisState{ +// Params: types.Params{ +// MinimumGasPrices: sdk.NewDecCoins(sdk.NewDecCoin("ALX", sdk.NewInt(1))), +// BypassMinFeeMsgTypes: []string{"/ibc.core.channel.v1.MsgRecvPacket"}, +// }, +// }, +// }, +// "multiple fee options": { +// src: `{"params":{"minimum_gas_prices":[{"denom":"ALX", "amount":"1"}, {"denom":"BLX", "amount":"0.001"}], "bypass_min_fee_msg_types":["/ibc.core.channel.v1.MsgRecvPacket","/ibc.core.channel.v1.MsgTimeoutOnClose"]}}`, +// exp: types.GenesisState{ +// Params: types.Params{ +// MinimumGasPrices: sdk.NewDecCoins(sdk.NewDecCoin("ALX", sdk.NewInt(1)), +// sdk.NewDecCoinFromDec("BLX", sdk.NewDecWithPrec(1, 3))), +// BypassMinFeeMsgTypes: []string{"/ibc.core.channel.v1.MsgRecvPacket", "/ibc.core.channel.v1.MsgTimeoutOnClose"}, +// }, +// }, +// }, +// "no fee set": { +// src: `{"params":{}}`, +// exp: types.GenesisState{ +// Params: types.Params{ +// MinimumGasPrices: sdk.DecCoins{}, +// BypassMinFeeMsgTypes: []string{}, +// }, +// }, +// }, +// } +// for name, spec := range specs { +// t.Run(name, func(t *testing.T) { +// ctx, encCfg, subspace := setupTestStore(t) +// m := NewAppModule(subspace) +// m.InitGenesis(ctx, encCfg.Marshaler, []byte(spec.src)) +// gotJSON := m.ExportGenesis(ctx, encCfg.Marshaler) +// var got types.GenesisState +// require.NoError(t, encCfg.Marshaler.UnmarshalJSON(gotJSON, &got)) +// assert.Equal(t, spec.exp, got, string(gotJSON)) +// }) +// } +// } -func setupTestStore(t *testing.T) (sdk.Context, simappparams.EncodingConfig, paramstypes.Subspace) { - t.Helper() - db := dbm.NewMemDB() - ms := store.NewCommitMultiStore(db) - encCfg := simapp.MakeTestEncodingConfig() - keyParams := sdk.NewKVStoreKey(paramstypes.StoreKey) - tkeyParams := sdk.NewTransientStoreKey(paramstypes.TStoreKey) - ms.MountStoreWithDB(keyParams, storetypes.StoreTypeIAVL, db) - ms.MountStoreWithDB(tkeyParams, storetypes.StoreTypeTransient, db) - require.NoError(t, ms.LoadLatestVersion()) +// func setupTestStore(t *testing.T) (sdk.Context, simappparams.EncodingConfig, paramstypes.Subspace) { +// t.Helper() +// db := dbm.NewMemDB() +// ms := store.NewCommitMultiStore(db) +// encCfg := simapp.MakeTestEncodingConfig() +// keyParams := sdk.NewKVStoreKey(paramstypes.StoreKey) +// tkeyParams := sdk.NewTransientStoreKey(paramstypes.TStoreKey) +// ms.MountStoreWithDB(keyParams, storetypes.StoreTypeIAVL, db) +// ms.MountStoreWithDB(tkeyParams, storetypes.StoreTypeTransient, db) +// require.NoError(t, ms.LoadLatestVersion()) - paramsKeeper := paramskeeper.NewKeeper(encCfg.Marshaler, encCfg.Amino, keyParams, tkeyParams) +// paramsKeeper := paramskeeper.NewKeeper(encCfg.Marshaler, encCfg.Amino, keyParams, tkeyParams) - ctx := sdk.NewContext(ms, tmproto.Header{ - Height: 1234567, - Time: time.Date(2020, time.April, 22, 12, 0, 0, 0, time.UTC), - }, false, log.NewNopLogger()) +// ctx := sdk.NewContext(ms, tmproto.Header{ +// Height: 1234567, +// Time: time.Date(2020, time.April, 22, 12, 0, 0, 0, time.UTC), +// }, false, log.NewNopLogger()) - subspace := paramsKeeper.Subspace(ModuleName).WithKeyTable(types.ParamKeyTable()) - return ctx, encCfg, subspace -} +// subspace := paramsKeeper.Subspace(ModuleName).WithKeyTable(types.ParamKeyTable()) +// return ctx, encCfg, subspace +// } diff --git a/x/globalfee/keeper/migrations.go b/x/globalfee/keeper/migrations.go index 64f08edd3b..3f2e40e12d 100644 --- a/x/globalfee/keeper/migrations.go +++ b/x/globalfee/keeper/migrations.go @@ -1,23 +1,23 @@ package keeper -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" +// import ( +// sdk "github.com/cosmos/cosmos-sdk/types" +// paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - v2 "github.com/cosmos/gaia/v11/x/globalfee/migrations/v2" -) +// v2 "github.com/cosmos/gaia/v11/x/globalfee/migrations/v2" +// ) -// Migrator is a struct for handling in-place store migrations. -type Migrator struct { - globalfeeSubspace paramtypes.Subspace -} +// // Migrator is a struct for handling in-place store migrations. +// type Migrator struct { +// globalfeeSubspace paramtypes.Subspace +// } -// NewMigrator returns a new Migrator. -func NewMigrator(globalfeeSubspace paramtypes.Subspace) Migrator { - return Migrator{globalfeeSubspace: globalfeeSubspace} -} +// // NewMigrator returns a new Migrator. +// func NewMigrator(globalfeeSubspace paramtypes.Subspace) Migrator { +// return Migrator{globalfeeSubspace: globalfeeSubspace} +// } -// Migrate1to2 migrates from version 1 to 2. -func (m Migrator) Migrate1to2(ctx sdk.Context) error { - return v2.MigrateStore(ctx, m.globalfeeSubspace) -} +// // Migrate1to2 migrates from version 1 to 2. +// func (m Migrator) Migrate1to2(ctx sdk.Context) error { +// return v2.MigrateStore(ctx, m.globalfeeSubspace) +// } diff --git a/x/globalfee/migrations/v2/migration.go b/x/globalfee/migrations/v2/migration.go index a6e3ea0b47..a49cbe5b63 100644 --- a/x/globalfee/migrations/v2/migration.go +++ b/x/globalfee/migrations/v2/migration.go @@ -1,11 +1,5 @@ package v2 -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/cosmos/gaia/v11/x/globalfee/types" -) - // MigrateStore performs in-place params migrations of // BypassMinFeeMsgTypes and MaxTotalBypassMinFeeMsgGasUsage // from app.toml to globalfee params. @@ -17,21 +11,21 @@ import ( // "/ibc.core.channel.v1.MsgTimeout", // "/ibc.core.channel.v1.MsgTimeoutOnClose"] as default and // add MaxTotalBypassMinFeeMsgGasUsage that is set 1_000_000 as default. -func MigrateStore(ctx sdk.Context, globalfeeSubspace paramtypes.Subspace) error { - var oldGlobalMinGasPrices sdk.DecCoins - globalfeeSubspace.Get(ctx, types.ParamStoreKeyMinGasPrices, &oldGlobalMinGasPrices) - defaultParams := types.DefaultParams() - params := types.Params{ - MinimumGasPrices: oldGlobalMinGasPrices, - BypassMinFeeMsgTypes: defaultParams.BypassMinFeeMsgTypes, - MaxTotalBypassMinFeeMsgGasUsage: defaultParams.MaxTotalBypassMinFeeMsgGasUsage, - } +// func MigrateStore(ctx sdk.Context, globalfeeSubspace paramtypes.Subspace) error { +// var oldGlobalMinGasPrices sdk.DecCoins +// globalfeeSubspace.Get(ctx, types.ParamStoreKeyMinGasPrices, &oldGlobalMinGasPrices) +// defaultParams := types.DefaultParams() +// params := types.Params{ +// MinimumGasPrices: oldGlobalMinGasPrices, +// BypassMinFeeMsgTypes: defaultParams.BypassMinFeeMsgTypes, +// MaxTotalBypassMinFeeMsgGasUsage: defaultParams.MaxTotalBypassMinFeeMsgGasUsage, +// } - if !globalfeeSubspace.HasKeyTable() { - globalfeeSubspace = globalfeeSubspace.WithKeyTable(types.ParamKeyTable()) - } +// if !globalfeeSubspace.HasKeyTable() { +// globalfeeSubspace = globalfeeSubspace.WithKeyTable(types.ParamKeyTable()) +// } - globalfeeSubspace.SetParamSet(ctx, ¶ms) +// globalfeeSubspace.SetParamSet(ctx, ¶ms) - return nil -} +// return nil +// } diff --git a/x/globalfee/migrations/v2/v2_test/migration_test.go b/x/globalfee/migrations/v2/v2_test/migration_test.go index 632e578980..b8f257906c 100644 --- a/x/globalfee/migrations/v2/v2_test/migration_test.go +++ b/x/globalfee/migrations/v2/v2_test/migration_test.go @@ -1,107 +1,107 @@ package v2_test -import ( - "testing" - - "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" - v2 "github.com/cosmos/gaia/v11/x/globalfee/migrations/v2" - globalfeetypes "github.com/cosmos/gaia/v11/x/globalfee/types" - "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/libs/log" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - tmdb "github.com/tendermint/tm-db" -) - -func TestMigrateStore(t *testing.T) { - db := tmdb.NewMemDB() - stateStore := store.NewCommitMultiStore(db) - - storeKey := sdk.NewKVStoreKey(paramtypes.StoreKey) - memStoreKey := storetypes.NewMemoryStoreKey("mem_key") - - stateStore.MountStoreWithDB(storeKey, sdk.StoreTypeIAVL, db) - stateStore.MountStoreWithDB(memStoreKey, sdk.StoreTypeMemory, nil) - require.NoError(t, stateStore.LoadLatestVersion()) - - registry := codectypes.NewInterfaceRegistry() - cdc := codec.NewProtoCodec(registry) - ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) - - require.NoError(t, stateStore.LoadLatestVersion()) - - // Create new empty subspace - newSubspace := paramtypes.NewSubspace(cdc, - codec.NewLegacyAmino(), - storeKey, - memStoreKey, - paramtypes.ModuleName, - ) - - // register the subspace with the v11 paramKeyTable - newSubspace = newSubspace.WithKeyTable(globalfeetypes.ParamKeyTable()) - - // check MinGasPrices isn't set - _, ok := getMinGasPrice(newSubspace, ctx) - require.Equal(t, ok, false) - - // set a minGasPrice different that default value - minGasPrices := sdk.NewDecCoins(sdk.NewDecCoin("uatom", sdk.OneInt())) - newSubspace.Set(ctx, globalfeetypes.ParamStoreKeyMinGasPrices, minGasPrices) - require.False(t, minGasPrices.IsEqual(globalfeetypes.DefaultMinGasPrices)) - - // check that the new parameters aren't set - _, ok = getBypassMsgTypes(newSubspace, ctx) - require.Equal(t, ok, false) - _, ok = getMaxTotalBypassMinFeeMsgGasUsage(newSubspace, ctx) - require.Equal(t, ok, false) - - // run global fee migration - err := v2.MigrateStore(ctx, newSubspace) - require.NoError(t, err) - - newMinGasPrices, _ := getMinGasPrice(newSubspace, ctx) - bypassMsgTypes, _ := getBypassMsgTypes(newSubspace, ctx) - maxGas, _ := getMaxTotalBypassMinFeeMsgGasUsage(newSubspace, ctx) - - require.Equal(t, bypassMsgTypes, globalfeetypes.DefaultBypassMinFeeMsgTypes) - require.Equal(t, maxGas, globalfeetypes.DefaultmaxTotalBypassMinFeeMsgGasUsage) - require.Equal(t, minGasPrices, newMinGasPrices) -} - -func getBypassMsgTypes(globalfeeSubspace paramtypes.Subspace, ctx sdk.Context) ([]string, bool) { - bypassMsgs := []string{} - if globalfeeSubspace.Has(ctx, globalfeetypes.ParamStoreKeyBypassMinFeeMsgTypes) { - globalfeeSubspace.Get(ctx, globalfeetypes.ParamStoreKeyBypassMinFeeMsgTypes, &bypassMsgs) - } else { - return bypassMsgs, false - } - - return bypassMsgs, true -} - -func getMaxTotalBypassMinFeeMsgGasUsage(globalfeeSubspace paramtypes.Subspace, ctx sdk.Context) (uint64, bool) { - var maxTotalBypassMinFeeMsgGasUsage uint64 - if globalfeeSubspace.Has(ctx, globalfeetypes.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage) { - globalfeeSubspace.Get(ctx, globalfeetypes.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage, &maxTotalBypassMinFeeMsgGasUsage) - } else { - return maxTotalBypassMinFeeMsgGasUsage, false - } - - return maxTotalBypassMinFeeMsgGasUsage, true -} - -func getMinGasPrice(globalfeeSubspace paramtypes.Subspace, ctx sdk.Context) (sdk.DecCoins, bool) { - var globalMinGasPrices sdk.DecCoins - if globalfeeSubspace.Has(ctx, globalfeetypes.ParamStoreKeyMinGasPrices) { - globalfeeSubspace.Get(ctx, globalfeetypes.ParamStoreKeyMinGasPrices, &globalMinGasPrices) - } else { - return globalMinGasPrices, false - } - - return globalMinGasPrices, true -} +// import ( +// "testing" + +// "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" +// v2 "github.com/cosmos/gaia/v11/x/globalfee/migrations/v2" +// globalfeetypes "github.com/cosmos/gaia/v11/x/globalfee/types" +// "github.com/stretchr/testify/require" +// "github.com/tendermint/tendermint/libs/log" +// tmproto "github.com/tendermint/tendermint/proto/tendermint/types" +// tmdb "github.com/tendermint/tm-db" +// ) + +// func TestMigrateStore(t *testing.T) { +// db := tmdb.NewMemDB() +// stateStore := store.NewCommitMultiStore(db) + +// storeKey := sdk.NewKVStoreKey(paramtypes.StoreKey) +// memStoreKey := storetypes.NewMemoryStoreKey("mem_key") + +// stateStore.MountStoreWithDB(storeKey, sdk.StoreTypeIAVL, db) +// stateStore.MountStoreWithDB(memStoreKey, sdk.StoreTypeMemory, nil) +// require.NoError(t, stateStore.LoadLatestVersion()) + +// registry := codectypes.NewInterfaceRegistry() +// cdc := codec.NewProtoCodec(registry) +// ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) + +// require.NoError(t, stateStore.LoadLatestVersion()) + +// // Create new empty subspace +// newSubspace := paramtypes.NewSubspace(cdc, +// codec.NewLegacyAmino(), +// storeKey, +// memStoreKey, +// paramtypes.ModuleName, +// ) + +// // register the subspace with the v11 paramKeyTable +// newSubspace = newSubspace.WithKeyTable(globalfeetypes.ParamKeyTable()) + +// // check MinGasPrices isn't set +// _, ok := getMinGasPrice(newSubspace, ctx) +// require.Equal(t, ok, false) + +// // set a minGasPrice different that default value +// minGasPrices := sdk.NewDecCoins(sdk.NewDecCoin("uatom", sdk.OneInt())) +// newSubspace.Set(ctx, globalfeetypes.ParamStoreKeyMinGasPrices, minGasPrices) +// require.False(t, minGasPrices.IsEqual(globalfeetypes.DefaultMinGasPrices)) + +// // check that the new parameters aren't set +// _, ok = getBypassMsgTypes(newSubspace, ctx) +// require.Equal(t, ok, false) +// _, ok = getMaxTotalBypassMinFeeMsgGasUsage(newSubspace, ctx) +// require.Equal(t, ok, false) + +// // run global fee migration +// err := v2.MigrateStore(ctx, newSubspace) +// require.NoError(t, err) + +// newMinGasPrices, _ := getMinGasPrice(newSubspace, ctx) +// bypassMsgTypes, _ := getBypassMsgTypes(newSubspace, ctx) +// maxGas, _ := getMaxTotalBypassMinFeeMsgGasUsage(newSubspace, ctx) + +// require.Equal(t, bypassMsgTypes, globalfeetypes.DefaultBypassMinFeeMsgTypes) +// require.Equal(t, maxGas, globalfeetypes.DefaultmaxTotalBypassMinFeeMsgGasUsage) +// require.Equal(t, minGasPrices, newMinGasPrices) +// } + +// func getBypassMsgTypes(globalfeeSubspace paramtypes.Subspace, ctx sdk.Context) ([]string, bool) { +// bypassMsgs := []string{} +// if globalfeeSubspace.Has(ctx, globalfeetypes.ParamStoreKeyBypassMinFeeMsgTypes) { +// globalfeeSubspace.Get(ctx, globalfeetypes.ParamStoreKeyBypassMinFeeMsgTypes, &bypassMsgs) +// } else { +// return bypassMsgs, false +// } + +// return bypassMsgs, true +// } + +// func getMaxTotalBypassMinFeeMsgGasUsage(globalfeeSubspace paramtypes.Subspace, ctx sdk.Context) (uint64, bool) { +// var maxTotalBypassMinFeeMsgGasUsage uint64 +// if globalfeeSubspace.Has(ctx, globalfeetypes.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage) { +// globalfeeSubspace.Get(ctx, globalfeetypes.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage, &maxTotalBypassMinFeeMsgGasUsage) +// } else { +// return maxTotalBypassMinFeeMsgGasUsage, false +// } + +// return maxTotalBypassMinFeeMsgGasUsage, true +// } + +// func getMinGasPrice(globalfeeSubspace paramtypes.Subspace, ctx sdk.Context) (sdk.DecCoins, bool) { +// var globalMinGasPrices sdk.DecCoins +// if globalfeeSubspace.Has(ctx, globalfeetypes.ParamStoreKeyMinGasPrices) { +// globalfeeSubspace.Get(ctx, globalfeetypes.ParamStoreKeyMinGasPrices, &globalMinGasPrices) +// } else { +// return globalMinGasPrices, false +// } + +// return globalMinGasPrices, true +// } diff --git a/x/globalfee/module.go b/x/globalfee/module.go index c49ed71133..e1e367455f 100644 --- a/x/globalfee/module.go +++ b/x/globalfee/module.go @@ -1,146 +1,146 @@ package globalfee -import ( - "context" - "encoding/json" - "fmt" - - errorsmod "cosmossdk.io/errors" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/gorilla/mux" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - abci "github.com/tendermint/tendermint/abci/types" - - "github.com/cosmos/gaia/v11/x/globalfee/client/cli" - "github.com/cosmos/gaia/v11/x/globalfee/keeper" - "github.com/cosmos/gaia/v11/x/globalfee/types" -) - -var ( - _ module.AppModuleBasic = AppModuleBasic{} - _ module.AppModuleGenesis = AppModule{} - _ module.AppModule = AppModule{} -) - -// AppModuleBasic defines the basic application module used by the wasm module. -type AppModuleBasic struct{} - -func (a AppModuleBasic) Name() string { - return types.ModuleName -} - -func (a AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { - return cdc.MustMarshalJSON(&types.GenesisState{ - Params: types.DefaultParams(), - }) -} - -func (a AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, _ client.TxEncodingConfig, message json.RawMessage) error { - var data types.GenesisState - err := marshaler.UnmarshalJSON(message, &data) - if err != nil { - return err - } - if err := data.Params.ValidateBasic(); err != nil { - return errorsmod.Wrap(err, "params") - } - return nil -} - -func (a AppModuleBasic) RegisterInterfaces(_ codectypes.InterfaceRegistry) { -} - -func (a AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) { -} - -func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) - if err != nil { - // same behavior as in cosmos-sdk - panic(err) - } -} - -func (a AppModuleBasic) GetTxCmd() *cobra.Command { - return nil -} - -func (a AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd() -} - -func (a AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino) { -} - -type AppModule struct { - AppModuleBasic - paramSpace paramstypes.Subspace -} - -// NewAppModule constructor -func NewAppModule(paramSpace paramstypes.Subspace) *AppModule { - if !paramSpace.HasKeyTable() { - paramSpace = paramSpace.WithKeyTable(types.ParamKeyTable()) - } - - return &AppModule{paramSpace: paramSpace} -} - -func (a AppModule) InitGenesis(ctx sdk.Context, marshaler codec.JSONCodec, message json.RawMessage) []abci.ValidatorUpdate { - var genesisState types.GenesisState - marshaler.MustUnmarshalJSON(message, &genesisState) - - a.paramSpace.SetParamSet(ctx, &genesisState.Params) - return nil -} - -func (a AppModule) ExportGenesis(ctx sdk.Context, marshaler codec.JSONCodec) json.RawMessage { - var genState types.GenesisState - a.paramSpace.GetParamSet(ctx, &genState.Params) - return marshaler.MustMarshalJSON(&genState) -} - -func (a AppModule) RegisterInvariants(_ sdk.InvariantRegistry) { -} - -func (a AppModule) Route() sdk.Route { - return sdk.Route{} -} - -func (a AppModule) QuerierRoute() string { - return types.QuerierRoute -} - -func (a AppModule) LegacyQuerierHandler(_ *codec.LegacyAmino) sdk.Querier { - return nil -} - -func (a AppModule) RegisterServices(cfg module.Configurator) { - types.RegisterQueryServer(cfg.QueryServer(), NewGrpcQuerier(a.paramSpace)) - - m := keeper.NewMigrator(a.paramSpace) - if err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2); err != nil { - panic(fmt.Sprintf("failed to migrate x/globalfee from version 1 to 2: %v", err)) - } -} - -func (a AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) { -} - -func (a AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - return nil -} - -// ConsensusVersion is a sequence number for state-breaking change of the -// module. It should be incremented on each consensus-breaking change -// introduced by the module. To avoid wrong/empty versions, the initial version -// should be set to 1. -func (a AppModule) ConsensusVersion() uint64 { - return 2 -} +// import ( +// "context" +// "encoding/json" +// "fmt" + +// errorsmod "cosmossdk.io/errors" +// "github.com/cosmos/cosmos-sdk/client" +// "github.com/cosmos/cosmos-sdk/codec" +// codectypes "github.com/cosmos/cosmos-sdk/codec/types" +// sdk "github.com/cosmos/cosmos-sdk/types" +// "github.com/cosmos/cosmos-sdk/types/module" +// paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" +// "github.com/gorilla/mux" +// "github.com/grpc-ecosystem/grpc-gateway/runtime" +// "github.com/spf13/cobra" +// abci "github.com/tendermint/tendermint/abci/types" + +// "github.com/cosmos/gaia/v11/x/globalfee/client/cli" +// "github.com/cosmos/gaia/v11/x/globalfee/keeper" +// "github.com/cosmos/gaia/v11/x/globalfee/types" +// ) + +// var ( +// _ module.AppModuleBasic = AppModuleBasic{} +// _ module.AppModuleGenesis = AppModule{} +// _ module.AppModule = AppModule{} +// ) + +// // AppModuleBasic defines the basic application module used by the wasm module. +// type AppModuleBasic struct{} + +// func (a AppModuleBasic) Name() string { +// return types.ModuleName +// } + +// func (a AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { +// return cdc.MustMarshalJSON(&types.GenesisState{ +// Params: types.DefaultParams(), +// }) +// } + +// func (a AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, _ client.TxEncodingConfig, message json.RawMessage) error { +// var data types.GenesisState +// err := marshaler.UnmarshalJSON(message, &data) +// if err != nil { +// return err +// } +// if err := data.Params.ValidateBasic(); err != nil { +// return errorsmod.Wrap(err, "params") +// } +// return nil +// } + +// func (a AppModuleBasic) RegisterInterfaces(_ codectypes.InterfaceRegistry) { +// } + +// func (a AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) { +// } + +// func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { +// err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) +// if err != nil { +// // same behavior as in cosmos-sdk +// panic(err) +// } +// } + +// func (a AppModuleBasic) GetTxCmd() *cobra.Command { +// return nil +// } + +// func (a AppModuleBasic) GetQueryCmd() *cobra.Command { +// return cli.GetQueryCmd() +// } + +// func (a AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino) { +// } + +// type AppModule struct { +// AppModuleBasic +// paramSpace paramstypes.Subspace +// } + +// // NewAppModule constructor +// func NewAppModule(paramSpace paramstypes.Subspace) *AppModule { +// if !paramSpace.HasKeyTable() { +// paramSpace = paramSpace.WithKeyTable(types.ParamKeyTable()) +// } + +// return &AppModule{paramSpace: paramSpace} +// } + +// func (a AppModule) InitGenesis(ctx sdk.Context, marshaler codec.JSONCodec, message json.RawMessage) []abci.ValidatorUpdate { +// var genesisState types.GenesisState +// marshaler.MustUnmarshalJSON(message, &genesisState) + +// a.paramSpace.SetParamSet(ctx, &genesisState.Params) +// return nil +// } + +// func (a AppModule) ExportGenesis(ctx sdk.Context, marshaler codec.JSONCodec) json.RawMessage { +// var genState types.GenesisState +// a.paramSpace.GetParamSet(ctx, &genState.Params) +// return marshaler.MustMarshalJSON(&genState) +// } + +// func (a AppModule) RegisterInvariants(_ sdk.InvariantRegistry) { +// } + +// func (a AppModule) Route() sdk.Route { +// return sdk.Route{} +// } + +// func (a AppModule) QuerierRoute() string { +// return types.QuerierRoute +// } + +// func (a AppModule) LegacyQuerierHandler(_ *codec.LegacyAmino) sdk.Querier { +// return nil +// } + +// func (a AppModule) RegisterServices(cfg module.Configurator) { +// types.RegisterQueryServer(cfg.QueryServer(), NewGrpcQuerier(a.paramSpace)) + +// m := keeper.NewMigrator(a.paramSpace) +// if err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2); err != nil { +// panic(fmt.Sprintf("failed to migrate x/globalfee from version 1 to 2: %v", err)) +// } +// } + +// func (a AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) { +// } + +// func (a AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { +// return nil +// } + +// // ConsensusVersion is a sequence number for state-breaking change of the +// // module. It should be incremented on each consensus-breaking change +// // introduced by the module. To avoid wrong/empty versions, the initial version +// // should be set to 1. +// func (a AppModule) ConsensusVersion() uint64 { +// return 2 +// } diff --git a/x/globalfee/querier.go b/x/globalfee/querier.go index 4ddd5ac28f..93d30999d7 100644 --- a/x/globalfee/querier.go +++ b/x/globalfee/querier.go @@ -1,52 +1,52 @@ package globalfee -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/cosmos/gaia/v11/x/globalfee/types" -) - -var _ types.QueryServer = &GrpcQuerier{} - -// ParamSource is a read only subset of paramtypes.Subspace -type ParamSource interface { - Get(ctx sdk.Context, key []byte, ptr interface{}) - Has(ctx sdk.Context, key []byte) bool -} - -type GrpcQuerier struct { - paramSource ParamSource -} - -func NewGrpcQuerier(paramSource ParamSource) GrpcQuerier { - return GrpcQuerier{paramSource: paramSource} -} - -// MinimumGasPrices return minimum gas prices -func (g GrpcQuerier) Params(stdCtx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { - var minGasPrices sdk.DecCoins - var bypassMinFeeMsgTypes []string - var maxTotalBypassMinFeeMsgGasUsage uint64 - ctx := sdk.UnwrapSDKContext(stdCtx) - - // todo: if return err if not exist? - if g.paramSource.Has(ctx, types.ParamStoreKeyMinGasPrices) { - g.paramSource.Get(ctx, types.ParamStoreKeyMinGasPrices, &minGasPrices) - } - if g.paramSource.Has(ctx, types.ParamStoreKeyBypassMinFeeMsgTypes) { - g.paramSource.Get(ctx, types.ParamStoreKeyBypassMinFeeMsgTypes, &bypassMinFeeMsgTypes) - } - if g.paramSource.Has(ctx, types.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage) { - g.paramSource.Get(ctx, types.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage, &maxTotalBypassMinFeeMsgGasUsage) - } - - return &types.QueryParamsResponse{ - Params: types.Params{ - MinimumGasPrices: minGasPrices, - BypassMinFeeMsgTypes: bypassMinFeeMsgTypes, - MaxTotalBypassMinFeeMsgGasUsage: maxTotalBypassMinFeeMsgGasUsage, - }, - }, nil -} +// import ( +// "context" + +// sdk "github.com/cosmos/cosmos-sdk/types" + +// "github.com/cosmos/gaia/v11/x/globalfee/types" +// ) + +// var _ types.QueryServer = &GrpcQuerier{} + +// // ParamSource is a read only subset of paramtypes.Subspace +// type ParamSource interface { +// Get(ctx sdk.Context, key []byte, ptr interface{}) +// Has(ctx sdk.Context, key []byte) bool +// } + +// type GrpcQuerier struct { +// paramSource ParamSource +// } + +// func NewGrpcQuerier(paramSource ParamSource) GrpcQuerier { +// return GrpcQuerier{paramSource: paramSource} +// } + +// // MinimumGasPrices return minimum gas prices +// func (g GrpcQuerier) Params(stdCtx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { +// var minGasPrices sdk.DecCoins +// var bypassMinFeeMsgTypes []string +// var maxTotalBypassMinFeeMsgGasUsage uint64 +// ctx := sdk.UnwrapSDKContext(stdCtx) + +// // todo: if return err if not exist? +// if g.paramSource.Has(ctx, types.ParamStoreKeyMinGasPrices) { +// g.paramSource.Get(ctx, types.ParamStoreKeyMinGasPrices, &minGasPrices) +// } +// if g.paramSource.Has(ctx, types.ParamStoreKeyBypassMinFeeMsgTypes) { +// g.paramSource.Get(ctx, types.ParamStoreKeyBypassMinFeeMsgTypes, &bypassMinFeeMsgTypes) +// } +// if g.paramSource.Has(ctx, types.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage) { +// g.paramSource.Get(ctx, types.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage, &maxTotalBypassMinFeeMsgGasUsage) +// } + +// return &types.QueryParamsResponse{ +// Params: types.Params{ +// MinimumGasPrices: minGasPrices, +// BypassMinFeeMsgTypes: bypassMinFeeMsgTypes, +// MaxTotalBypassMinFeeMsgGasUsage: maxTotalBypassMinFeeMsgGasUsage, +// }, +// }, nil +// } diff --git a/x/globalfee/querier_test.go b/x/globalfee/querier_test.go index 5f6c86345c..58db62280d 100644 --- a/x/globalfee/querier_test.go +++ b/x/globalfee/querier_test.go @@ -1,56 +1,56 @@ package globalfee -import ( - "testing" +// import ( +// "testing" - sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/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/stretchr/testify/assert" +// "github.com/stretchr/testify/require" - "github.com/cosmos/gaia/v11/x/globalfee/types" -) +// "github.com/cosmos/gaia/v11/x/globalfee/types" +// ) -func TestQueryMinimumGasPrices(t *testing.T) { - specs := map[string]struct { - setupStore func(ctx sdk.Context, s paramtypes.Subspace) - expMin sdk.DecCoins - }{ - "one coin": { - setupStore: func(ctx sdk.Context, s paramtypes.Subspace) { - s.SetParamSet(ctx, &types.Params{ - MinimumGasPrices: sdk.NewDecCoins(sdk.NewDecCoin("ALX", sdk.OneInt())), - }) - }, - expMin: sdk.NewDecCoins(sdk.NewDecCoin("ALX", sdk.OneInt())), - }, - "multiple coins": { - setupStore: func(ctx sdk.Context, s paramtypes.Subspace) { - s.SetParamSet(ctx, &types.Params{ - MinimumGasPrices: sdk.NewDecCoins(sdk.NewDecCoin("ALX", sdk.OneInt()), sdk.NewDecCoin("BLX", sdk.NewInt(2))), - }) - }, - expMin: sdk.NewDecCoins(sdk.NewDecCoin("ALX", sdk.OneInt()), sdk.NewDecCoin("BLX", sdk.NewInt(2))), - }, - "no min gas price set": { - setupStore: func(ctx sdk.Context, s paramtypes.Subspace) { - s.SetParamSet(ctx, &types.Params{}) - }, - }, - "no param set": { - setupStore: func(ctx sdk.Context, s paramtypes.Subspace) { - }, - }, - } - for name, spec := range specs { - t.Run(name, func(t *testing.T) { - ctx, _, subspace := setupTestStore(t) - spec.setupStore(ctx, subspace) - q := NewGrpcQuerier(subspace) - gotResp, gotErr := q.Params(sdk.WrapSDKContext(ctx), nil) - require.NoError(t, gotErr) - require.NotNil(t, gotResp) - assert.Equal(t, spec.expMin, gotResp.Params.MinimumGasPrices) - }) - } -} +// func TestQueryMinimumGasPrices(t *testing.T) { +// specs := map[string]struct { +// setupStore func(ctx sdk.Context, s paramtypes.Subspace) +// expMin sdk.DecCoins +// }{ +// "one coin": { +// setupStore: func(ctx sdk.Context, s paramtypes.Subspace) { +// s.SetParamSet(ctx, &types.Params{ +// MinimumGasPrices: sdk.NewDecCoins(sdk.NewDecCoin("ALX", sdk.OneInt())), +// }) +// }, +// expMin: sdk.NewDecCoins(sdk.NewDecCoin("ALX", sdk.OneInt())), +// }, +// "multiple coins": { +// setupStore: func(ctx sdk.Context, s paramtypes.Subspace) { +// s.SetParamSet(ctx, &types.Params{ +// MinimumGasPrices: sdk.NewDecCoins(sdk.NewDecCoin("ALX", sdk.OneInt()), sdk.NewDecCoin("BLX", sdk.NewInt(2))), +// }) +// }, +// expMin: sdk.NewDecCoins(sdk.NewDecCoin("ALX", sdk.OneInt()), sdk.NewDecCoin("BLX", sdk.NewInt(2))), +// }, +// "no min gas price set": { +// setupStore: func(ctx sdk.Context, s paramtypes.Subspace) { +// s.SetParamSet(ctx, &types.Params{}) +// }, +// }, +// "no param set": { +// setupStore: func(ctx sdk.Context, s paramtypes.Subspace) { +// }, +// }, +// } +// for name, spec := range specs { +// t.Run(name, func(t *testing.T) { +// ctx, _, subspace := setupTestStore(t) +// spec.setupStore(ctx, subspace) +// q := NewGrpcQuerier(subspace) +// gotResp, gotErr := q.Params(sdk.WrapSDKContext(ctx), nil) +// require.NoError(t, gotErr) +// require.NotNil(t, gotResp) +// assert.Equal(t, spec.expMin, gotResp.Params.MinimumGasPrices) +// }) +// } +// } diff --git a/x/globalfee/types/genesis.go b/x/globalfee/types/genesis.go index 253df889c6..5d045dd9b5 100644 --- a/x/globalfee/types/genesis.go +++ b/x/globalfee/types/genesis.go @@ -1,40 +1,40 @@ package types -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - "github.com/cosmos/cosmos-sdk/codec" -) - -// NewGenesisState - Create a new genesis state -func NewGenesisState(params Params) *GenesisState { - return &GenesisState{ - Params: params, - } -} - -// DefaultGenesisState - Return a default genesis state -func DefaultGenesisState() *GenesisState { - return NewGenesisState(DefaultParams()) -} - -// GetGenesisStateFromAppState returns x/auth GenesisState given raw application -// genesis state. -func GetGenesisStateFromAppState(cdc codec.Codec, appState map[string]json.RawMessage) *GenesisState { - var genesisState GenesisState - - if appState[ModuleName] != nil { - cdc.MustUnmarshalJSON(appState[ModuleName], &genesisState) - } - - return &genesisState -} - -func ValidateGenesis(data GenesisState) error { - if err := data.Params.ValidateBasic(); err != nil { - return errorsmod.Wrap(err, "globalfee params") - } - - return nil -} +// import ( +// "encoding/json" + +// errorsmod "cosmossdk.io/errors" +// "github.com/cosmos/cosmos-sdk/codec" +// ) + +// // NewGenesisState - Create a new genesis state +// func NewGenesisState(params Params) *GenesisState { +// return &GenesisState{ +// Params: params, +// } +// } + +// // DefaultGenesisState - Return a default genesis state +// func DefaultGenesisState() *GenesisState { +// return NewGenesisState(DefaultParams()) +// } + +// // GetGenesisStateFromAppState returns x/auth GenesisState given raw application +// // genesis state. +// func GetGenesisStateFromAppState(cdc codec.Codec, appState map[string]json.RawMessage) *GenesisState { +// var genesisState GenesisState + +// if appState[ModuleName] != nil { +// cdc.MustUnmarshalJSON(appState[ModuleName], &genesisState) +// } + +// return &genesisState +// } + +// func ValidateGenesis(data GenesisState) error { +// if err := data.Params.ValidateBasic(); err != nil { +// return errorsmod.Wrap(err, "globalfee params") +// } + +// return nil +// } diff --git a/x/globalfee/types/genesis.pb.go b/x/globalfee/types/genesis.pb.go index 1e9188ad46..f42a1699b2 100644 --- a/x/globalfee/types/genesis.pb.go +++ b/x/globalfee/types/genesis.pb.go @@ -1,17 +1,12 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: gaia/globalfee/v1beta1/genesis.proto +// source: gaia/globalfee/v1/genesis.proto package types import ( fmt "fmt" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" + proto "github.com/cosmos/gogoproto/proto" math "math" - math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -25,598 +20,14 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// GenesisState - initial state of module -type GenesisState struct { - // Params of this module - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_015b3e8b7a7c65c5, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -// Params defines the set of module parameters. -type Params struct { - // minimum_gas_prices stores the minimum gas price(s) for all TX on the chain. - // When multiple coins are defined then they are accepted alternatively. - // The list must be sorted by denoms asc. No duplicate denoms or zero amount - // values allowed. For more information see - // https://docs.cosmos.network/main/modules/auth#concepts - MinimumGasPrices github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,1,rep,name=minimum_gas_prices,json=minimumGasPrices,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"minimum_gas_prices,omitempty" yaml:"minimum_gas_prices"` - // bypass_min_fee_msg_types defines a list of message type urls - // that are free of fee charge. - BypassMinFeeMsgTypes []string `protobuf:"bytes,2,rep,name=bypass_min_fee_msg_types,json=bypassMinFeeMsgTypes,proto3" json:"bypass_min_fee_msg_types,omitempty" yaml:"bypass_min_fee_msg_types"` - // max_total_bypass_min_fee_msg_gas_usage defines the total maximum gas usage - // allowed for a transaction containing only messages of types in bypass_min_fee_msg_types - // to bypass fee charge. - MaxTotalBypassMinFeeMsgGasUsage uint64 `protobuf:"varint,3,opt,name=max_total_bypass_min_fee_msg_gas_usage,json=maxTotalBypassMinFeeMsgGasUsage,proto3" json:"max_total_bypass_min_fee_msg_gas_usage,omitempty"` -} - -func (m *Params) Reset() { *m = Params{} } -func (m *Params) String() string { return proto.CompactTextString(m) } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_015b3e8b7a7c65c5, []int{1} -} -func (m *Params) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Params.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Params) XXX_Merge(src proto.Message) { - xxx_messageInfo_Params.Merge(m, src) -} -func (m *Params) XXX_Size() int { - return m.Size() -} -func (m *Params) XXX_DiscardUnknown() { - xxx_messageInfo_Params.DiscardUnknown(m) -} - -var xxx_messageInfo_Params proto.InternalMessageInfo - -func (m *Params) GetMinimumGasPrices() github_com_cosmos_cosmos_sdk_types.DecCoins { - if m != nil { - return m.MinimumGasPrices - } - return nil -} - -func (m *Params) GetBypassMinFeeMsgTypes() []string { - if m != nil { - return m.BypassMinFeeMsgTypes - } - return nil -} - -func (m *Params) GetMaxTotalBypassMinFeeMsgGasUsage() uint64 { - if m != nil { - return m.MaxTotalBypassMinFeeMsgGasUsage - } - return 0 -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "gaia.globalfee.v1beta1.GenesisState") - proto.RegisterType((*Params)(nil), "gaia.globalfee.v1beta1.Params") -} +func init() { proto.RegisterFile("gaia/globalfee/v1/genesis.proto", fileDescriptor_adcbe28f22ae5b0a) } -func init() { - proto.RegisterFile("gaia/globalfee/v1beta1/genesis.proto", fileDescriptor_015b3e8b7a7c65c5) +var fileDescriptor_adcbe28f22ae5b0a = []byte{ + // 90 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0x4f, 0xcc, 0x4c, + 0xd4, 0x4f, 0xcf, 0xc9, 0x4f, 0x4a, 0xcc, 0x49, 0x4b, 0x4d, 0xd5, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, + 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x77, 0x92, 0x38, 0xf1, 0x48, + 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, + 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x24, 0x36, 0xb0, 0x02, 0x63, 0x40, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xd4, 0x1e, 0x8a, 0x2e, 0x43, 0x00, 0x00, 0x00, } - -var fileDescriptor_015b3e8b7a7c65c5 = []byte{ - // 428 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x4d, 0x6e, 0xd3, 0x40, - 0x14, 0xc7, 0x33, 0x04, 0x45, 0xc2, 0x65, 0x51, 0x59, 0x15, 0x32, 0x55, 0x35, 0x8e, 0x2c, 0x84, - 0x2c, 0x01, 0x63, 0xb5, 0xec, 0x58, 0x1a, 0x44, 0xc4, 0xa2, 0x22, 0x0a, 0x65, 0xc3, 0x66, 0x78, - 0x36, 0xd3, 0x61, 0x44, 0xc6, 0x63, 0xe5, 0x4d, 0x50, 0xb2, 0xe4, 0x06, 0x1c, 0x80, 0x13, 0x70, - 0x06, 0x0e, 0xd0, 0x65, 0x97, 0xac, 0x0c, 0x4a, 0x76, 0x5d, 0x72, 0x02, 0x34, 0x1e, 0xd3, 0x52, - 0xa5, 0x59, 0xd9, 0xf2, 0xfb, 0xfd, 0x3f, 0xfc, 0xf4, 0x82, 0x07, 0x12, 0x14, 0x64, 0x72, 0x6a, - 0x0a, 0x98, 0x9e, 0x0a, 0x91, 0x7d, 0x3e, 0x2c, 0x84, 0x85, 0xc3, 0x4c, 0x8a, 0x4a, 0xa0, 0x42, - 0x56, 0xcf, 0x8c, 0x35, 0xe1, 0x3d, 0x47, 0xb1, 0x4b, 0x8a, 0x75, 0xd4, 0xfe, 0x9e, 0x34, 0xd2, - 0xb4, 0x48, 0xe6, 0xde, 0x3c, 0xbd, 0x4f, 0x4b, 0x83, 0xda, 0x60, 0x56, 0x00, 0x5e, 0x19, 0x96, - 0x46, 0x55, 0x7e, 0x9e, 0xbc, 0x0f, 0xee, 0x8e, 0xbc, 0xfd, 0x1b, 0x0b, 0x56, 0x84, 0xe3, 0x60, - 0x50, 0xc3, 0x0c, 0x34, 0x46, 0x64, 0x48, 0xd2, 0x9d, 0x23, 0xca, 0x6e, 0x8e, 0x63, 0xe3, 0x96, - 0xca, 0xa3, 0xb3, 0x26, 0xee, 0x5d, 0x34, 0xf1, 0xae, 0x57, 0x3d, 0x36, 0x5a, 0x59, 0xa1, 0x6b, - 0xbb, 0x9c, 0x74, 0x3e, 0xc9, 0xb7, 0x7e, 0x30, 0xf0, 0x70, 0xf8, 0x83, 0x04, 0xa1, 0x56, 0x95, - 0xd2, 0x73, 0xcd, 0x25, 0x20, 0xaf, 0x67, 0xaa, 0x14, 0x2e, 0xa9, 0x9f, 0xee, 0x1c, 0x1d, 0x30, - 0x5f, 0x95, 0xb9, 0xaa, 0x97, 0x31, 0x2f, 0x44, 0xf9, 0xdc, 0xa8, 0x2a, 0xaf, 0xbb, 0x9c, 0x83, - 0x4d, 0xfd, 0x55, 0xe6, 0x9f, 0x26, 0xbe, 0xbf, 0x04, 0x3d, 0x7d, 0x96, 0x6c, 0x52, 0xc9, 0xf7, - 0x5f, 0xf1, 0x23, 0xa9, 0xec, 0xc7, 0x79, 0xc1, 0x4a, 0xa3, 0xb3, 0x6e, 0x2f, 0xfe, 0xf1, 0x04, - 0x3f, 0x7c, 0xca, 0xec, 0xb2, 0x16, 0xf8, 0x2f, 0x10, 0x27, 0xbb, 0x9d, 0xc7, 0x08, 0x70, 0xdc, - 0x3a, 0x84, 0x5f, 0x48, 0x10, 0x15, 0xcb, 0x1a, 0x10, 0xb9, 0x56, 0x15, 0x3f, 0x15, 0x82, 0x6b, - 0x94, 0xbc, 0xd5, 0x45, 0xb7, 0x86, 0xfd, 0xf4, 0x4e, 0xfe, 0xea, 0xa2, 0x89, 0x93, 0x6d, 0xcc, - 0xb5, 0xa2, 0xb1, 0x2f, 0xba, 0x8d, 0x4d, 0x26, 0x7b, 0x7e, 0x74, 0xac, 0xaa, 0x97, 0x42, 0x1c, - 0xa3, 0x3c, 0x71, 0x9f, 0xc3, 0xd7, 0xc1, 0x43, 0x0d, 0x0b, 0x6e, 0x8d, 0x85, 0x29, 0xbf, 0x41, - 0xec, 0x7e, 0x78, 0x8e, 0x20, 0x45, 0xd4, 0x1f, 0x92, 0xf4, 0xf6, 0x24, 0xd6, 0xb0, 0x38, 0x71, - 0x70, 0x7e, 0xdd, 0x6d, 0x04, 0xf8, 0xd6, 0x61, 0x79, 0x7e, 0xb6, 0xa2, 0xe4, 0x7c, 0x45, 0xc9, - 0xef, 0x15, 0x25, 0x5f, 0xd7, 0xb4, 0x77, 0xbe, 0xa6, 0xbd, 0x9f, 0x6b, 0xda, 0x7b, 0x97, 0x6e, - 0x6e, 0xab, 0x3d, 0xd0, 0xc5, 0x7f, 0x27, 0xda, 0x76, 0x2d, 0x06, 0xed, 0x2d, 0x3d, 0xfd, 0x1b, - 0x00, 0x00, 0xff, 0xff, 0x90, 0xb9, 0xb2, 0x8a, 0xc1, 0x02, 0x00, 0x00, -} - -func (m *GenesisState) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *Params) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Params) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.MaxTotalBypassMinFeeMsgGasUsage != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.MaxTotalBypassMinFeeMsgGasUsage)) - i-- - dAtA[i] = 0x18 - } - if len(m.BypassMinFeeMsgTypes) > 0 { - for iNdEx := len(m.BypassMinFeeMsgTypes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.BypassMinFeeMsgTypes[iNdEx]) - copy(dAtA[i:], m.BypassMinFeeMsgTypes[iNdEx]) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.BypassMinFeeMsgTypes[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.MinimumGasPrices) > 0 { - for iNdEx := len(m.MinimumGasPrices) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.MinimumGasPrices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { - offset -= sovGenesis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovGenesis(uint64(l)) - return n -} - -func (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.MinimumGasPrices) > 0 { - for _, e := range m.MinimumGasPrices { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.BypassMinFeeMsgTypes) > 0 { - for _, s := range m.BypassMinFeeMsgTypes { - l = len(s) - n += 1 + l + sovGenesis(uint64(l)) - } - } - if m.MaxTotalBypassMinFeeMsgGasUsage != 0 { - n += 1 + sovGenesis(uint64(m.MaxTotalBypassMinFeeMsgGasUsage)) - } - return n -} - -func sovGenesis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenesis(x uint64) (n int) { - return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *GenesisState) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Params) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Params: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MinimumGasPrices", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MinimumGasPrices = append(m.MinimumGasPrices, types.DecCoin{}) - if err := m.MinimumGasPrices[len(m.MinimumGasPrices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BypassMinFeeMsgTypes", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.BypassMinFeeMsgTypes = append(m.BypassMinFeeMsgTypes, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxTotalBypassMinFeeMsgGasUsage", wireType) - } - m.MaxTotalBypassMinFeeMsgGasUsage = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxTotalBypassMinFeeMsgGasUsage |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenesis(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenesis - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenesis - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenesis - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/globalfee/types/keys.go b/x/globalfee/types/keys.go index 71b43267dd..13d6c31ad0 100644 --- a/x/globalfee/types/keys.go +++ b/x/globalfee/types/keys.go @@ -1,8 +1,9 @@ package types -const ( - // ModuleName is the name of the this module - ModuleName = "globalfee" - - QuerierRoute = ModuleName -) +// +// const ( +// // ModuleName is the name of the this module +// ModuleName = "globalfee" +// +// QuerierRoute = ModuleName +//) diff --git a/x/globalfee/types/params.go b/x/globalfee/types/params.go index f3fc120acb..0e61a2ae41 100644 --- a/x/globalfee/types/params.go +++ b/x/globalfee/types/params.go @@ -1,155 +1,155 @@ package types -import ( - "fmt" - "strings" - - errorsmod "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - gaiaerrors "github.com/cosmos/gaia/v11/types/errors" - ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" - ibcchanneltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" -) - -var ( - // ParamStoreKeyMinGasPrices store key - ParamStoreKeyMinGasPrices = []byte("MinimumGasPricesParam") - ParamStoreKeyBypassMinFeeMsgTypes = []byte("BypassMinFeeMsgTypes") - ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage = []byte("MaxTotalBypassMinFeeMsgGasUsage") - - // DefaultMinGasPrices is set at runtime to the staking token with zero amount i.e. "0uatom" - // see DefaultZeroGlobalFee method in gaia/x/globalfee/ante/fee.go. - DefaultMinGasPrices = sdk.DecCoins{} - DefaultBypassMinFeeMsgTypes = []string{ - sdk.MsgTypeURL(&ibcchanneltypes.MsgRecvPacket{}), - sdk.MsgTypeURL(&ibcchanneltypes.MsgAcknowledgement{}), - sdk.MsgTypeURL(&ibcclienttypes.MsgUpdateClient{}), - sdk.MsgTypeURL(&ibcchanneltypes.MsgTimeout{}), - sdk.MsgTypeURL(&ibcchanneltypes.MsgTimeoutOnClose{}), - } - - // maxTotalBypassMinFeeMsgGasUsage is the allowed maximum gas usage - // for all the bypass msgs in a transactions. - // A transaction that contains only bypass message types and the gas usage does not - // exceed maxTotalBypassMinFeeMsgGasUsage can be accepted with a zero fee. - // For details, see gaiafeeante.NewFeeDecorator() - DefaultmaxTotalBypassMinFeeMsgGasUsage uint64 = 1_000_000 -) - -// DefaultParams returns default parameters -func DefaultParams() Params { - return Params{ - MinimumGasPrices: DefaultMinGasPrices, - BypassMinFeeMsgTypes: DefaultBypassMinFeeMsgTypes, - MaxTotalBypassMinFeeMsgGasUsage: DefaultmaxTotalBypassMinFeeMsgGasUsage, - } -} - -func ParamKeyTable() paramtypes.KeyTable { - return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) -} - -// ValidateBasic performs basic validation. -func (p Params) ValidateBasic() error { - if err := validateMinimumGasPrices(p.MinimumGasPrices); err != nil { - return err - } - - if err := validateBypassMinFeeMsgTypes(p.BypassMinFeeMsgTypes); err != nil { - return err - } - - return validateMaxTotalBypassMinFeeMsgGasUsage(p.MaxTotalBypassMinFeeMsgGasUsage) -} - -// ParamSetPairs returns the parameter set pairs. -func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { - return paramtypes.ParamSetPairs{ - paramtypes.NewParamSetPair( - ParamStoreKeyMinGasPrices, &p.MinimumGasPrices, validateMinimumGasPrices, - ), - paramtypes.NewParamSetPair( - ParamStoreKeyBypassMinFeeMsgTypes, &p.BypassMinFeeMsgTypes, validateBypassMinFeeMsgTypes, - ), - paramtypes.NewParamSetPair( - ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage, &p.MaxTotalBypassMinFeeMsgGasUsage, validateMaxTotalBypassMinFeeMsgGasUsage, - ), - } -} - -func validateMinimumGasPrices(i interface{}) error { - v, ok := i.(sdk.DecCoins) - if !ok { - return errorsmod.Wrapf(gaiaerrors.ErrInvalidType, "type: %T, expected sdk.DecCoins", i) - } - - dec := DecCoins(v) - return dec.Validate() -} - -type BypassMinFeeMsgTypes []string +// import ( +// "fmt" +// "strings" + +// errorsmod "cosmossdk.io/errors" +// sdk "github.com/cosmos/cosmos-sdk/types" +// paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" +// gaiaerrors "github.com/cosmos/gaia/v11/types/errors" +// ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" +// ibcchanneltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" +// ) + +// var ( +// // ParamStoreKeyMinGasPrices store key +// ParamStoreKeyMinGasPrices = []byte("MinimumGasPricesParam") +// ParamStoreKeyBypassMinFeeMsgTypes = []byte("BypassMinFeeMsgTypes") +// ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage = []byte("MaxTotalBypassMinFeeMsgGasUsage") + +// // DefaultMinGasPrices is set at runtime to the staking token with zero amount i.e. "0uatom" +// // see DefaultZeroGlobalFee method in gaia/x/globalfee/ante/fee.go. +// DefaultMinGasPrices = sdk.DecCoins{} +// DefaultBypassMinFeeMsgTypes = []string{ +// sdk.MsgTypeURL(&ibcchanneltypes.MsgRecvPacket{}), +// sdk.MsgTypeURL(&ibcchanneltypes.MsgAcknowledgement{}), +// sdk.MsgTypeURL(&ibcclienttypes.MsgUpdateClient{}), +// sdk.MsgTypeURL(&ibcchanneltypes.MsgTimeout{}), +// sdk.MsgTypeURL(&ibcchanneltypes.MsgTimeoutOnClose{}), +// } + +// // maxTotalBypassMinFeeMsgGasUsage is the allowed maximum gas usage +// // for all the bypass msgs in a transactions. +// // A transaction that contains only bypass message types and the gas usage does not +// // exceed maxTotalBypassMinFeeMsgGasUsage can be accepted with a zero fee. +// // For details, see gaiafeeante.NewFeeDecorator() +// DefaultmaxTotalBypassMinFeeMsgGasUsage uint64 = 1_000_000 +// ) + +// // DefaultParams returns default parameters +// func DefaultParams() Params { +// return Params{ +// MinimumGasPrices: DefaultMinGasPrices, +// BypassMinFeeMsgTypes: DefaultBypassMinFeeMsgTypes, +// MaxTotalBypassMinFeeMsgGasUsage: DefaultmaxTotalBypassMinFeeMsgGasUsage, +// } +// } + +// func ParamKeyTable() paramtypes.KeyTable { +// return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) +// } + +// // ValidateBasic performs basic validation. +// func (p Params) ValidateBasic() error { +// if err := validateMinimumGasPrices(p.MinimumGasPrices); err != nil { +// return err +// } + +// if err := validateBypassMinFeeMsgTypes(p.BypassMinFeeMsgTypes); err != nil { +// return err +// } + +// return validateMaxTotalBypassMinFeeMsgGasUsage(p.MaxTotalBypassMinFeeMsgGasUsage) +// } + +// // ParamSetPairs returns the parameter set pairs. +// func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { +// return paramtypes.ParamSetPairs{ +// paramtypes.NewParamSetPair( +// ParamStoreKeyMinGasPrices, &p.MinimumGasPrices, validateMinimumGasPrices, +// ), +// paramtypes.NewParamSetPair( +// ParamStoreKeyBypassMinFeeMsgTypes, &p.BypassMinFeeMsgTypes, validateBypassMinFeeMsgTypes, +// ), +// paramtypes.NewParamSetPair( +// ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage, &p.MaxTotalBypassMinFeeMsgGasUsage, validateMaxTotalBypassMinFeeMsgGasUsage, +// ), +// } +// } + +// func validateMinimumGasPrices(i interface{}) error { +// v, ok := i.(sdk.DecCoins) +// if !ok { +// return errorsmod.Wrapf(gaiaerrors.ErrInvalidType, "type: %T, expected sdk.DecCoins", i) +// } + +// dec := DecCoins(v) +// return dec.Validate() +// } + +// type BypassMinFeeMsgTypes []string // validateBypassMinFeeMsgTypes checks that bypass msg types aren't empty -func validateBypassMinFeeMsgTypes(i interface{}) error { - bypassMinFeeMsgTypes, ok := i.([]string) - if !ok { - return errorsmod.Wrapf(gaiaerrors.ErrInvalidType, "type: %T, expected []sdk.Msg", i) - } - - for _, msgType := range bypassMinFeeMsgTypes { - if msgType == "" { - return fmt.Errorf("invalid empty bypass msg type") - } - - if !strings.HasPrefix(msgType, sdk.MsgTypeURL(nil)) { - return fmt.Errorf("invalid bypass msg type name %s", msgType) - } - } - - return nil -} - -func validateMaxTotalBypassMinFeeMsgGasUsage(i interface{}) error { - _, ok := i.(uint64) - if !ok { - return errorsmod.Wrapf(gaiaerrors.ErrInvalidType, "type: %T, expected uint64", i) - } - - return nil -} - -type DecCoins sdk.DecCoins - -// Validate checks that the DecCoins are sorted, have nonnegtive amount, with a valid and unique -// denomination (i.e no duplicates). Otherwise, it returns an error. -func (coins DecCoins) Validate() error { - if len(coins) == 0 { - return nil - } - - lowDenom := "" - seenDenoms := make(map[string]bool) - - for i, coin := range coins { - if seenDenoms[coin.Denom] { - return fmt.Errorf("duplicate denomination %s", coin.Denom) - } - if err := sdk.ValidateDenom(coin.Denom); err != nil { - return err - } - // skip the denom order check for the first denom in the coins list - if i != 0 && coin.Denom <= lowDenom { - return fmt.Errorf("denomination %s is not sorted", coin.Denom) - } - if coin.IsNegative() { - return fmt.Errorf("coin %s amount is negative", coin.Amount) - } - - // we compare each coin against the last denom - lowDenom = coin.Denom - seenDenoms[coin.Denom] = true - } - - return nil -} +// func validateBypassMinFeeMsgTypes(i interface{}) error { +// bypassMinFeeMsgTypes, ok := i.([]string) +// if !ok { +// return errorsmod.Wrapf(gaiaerrors.ErrInvalidType, "type: %T, expected []sdk.Msg", i) +// } + +// for _, msgType := range bypassMinFeeMsgTypes { +// if msgType == "" { +// return fmt.Errorf("invalid empty bypass msg type") +// } + +// if !strings.HasPrefix(msgType, sdk.MsgTypeURL(nil)) { +// return fmt.Errorf("invalid bypass msg type name %s", msgType) +// } +// } + +// return nil +// } + +// func validateMaxTotalBypassMinFeeMsgGasUsage(i interface{}) error { +// _, ok := i.(uint64) +// if !ok { +// return errorsmod.Wrapf(gaiaerrors.ErrInvalidType, "type: %T, expected uint64", i) +// } + +// return nil +// } + +// type DecCoins sdk.DecCoins + +// // Validate checks that the DecCoins are sorted, have nonnegtive amount, with a valid and unique +// // denomination (i.e no duplicates). Otherwise, it returns an error. +// func (coins DecCoins) Validate() error { +// if len(coins) == 0 { +// return nil +// } + +// lowDenom := "" +// seenDenoms := make(map[string]bool) + +// for i, coin := range coins { +// if seenDenoms[coin.Denom] { +// return fmt.Errorf("duplicate denomination %s", coin.Denom) +// } +// if err := sdk.ValidateDenom(coin.Denom); err != nil { +// return err +// } +// // skip the denom order check for the first denom in the coins list +// if i != 0 && coin.Denom <= lowDenom { +// return fmt.Errorf("denomination %s is not sorted", coin.Denom) +// } +// if coin.IsNegative() { +// return fmt.Errorf("coin %s amount is negative", coin.Amount) +// } + +// // we compare each coin against the last denom +// lowDenom = coin.Denom +// seenDenoms[coin.Denom] = true +// } + +// return nil +// } diff --git a/x/globalfee/types/params_test.go b/x/globalfee/types/params_test.go index b2c2931674..1f31fe9fd6 100644 --- a/x/globalfee/types/params_test.go +++ b/x/globalfee/types/params_test.go @@ -1,156 +1,157 @@ package types -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" -) - -func TestDefaultParams(t *testing.T) { - p := DefaultParams() - require.EqualValues(t, p.MinimumGasPrices, sdk.DecCoins{}) - require.EqualValues(t, p.BypassMinFeeMsgTypes, DefaultBypassMinFeeMsgTypes) - require.EqualValues(t, p.MaxTotalBypassMinFeeMsgGasUsage, DefaultmaxTotalBypassMinFeeMsgGasUsage) -} - -func Test_validateMinGasPrices(t *testing.T) { - tests := map[string]struct { - coins interface{} - expectErr bool - }{ - "DefaultParams, pass": { - DefaultParams().MinimumGasPrices, - false, - }, - "DecCoins conversion fails, fail": { - sdk.Coins{sdk.NewCoin("photon", sdk.OneInt())}, - true, - }, - "coins amounts are zero, pass": { - sdk.DecCoins{ - sdk.NewDecCoin("atom", sdk.ZeroInt()), - sdk.NewDecCoin("photon", sdk.ZeroInt()), - }, - false, - }, - "duplicate coins denoms, fail": { - sdk.DecCoins{ - sdk.NewDecCoin("photon", sdk.OneInt()), - sdk.NewDecCoin("photon", sdk.OneInt()), - }, - true, - }, - "coins are not sorted by denom alphabetically, fail": { - sdk.DecCoins{ - sdk.NewDecCoin("photon", sdk.OneInt()), - sdk.NewDecCoin("atom", sdk.OneInt()), - }, - true, - }, - "negative amount, fail": { - sdk.DecCoins{ - sdk.DecCoin{Denom: "photon", Amount: sdk.OneDec().Neg()}, - }, - true, - }, - "invalid denom, fail": { - sdk.DecCoins{ - sdk.DecCoin{Denom: "photon!", Amount: sdk.OneDec().Neg()}, - }, - true, - }, - } - - for name, test := range tests { - t.Run(name, func(t *testing.T) { - err := validateMinimumGasPrices(test.coins) - if test.expectErr { - require.Error(t, err) - return - } - require.NoError(t, err) - }) - } -} - -func Test_validateBypassMinFeeMsgTypes(t *testing.T) { - tests := map[string]struct { - msgTypes interface{} - expectErr bool - }{ - "DefaultParams, pass": { - DefaultParams().BypassMinFeeMsgTypes, - false, - }, - "wrong msg type should make conversion fail, fail": { - []int{0, 1, 2, 3}, - true, - }, - "empty msg types, pass": { - []string{}, - false, - }, - "empty msg type, fail": { - []string{""}, - true, - }, - "invalid msg type name, fail": { - []string{"ibc.core.channel.v1.MsgRecvPacket"}, - true, - }, - "mixed valid and invalid msgs, fail": { - []string{ - "/ibc.core.channel.v1.MsgRecvPacket", - "", - }, - true, - }, - } - - for name, test := range tests { - t.Run(name, func(t *testing.T) { - err := validateBypassMinFeeMsgTypes(test.msgTypes) - if test.expectErr { - require.Error(t, err) - return - } - require.NoError(t, err) - }) - } -} - -func Test_validateMaxTotalBypassMinFeeMsgGasUsage(t *testing.T) { - tests := map[string]struct { - msgTypes interface{} - expectErr bool - }{ - "DefaultParams, pass": { - DefaultParams().MaxTotalBypassMinFeeMsgGasUsage, - false, - }, - "zero value, pass": { - uint64(0), - false, - }, - "negative value, fail": { - -1, - true, - }, - "invalid type, fail": { - "5", - true, - }, - } - - for name, test := range tests { - t.Run(name, func(t *testing.T) { - err := validateMaxTotalBypassMinFeeMsgGasUsage(test.msgTypes) - if test.expectErr { - require.Error(t, err) - return - } - require.NoError(t, err) - }) - } -} +// +// import ( +// "testing" +// +// sdk "github.com/cosmos/cosmos-sdk/types" +// "github.com/stretchr/testify/require" +//) +// +// func TestDefaultParams(t *testing.T) { +// p := DefaultParams() +// require.EqualValues(t, p.MinimumGasPrices, sdk.DecCoins{}) +// require.EqualValues(t, p.BypassMinFeeMsgTypes, DefaultBypassMinFeeMsgTypes) +// require.EqualValues(t, p.MaxTotalBypassMinFeeMsgGasUsage, DefaultmaxTotalBypassMinFeeMsgGasUsage) +//} +// +// func Test_validateMinGasPrices(t *testing.T) { +// tests := map[string]struct { +// coins interface{} +// expectErr bool +// }{ +// "DefaultParams, pass": { +// DefaultParams().MinimumGasPrices, +// false, +// }, +// "DecCoins conversion fails, fail": { +// sdk.Coins{sdk.NewCoin("photon", sdk.OneInt())}, +// true, +// }, +// "coins amounts are zero, pass": { +// sdk.DecCoins{ +// sdk.NewDecCoin("atom", sdk.ZeroInt()), +// sdk.NewDecCoin("photon", sdk.ZeroInt()), +// }, +// false, +// }, +// "duplicate coins denoms, fail": { +// sdk.DecCoins{ +// sdk.NewDecCoin("photon", sdk.OneInt()), +// sdk.NewDecCoin("photon", sdk.OneInt()), +// }, +// true, +// }, +// "coins are not sorted by denom alphabetically, fail": { +// sdk.DecCoins{ +// sdk.NewDecCoin("photon", sdk.OneInt()), +// sdk.NewDecCoin("atom", sdk.OneInt()), +// }, +// true, +// }, +// "negative amount, fail": { +// sdk.DecCoins{ +// sdk.DecCoin{Denom: "photon", Amount: sdk.OneDec().Neg()}, +// }, +// true, +// }, +// "invalid denom, fail": { +// sdk.DecCoins{ +// sdk.DecCoin{Denom: "photon!", Amount: sdk.OneDec().Neg()}, +// }, +// true, +// }, +// } +// +// for name, test := range tests { +// t.Run(name, func(t *testing.T) { +// err := validateMinimumGasPrices(test.coins) +// if test.expectErr { +// require.Error(t, err) +// return +// } +// require.NoError(t, err) +// }) +// } +//} +// +// func Test_validateBypassMinFeeMsgTypes(t *testing.T) { +// tests := map[string]struct { +// msgTypes interface{} +// expectErr bool +// }{ +// "DefaultParams, pass": { +// DefaultParams().BypassMinFeeMsgTypes, +// false, +// }, +// "wrong msg type should make conversion fail, fail": { +// []int{0, 1, 2, 3}, +// true, +// }, +// "empty msg types, pass": { +// []string{}, +// false, +// }, +// "empty msg type, fail": { +// []string{""}, +// true, +// }, +// "invalid msg type name, fail": { +// []string{"ibc.core.channel.v1.MsgRecvPacket"}, +// true, +// }, +// "mixed valid and invalid msgs, fail": { +// []string{ +// "/ibc.core.channel.v1.MsgRecvPacket", +// "", +// }, +// true, +// }, +// } +// +// for name, test := range tests { +// t.Run(name, func(t *testing.T) { +// err := validateBypassMinFeeMsgTypes(test.msgTypes) +// if test.expectErr { +// require.Error(t, err) +// return +// } +// require.NoError(t, err) +// }) +// } +//} +// +// func Test_validateMaxTotalBypassMinFeeMsgGasUsage(t *testing.T) { +// tests := map[string]struct { +// msgTypes interface{} +// expectErr bool +// }{ +// "DefaultParams, pass": { +// DefaultParams().MaxTotalBypassMinFeeMsgGasUsage, +// false, +// }, +// "zero value, pass": { +// uint64(0), +// false, +// }, +// "negative value, fail": { +// -1, +// true, +// }, +// "invalid type, fail": { +// "5", +// true, +// }, +// } +// +// for name, test := range tests { +// t.Run(name, func(t *testing.T) { +// err := validateMaxTotalBypassMinFeeMsgGasUsage(test.msgTypes) +// if test.expectErr { +// require.Error(t, err) +// return +// } +// require.NoError(t, err) +// }) +// } +//} diff --git a/x/globalfee/types/query.pb.go b/x/globalfee/types/query.pb.go index 3b73bc4570..cb690734b0 100644 --- a/x/globalfee/types/query.pb.go +++ b/x/globalfee/types/query.pb.go @@ -1,21 +1,12 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: gaia/globalfee/v1beta1/query.proto +// source: gaia/globalfee/v1/query.proto package types import ( - context "context" fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - io "io" + proto "github.com/cosmos/gogoproto/proto" math "math" - math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -29,508 +20,14 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// QueryMinimumGasPricesRequest is the request type for the -// Query/MinimumGasPrices RPC method. -type QueryParamsRequest struct { -} - -func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } -func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryParamsRequest) ProtoMessage() {} -func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_12a736cede25d10a, []int{0} -} -func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryParamsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsRequest.Merge(m, src) -} -func (m *QueryParamsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo - -// QueryMinimumGasPricesResponse is the response type for the -// Query/MinimumGasPrices RPC method. -type QueryParamsResponse struct { - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` -} - -func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } -func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryParamsResponse) ProtoMessage() {} -func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_12a736cede25d10a, []int{1} -} -func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsResponse.Merge(m, src) -} -func (m *QueryParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo - -func (m *QueryParamsResponse) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "gaia.globalfee.v1beta1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "gaia.globalfee.v1beta1.QueryParamsResponse") -} - -func init() { - proto.RegisterFile("gaia/globalfee/v1beta1/query.proto", fileDescriptor_12a736cede25d10a) -} - -var fileDescriptor_12a736cede25d10a = []byte{ - // 286 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0x31, 0x4b, 0xc3, 0x40, - 0x14, 0xc7, 0x73, 0xa2, 0x1d, 0xce, 0xed, 0x2c, 0x22, 0x41, 0xce, 0x12, 0x44, 0x8a, 0xc2, 0x1d, - 0xad, 0xab, 0x53, 0x3e, 0x81, 0xd6, 0xcd, 0xed, 0x52, 0x9e, 0x67, 0x20, 0xc9, 0x4b, 0x73, 0x17, - 0xb1, 0xab, 0x9b, 0x9b, 0xd0, 0x2f, 0xd5, 0xb1, 0xe0, 0xe2, 0x24, 0x92, 0xf8, 0x41, 0x24, 0xb9, - 0x20, 0x8a, 0x06, 0xdc, 0x8e, 0x77, 0xbf, 0xf7, 0x7f, 0x3f, 0xfe, 0x34, 0xd0, 0x2a, 0x56, 0x52, - 0x27, 0x18, 0xa9, 0xe4, 0x16, 0x40, 0xde, 0x4f, 0x22, 0xb0, 0x6a, 0x22, 0x17, 0x25, 0x14, 0x4b, - 0x91, 0x17, 0x68, 0x91, 0xed, 0x37, 0x8c, 0xf8, 0x62, 0x44, 0xc7, 0xf8, 0x43, 0x8d, 0x1a, 0x5b, - 0x44, 0x36, 0x2f, 0x47, 0xfb, 0x87, 0x1a, 0x51, 0x27, 0x20, 0x55, 0x1e, 0x4b, 0x95, 0x65, 0x68, - 0x95, 0x8d, 0x31, 0x33, 0xdd, 0xef, 0x71, 0xcf, 0x3d, 0x0d, 0x19, 0x98, 0xb8, 0xa3, 0x82, 0x21, - 0x65, 0x57, 0x8d, 0xc0, 0xa5, 0x2a, 0x54, 0x6a, 0x66, 0xb0, 0x28, 0xc1, 0xd8, 0xe0, 0x9a, 0xee, - 0xfd, 0x98, 0x9a, 0x1c, 0x33, 0x03, 0xec, 0x82, 0x0e, 0xf2, 0x76, 0x72, 0x40, 0x46, 0x64, 0xbc, - 0x3b, 0xe5, 0xe2, 0x6f, 0x5f, 0xe1, 0xf6, 0xc2, 0xed, 0xf5, 0xdb, 0x91, 0x37, 0xeb, 0x76, 0xa6, - 0x2b, 0x42, 0x77, 0xda, 0x54, 0xf6, 0x44, 0xe8, 0xc0, 0x21, 0xec, 0xb4, 0x2f, 0xe2, 0xb7, 0x95, - 0x7f, 0xf6, 0x2f, 0xd6, 0xb9, 0x06, 0x27, 0x8f, 0x2f, 0x1f, 0xab, 0xad, 0x11, 0xe3, 0xb2, 0xa7, - 0x07, 0x67, 0x15, 0x86, 0xeb, 0x8a, 0x93, 0x4d, 0xc5, 0xc9, 0x7b, 0xc5, 0xc9, 0x73, 0xcd, 0xbd, - 0x4d, 0xcd, 0xbd, 0xd7, 0x9a, 0x7b, 0x37, 0x63, 0x1d, 0xdb, 0xbb, 0x32, 0x12, 0x73, 0x4c, 0xe5, - 0x1c, 0x4d, 0x8a, 0xc6, 0x45, 0x3d, 0x7c, 0x0b, 0xb3, 0xcb, 0x1c, 0x4c, 0x34, 0x68, 0xbb, 0x3c, - 0xff, 0x0c, 0x00, 0x00, 0xff, 0xff, 0x01, 0xc5, 0x11, 0x71, 0xe3, 0x01, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type QueryClient interface { - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { - out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/gaia.globalfee.v1beta1.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryParamsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Params(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gaia.globalfee.v1beta1.Query/Params", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "gaia.globalfee.v1beta1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "gaia/globalfee/v1beta1/query.proto", -} - -func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} +func init() { proto.RegisterFile("gaia/globalfee/v1/query.proto", fileDescriptor_9d905334454049fe) } -func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +var fileDescriptor_9d905334454049fe = []byte{ + // 88 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4d, 0x4f, 0xcc, 0x4c, + 0xd4, 0x4f, 0xcf, 0xc9, 0x4f, 0x4a, 0xcc, 0x49, 0x4b, 0x4d, 0xd5, 0x2f, 0x33, 0xd4, 0x2f, 0x2c, + 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x77, 0x92, 0x38, 0xf1, 0x48, 0x8e, 0xf1, + 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, + 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x24, 0x36, 0xb0, 0x02, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x8e, 0xf4, 0x45, 0x9d, 0x41, 0x00, 0x00, 0x00, } - -func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *QueryParamsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipQuery(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthQuery - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupQuery - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthQuery - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/globalfee/types/query.pb.gw.go b/x/globalfee/types/query.pb.gw.go deleted file mode 100644 index 5a24a95a0c..0000000000 --- a/x/globalfee/types/query.pb.gw.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: gaia/globalfee/v1beta1/query.proto - -/* -Package types is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package types - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := server.Params(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QueryClient" to call the correct interceptors. -func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"gaia", "globalfee", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(true))) -) - -var ( - forward_Query_Params_0 = runtime.ForwardResponseMessage -) From f5fc4ba0183e4d471022684c4347b5f04acfab14 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Wed, 12 Jul 2023 14:58:19 +0200 Subject: [PATCH 03/43] feat: refactor base E2E tests (#2587) * Squash multiple commits for E2E tests after history was broken * Upgrade all e2e tests except global fee and ICS * Add back go.mod replace ` github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7` * Upgrade hermes version for e2e tests * Change docker image for e2e tets to be able to attach shell for debugging * Bump ICS to v3rc0 to work with SDK47 n IBC7 * clean dockerfiles * revert changes in Dockerfile * linter fix --- Dockerfile | 2 +- e2e.Dockerfile | 3 +- go.mod | 39 +- go.sum | 53 +- tests/e2e/address.go | 63 +- tests/e2e/chain.go | 258 +++-- tests/e2e/docker/hermes.Dockerfile | 2 +- tests/e2e/e2e_bank_test.go | 115 +- tests/e2e/e2e_distribution_test.go | 173 ++- tests/e2e/e2e_encode_test.go | 97 +- tests/e2e/e2e_evidence_test.go | 103 +- tests/e2e/e2e_exec_test.go | 1223 ++++++++++---------- tests/e2e/e2e_feegrant_test.go | 190 +-- tests/e2e/e2e_gov_test.go | 448 ++++---- tests/e2e/e2e_ibc_test.go | 959 ++++++++-------- tests/e2e/e2e_rest_regression_test.go | 136 ++- tests/e2e/e2e_setup_test.go | 1524 +++++++++++-------------- tests/e2e/e2e_slashing_test.go | 43 +- tests/e2e/e2e_staking_test.go | 115 +- tests/e2e/e2e_test.go | 210 ++-- tests/e2e/e2e_vesting_test.go | 668 +++++------ tests/e2e/genesis.go | 418 +++---- tests/e2e/http_util.go | 76 +- tests/e2e/io.go | 84 +- tests/e2e/keys.go | 37 +- tests/e2e/query.go | 479 ++++---- tests/e2e/scripts/hermes_bootstrap.sh | 1 + tests/e2e/util.go | 101 +- tests/e2e/validator.go | 653 ++++++----- tests/ics/interchain_security_test.go | 4 +- 30 files changed, 4118 insertions(+), 4159 deletions(-) diff --git a/Dockerfile b/Dockerfile index 07546c6b8f..01937d6117 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,4 +17,4 @@ COPY --from=gaiad-builder /go/bin/gaiad /usr/local/bin/ EXPOSE 26656 26657 1317 9090 USER 0 -ENTRYPOINT ["gaiad", "start"] +ENTRYPOINT ["gaiad", "start"] \ No newline at end of file diff --git a/e2e.Dockerfile b/e2e.Dockerfile index d6facae2f8..2c7eb0e112 100644 --- a/e2e.Dockerfile +++ b/e2e.Dockerfile @@ -11,7 +11,8 @@ RUN apk add --no-cache $PACKAGES RUN CGO_ENABLED=0 make install # Add to a distroless container -FROM cgr.dev/chainguard/static:$IMG_TAG +FROM alpine:$IMG_TAG +RUN adduser -D nonroot ARG IMG_TAG COPY --from=gaiad-builder /go/bin/gaiad /usr/local/bin/ EXPOSE 26656 26657 1317 9090 diff --git a/go.mod b/go.mod index 567c0f94dd..15837fde7d 100644 --- a/go.mod +++ b/go.mod @@ -4,36 +4,40 @@ go 1.20 require ( cosmossdk.io/api v0.3.1 - cosmossdk.io/errors v1.0.0-beta.7 cosmossdk.io/math v1.0.1 cosmossdk.io/simapp v0.0.0-20230602123434-616841b9704d cosmossdk.io/tools/rosetta v0.2.1 github.com/cometbft/cometbft v0.37.1 github.com/cometbft/cometbft-db v0.8.0 github.com/cosmos/cosmos-sdk v0.47.3 + github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/gogoproto v1.4.10 github.com/cosmos/ibc-go/v7 v7.1.0 github.com/cosmos/interchain-security/v3 v3.0.0-rc0 github.com/gorilla/mux v1.8.0 + github.com/rakyll/statik v0.1.7 + github.com/spf13/cast v1.5.1 + github.com/spf13/cobra v1.7.0 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.16.0 github.com/strangelove-ventures/packet-forward-middleware/v7 v7.0.0-20230412224111-136e94e98861 github.com/stretchr/testify v1.8.4 ) +require ( + cosmossdk.io/errors v1.0.0-beta.7 + github.com/ory/dockertest/v3 v3.10.0 +) + require ( cloud.google.com/go v0.110.0 // indirect cloud.google.com/go/compute v1.19.0 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect cloud.google.com/go/iam v0.13.0 // indirect cloud.google.com/go/storage v1.29.0 // indirect - github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/golang/protobuf v1.5.3 // indirect // github.com/gravity-devs/liquidity v1.6.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect - github.com/rakyll/statik v0.1.7 - github.com/spf13/cast v1.5.1 - github.com/spf13/cobra v1.7.0 google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect google.golang.org/grpc v1.55.0 // indirect ) @@ -45,7 +49,10 @@ require ( filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect + github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect + github.com/Microsoft/go-winio v0.6.0 // indirect + github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect github.com/armon/go-metrics v0.4.1 // indirect github.com/aws/aws-sdk-go v1.44.203 // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -59,6 +66,7 @@ require ( github.com/cockroachdb/apd/v2 v2.0.2 // indirect github.com/coinbase/rosetta-sdk-go v0.7.9 // indirect github.com/confio/ics23/go v0.9.0 // indirect + github.com/containerd/continuity v0.3.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.2 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect @@ -74,6 +82,10 @@ require ( github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect + github.com/docker/cli v20.10.17+incompatible // indirect + github.com/docker/docker v20.10.19+incompatible // indirect + github.com/docker/go-connections v0.4.0 // indirect + github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect github.com/felixge/httpsnoop v1.0.2 // indirect @@ -96,6 +108,7 @@ require ( github.com/google/go-cmp v0.5.9 // indirect github.com/google/orderedcode v0.0.1 // indirect github.com/google/s2a-go v0.1.3 // indirect + github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/google/uuid v1.3.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect github.com/googleapis/gax-go/v2 v2.8.0 // indirect @@ -115,6 +128,7 @@ require ( github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/huandu/skiplist v1.2.0 // indirect github.com/iancoleman/orderedmap v0.2.0 // indirect + github.com/imdario/mergo v0.3.13 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect @@ -133,8 +147,11 @@ require ( github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae // indirect github.com/mtibben/percent v0.2.1 // indirect github.com/onsi/gomega v1.26.0 // indirect + github.com/opencontainers/go-digest v1.0.0 // indirect + github.com/opencontainers/image-spec v1.1.0-rc2 // indirect github.com/opencontainers/runc v1.1.5 // indirect github.com/oxyno-zeta/gomock-extra-matcher v1.1.0 // indirect github.com/pelletier/go-toml/v2 v2.0.8 // indirect @@ -149,6 +166,7 @@ require ( github.com/rs/cors v1.8.3 // indirect github.com/rs/zerolog v1.29.1 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect + github.com/sirupsen/logrus v1.9.0 // indirect github.com/spf13/afero v1.9.5 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/subosito/gotenv v1.4.2 // indirect @@ -156,12 +174,16 @@ require ( github.com/tendermint/go-amino v0.16.0 // indirect github.com/tidwall/btree v1.6.0 // indirect github.com/ulikunitz/xz v0.5.11 // indirect + github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect + github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect + github.com/xeipuuv/gojsonschema v1.2.0 // indirect github.com/zondax/hid v0.9.1 // indirect github.com/zondax/ledger-go v0.14.1 // indirect go.etcd.io/bbolt v1.3.7 // indirect go.opencensus.io v0.24.0 // indirect golang.org/x/crypto v0.9.0 // indirect golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc // indirect + golang.org/x/mod v0.9.0 // indirect golang.org/x/net v0.10.0 // indirect golang.org/x/oauth2 v0.7.0 // indirect golang.org/x/sys v0.8.0 // indirect @@ -189,11 +211,8 @@ replace ( // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.8.1 - // Liquidity force withdrawal: https://www.mintscan.io/cosmos/proposals/801 - // github.com/gravity-devs/liquidity => github.com/gravity-devs/liquidity v1.6.0-forced-withdrawal-rc1 - - // Comet - github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.29 + // 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 // the following version across all dependencies. diff --git a/go.sum b/go.sum index 7e0d2592f7..d323d9de5d 100644 --- a/go.sum +++ b/go.sum @@ -425,6 +425,7 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3 github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= +github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= @@ -434,7 +435,9 @@ github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3 github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= +github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= @@ -578,6 +581,7 @@ github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1 github.com/consensys/gnark-crypto v0.5.3/go.mod h1:hOdPlWQV1gDLp7faZVeg8Y0iEPFaOUnCc4XeCCk96p0= github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= +github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -620,6 +624,8 @@ github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJF github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= +github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= @@ -656,10 +662,16 @@ github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8 github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= +github.com/docker/cli v20.10.17+incompatible h1:eO2KS7ZFeov5UJeaDmIs1NFEDRf32PaqRpvoEkKBy5M= +github.com/docker/cli v20.10.17+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v20.10.19+incompatible h1:lzEmjivyNHFHMNAFLXORMBXyGIhw/UP4DvJwvyKYq64= +github.com/docker/docker v20.10.19+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dop251/goja v0.0.0-20211011172007-d99e4b8cbf48/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= @@ -693,7 +705,6 @@ github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= @@ -736,8 +747,8 @@ github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4 github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= @@ -858,13 +869,14 @@ github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.3 h1:FAgZmpLl/SXurPEZyCMPBIiiYeTbqfjlbdnCNTAkbGE= github.com/google/s2a-go v0.1.3/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -976,6 +988,8 @@ github.com/iancoleman/orderedmap v0.2.0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36 github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= +github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= @@ -1126,6 +1140,8 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= +github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae h1:O4SWKdcHVCvYqyDV+9CJA1fcDN2L11Bule0iFy3YlAI= +github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -1155,7 +1171,6 @@ github.com/neilotoole/errgroup v0.1.6/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= -github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= @@ -1165,21 +1180,18 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= +github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= +github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= +github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= github.com/opencontainers/runc v1.1.5 h1:L44KXEpKmfWDcS02aeGm8QNTFXTo2D+8MYGDIJ/GDEs= github.com/opencontainers/runc v1.1.5/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= @@ -1194,6 +1206,8 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= +github.com/ory/dockertest/v3 v3.10.0 h1:4K3z2VMe8Woe++invjaTB7VRyQXQy5UY+loujO4aNE4= +github.com/ory/dockertest/v3 v3.10.0/go.mod h1:nr57ZbRWMqfsdGdFNLHz5jjNdDb7VVFnzAeW1n5N1Lg= github.com/oxyno-zeta/gomock-extra-matcher v1.1.0 h1:Yyk5ov0ZPKBXtVEeIWtc4J2XVrHuNoIK+0F2BUJgtsc= github.com/oxyno-zeta/gomock-extra-matcher v1.1.0/go.mod h1:UMGTHYEmJ1dRq8LDZ7VTAYO4nqM3GD1UGC3RJEUxEz0= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= @@ -1303,6 +1317,7 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -1352,7 +1367,6 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= @@ -1361,9 +1375,8 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= +github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= -github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= -github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= @@ -1399,6 +1412,12 @@ github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17 github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= +github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= +github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= @@ -1514,6 +1533,7 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91 golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= +golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1562,7 +1582,6 @@ golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -1693,7 +1712,6 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201207223542-d4d67f95c62d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1740,6 +1758,7 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1801,6 +1820,7 @@ golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1839,7 +1859,6 @@ golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82u golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -2106,10 +2125,12 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/tests/e2e/address.go b/tests/e2e/address.go index 09a8d2e986..33079aa8ce 100644 --- a/tests/e2e/address.go +++ b/tests/e2e/address.go @@ -1,34 +1,33 @@ package e2e -// -// import ( -// "fmt" -// "math/rand" -// "strconv" -// -// "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" -// crypto "github.com/cosmos/cosmos-sdk/crypto/types" -// sdk "github.com/cosmos/cosmos-sdk/types" -//) -// -//// HDPath generates an HD path based on the wallet index -// func HDPath(index int) string { -// return fmt.Sprintf("m/44'/118'/0'/0/%d", index) -//} -// -//// PubKey returns a sample account PubKey -// func PubKey() crypto.PubKey { -// seed := []byte(strconv.Itoa(rand.Int())) -// return ed25519.GenPrivKeyFromSecret(seed).PubKey() -//} -// -//// AccAddress returns a sample account address -// func AccAddress() sdk.AccAddress { -// addr := PubKey().Address() -// return sdk.AccAddress(addr) -//} -// -//// Address returns a sample string account address -// func Address() string { -// return AccAddress().String() -//} +import ( + "fmt" + "math/rand" + "strconv" + + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + crypto "github.com/cosmos/cosmos-sdk/crypto/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// HDPath generates an HD path based on the wallet index +func HDPath(index int) string { + return fmt.Sprintf("m/44'/118'/0'/0/%d", index) +} + +// PubKey returns a sample account PubKey +func PubKey() crypto.PubKey { + seed := []byte(strconv.Itoa(rand.Int())) + return ed25519.GenPrivKeyFromSecret(seed).PubKey() +} + +// AccAddress returns a sample account address +func AccAddress() sdk.AccAddress { + addr := PubKey().Address() + return sdk.AccAddress(addr) +} + +// Address returns a sample string account address +func Address() string { + return AccAddress().String() +} diff --git a/tests/e2e/chain.go b/tests/e2e/chain.go index b5ff7995c4..81706d36a5 100644 --- a/tests/e2e/chain.go +++ b/tests/e2e/chain.go @@ -1,124 +1,138 @@ package e2e -// import ( -// "fmt" -// "os" - -// "github.com/cosmos/cosmos-sdk/client" -// "github.com/cosmos/cosmos-sdk/codec" -// sdk "github.com/cosmos/cosmos-sdk/types" -// authvesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" -// evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" -// stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" -// tmrand "github.com/tendermint/tendermint/libs/rand" - -// gaia "github.com/cosmos/gaia/v11/app" -// "github.com/cosmos/gaia/v11/app/params" -// ) - -// const ( -// keyringPassphrase = "testpassphrase" -// keyringAppName = "testnet" -// ) - -// var ( -// encodingConfig params.EncodingConfig -// cdc codec.Codec -// txConfig client.TxConfig -// ) - -// func init() { -// encodingConfig = gaia.MakeTestEncodingConfig() -// authvesting.RegisterInterfaces(encodingConfig.InterfaceRegistry) -// stakingtypes.RegisterInterfaces(encodingConfig.InterfaceRegistry) -// evidencetypes.RegisterInterfaces(encodingConfig.InterfaceRegistry) -// cdc = encodingConfig.Codec -// txConfig = encodingConfig.TxConfig -// } - -// type chain struct { -// dataDir string -// id string -// validators []*validator -// accounts []*account //nolint:unused -// // initial accounts in genesis -// genesisAccounts []*account -// genesisVestingAccounts map[string]sdk.AccAddress -// } - -// func newChain() (*chain, error) { -// tmpDir, err := os.MkdirTemp("", "gaia-e2e-testnet-") -// if err != nil { -// return nil, err -// } - -// return &chain{ -// id: "chain-" + tmrand.Str(6), -// dataDir: tmpDir, -// }, nil -// } - -// func (c *chain) configDir() string { -// return fmt.Sprintf("%s/%s", c.dataDir, c.id) -// } - -// func (c *chain) createAndInitValidators(count int) error { -// for i := 0; i < count; i++ { -// node := c.createValidator(i) - -// // generate genesis files -// if err := node.init(); err != nil { -// return err -// } - -// c.validators = append(c.validators, node) - -// // create keys -// if err := node.createKey("val"); err != nil { -// return err -// } -// if err := node.createNodeKey(); err != nil { -// return err -// } -// if err := node.createConsensusKey(); err != nil { -// return err -// } -// } - -// return nil -// } - -// func (c *chain) createAndInitValidatorsWithMnemonics(count int, mnemonics []string) error { //nolint:unused // this is called during e2e tests -// for i := 0; i < count; i++ { -// // create node -// node := c.createValidator(i) - -// // generate genesis files -// if err := node.init(); err != nil { -// return err -// } - -// c.validators = append(c.validators, node) - -// // create keys -// if err := node.createKeyFromMnemonic("val", mnemonics[i]); err != nil { -// return err -// } -// if err := node.createNodeKey(); err != nil { -// return err -// } -// if err := node.createConsensusKey(); err != nil { -// return err -// } -// } - -// return nil -// } - -// func (c *chain) createValidator(index int) *validator { -// return &validator{ -// chain: c, -// index: index, -// moniker: fmt.Sprintf("%s-gaia-%d", c.id, index), -// } -// } +import ( + "fmt" + "os" + + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + + tmrand "github.com/cometbft/cometbft/libs/rand" + "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" + 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" + govv1types "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + govv1beta1types "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + + gaiaparams "github.com/cosmos/gaia/v11/app/params" +) + +const ( + keyringPassphrase = "testpassphrase" + keyringAppName = "testnet" +) + +var ( + encodingConfig gaiaparams.EncodingConfig + cdc codec.Codec + txConfig client.TxConfig +) + +func init() { + encodingConfig = gaiaparams.MakeEncodingConfig() + authtypes.RegisterInterfaces(encodingConfig.InterfaceRegistry) + authvesting.RegisterInterfaces(encodingConfig.InterfaceRegistry) + stakingtypes.RegisterInterfaces(encodingConfig.InterfaceRegistry) + evidencetypes.RegisterInterfaces(encodingConfig.InterfaceRegistry) + cryptocodec.RegisterInterfaces(encodingConfig.InterfaceRegistry) + govv1types.RegisterInterfaces(encodingConfig.InterfaceRegistry) + govv1beta1types.RegisterInterfaces(encodingConfig.InterfaceRegistry) + + upgradetypes.RegisterInterfaces(encodingConfig.InterfaceRegistry) + distribtypes.RegisterInterfaces(encodingConfig.InterfaceRegistry) + + cdc = encodingConfig.Marshaler + txConfig = encodingConfig.TxConfig +} + +type chain struct { + dataDir string + id string + validators []*validator + accounts []*account //nolint:unused + // initial accounts in genesis + genesisAccounts []*account + genesisVestingAccounts map[string]sdk.AccAddress +} + +func newChain() (*chain, error) { + tmpDir, err := os.MkdirTemp("", "gaia-e2e-testnet-") + if err != nil { + return nil, err + } + + return &chain{ + id: "chain-" + tmrand.Str(6), + dataDir: tmpDir, + }, nil +} + +func (c *chain) configDir() string { + return fmt.Sprintf("%s/%s", c.dataDir, c.id) +} + +func (c *chain) createAndInitValidators(count int) error { + for i := 0; i < count; i++ { + node := c.createValidator(i) + + // generate genesis files + if err := node.init(); err != nil { + return err + } + + c.validators = append(c.validators, node) + + // create keys + if err := node.createKey("val"); err != nil { + return err + } + if err := node.createNodeKey(); err != nil { + return err + } + if err := node.createConsensusKey(); err != nil { + return err + } + } + + return nil +} + +func (c *chain) createAndInitValidatorsWithMnemonics(count int, mnemonics []string) error { //nolint:unused // this is called during e2e tests + for i := 0; i < count; i++ { + // create node + node := c.createValidator(i) + + // generate genesis files + if err := node.init(); err != nil { + return err + } + + c.validators = append(c.validators, node) + + // create keys + if err := node.createKeyFromMnemonic("val", mnemonics[i]); err != nil { + return err + } + if err := node.createNodeKey(); err != nil { + return err + } + if err := node.createConsensusKey(); err != nil { + return err + } + } + + return nil +} + +func (c *chain) createValidator(index int) *validator { + return &validator{ + chain: c, + index: index, + moniker: fmt.Sprintf("%s-gaia-%d", c.id, index), + } +} diff --git a/tests/e2e/docker/hermes.Dockerfile b/tests/e2e/docker/hermes.Dockerfile index 54795ef313..f6086acf86 100644 --- a/tests/e2e/docker/hermes.Dockerfile +++ b/tests/e2e/docker/hermes.Dockerfile @@ -1,4 +1,4 @@ -FROM informalsystems/hermes:1.3.0 AS hermes-builder +FROM informalsystems/hermes:1.4.0 AS hermes-builder FROM debian:buster-slim USER root diff --git a/tests/e2e/e2e_bank_test.go b/tests/e2e/e2e_bank_test.go index 4827b1b28a..bb9e7ffbc2 100644 --- a/tests/e2e/e2e_bank_test.go +++ b/tests/e2e/e2e_bank_test.go @@ -1,60 +1,59 @@ package e2e -// -// import ( -// "fmt" -// "time" -// -// sdk "github.com/cosmos/cosmos-sdk/types" -//) -// -// func (s *IntegrationTestSuite) testBankTokenTransfer() { -// s.Run("send_photon_between_accounts", func() { -// var err error -// senderAddress := s.chainA.validators[0].keyInfo.GetAddress() -// sender := senderAddress.String() -// -// recipientAddress := s.chainA.validators[1].keyInfo.GetAddress() -// recipient := recipientAddress.String() -// -// chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) -// -// var ( -// beforeSenderUAtomBalance sdk.Coin -// beforeRecipientUAtomBalance sdk.Coin -// ) -// -// s.Require().Eventually( -// func() bool { -// beforeSenderUAtomBalance, err = getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) -// s.Require().NoError(err) -// -// beforeRecipientUAtomBalance, err = getSpecificBalance(chainAAPIEndpoint, recipient, uatomDenom) -// s.Require().NoError(err) -// -// return beforeSenderUAtomBalance.IsValid() && beforeRecipientUAtomBalance.IsValid() -// }, -// 10*time.Second, -// 5*time.Second, -// ) -// -// s.execBankSend(s.chainA, 0, sender, recipient, tokenAmount.String(), standardFees.String(), false) -// -// s.Require().Eventually( -// func() bool { -// afterSenderUAtomBalance, err := getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) -// s.Require().NoError(err) -// -// afterRecipientUAtomBalance, err := getSpecificBalance(chainAAPIEndpoint, recipient, uatomDenom) -// s.Require().NoError(err) -// -// decremented := beforeSenderUAtomBalance.Sub(tokenAmount).Sub(standardFees).IsEqual(afterSenderUAtomBalance) -// incremented := beforeRecipientUAtomBalance.Add(tokenAmount).IsEqual(afterRecipientUAtomBalance) -// -// return decremented && incremented -// }, -// time.Minute, -// 5*time.Second, -// ) -// }) -//} +import ( + "fmt" + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (s *IntegrationTestSuite) testBankTokenTransfer() { + s.Run("send_photon_between_accounts", func() { + var err error + senderAddress, _ := s.chainA.validators[0].keyInfo.GetAddress() + sender := senderAddress.String() + + recipientAddress, _ := s.chainA.validators[1].keyInfo.GetAddress() + recipient := recipientAddress.String() + + chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) + + var ( + beforeSenderUAtomBalance sdk.Coin + beforeRecipientUAtomBalance sdk.Coin + ) + + s.Require().Eventually( + func() bool { + beforeSenderUAtomBalance, err = getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) + s.Require().NoError(err) + + beforeRecipientUAtomBalance, err = getSpecificBalance(chainAAPIEndpoint, recipient, uatomDenom) + s.Require().NoError(err) + + return beforeSenderUAtomBalance.IsValid() && beforeRecipientUAtomBalance.IsValid() + }, + 10*time.Second, + 5*time.Second, + ) + + s.execBankSend(s.chainA, 0, sender, recipient, tokenAmount.String(), standardFees.String(), false) + + s.Require().Eventually( + func() bool { + afterSenderUAtomBalance, err := getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) + s.Require().NoError(err) + + afterRecipientUAtomBalance, err := getSpecificBalance(chainAAPIEndpoint, recipient, uatomDenom) + s.Require().NoError(err) + + decremented := beforeSenderUAtomBalance.Sub(tokenAmount).Sub(standardFees).IsEqual(afterSenderUAtomBalance) + incremented := beforeRecipientUAtomBalance.Add(tokenAmount).IsEqual(afterRecipientUAtomBalance) + + return decremented && incremented + }, + time.Minute, + 5*time.Second, + ) + }) +} diff --git a/tests/e2e/e2e_distribution_test.go b/tests/e2e/e2e_distribution_test.go index ff1471e451..e00359c274 100644 --- a/tests/e2e/e2e_distribution_test.go +++ b/tests/e2e/e2e_distribution_test.go @@ -1,89 +1,88 @@ package e2e -// -// import ( -// "fmt" -// "time" -// -// sdk "github.com/cosmos/cosmos-sdk/types" -//) -// -// func (s *IntegrationTestSuite) testDistribution() { -// chainEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) -// -// validatorB := s.chainA.validators[1] -// validatorBAddr := validatorB.keyInfo.GetAddress() -// -// valOperAddressA := sdk.ValAddress(validatorBAddr).String() -// -// delegatorAddress := s.chainA.genesisAccounts[2].keyInfo.GetAddress().String() -// -// newWithdrawalAddress := s.chainA.genesisAccounts[3].keyInfo.GetAddress().String() -// fees := sdk.NewCoin(uatomDenom, sdk.NewInt(1000)) -// -// beforeBalance, err := getSpecificBalance(chainEndpoint, newWithdrawalAddress, uatomDenom) -// s.Require().NoError(err) -// if beforeBalance.IsNil() { -// beforeBalance = sdk.NewCoin(uatomDenom, sdk.NewInt(0)) -// } -// -// s.execSetWithdrawAddress(s.chainA, 0, fees.String(), delegatorAddress, newWithdrawalAddress, gaiaHomePath) -// -// // Verify -// s.Require().Eventually( -// func() bool { -// res, err := queryDelegatorWithdrawalAddress(chainEndpoint, delegatorAddress) -// s.Require().NoError(err) -// -// return res.WithdrawAddress == newWithdrawalAddress -// }, -// 10*time.Second, -// 5*time.Second, -// ) -// -// s.execWithdrawReward(s.chainA, 0, delegatorAddress, valOperAddressA, gaiaHomePath) -// s.Require().Eventually( -// func() bool { -// afterBalance, err := getSpecificBalance(chainEndpoint, newWithdrawalAddress, uatomDenom) -// s.Require().NoError(err) -// -// return afterBalance.IsGTE(beforeBalance) -// }, -// 10*time.Second, -// 5*time.Second, -// ) -//} -// -///* -// fundCommunityPool tests the funding of the community pool on behalf of the distribution module. -// Test Benchmarks: -// 1. Validation that balance of the distribution module account before funding -// 2. Execution funding the community pool -// 3. Verification that correct funds have been deposited to distribution module account -// */ -// func (s *IntegrationTestSuite) fundCommunityPool() { -// chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) -// sender := s.chainA.validators[0].keyInfo.GetAddress() -// -// beforeDistUatomBalance, _ := getSpecificBalance(chainAAPIEndpoint, distModuleAddress, tokenAmount.Denom) -// if beforeDistUatomBalance.IsNil() { -// // Set balance to 0 if previous balance does not exist -// beforeDistUatomBalance = sdk.NewInt64Coin(uatomDenom, 0) -// } -// -// s.execDistributionFundCommunityPool(s.chainA, 0, sender.String(), tokenAmount.String(), standardFees.String()) -// -// // there are still tokens being added to the community pool through block production rewards but they should be less than 500 tokens -// marginOfErrorForBlockReward := sdk.NewInt64Coin(uatomDenom, 500) -// -// s.Require().Eventually( -// func() bool { -// afterDistPhotonBalance, err := getSpecificBalance(chainAAPIEndpoint, distModuleAddress, tokenAmount.Denom) -// s.Require().NoErrorf(err, "Error getting balance: %s", afterDistPhotonBalance) -// -// return afterDistPhotonBalance.Sub(beforeDistUatomBalance.Add(tokenAmount.Add(standardFees))).IsLT(marginOfErrorForBlockReward) -// }, -// 15*time.Second, -// 5*time.Second, -// ) -//} +import ( + "fmt" + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (s *IntegrationTestSuite) testDistribution() { + chainEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) + + validatorB := s.chainA.validators[1] + validatorBAddr, _ := validatorB.keyInfo.GetAddress() + + valOperAddressA := sdk.ValAddress(validatorBAddr).String() + + delegatorAddress, _ := s.chainA.genesisAccounts[2].keyInfo.GetAddress() + + newWithdrawalAddress, _ := s.chainA.genesisAccounts[3].keyInfo.GetAddress() + fees := sdk.NewCoin(uatomDenom, sdk.NewInt(1000)) + + beforeBalance, err := getSpecificBalance(chainEndpoint, newWithdrawalAddress.String(), uatomDenom) + s.Require().NoError(err) + if beforeBalance.IsNil() { + beforeBalance = sdk.NewCoin(uatomDenom, sdk.NewInt(0)) + } + + s.execSetWithdrawAddress(s.chainA, 0, fees.String(), delegatorAddress.String(), newWithdrawalAddress.String(), gaiaHomePath) + + // Verify + s.Require().Eventually( + func() bool { + res, err := queryDelegatorWithdrawalAddress(chainEndpoint, delegatorAddress.String()) + s.Require().NoError(err) + + return res.WithdrawAddress == newWithdrawalAddress.String() + }, + 10*time.Second, + 5*time.Second, + ) + + s.execWithdrawReward(s.chainA, 0, delegatorAddress.String(), valOperAddressA, gaiaHomePath) + s.Require().Eventually( + func() bool { + afterBalance, err := getSpecificBalance(chainEndpoint, newWithdrawalAddress.String(), uatomDenom) + s.Require().NoError(err) + + return afterBalance.IsGTE(beforeBalance) + }, + 10*time.Second, + 5*time.Second, + ) +} + +/* +fundCommunityPool tests the funding of the community pool on behalf of the distribution module. +Test Benchmarks: +1. Validation that balance of the distribution module account before funding +2. Execution funding the community pool +3. Verification that correct funds have been deposited to distribution module account +*/ +func (s *IntegrationTestSuite) fundCommunityPool() { + chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) + sender, _ := s.chainA.validators[0].keyInfo.GetAddress() + + beforeDistUatomBalance, _ := getSpecificBalance(chainAAPIEndpoint, distModuleAddress, tokenAmount.Denom) + if beforeDistUatomBalance.IsNil() { + // Set balance to 0 if previous balance does not exist + beforeDistUatomBalance = sdk.NewInt64Coin(uatomDenom, 0) + } + + s.execDistributionFundCommunityPool(s.chainA, 0, sender.String(), tokenAmount.String(), standardFees.String()) + + // there are still tokens being added to the community pool through block production rewards but they should be less than 500 tokens + marginOfErrorForBlockReward := sdk.NewInt64Coin(uatomDenom, 500) + + s.Require().Eventually( + func() bool { + afterDistPhotonBalance, err := getSpecificBalance(chainAAPIEndpoint, distModuleAddress, tokenAmount.Denom) + s.Require().NoErrorf(err, "Error getting balance: %s", afterDistPhotonBalance) + + return afterDistPhotonBalance.Sub(beforeDistUatomBalance.Add(tokenAmount.Add(standardFees))).IsLT(marginOfErrorForBlockReward) + }, + 15*time.Second, + 5*time.Second, + ) +} diff --git a/tests/e2e/e2e_encode_test.go b/tests/e2e/e2e_encode_test.go index 89ac30c97e..073c6e2a11 100644 --- a/tests/e2e/e2e_encode_test.go +++ b/tests/e2e/e2e_encode_test.go @@ -1,51 +1,50 @@ package e2e -// -// import ( -// "encoding/base64" -// "path/filepath" -// -// sdk "github.com/cosmos/cosmos-sdk/types" -//) -// -// const ( -// rawTxFile = "tx_raw.json" -//) -// -// func (s *IntegrationTestSuite) testEncode() { -// chain := s.chainA -// _, encoded, err := buildRawTx() -// s.Require().NoError(err) -// -// got := s.execEncode(chain, filepath.Join(gaiaHomePath, rawTxFile)) -// s.T().Logf("encoded tx: %s", got) -// s.Require().Equal(encoded, got) -//} -// -// func (s *IntegrationTestSuite) testDecode() { -// chain := s.chainA -// rawTx, encoded, err := buildRawTx() -// s.Require().NoError(err) -// -// got := s.execDecode(chain, encoded) -// s.T().Logf("raw tx: %s", got) -// s.Require().Equal(string(rawTx), got) -//} -// -//// buildRawTx build a dummy tx using the TxBuilder and -//// return the JSON and encoded tx's -// func buildRawTx() ([]byte, string, error) { -// builder := txConfig.NewTxBuilder() -// builder.SetGasLimit(gas) -// builder.SetFeeAmount(sdk.NewCoins(standardFees)) -// builder.SetMemo("foomemo") -// tx, err := txConfig.TxJSONEncoder()(builder.GetTx()) -// if err != nil { -// return nil, "", err -// } -// txBytes, err := txConfig.TxEncoder()(builder.GetTx()) -// if err != nil { -// return nil, "", err -// } -// return tx, base64.StdEncoding.EncodeToString(txBytes), err -//} +import ( + "encoding/base64" + "path/filepath" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +const ( + rawTxFile = "tx_raw.json" +) + +func (s *IntegrationTestSuite) testEncode() { + chain := s.chainA + _, encoded, err := buildRawTx() + s.Require().NoError(err) + + got := s.execEncode(chain, filepath.Join(gaiaHomePath, rawTxFile)) + s.T().Logf("encoded tx: %s", got) + s.Require().Equal(encoded, got) +} + +func (s *IntegrationTestSuite) testDecode() { + chain := s.chainA + rawTx, encoded, err := buildRawTx() + s.Require().NoError(err) + + got := s.execDecode(chain, encoded) + s.T().Logf("raw tx: %s", got) + s.Require().Equal(string(rawTx), got) +} + +// buildRawTx build a dummy tx using the TxBuilder and +// return the JSON and encoded tx's +func buildRawTx() ([]byte, string, error) { + builder := txConfig.NewTxBuilder() + builder.SetGasLimit(gas) + builder.SetFeeAmount(sdk.NewCoins(standardFees)) + builder.SetMemo("foomemo") + tx, err := txConfig.TxJSONEncoder()(builder.GetTx()) + if err != nil { + return nil, "", err + } + txBytes, err := txConfig.TxEncoder()(builder.GetTx()) + if err != nil { + return nil, "", err + } + return tx, base64.StdEncoding.EncodeToString(txBytes), err +} diff --git a/tests/e2e/e2e_evidence_test.go b/tests/e2e/e2e_evidence_test.go index e026c5e5b9..9f49fc278e 100644 --- a/tests/e2e/e2e_evidence_test.go +++ b/tests/e2e/e2e_evidence_test.go @@ -1,54 +1,53 @@ package e2e -// -// import ( -// "context" -// "fmt" -// "time" -// -// "github.com/cosmos/cosmos-sdk/x/evidence/exported" -// evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" -//) -// -// func (s *IntegrationTestSuite) testEvidence() { -// s.Run("test evidence queries", func() { -// var ( -// valIdx = 0 -// chain = s.chainA -// chainAPI = fmt.Sprintf("http://%s", s.valResources[chain.id][valIdx].GetHostPort("1317/tcp")) -// ) -// res, err := queryAllEvidence(chainAPI) -// s.Require().NoError(err) -// s.Require().Equal(numberOfEvidences, len(res.Evidence)) -// for _, evidence := range res.Evidence { -// var exportedEvidence exported.Evidence -// err := cdc.UnpackAny(evidence, &exportedEvidence) -// s.Require().NoError(err) -// eq, ok := exportedEvidence.(*evidencetypes.Equivocation) -// s.Require().True(ok) -// s.execQueryEvidence(chain, valIdx, eq.Hash().String()) -// } -// }) -//} -// -// func (s *IntegrationTestSuite) execQueryEvidence(c *chain, valIdx int, hash string) (res evidencetypes.Equivocation) { -// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) -// defer cancel() -// -// s.T().Logf("querying evidence %s on chain %s", hash, c.id) -// -// gaiaCommand := []string{ -// gaiadBinary, -// queryCommand, -// evidencetypes.ModuleName, -// hash, -// } -// -// s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, func(stdOut []byte, stdErr []byte) bool { -// // TODO parse evidence after fix the SDK -// // https://github.com/cosmos/cosmos-sdk/issues/13444 -// // s.Require().NoError(yaml.Unmarshal(stdOut, &res)) -// return true -// }) -// return res -//} +import ( + "context" + "fmt" + "time" + + "github.com/cosmos/cosmos-sdk/x/evidence/exported" + evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" +) + +func (s *IntegrationTestSuite) testEvidence() { + s.Run("test evidence queries", func() { + var ( + valIdx = 0 + chain = s.chainA + chainAPI = fmt.Sprintf("http://%s", s.valResources[chain.id][valIdx].GetHostPort("1317/tcp")) + ) + res, err := queryAllEvidence(chainAPI) + s.Require().NoError(err) + s.Require().Equal(numberOfEvidences, len(res.Evidence)) + for _, evidence := range res.Evidence { + var exportedEvidence exported.Evidence + err := cdc.UnpackAny(evidence, &exportedEvidence) + s.Require().NoError(err) + eq, ok := exportedEvidence.(*evidencetypes.Equivocation) + s.Require().True(ok) + s.execQueryEvidence(chain, valIdx, eq.Hash().String()) + } + }) +} + +func (s *IntegrationTestSuite) execQueryEvidence(c *chain, valIdx int, hash string) (res evidencetypes.Equivocation) { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("querying evidence %s on chain %s", hash, c.id) + + gaiaCommand := []string{ + gaiadBinary, + queryCommand, + evidencetypes.ModuleName, + hash, + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, func(stdOut []byte, stdErr []byte) bool { + // TODO parse evidence after fix the SDK + // https://github.com/cosmos/cosmos-sdk/issues/13444 + // s.Require().NoError(yaml.Unmarshal(stdOut, &res)) + return true + }) + return res +} diff --git a/tests/e2e/e2e_exec_test.go b/tests/e2e/e2e_exec_test.go index 4910753ef0..da499a8702 100644 --- a/tests/e2e/e2e_exec_test.go +++ b/tests/e2e/e2e_exec_test.go @@ -1,283 +1,288 @@ package e2e -// import ( -// "bytes" -// "context" -// "encoding/json" -// "fmt" -// "strconv" -// "strings" -// "time" - -// "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 ( -// flagFrom = "from" -// flagHome = "home" -// flagFees = "fees" -// flagGas = "gas" -// flagOutput = "output" -// flagChainID = "chain-id" -// flagSpendLimit = "spend-limit" -// flagGasAdjustment = "gas-adjustment" -// flagFeeAccount = "fee-account" -// flagBroadcastMode = "broadcast-mode" -// flagKeyringBackend = "keyring-backend" -// flagAllowedMessages = "allowed-messages" -// ) - -// type flagOption func(map[string]interface{}) - -// // withKeyValue add a new flag to command -// func withKeyValue(key string, value interface{}) flagOption { -// return func(o map[string]interface{}) { -// o[key] = value -// } -// } - -// func applyOptions(chainID string, options []flagOption) map[string]interface{} { -// opts := map[string]interface{}{ -// flagKeyringBackend: "test", -// flagOutput: "json", -// flagGas: "auto", -// flagFrom: "alice", -// flagBroadcastMode: "sync", -// flagGasAdjustment: "1.5", -// flagChainID: chainID, -// flagHome: gaiaHomePath, -// flagFees: standardFees.String(), -// } -// for _, apply := range options { -// apply(opts) -// } -// return opts -// } - -// func (s *IntegrationTestSuite) execEncode( -// c *chain, -// txPath string, -// opt ...flagOption, -// ) string { -// opts := applyOptions(c.id, opt) -// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) -// defer cancel() - -// s.T().Logf("%s - Executing gaiad encoding with %v", c.id, txPath) -// gaiaCommand := []string{ -// gaiadBinary, -// txCommand, -// "encode", -// txPath, -// } -// for flag, value := range opts { -// gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) -// } - -// var encoded string -// s.executeGaiaTxCommand(ctx, c, gaiaCommand, 0, func(stdOut []byte, stdErr []byte) bool { -// if stdErr != nil { -// return false -// } -// encoded = strings.TrimSuffix(string(stdOut), "\n") -// return true -// }) -// s.T().Logf("successfully encode with %v", txPath) -// return encoded -// } - -// func (s *IntegrationTestSuite) execDecode( -// c *chain, -// txPath string, -// opt ...flagOption, -// ) string { -// opts := applyOptions(c.id, opt) -// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) -// defer cancel() - -// s.T().Logf("%s - Executing gaiad decoding with %v", c.id, txPath) -// gaiaCommand := []string{ -// gaiadBinary, -// txCommand, -// "decode", -// txPath, -// } -// for flag, value := range opts { -// gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) -// } - -// var decoded string -// s.executeGaiaTxCommand(ctx, c, gaiaCommand, 0, func(stdOut []byte, stdErr []byte) bool { -// if stdErr != nil { -// return false -// } -// decoded = strings.TrimSuffix(string(stdOut), "\n") -// return true -// }) -// s.T().Logf("successfully decode %v", txPath) -// return decoded -// } - -// func (s *IntegrationTestSuite) execVestingTx( -// c *chain, -// method string, -// args []string, -// opt ...flagOption, -// ) { -// opts := applyOptions(c.id, opt) -// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) -// defer cancel() - -// s.T().Logf("%s - Executing gaiad %s with %v", c.id, method, args) -// gaiaCommand := []string{ -// gaiadBinary, -// txCommand, -// vestingtypes.ModuleName, -// method, -// "-y", -// } -// gaiaCommand = append(gaiaCommand, args...) - -// for flag, value := range opts { -// gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) -// } - -// s.executeGaiaTxCommand(ctx, c, gaiaCommand, 0, s.defaultExecValidation(c, 0)) -// s.T().Logf("successfully %s with %v", method, args) -// } - -// func (s *IntegrationTestSuite) execCreatePeriodicVestingAccount( -// c *chain, -// address, -// jsonPath string, -// opt ...flagOption, -// ) { -// s.T().Logf("Executing gaiad create periodic vesting account %s", c.id) -// s.execVestingTx(c, "create-periodic-vesting-account", []string{address, jsonPath}, opt...) -// s.T().Logf("successfully created periodic vesting account %s with %s", address, jsonPath) -// } - -// func (s *IntegrationTestSuite) execUnjail( -// c *chain, -// opt ...flagOption, -// ) { -// opts := applyOptions(c.id, opt) -// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) -// defer cancel() - -// s.T().Logf("Executing gaiad slashing unjail %s with options: %v", c.id, opt) -// gaiaCommand := []string{ -// gaiadBinary, -// txCommand, -// slashingtypes.ModuleName, -// "unjail", -// "-y", -// } - -// for flag, value := range opts { -// gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) -// } - -// s.executeGaiaTxCommand(ctx, c, gaiaCommand, 0, s.defaultExecValidation(c, 0)) -// s.T().Logf("successfully unjail with options %v", opt) -// } - -// func (s *IntegrationTestSuite) execFeeGrant(c *chain, valIdx int, granter, grantee, spendLimit string, opt ...flagOption) { -// opt = append(opt, withKeyValue(flagFrom, granter)) -// opt = append(opt, withKeyValue(flagSpendLimit, spendLimit)) -// opts := applyOptions(c.id, opt) - -// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) -// defer cancel() - -// s.T().Logf("granting %s fee from %s on chain %s", grantee, granter, c.id) - -// gaiaCommand := []string{ -// gaiadBinary, -// txCommand, -// feegrant.ModuleName, -// "grant", -// granter, -// grantee, -// "-y", -// } -// for flag, value := range opts { -// gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) -// } - -// s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) -// } - -// func (s *IntegrationTestSuite) execFeeGrantRevoke(c *chain, valIdx int, granter, grantee string, opt ...flagOption) { -// opt = append(opt, withKeyValue(flagFrom, granter)) -// opts := applyOptions(c.id, opt) - -// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) -// defer cancel() - -// s.T().Logf("revoking %s fee grant from %s on chain %s", grantee, granter, c.id) - -// gaiaCommand := []string{ -// gaiadBinary, -// txCommand, -// feegrant.ModuleName, -// "revoke", -// granter, -// grantee, -// "-y", -// } -// for flag, value := range opts { -// gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) -// } - -// s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) -// } - -// func (s *IntegrationTestSuite) execBankSend( -// c *chain, -// valIdx int, -// from, -// to, -// amt, -// fees string, -// expectErr bool, -// opt ...flagOption, -// ) { -// // TODO remove the hardcode opt after refactor, all methods should accept custom flags -// opt = append(opt, withKeyValue(flagFees, fees)) -// opt = append(opt, withKeyValue(flagFrom, from)) -// opts := applyOptions(c.id, opt) - -// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) -// defer cancel() - -// s.T().Logf("sending %s tokens from %s to %s on chain %s", amt, from, to, c.id) - -// gaiaCommand := []string{ -// gaiadBinary, -// txCommand, -// banktypes.ModuleName, -// "send", -// from, -// to, -// amt, -// "-y", -// } -// for flag, value := range opts { -// gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) -// } - -// s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.expectErrExecValidation(c, valIdx, expectErr)) -// } +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "strconv" + "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/cosmos/cosmos-sdk/client/flags" + sdk "github.com/cosmos/cosmos-sdk/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/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 ( + flagFrom = "from" + flagHome = "home" + flagFees = "fees" + flagGas = "gas" + flagOutput = "output" + flagChainID = "chain-id" + flagSpendLimit = "spend-limit" + flagGasAdjustment = "gas-adjustment" + flagFeeGranter = "fee-granter" + flagBroadcastMode = "broadcast-mode" + flagKeyringBackend = "keyring-backend" + flagAllowedMessages = "allowed-messages" +) + +type flagOption func(map[string]interface{}) + +// withKeyValue add a new flag to command + +func withKeyValue(key string, value interface{}) flagOption { + return func(o map[string]interface{}) { + o[key] = value + } +} + +func applyOptions(chainID string, options []flagOption) map[string]interface{} { + opts := map[string]interface{}{ + flagKeyringBackend: "test", + flagOutput: "json", + flagGas: "auto", + flagFrom: "alice", + flagBroadcastMode: "sync", + flagGasAdjustment: "1.5", + flagChainID: chainID, + flagHome: gaiaHomePath, + flagFees: standardFees.String(), + } + for _, apply := range options { + apply(opts) + } + return opts +} + +func (s *IntegrationTestSuite) execEncode( + c *chain, + txPath string, + opt ...flagOption, +) string { + opts := applyOptions(c.id, opt) + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("%s - Executing gaiad encoding with %v", c.id, txPath) + gaiaCommand := []string{ + gaiadBinary, + txCommand, + "encode", + txPath, + } + for flag, value := range opts { + gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) + } + + var encoded string + s.executeGaiaTxCommand(ctx, c, gaiaCommand, 0, func(stdOut []byte, stdErr []byte) bool { + if stdErr != nil { + return false + } + encoded = strings.TrimSuffix(string(stdOut), "\n") + return true + }) + s.T().Logf("successfully encode with %v", txPath) + return encoded +} + +func (s *IntegrationTestSuite) execDecode( + c *chain, + txPath string, + opt ...flagOption, +) string { + opts := applyOptions(c.id, opt) + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("%s - Executing gaiad decoding with %v", c.id, txPath) + gaiaCommand := []string{ + gaiadBinary, + txCommand, + "decode", + txPath, + } + for flag, value := range opts { + gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) + } + + var decoded string + s.executeGaiaTxCommand(ctx, c, gaiaCommand, 0, func(stdOut []byte, stdErr []byte) bool { + if stdErr != nil { + return false + } + decoded = strings.TrimSuffix(string(stdOut), "\n") + return true + }) + s.T().Logf("successfully decode %v", txPath) + return decoded +} + +func (s *IntegrationTestSuite) execVestingTx( //nolint:unused + + c *chain, + method string, + args []string, + opt ...flagOption, +) { + opts := applyOptions(c.id, opt) + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("%s - Executing gaiad %s with %v", c.id, method, args) + gaiaCommand := []string{ + gaiadBinary, + txCommand, + vestingtypes.ModuleName, + method, + "-y", + } + gaiaCommand = append(gaiaCommand, args...) + + for flag, value := range opts { + gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, 0, s.defaultExecValidation(c, 0)) + s.T().Logf("successfully %s with %v", method, args) +} + +func (s *IntegrationTestSuite) execCreatePeriodicVestingAccount( //nolint:unused + + c *chain, + address, + jsonPath string, + opt ...flagOption, +) { + s.T().Logf("Executing gaiad create periodic vesting account %s", c.id) + s.execVestingTx(c, "create-periodic-vesting-account", []string{address, jsonPath}, opt...) + s.T().Logf("successfully created periodic vesting account %s with %s", address, jsonPath) +} + +func (s *IntegrationTestSuite) execUnjail( + c *chain, + opt ...flagOption, +) { + opts := applyOptions(c.id, opt) + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("Executing gaiad slashing unjail %s with options: %v", c.id, opt) + gaiaCommand := []string{ + gaiadBinary, + txCommand, + slashingtypes.ModuleName, + "unjail", + "-y", + } + + for flag, value := range opts { + gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, 0, s.defaultExecValidation(c, 0)) + s.T().Logf("successfully unjail with options %v", opt) +} + +func (s *IntegrationTestSuite) execFeeGrant(c *chain, valIdx int, granter, grantee, spendLimit string, opt ...flagOption) { + opt = append(opt, withKeyValue(flagFrom, granter)) + opt = append(opt, withKeyValue(flagSpendLimit, spendLimit)) + opts := applyOptions(c.id, opt) + + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("granting %s fee from %s on chain %s", grantee, granter, c.id) + + gaiaCommand := []string{ + gaiadBinary, + txCommand, + feegrant.ModuleName, + "grant", + granter, + grantee, + "-y", + } + for flag, value := range opts { + gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) +} + +func (s *IntegrationTestSuite) execFeeGrantRevoke(c *chain, valIdx int, granter, grantee string, opt ...flagOption) { + opt = append(opt, withKeyValue(flagFrom, granter)) + opts := applyOptions(c.id, opt) + + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("revoking %s fee grant from %s on chain %s", grantee, granter, c.id) + + gaiaCommand := []string{ + gaiadBinary, + txCommand, + feegrant.ModuleName, + "revoke", + granter, + grantee, + "-y", + } + for flag, value := range opts { + gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) +} + +func (s *IntegrationTestSuite) execBankSend( + c *chain, + valIdx int, + from, + to, + amt, + fees string, + expectErr bool, + opt ...flagOption, +) { + // TODO remove the hardcode opt after refactor, all methods should accept custom flags + opt = append(opt, withKeyValue(flagFees, fees)) + opt = append(opt, withKeyValue(flagFrom, from)) + opts := applyOptions(c.id, opt) + + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("sending %s tokens from %s to %s on chain %s", amt, from, to, c.id) + + gaiaCommand := []string{ + gaiadBinary, + txCommand, + banktypes.ModuleName, + "send", + from, + to, + amt, + "-y", + } + for flag, value := range opts { + gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.expectErrExecValidation(c, valIdx, expectErr)) +} // type txBankSend struct { // from string @@ -289,97 +294,98 @@ package e2e // } // func (s *IntegrationTestSuite) execBankSendBatch( -// c *chain, -// valIdx int, //nolint:unparam -// txs ...txBankSend, -// ) int { -// sucessBankSendCount := 0 - -// for i := range txs { -// s.T().Logf(txs[i].log) - -// s.execBankSend(c, valIdx, txs[i].from, txs[i].to, txs[i].amt, txs[i].fees, txs[i].expectErr) -// if !txs[i].expectErr { -// if !txs[i].expectErr { -// sucessBankSendCount++ -// } -// } -// } - -// return sucessBankSendCount -// } - -// func (s *IntegrationTestSuite) execWithdrawAllRewards(c *chain, valIdx int, payee, fees string, expectErr bool) { -// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) -// defer cancel() - -// gaiaCommand := []string{ -// gaiadBinary, -// txCommand, -// distributiontypes.ModuleName, -// "withdraw-all-rewards", -// fmt.Sprintf("--%s=%s", flags.FlagFrom, payee), -// fmt.Sprintf("--%s=%s", flags.FlagGasPrices, fees), -// fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), -// "--keyring-backend=test", -// "--output=json", -// "-y", -// } - -// s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.expectErrExecValidation(c, valIdx, expectErr)) -// } - -// func (s *IntegrationTestSuite) execDistributionFundCommunityPool(c *chain, valIdx int, from, amt, fees string) { -// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) -// defer cancel() - -// s.T().Logf("Executing gaiad tx distribution fund-community-pool on chain %s", c.id) - -// gaiaCommand := []string{ -// gaiadBinary, -// txCommand, -// distributiontypes.ModuleName, -// "fund-community-pool", -// amt, -// fmt.Sprintf("--%s=%s", flags.FlagFrom, from), -// fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), -// fmt.Sprintf("--%s=%s", flags.FlagFees, fees), -// "--keyring-backend=test", -// "--output=json", -// "-y", -// } - -// s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) -// s.T().Logf("Successfully funded community pool") -// } - -// func (s *IntegrationTestSuite) runGovExec(c *chain, valIdx int, submitterAddr, govCommand string, proposalFlags []string, fees string) { -// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) -// defer cancel() - -// gaiaCommand := []string{ -// gaiadBinary, -// txCommand, -// govtypes.ModuleName, -// govCommand, -// } - -// generalFlags := []string{ -// fmt.Sprintf("--%s=%s", flags.FlagFrom, submitterAddr), -// fmt.Sprintf("--%s=%s", flags.FlagGas, "300000"), // default 200000 isn't enough -// fmt.Sprintf("--%s=%s", flags.FlagGasPrices, fees), -// fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), -// "--keyring-backend=test", -// "--output=json", -// "-y", -// } - -// gaiaCommand = concatFlags(gaiaCommand, proposalFlags, generalFlags) - -// s.T().Logf("Executing gaiad tx gov %s on chain %s", govCommand, c.id) -// s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) -// s.T().Logf("Successfully executed %s", govCommand) -// } +// +// c *chain, +// valIdx int, //nolint:unparam +// txs ...txBankSend, +// +// ) int { +// sucessBankSendCount := 0 +// +// for i := range txs { +// s.T().Logf(txs[i].log) +// +// s.execBankSend(c, valIdx, txs[i].from, txs[i].to, txs[i].amt, txs[i].fees, txs[i].expectErr) +// if !txs[i].expectErr { +// if !txs[i].expectErr { +// sucessBankSendCount++ +// } +// } +// } +// +// return sucessBankSendCount +// } +// +// func (s *IntegrationTestSuite) execWithdrawAllRewards(c *chain, valIdx int, payee, fees string, expectErr bool) { +// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) +// defer cancel() +// +// gaiaCommand := []string{ +// gaiadBinary, +// txCommand, +// distributiontypes.ModuleName, +// "withdraw-all-rewards", +// fmt.Sprintf("--%s=%s", flags.FlagFrom, payee), +// fmt.Sprintf("--%s=%s", flags.FlagGasPrices, fees), +// fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), +// "--keyring-backend=test", +// "--output=json", +// "-y", +// } +// +// s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.expectErrExecValidation(c, valIdx, expectErr)) +// } +func (s *IntegrationTestSuite) execDistributionFundCommunityPool(c *chain, valIdx int, from, amt, fees string) { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("Executing gaiad tx distribution fund-community-pool on chain %s", c.id) + + gaiaCommand := []string{ + gaiadBinary, + txCommand, + distributiontypes.ModuleName, + "fund-community-pool", + amt, + fmt.Sprintf("--%s=%s", flags.FlagFrom, from), + fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), + fmt.Sprintf("--%s=%s", flags.FlagFees, fees), + "--keyring-backend=test", + "--output=json", + "-y", + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) + s.T().Logf("Successfully funded community pool") +} + +func (s *IntegrationTestSuite) runGovExec(c *chain, valIdx int, submitterAddr, govCommand string, proposalFlags []string, fees string) { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + gaiaCommand := []string{ + gaiadBinary, + txCommand, + govtypes.ModuleName, + govCommand, + } + + generalFlags := []string{ + fmt.Sprintf("--%s=%s", flags.FlagFrom, submitterAddr), + fmt.Sprintf("--%s=%s", flags.FlagGas, "300000"), // default 200000 isn't enough + fmt.Sprintf("--%s=%s", flags.FlagGasPrices, fees), + fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), + "--keyring-backend=test", + "--output=json", + "-y", + } + + gaiaCommand = concatFlags(gaiaCommand, proposalFlags, generalFlags) + + s.T().Logf("Executing gaiad tx gov %s on chain %s", govCommand, c.id) + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) + s.T().Logf("Successfully executed %s", govCommand) +} // func (s *IntegrationTestSuite) executeGKeysAddCommand(c *chain, valIdx int, name string, home string) string { // ctx, cancel := context.WithTimeout(context.Background(), time.Minute) @@ -424,86 +430,88 @@ package e2e // }) // } -// func (s *IntegrationTestSuite) executeDelegate(c *chain, valIdx int, amount, valOperAddress, delegatorAddr, home, delegateFees string) { //nolint:unparam -// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) -// defer cancel() - -// s.T().Logf("Executing gaiad tx staking delegate %s", c.id) - -// gaiaCommand := []string{ -// gaiadBinary, -// txCommand, -// stakingtypes.ModuleName, -// "delegate", -// valOperAddress, -// amount, -// fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddr), -// fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), -// fmt.Sprintf("--%s=%s", flags.FlagGasPrices, delegateFees), -// "--keyring-backend=test", -// fmt.Sprintf("--%s=%s", flags.FlagHome, home), -// "--output=json", -// "-y", -// } - -// s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) -// s.T().Logf("%s successfully delegated %s to %s", delegatorAddr, amount, valOperAddress) -// } - -// func (s *IntegrationTestSuite) executeRedelegate(c *chain, valIdx int, amount, originalValOperAddress, -// newValOperAddress, delegatorAddr, home, delegateFees string, -// ) { -// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) -// defer cancel() - -// s.T().Logf("Executing gaiad tx staking redelegate %s", c.id) - -// gaiaCommand := []string{ -// gaiadBinary, -// txCommand, -// stakingtypes.ModuleName, -// "redelegate", -// originalValOperAddress, -// newValOperAddress, -// amount, -// fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddr), -// fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), -// fmt.Sprintf("--%s=%s", flags.FlagGas, "300000"), // default 200000 isn't enough -// fmt.Sprintf("--%s=%s", flags.FlagGasPrices, delegateFees), -// "--keyring-backend=test", -// fmt.Sprintf("--%s=%s", flags.FlagHome, home), -// "--output=json", -// "-y", -// } - -// s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) -// s.T().Logf("%s successfully redelegated %s from %s to %s", delegatorAddr, amount, originalValOperAddress, newValOperAddress) -// } - -// func (s *IntegrationTestSuite) getLatestBlockHeight(c *chain, valIdx int) int { -// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) -// defer cancel() - -// type syncInfo struct { -// SyncInfo struct { -// LatestHeight string `json:"latest_block_height"` -// } `json:"SyncInfo"` -// } - -// var currentHeight int -// gaiaCommand := []string{gaiadBinary, "status"} -// s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, func(stdOut []byte, stdErr []byte) bool { -// var ( -// err error -// block syncInfo -// ) -// s.Require().NoError(json.Unmarshal(stdErr, &block)) -// currentHeight, err = strconv.Atoi(block.SyncInfo.LatestHeight) -// s.Require().NoError(err) -// return currentHeight > 0 -// }) -// return currentHeight -// } +func (s *IntegrationTestSuite) executeDelegate(c *chain, valIdx int, amount, valOperAddress, delegatorAddr, home, delegateFees string) { //nolint:unparam + + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("Executing gaiad tx staking delegate %s", c.id) + + gaiaCommand := []string{ + gaiadBinary, + txCommand, + stakingtypes.ModuleName, + "delegate", + valOperAddress, + amount, + fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddr), + fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), + fmt.Sprintf("--%s=%s", flags.FlagGasPrices, delegateFees), + "--keyring-backend=test", + fmt.Sprintf("--%s=%s", flags.FlagHome, home), + "--output=json", + "-y", + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) + s.T().Logf("%s successfully delegated %s to %s", delegatorAddr, amount, valOperAddress) +} + +func (s *IntegrationTestSuite) executeRedelegate(c *chain, valIdx int, amount, originalValOperAddress, + + newValOperAddress, delegatorAddr, home, delegateFees string, +) { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("Executing gaiad tx staking redelegate %s", c.id) + + gaiaCommand := []string{ + gaiadBinary, + txCommand, + stakingtypes.ModuleName, + "redelegate", + originalValOperAddress, + newValOperAddress, + amount, + fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddr), + fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), + fmt.Sprintf("--%s=%s", flags.FlagGas, "300000"), // default 200000 isn't enough + fmt.Sprintf("--%s=%s", flags.FlagGasPrices, delegateFees), + "--keyring-backend=test", + fmt.Sprintf("--%s=%s", flags.FlagHome, home), + "--output=json", + "-y", + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) + s.T().Logf("%s successfully redelegated %s from %s to %s", delegatorAddr, amount, originalValOperAddress, newValOperAddress) +} + +func (s *IntegrationTestSuite) getLatestBlockHeight(c *chain, valIdx int) int { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + type syncInfo struct { + SyncInfo struct { + LatestHeight string `json:"latest_block_height"` + } `json:"SyncInfo"` + } + + var currentHeight int + gaiaCommand := []string{gaiadBinary, "status"} + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, func(stdOut []byte, stdErr []byte) bool { + var ( + err error + block syncInfo + ) + s.Require().NoError(json.Unmarshal(stdOut, &block)) + currentHeight, err = strconv.Atoi(block.SyncInfo.LatestHeight) + s.Require().NoError(err) + return currentHeight > 0 + }) + return currentHeight +} // func (s *IntegrationTestSuite) verifyBalanceChange(endpoint string, expectedAmount sdk.Coin, recipientAddress string) { // s.Require().Eventually( @@ -518,176 +526,147 @@ package e2e // ) // } -// func (s *IntegrationTestSuite) execSetWithdrawAddress( -// c *chain, -// valIdx int, -// fees, -// delegatorAddress, -// newWithdrawalAddress, -// homePath string, -// ) { -// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) -// defer cancel() - -// s.T().Logf("Setting distribution withdrawal address on chain %s for %s to %s", c.id, delegatorAddress, newWithdrawalAddress) -// gaiaCommand := []string{ -// gaiadBinary, -// txCommand, -// distributiontypes.ModuleName, -// "set-withdraw-addr", -// newWithdrawalAddress, -// fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddress), -// fmt.Sprintf("--%s=%s", flags.FlagFees, fees), -// fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), -// fmt.Sprintf("--%s=%s", flags.FlagHome, homePath), -// "--keyring-backend=test", -// "--output=json", -// "-y", -// } - -// s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) -// s.T().Logf("Successfully set new distribution withdrawal address for %s to %s", delegatorAddress, newWithdrawalAddress) -// } - -// func (s *IntegrationTestSuite) execWithdrawReward( -// c *chain, -// valIdx int, -// delegatorAddress, -// validatorAddress, -// homePath string, -// ) { -// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) -// defer cancel() - -// s.T().Logf("Withdrawing distribution rewards on chain %s for delegator %s from %s validator", c.id, delegatorAddress, validatorAddress) -// gaiaCommand := []string{ -// gaiadBinary, -// txCommand, -// distributiontypes.ModuleName, -// "withdraw-rewards", -// validatorAddress, -// fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddress), -// fmt.Sprintf("--%s=%s", flags.FlagGasPrices, "300uatom"), -// fmt.Sprintf("--%s=%s", flags.FlagGas, "auto"), -// fmt.Sprintf("--%s=%s", flags.FlagGasAdjustment, "1.5"), -// fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), -// fmt.Sprintf("--%s=%s", flags.FlagHome, homePath), -// "--keyring-backend=test", -// "--output=json", -// "-y", -// } - -// s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) -// s.T().Logf("Successfully withdrew distribution rewards for delegator %s from validator %s", delegatorAddress, validatorAddress) -// } - -// func (s *IntegrationTestSuite) executeGaiaTxCommand(ctx context.Context, c *chain, gaiaCommand []string, valIdx int, validation func([]byte, []byte) bool) { -// if validation == nil { -// validation = s.defaultExecValidation(s.chainA, 0) -// } -// var ( -// outBuf bytes.Buffer -// errBuf bytes.Buffer -// ) -// exec, err := s.dkrPool.Client.CreateExec(docker.CreateExecOptions{ -// Context: ctx, -// AttachStdout: true, -// AttachStderr: true, -// Container: s.valResources[c.id][valIdx].Container.ID, -// User: "nonroot", -// Cmd: gaiaCommand, -// }) -// s.Require().NoError(err) - -// err = s.dkrPool.Client.StartExec(exec.ID, docker.StartExecOptions{ -// Context: ctx, -// Detach: false, -// OutputStream: &outBuf, -// ErrorStream: &errBuf, -// }) -// s.Require().NoError(err) - -// stdOut := outBuf.Bytes() -// stdErr := errBuf.Bytes() - -// if !validation(stdOut, stdErr) { -// s.Require().FailNowf("Exec validation failed", "stdout: %s, stderr: %s", -// string(stdOut), string(stdErr)) -// } -// } - -// func (s *IntegrationTestSuite) executeHermesCommand(ctx context.Context, hermesCmd []string) ([]byte, []byte) { -// var ( -// outBuf bytes.Buffer -// errBuf bytes.Buffer -// ) -// exec, err := s.dkrPool.Client.CreateExec(docker.CreateExecOptions{ -// Context: ctx, -// AttachStdout: true, -// AttachStderr: true, -// Container: s.hermesResource1.Container.ID, -// User: "root", -// Cmd: hermesCmd, -// }) -// s.Require().NoError(err) - -// err = s.dkrPool.Client.StartExec(exec.ID, docker.StartExecOptions{ -// Context: ctx, -// Detach: false, -// OutputStream: &outBuf, -// ErrorStream: &errBuf, -// }) -// s.Require().NoError(err) - -// stdOut := outBuf.Bytes() -// stdErr := errBuf.Bytes() - -// return stdOut, stdErr -// } - -// func (s *IntegrationTestSuite) expectErrExecValidation(chain *chain, valIdx int, expectErr bool) func([]byte, []byte) bool { -// return func(stdOut []byte, stdErr []byte) bool { -// var txResp sdk.TxResponse -// gotErr := cdc.UnmarshalJSON(stdOut, &txResp) != nil -// if gotErr { -// s.Require().True(expectErr) -// } - -// endpoint := fmt.Sprintf("http://%s", s.valResources[chain.id][valIdx].GetHostPort("1317/tcp")) -// // wait for the tx to be committed on chain -// s.Require().Eventuallyf( -// func() bool { -// gotErr := queryGaiaTx(endpoint, txResp.TxHash) != nil -// return gotErr == expectErr -// }, -// time.Minute, -// 5*time.Second, -// "stdOut: %s, stdErr: %s", -// string(stdOut), string(stdErr), -// ) -// return true -// } -// } - -// func (s *IntegrationTestSuite) defaultExecValidation(chain *chain, valIdx int) func([]byte, []byte) bool { -// return func(stdOut []byte, stdErr []byte) bool { -// var txResp sdk.TxResponse -// if err := cdc.UnmarshalJSON(stdOut, &txResp); err != nil { -// return false -// } -// if strings.Contains(txResp.String(), "code: 0") || txResp.Code == 0 { -// endpoint := fmt.Sprintf("http://%s", s.valResources[chain.id][valIdx].GetHostPort("1317/tcp")) -// s.Require().Eventually( -// func() bool { -// return queryGaiaTx(endpoint, txResp.TxHash) == nil -// }, -// time.Minute, -// 5*time.Second, -// "stdOut: %s, stdErr: %s", -// string(stdOut), string(stdErr), -// ) -// return true -// } -// return false -// } -// } +func (s *IntegrationTestSuite) execSetWithdrawAddress( + c *chain, + valIdx int, + fees, + delegatorAddress, + newWithdrawalAddress, + homePath string, +) { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("Setting distribution withdrawal address on chain %s for %s to %s", c.id, delegatorAddress, newWithdrawalAddress) + gaiaCommand := []string{ + gaiadBinary, + txCommand, + distributiontypes.ModuleName, + "set-withdraw-addr", + newWithdrawalAddress, + fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddress), + fmt.Sprintf("--%s=%s", flags.FlagFees, fees), + fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), + fmt.Sprintf("--%s=%s", flags.FlagHome, homePath), + "--keyring-backend=test", + "--output=json", + "-y", + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) + s.T().Logf("Successfully set new distribution withdrawal address for %s to %s", delegatorAddress, newWithdrawalAddress) +} + +func (s *IntegrationTestSuite) execWithdrawReward( + c *chain, + valIdx int, + delegatorAddress, + validatorAddress, + homePath string, +) { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("Withdrawing distribution rewards on chain %s for delegator %s from %s validator", c.id, delegatorAddress, validatorAddress) + gaiaCommand := []string{ + gaiadBinary, + txCommand, + distributiontypes.ModuleName, + "withdraw-rewards", + validatorAddress, + fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddress), + fmt.Sprintf("--%s=%s", flags.FlagGasPrices, "300uatom"), + fmt.Sprintf("--%s=%s", flags.FlagGas, "auto"), + fmt.Sprintf("--%s=%s", flags.FlagGasAdjustment, "1.5"), + fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), + fmt.Sprintf("--%s=%s", flags.FlagHome, homePath), + "--keyring-backend=test", + "--output=json", + "-y", + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) + s.T().Logf("Successfully withdrew distribution rewards for delegator %s from validator %s", delegatorAddress, validatorAddress) +} + +func (s *IntegrationTestSuite) executeGaiaTxCommand(ctx context.Context, c *chain, gaiaCommand []string, valIdx int, validation func([]byte, []byte) bool) { + if validation == nil { + validation = s.defaultExecValidation(s.chainA, 0) + } + var ( + outBuf bytes.Buffer + errBuf bytes.Buffer + ) + exec, err := s.dkrPool.Client.CreateExec(docker.CreateExecOptions{ + Context: ctx, + AttachStdout: true, + AttachStderr: true, + Container: s.valResources[c.id][valIdx].Container.ID, + User: "nonroot", + Cmd: gaiaCommand, + }) + s.Require().NoError(err) + + err = s.dkrPool.Client.StartExec(exec.ID, docker.StartExecOptions{ + Context: ctx, + Detach: false, + OutputStream: &outBuf, + ErrorStream: &errBuf, + }) + s.Require().NoError(err) + + stdOut := outBuf.Bytes() + stdErr := errBuf.Bytes() + + if !validation(stdOut, stdErr) { + s.Require().FailNowf("Exec validation failed", "stdout: %s, stderr: %s", + string(stdOut), string(stdErr)) + } +} + +func (s *IntegrationTestSuite) expectErrExecValidation(chain *chain, valIdx int, expectErr bool) func([]byte, []byte) bool { + return func(stdOut []byte, stdErr []byte) bool { + var txResp sdk.TxResponse + gotErr := cdc.UnmarshalJSON(stdOut, &txResp) != nil + if gotErr { + s.Require().True(expectErr) + } + + endpoint := fmt.Sprintf("http://%s", s.valResources[chain.id][valIdx].GetHostPort("1317/tcp")) + // wait for the tx to be committed on chain + s.Require().Eventuallyf( + func() bool { + gotErr := queryGaiaTx(endpoint, txResp.TxHash) != nil + return gotErr == expectErr + }, + time.Minute, + 5*time.Second, + "stdOut: %s, stdErr: %s", + string(stdOut), string(stdErr), + ) + return true + } +} + +func (s *IntegrationTestSuite) defaultExecValidation(chain *chain, valIdx int) func([]byte, []byte) bool { + return func(stdOut []byte, stdErr []byte) bool { + var txResp sdk.TxResponse + if err := cdc.UnmarshalJSON(stdOut, &txResp); err != nil { + return false + } + if strings.Contains(txResp.String(), "code: 0") || txResp.Code == 0 { + endpoint := fmt.Sprintf("http://%s", s.valResources[chain.id][valIdx].GetHostPort("1317/tcp")) + s.Require().Eventually( + func() bool { + return queryGaiaTx(endpoint, txResp.TxHash) == nil + }, + time.Minute, + 5*time.Second, + "stdOut: %s, stdErr: %s", + string(stdOut), string(stdErr), + ) + return true + } + return false + } +} diff --git a/tests/e2e/e2e_feegrant_test.go b/tests/e2e/e2e_feegrant_test.go index 36750715b2..316cc4e562 100644 --- a/tests/e2e/e2e_feegrant_test.go +++ b/tests/e2e/e2e_feegrant_test.go @@ -1,14 +1,13 @@ package e2e -// -// import ( -// "fmt" -// -// sdk "github.com/cosmos/cosmos-sdk/types" -// banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" -//) -// -///* +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" +) + +// /* // TestFeeGrant creates a test to ensure that Alice can grant the fees for bob. // Test Benchmarks: // 1. Execute fee grant CLI command for Alice to pay bob fees @@ -16,90 +15,91 @@ package e2e // 3. Check the bob balances if the fee was not deducted // 4. Try to send a transaction from bob with Alice as a fee granter again. Should fail // because all amount granted was expended -// */ -// func (s *IntegrationTestSuite) testFeeGrant() { -// s.Run("test fee grant module", func() { -// var ( -// valIdx = 0 -// c = s.chainA -// api = fmt.Sprintf("http://%s", s.valResources[c.id][valIdx].GetHostPort("1317/tcp")) -// ) -// -// alice := c.genesisAccounts[1].keyInfo.GetAddress() -// bob := c.genesisAccounts[2].keyInfo.GetAddress() -// charlie := c.genesisAccounts[3].keyInfo.GetAddress() -// -// // add fee grant from alice to bob -// s.execFeeGrant( -// c, -// valIdx, -// alice.String(), -// bob.String(), -// standardFees.String(), -// withKeyValue(flagAllowedMessages, sdk.MsgTypeURL(&banktypes.MsgSend{})), -// ) -// -// bobBalance, err := getSpecificBalance(api, bob.String(), uatomDenom) -// s.Require().NoError(err) -// -// // withdrawal all balance + fee + fee granter flag should succeed -// s.execBankSend( -// c, -// valIdx, -// bob.String(), -// Address(), -// tokenAmount.String(), -// standardFees.String(), -// false, -// withKeyValue(flagFeeAccount, alice.String()), -// ) -// -// // check if the bob balance was subtracted without the fees -// expectedBobBalance := bobBalance.Sub(tokenAmount) -// bobBalance, err = getSpecificBalance(api, bob.String(), uatomDenom) -// s.Require().NoError(err) -// s.Require().Equal(expectedBobBalance, bobBalance) -// -// // tx should fail after spend limit reach -// s.execBankSend( -// c, -// valIdx, -// bob.String(), -// Address(), -// tokenAmount.String(), -// standardFees.String(), -// true, -// withKeyValue(flagFeeAccount, alice.String()), -// ) // -// // add fee grant from alice to charlie -// s.execFeeGrant( -// c, -// valIdx, -// alice.String(), -// charlie.String(), -// standardFees.String(), // spend limit -// withKeyValue(flagAllowedMessages, sdk.MsgTypeURL(&banktypes.MsgSend{})), -// ) -// -// // revoke fee grant from alice to charlie -// s.execFeeGrantRevoke( -// c, -// valIdx, -// alice.String(), -// charlie.String(), -// ) -// -// // tx should fail because the grant was revoked -// s.execBankSend( -// c, -// valIdx, -// charlie.String(), -// Address(), -// tokenAmount.String(), -// standardFees.String(), -// true, -// withKeyValue(flagFeeAccount, alice.String()), -// ) -// }) -//} +// */ +func (s *IntegrationTestSuite) testFeeGrant() { + s.Run("test fee grant module", func() { + var ( + valIdx = 0 + c = s.chainA + api = fmt.Sprintf("http://%s", s.valResources[c.id][valIdx].GetHostPort("1317/tcp")) + ) + + alice, _ := c.genesisAccounts[1].keyInfo.GetAddress() + bob, _ := c.genesisAccounts[2].keyInfo.GetAddress() + charlie, _ := c.genesisAccounts[3].keyInfo.GetAddress() + + // add fee grant from alice to bob + s.execFeeGrant( + c, + valIdx, + alice.String(), + bob.String(), + standardFees.String(), + withKeyValue(flagAllowedMessages, sdk.MsgTypeURL(&banktypes.MsgSend{})), + ) + + bobBalance, err := getSpecificBalance(api, bob.String(), uatomDenom) + s.Require().NoError(err) + + // withdrawal all balance + fee + fee granter flag should succeed + s.execBankSend( + c, + valIdx, + bob.String(), + Address(), + tokenAmount.String(), + standardFees.String(), + false, + withKeyValue(flagFeeGranter, alice.String()), + ) + + // check if the bob balance was subtracted without the fees + expectedBobBalance := bobBalance.Sub(tokenAmount) + bobBalance, err = getSpecificBalance(api, bob.String(), uatomDenom) + s.Require().NoError(err) + s.Require().Equal(expectedBobBalance, bobBalance) + + // tx should fail after spend limit reach + s.execBankSend( + c, + valIdx, + bob.String(), + Address(), + tokenAmount.String(), + standardFees.String(), + true, + withKeyValue(flagFeeGranter, alice.String()), + ) + + // add fee grant from alice to charlie + s.execFeeGrant( + c, + valIdx, + alice.String(), + charlie.String(), + standardFees.String(), // spend limit + withKeyValue(flagAllowedMessages, sdk.MsgTypeURL(&banktypes.MsgSend{})), + ) + + // revoke fee grant from alice to charlie + s.execFeeGrantRevoke( + c, + valIdx, + alice.String(), + charlie.String(), + ) + + // tx should fail because the grant was revoked + s.execBankSend( + c, + valIdx, + charlie.String(), + Address(), + tokenAmount.String(), + standardFees.String(), + true, + withKeyValue(flagFeeGranter, alice.String()), + ) + }) +} diff --git a/tests/e2e/e2e_gov_test.go b/tests/e2e/e2e_gov_test.go index ffbfab5014..2e7a668481 100644 --- a/tests/e2e/e2e_gov_test.go +++ b/tests/e2e/e2e_gov_test.go @@ -1,144 +1,164 @@ package e2e -// import ( -// "fmt" -// "strconv" -// "strings" -// "time" - -// ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" - -// sdk "github.com/cosmos/cosmos-sdk/types" - -// distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" -// govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" -// upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" -// ) - -// /* -// GovSoftwareUpgrade tests passing a gov proposal to upgrade the chain at a given height. -// Test Benchmarks: -// 1. Submission, deposit and vote of message based proposal to upgrade the chain at a height (current height + buffer) -// 2. Validation that chain halted at upgrade height -// 3. Teardown & restart chains -// 4. Reset proposalCounter so subsequent tests have the correct last effective proposal id for chainA -// TODO: Perform upgrade in place of chain restart -// */ -// func (s *IntegrationTestSuite) GovSoftwareUpgrade() { -// chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) -// senderAddress := s.chainA.validators[0].keyInfo.GetAddress() -// sender := senderAddress.String() -// height := s.getLatestBlockHeight(s.chainA, 0) -// proposalHeight := height + govProposalBlockBuffer -// // Gov tests may be run in arbitrary order, each test must increment proposalCounter to have the correct proposal id to submit and query -// proposalCounter++ -// submitGovFlags := []string{"software-upgrade", "Upgrade-0", "--title='Upgrade V1'", "--description='Software Upgrade'", fmt.Sprintf("--upgrade-height=%d", proposalHeight)} -// depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} -// voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes=0.8,no=0.1,abstain=0.05,no_with_veto=0.05"} -// s.runGovProcess(chainAAPIEndpoint, sender, proposalCounter, upgradetypes.ProposalTypeSoftwareUpgrade, submitGovFlags, depositGovFlags, voteGovFlags, "weighted-vote", true) - -// s.verifyChainHaltedAtUpgradeHeight(s.chainA, 0, proposalHeight) -// s.T().Logf("Successfully halted chain at height %d", proposalHeight) - -// s.TearDownSuite() - -// s.T().Logf("Restarting containers") -// s.SetupSuite() - -// s.Require().Eventually( -// func() bool { -// h := s.getLatestBlockHeight(s.chainA, 0) -// return h > 0 -// }, -// 30*time.Second, -// 5*time.Second, -// ) - -// proposalCounter = 0 -// } - -// /* -// GovCancelSoftwareUpgrade tests passing a gov proposal that cancels a pending upgrade. -// Test Benchmarks: -// 1. Submission, deposit and vote of message based proposal to upgrade the chain at a height (current height + buffer) -// 2. Submission, deposit and vote of message based proposal to cancel the pending upgrade -// 3. Validation that the chain produced blocks past the intended upgrade height -// */ -// func (s *IntegrationTestSuite) GovCancelSoftwareUpgrade() { -// chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) -// senderAddress := s.chainA.validators[0].keyInfo.GetAddress() - -// sender := senderAddress.String() -// height := s.getLatestBlockHeight(s.chainA, 0) -// proposalHeight := height + 50 -// // Gov tests may be run in arbitrary order, each test must increment proposalCounter to have the correct proposal id to submit and query -// proposalCounter++ -// submitGovFlags := []string{"software-upgrade", "Upgrade-1", "--title='Upgrade V1'", "--description='Software Upgrade'", fmt.Sprintf("--upgrade-height=%d", proposalHeight)} -// depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} -// voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} -// s.runGovProcess(chainAAPIEndpoint, sender, proposalCounter, upgradetypes.ProposalTypeSoftwareUpgrade, submitGovFlags, depositGovFlags, voteGovFlags, "vote", true) - -// proposalCounter++ -// submitGovFlags = []string{"cancel-software-upgrade", "--title='Upgrade V1'", "--description='Software Upgrade'"} -// depositGovFlags = []string{strconv.Itoa(proposalCounter), depositAmount.String()} -// voteGovFlags = []string{strconv.Itoa(proposalCounter), "yes"} -// s.runGovProcess(chainAAPIEndpoint, sender, proposalCounter, upgradetypes.ProposalTypeCancelSoftwareUpgrade, submitGovFlags, depositGovFlags, voteGovFlags, "vote", true) - -// s.verifyChainPassesUpgradeHeight(s.chainA, 0, proposalHeight) -// s.T().Logf("Successfully canceled upgrade at height %d", proposalHeight) -// } - -// /* -// GovCommunityPoolSpend tests passing a community spend proposal. -// Test Benchmarks: -// 1. Fund Community Pool -// 2. Submission, deposit and vote of proposal to spend from the community pool to send atoms to a recipient -// 3. Validation that the recipient balance has increased by proposal amount -// */ -// func (s *IntegrationTestSuite) GovCommunityPoolSpend() { -// s.fundCommunityPool() -// chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) -// senderAddress := s.chainA.validators[0].keyInfo.GetAddress() -// sender := senderAddress.String() -// recipientAddress := s.chainA.validators[1].keyInfo.GetAddress() -// recipient := recipientAddress.String() -// sendAmount := sdk.NewCoin(uatomDenom, sdk.NewInt(10000000)) // 10uatom -// s.writeGovCommunitySpendProposal(s.chainA, sendAmount.String(), recipient) - -// beforeRecipientBalance, err := getSpecificBalance(chainAAPIEndpoint, recipient, uatomDenom) -// s.Require().NoError(err) - -// // Gov tests may be run in arbitrary order, each test must increment proposalCounter to have the correct proposal id to submit and query -// proposalCounter++ -// submitGovFlags := []string{"community-pool-spend", configFile(proposalCommunitySpendFilename)} -// depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} -// voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} -// s.runGovProcess(chainAAPIEndpoint, sender, proposalCounter, distrtypes.ProposalTypeCommunityPoolSpend, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false) - -// s.Require().Eventually( -// func() bool { -// afterRecipientBalance, err := getSpecificBalance(chainAAPIEndpoint, recipient, uatomDenom) -// s.Require().NoError(err) - -// return afterRecipientBalance.Sub(sendAmount).IsEqual(beforeRecipientBalance) -// }, -// 10*time.Second, -// 5*time.Second, -// ) -// } - -// /* -// AddRemoveConsumerChain tests adding and subsequently removing a new consumer chain to Gaia. -// Test Benchmarks: -// 1. Submit and pass proposal to add consumer chain -// 2. Validation that consumer chain was added -// 3. Submit and pass proposal to remove consumer chain -// 4. Validation that consumer chain was removed -// */ +import ( + "fmt" + "strconv" + "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" +) + +/* +GovSoftwareUpgrade tests passing a gov proposal to upgrade the chain at a given height. +Test Benchmarks: +1. Submission, deposit and vote of message based proposal to upgrade the chain at a height (current height + buffer) +2. Validation that chain halted at upgrade height +3. Teardown & restart chains +4. Reset proposalCounter so subsequent tests have the correct last effective proposal id for chainA +TODO: Perform upgrade in place of chain restart +*/ +func (s *IntegrationTestSuite) GovSoftwareUpgrade() { + chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) + senderAddress, _ := s.chainA.validators[0].keyInfo.GetAddress() + sender := senderAddress.String() + height := s.getLatestBlockHeight(s.chainA, 0) + proposalHeight := height + govProposalBlockBuffer + // Gov tests may be run in arbitrary order, each test must increment proposalCounter to have the correct proposal id to submit and query + proposalCounter++ + + s.writeGovLegProposal(s.chainA, int64(height), "upgrade-v0") + + submitGovFlags := []string{ + "software-upgrade", + "Upgrade-0", + "--title='Upgrade V0'", + "--description='Software Upgrade'", + "--no-validate", + fmt.Sprintf("--upgrade-height=%d", proposalHeight), + fmt.Sprintf("--upgrade-info=%s", configFile(proposalCommunitySpendFilename)), + } + + depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} + voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes=0.8,no=0.1,abstain=0.05,no_with_veto=0.05"} + s.runGovProcess(chainAAPIEndpoint, sender, proposalCounter, upgradetypes.ProposalTypeSoftwareUpgrade, submitGovFlags, depositGovFlags, voteGovFlags, "weighted-vote", true) + + s.verifyChainHaltedAtUpgradeHeight(s.chainA, 0, proposalHeight) + s.T().Logf("Successfully halted chain at height %d", proposalHeight) + + s.TearDownSuite() + + s.T().Logf("Restarting containers") + s.SetupSuite() + + s.Require().Eventually( + func() bool { + h := s.getLatestBlockHeight(s.chainA, 0) + return h > 0 + }, + 30*time.Second, + 5*time.Second, + ) + + proposalCounter = 0 +} + +/* +GovCancelSoftwareUpgrade tests passing a gov proposal that cancels a pending upgrade. +Test Benchmarks: +1. Submission, deposit and vote of message based proposal to upgrade the chain at a height (current height + buffer) +2. Submission, deposit and vote of message based proposal to cancel the pending upgrade +3. Validation that the chain produced blocks past the intended upgrade height +*/ +func (s *IntegrationTestSuite) GovCancelSoftwareUpgrade() { + chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) + senderAddress, _ := s.chainA.validators[0].keyInfo.GetAddress() + + sender := senderAddress.String() + height := s.getLatestBlockHeight(s.chainA, 0) + proposalHeight := height + 50 + s.writeGovLegProposal(s.chainA, int64(height), "upgrade-v1") + + // Gov tests may be run in arbitrary order, each test must increment proposalCounter to have the correct proposal id to submit and query + proposalCounter++ + submitGovFlags := []string{ + "software-upgrade", + "Upgrade-1", + "--title='Upgrade V1'", + "--description='Software Upgrade'", + "--no-validate", + fmt.Sprintf("--upgrade-height=%d", proposalHeight), + fmt.Sprintf("--upgrade-info=%s", configFile(proposalCommunitySpendFilename)), + } + + depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} + voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} + s.runGovProcess(chainAAPIEndpoint, sender, proposalCounter, upgradetypes.ProposalTypeSoftwareUpgrade, submitGovFlags, depositGovFlags, voteGovFlags, "vote", true) + + proposalCounter++ + submitGovFlags = []string{"cancel-software-upgrade", "--title='Upgrade V1'", "--description='Software Upgrade'"} + depositGovFlags = []string{strconv.Itoa(proposalCounter), depositAmount.String()} + voteGovFlags = []string{strconv.Itoa(proposalCounter), "yes"} + s.runGovProcess(chainAAPIEndpoint, sender, proposalCounter, upgradetypes.ProposalTypeCancelSoftwareUpgrade, submitGovFlags, depositGovFlags, voteGovFlags, "vote", true) + + s.verifyChainPassesUpgradeHeight(s.chainA, 0, proposalHeight) + s.T().Logf("Successfully canceled upgrade at height %d", proposalHeight) +} + +/* +GovCommunityPoolSpend tests passing a community spend proposal. +Test Benchmarks: +1. Fund Community Pool +2. Submission, deposit and vote of proposal to spend from the community pool to send atoms to a recipient +3. Validation that the recipient balance has increased by proposal amount +*/ +func (s *IntegrationTestSuite) GovCommunityPoolSpend() { + s.fundCommunityPool() + chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) + senderAddress, _ := s.chainA.validators[0].keyInfo.GetAddress() + sender := senderAddress.String() + recipientAddress, _ := s.chainA.validators[1].keyInfo.GetAddress() + recipient := recipientAddress.String() + sendAmount := sdk.NewCoin(uatomDenom, sdk.NewInt(10000000)) // 10uatom + s.writeGovCommunitySpendProposal(s.chainA, sendAmount, recipient) + + beforeRecipientBalance, err := getSpecificBalance(chainAAPIEndpoint, recipient, uatomDenom) + s.Require().NoError(err) + + // Gov tests may be run in arbitrary order, each test must increment proposalCounter to have the correct proposal id to submit and query + proposalCounter++ + submitGovFlags := []string{configFile(proposalCommunitySpendFilename)} + depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} + voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} + // TODO: replace proposal type by distrtypes.ProposalTypeCommunityPoolSpend equivalent in SDK v0.47 + s.runGovProcessV1(chainAAPIEndpoint, sender, proposalCounter, "CommunityPoolSpend", submitGovFlags, depositGovFlags, voteGovFlags, "vote", false) + + s.Require().Eventually( + func() bool { + afterRecipientBalance, err := getSpecificBalance(chainAAPIEndpoint, recipient, uatomDenom) + s.Require().NoError(err) + + return afterRecipientBalance.Sub(sendAmount).IsEqual(beforeRecipientBalance) + }, + 10*time.Second, + 5*time.Second, + ) +} + +/* +AddRemoveConsumerChain tests adding and subsequently removing a new consumer chain to Gaia. +Test Benchmarks: +1. Submit and pass proposal to add consumer chain +2. Validation that consumer chain was added +3. Submit and pass proposal to remove consumer chain +4. Validation that consumer chain was removed +*/ // func (s *IntegrationTestSuite) AddRemoveConsumerChain() { // s.fundCommunityPool() // chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) -// proposerAddress := s.chainA.validators[0].keyInfo.GetAddress() +// proposerAddress, _ := s.chainA.validators[0].keyInfo.GetAddress() // sender := proposerAddress.String() // consumerChainID := "consumer" // s.writeAddRemoveConsumerProposals(s.chainA, consumerChainID) @@ -185,74 +205,88 @@ package e2e // return true // } -// func (s *IntegrationTestSuite) runGovProcess(chainAAPIEndpoint, sender string, proposalID int, proposalType string, submitFlags []string, depositFlags []string, voteFlags []string, voteCommand string, withDeposit bool) { -// s.T().Logf("Submitting Gov Proposal: %s", proposalType) -// // min deposit of 1000uatom is required in e2e tests, otherwise the gov antehandler causes the proposal to be dropped -// sflags := submitFlags -// if withDeposit { -// sflags = append(sflags, "--deposit=1000uatom") -// } -// s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, "submit-proposal", sflags, govtypes.StatusDepositPeriod) -// s.T().Logf("Depositing Gov Proposal: %s", proposalType) -// s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, "deposit", depositFlags, govtypes.StatusVotingPeriod) -// s.T().Logf("Voting Gov Proposal: %s", proposalType) -// s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, voteCommand, voteFlags, govtypes.StatusPassed) -// } - -// func (s *IntegrationTestSuite) verifyChainHaltedAtUpgradeHeight(c *chain, valIdx, upgradeHeight int) { -// s.Require().Eventually( -// func() bool { -// currentHeight := s.getLatestBlockHeight(c, valIdx) - -// return currentHeight == upgradeHeight -// }, -// 30*time.Second, -// 5*time.Second, -// ) - -// counter := 0 -// s.Require().Eventually( -// func() bool { -// currentHeight := s.getLatestBlockHeight(c, valIdx) - -// if currentHeight > upgradeHeight { -// return false -// } -// if currentHeight == upgradeHeight { -// counter++ -// } -// return counter >= 2 -// }, -// 8*time.Second, -// 2*time.Second, -// ) -// } - -// func (s *IntegrationTestSuite) verifyChainPassesUpgradeHeight(c *chain, valIdx, upgradeHeight int) { -// s.Require().Eventually( -// func() bool { -// currentHeight := s.getLatestBlockHeight(c, valIdx) - -// return currentHeight > upgradeHeight -// }, -// 30*time.Second, -// 5*time.Second, -// ) -// } - -// func (s *IntegrationTestSuite) submitGovCommand(chainAAPIEndpoint, sender string, proposalID int, govCommand string, proposalFlags []string, expectedSuccessStatus govtypes.ProposalStatus) { -// s.Run(fmt.Sprintf("Running tx gov %s", govCommand), func() { -// s.runGovExec(s.chainA, 0, sender, govCommand, proposalFlags, standardFees.String()) - -// s.Require().Eventually( -// func() bool { -// proposal, err := queryGovProposal(chainAAPIEndpoint, proposalID) -// s.Require().NoError(err) - -// return proposal.GetProposal().Status == expectedSuccessStatus -// }, -// 15*time.Second, -// 5*time.Second, -// ) -// }) -// } +func (s *IntegrationTestSuite) runGovProcess(chainAAPIEndpoint, sender string, proposalID int, proposalType string, submitFlags []string, depositFlags []string, voteFlags []string, voteCommand string, withDeposit bool) { + s.T().Logf("Submitting Gov Proposal: %s", proposalType) + // min deposit of 1000uatom is required in e2e tests, otherwise the gov antehandler causes the proposal to be dropped + sflags := submitFlags + if withDeposit { + sflags = append(sflags, "--deposit=1000uatom") + } + s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, "submit-legacy-proposal", sflags, govtypesv1beta1.StatusDepositPeriod) + s.T().Logf("Depositing Gov Proposal: %s", proposalType) + s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, "deposit", depositFlags, govtypesv1beta1.StatusVotingPeriod) + s.T().Logf("Voting Gov Proposal: %s", proposalType) + s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, voteCommand, voteFlags, govtypesv1beta1.StatusPassed) +} + +func (s *IntegrationTestSuite) runGovProcessV1(chainAAPIEndpoint, sender string, proposalID int, proposalType string, submitFlags []string, depositFlags []string, voteFlags []string, voteCommand string, withDeposit bool) { + s.T().Logf("Submitting Gov Proposal: %s", proposalType) + // min deposit of 1000uatom is required in e2e tests, otherwise the gov antehandler causes the proposal to be dropped + sflags := submitFlags + if withDeposit { + sflags = append(sflags, "--deposit=1000uatom") + } + s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, "submit-proposal", sflags, govtypesv1beta1.StatusDepositPeriod) + s.T().Logf("Depositing Gov Proposal: %s", proposalType) + s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, "deposit", depositFlags, govtypesv1beta1.StatusVotingPeriod) + s.T().Logf("Voting Gov Proposal: %s", proposalType) + s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, voteCommand, voteFlags, govtypesv1beta1.StatusPassed) +} + +func (s *IntegrationTestSuite) verifyChainHaltedAtUpgradeHeight(c *chain, valIdx, upgradeHeight int) { + s.Require().Eventually( + func() bool { + currentHeight := s.getLatestBlockHeight(c, valIdx) + + return currentHeight == upgradeHeight + }, + 30*time.Second, + 5*time.Second, + ) + + counter := 0 + s.Require().Eventually( + func() bool { + currentHeight := s.getLatestBlockHeight(c, valIdx) + + if currentHeight > upgradeHeight { + return false + } + if currentHeight == upgradeHeight { + counter++ + } + return counter >= 2 + }, + 8*time.Second, + 2*time.Second, + ) +} + +func (s *IntegrationTestSuite) verifyChainPassesUpgradeHeight(c *chain, valIdx, upgradeHeight int) { + s.Require().Eventually( + func() bool { + currentHeight := s.getLatestBlockHeight(c, valIdx) + + return currentHeight > upgradeHeight + }, + 30*time.Second, + 5*time.Second, + ) +} + +func (s *IntegrationTestSuite) submitGovCommand(chainAAPIEndpoint, sender string, proposalID int, govCommand string, proposalFlags []string, expectedSuccessStatus govtypesv1beta1.ProposalStatus) { + s.Run(fmt.Sprintf("Running tx gov %s", govCommand), func() { + s.runGovExec(s.chainA, 0, sender, govCommand, proposalFlags, standardFees.String()) + + s.Require().Eventually( + func() bool { + proposal, err := queryGovProposal(chainAAPIEndpoint, proposalID) + s.Require().NoError(err) + + return proposal.GetProposal().Status == expectedSuccessStatus + }, + 15*time.Second, + 5*time.Second, + ) + }) +} diff --git a/tests/e2e/e2e_ibc_test.go b/tests/e2e/e2e_ibc_test.go index a8b8d57cbb..2f2ce19ddb 100644 --- a/tests/e2e/e2e_ibc_test.go +++ b/tests/e2e/e2e_ibc_test.go @@ -1,482 +1,481 @@ package e2e -// import ( -// "bytes" -// "context" -// "encoding/json" -// "fmt" -// "strconv" -// "strings" -// "time" - -// "github.com/cosmos/cosmos-sdk/client/flags" -// sdk "github.com/cosmos/cosmos-sdk/types" -// "github.com/ory/dockertest/v3/docker" -// ) - -// type ForwardMetadata struct { -// Receiver string `json:"receiver"` -// Port string `json:"port"` -// Channel string `json:"channel"` -// // Timeout time.Duration `json:"timeout"` -// // Retries *uint8 `json:"retries,omitempty"` -// // Next *string `json:"next,omitempty"` -// // RefundSequence *uint64 `json:"refund_sequence,omitempty"` -// } - -// type PacketMetadata struct { -// Forward *ForwardMetadata `json:"forward"` -// } - -// func (s *IntegrationTestSuite) sendIBC(c *chain, valIdx int, sender, recipient, token, fees, note string) { -// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) -// defer cancel() - -// ibcCmd := []string{ -// gaiadBinary, -// txCommand, -// "ibc-transfer", -// "transfer", -// "transfer", -// "channel-0", -// recipient, -// token, -// fmt.Sprintf("--from=%s", sender), -// fmt.Sprintf("--%s=%s", flags.FlagFees, fees), -// fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), -// // fmt.Sprintf("--%s=%s", flags.FlagNote, note), -// fmt.Sprintf("--memo=%s", note), -// "--keyring-backend=test", -// "--broadcast-mode=sync", -// "--output=json", -// "-y", -// } -// s.T().Logf("sending %s from %s (%s) to %s (%s) with memo %s", token, s.chainA.id, sender, s.chainB.id, recipient, note) -// s.executeGaiaTxCommand(ctx, c, ibcCmd, valIdx, s.defaultExecValidation(c, valIdx)) -// s.T().Log("successfully sent IBC tokens") -// } - -// func (s *IntegrationTestSuite) hermesTransfer(configPath, srcChainID, dstChainID, srcChannelID, denom string, sendAmt, timeOutOffset, numMsg int) (success bool) { -// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) -// defer cancel() - -// hermesCmd := []string{ -// hermesBinary, -// fmt.Sprintf("--config=%s", configPath), -// "tx", -// "ft-transfer", -// fmt.Sprintf("--dst-chain=%s", dstChainID), -// fmt.Sprintf("--src-chain=%s", srcChainID), -// fmt.Sprintf("--src-channel=%s", srcChannelID), -// fmt.Sprintf("--src-port=%s", "transfer"), -// fmt.Sprintf("--amount=%v", sendAmt), -// fmt.Sprintf("--denom=%s", denom), -// fmt.Sprintf("--timeout-height-offset=%v", timeOutOffset), -// fmt.Sprintf("--number-msgs=%v", numMsg), -// } - -// stdout, stderr := s.executeHermesCommand(ctx, hermesCmd) -// if strings.Contains(string(stdout), "ERROR") || strings.Contains(string(stderr), "ERROR") { -// return false -// } - -// return true -// } - -// func (s *IntegrationTestSuite) hermesClearPacket(configPath, chainID, channelID string) (success bool) { //nolint:unparam -// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) -// defer cancel() - -// hermesCmd := []string{ -// hermesBinary, -// fmt.Sprintf("--config=%s", configPath), -// "clear", -// "packets", -// fmt.Sprintf("--chain=%s", chainID), -// fmt.Sprintf("--channel=%s", channelID), -// fmt.Sprintf("--port=%s", "transfer"), -// } - -// stdout, stderr := s.executeHermesCommand(ctx, hermesCmd) -// if strings.Contains(string(stdout), "ERROR") || strings.Contains(string(stderr), "ERROR") { -// return false -// } - -// return true -// } - -// type RelayerPacketsOutput struct { -// Result struct { -// Dst struct { -// UnreceivedPackets []interface{} `json:"unreceived_packets"` -// } `json:"dst"` -// Src struct { -// UnreceivedPackets []interface{} `json:"unreceived_packets"` -// } `json:"src"` -// } `json:"result"` -// Status string `json:"status"` -// } - -// func (s *IntegrationTestSuite) hermesPendingPackets(configPath, chainID, channelID string) (pendingPackets bool) { -// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) -// defer cancel() -// hermesCmd := []string{ -// hermesBinary, -// "--json", -// fmt.Sprintf("--config=%s", configPath), -// "query", -// "packet", -// "pending", -// fmt.Sprintf("--chain=%s", chainID), -// fmt.Sprintf("--channel=%s", channelID), -// fmt.Sprintf("--port=%s", "transfer"), -// } - -// stdout, _ := s.executeHermesCommand(ctx, hermesCmd) - -// var relayerPacketsOutput RelayerPacketsOutput -// err := json.Unmarshal(stdout, &relayerPacketsOutput) -// s.Require().NoError(err) - -// // Check if "unreceived_packets" exists in "src" -// return len(relayerPacketsOutput.Result.Src.UnreceivedPackets) != 0 -// } - -// func (s *IntegrationTestSuite) queryRelayerWalletsBalances() (sdk.Coin, sdk.Coin) { -// chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) -// scrRelayerBalance, err := getSpecificBalance( -// chainAAPIEndpoint, -// s.chainA.genesisAccounts[relayerAccountIndexHermes1].keyInfo.GetAddress().String(), -// uatomDenom) -// s.Require().NoError(err) - -// chainBAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainB.id][0].GetHostPort("1317/tcp")) -// dstRelayerBalance, err := getSpecificBalance( -// chainBAPIEndpoint, -// s.chainB.genesisAccounts[relayerAccountIndexHermes1].keyInfo.GetAddress().String(), -// uatomDenom) -// s.Require().NoError(err) - -// return scrRelayerBalance, dstRelayerBalance -// } - -// func (s *IntegrationTestSuite) createConnection() { -// s.T().Logf("connecting %s and %s chains via IBC", s.chainA.id, s.chainB.id) - -// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) -// defer cancel() - -// exec, err := s.dkrPool.Client.CreateExec(docker.CreateExecOptions{ -// Context: ctx, -// AttachStdout: true, -// AttachStderr: true, -// Container: s.hermesResource0.Container.ID, -// User: "root", -// Cmd: []string{ -// "hermes", -// "create", -// "connection", -// "--a-chain", -// s.chainA.id, -// "--b-chain", -// s.chainB.id, -// }, -// }) -// s.Require().NoError(err) - -// var ( -// outBuf bytes.Buffer -// errBuf bytes.Buffer -// ) - -// err = s.dkrPool.Client.StartExec(exec.ID, docker.StartExecOptions{ -// Context: ctx, -// Detach: false, -// OutputStream: &outBuf, -// ErrorStream: &errBuf, -// }) -// s.Require().NoErrorf( -// err, -// "failed connect chains; stdout: %s, stderr: %s", outBuf.String(), errBuf.String(), -// ) - -// s.T().Logf("connected %s and %s chains via IBC", s.chainA.id, s.chainB.id) -// } - -// func (s *IntegrationTestSuite) createChannel() { -// s.T().Logf("connecting %s and %s chains via IBC", s.chainA.id, s.chainB.id) - -// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) -// defer cancel() - -// exec, err := s.dkrPool.Client.CreateExec(docker.CreateExecOptions{ -// Context: ctx, -// AttachStdout: true, -// AttachStderr: true, -// Container: s.hermesResource0.Container.ID, -// User: "root", -// Cmd: []string{ -// "hermes", -// txCommand, -// "chan-open-init", -// "--dst-chain", -// s.chainA.id, -// "--src-chain", -// s.chainB.id, -// "--dst-connection", -// "connection-0", -// "--src-port=transfer", -// "--dst-port=transfer", -// }, -// }) -// s.Require().NoError(err) - -// var ( -// outBuf bytes.Buffer -// errBuf bytes.Buffer -// ) - -// err = s.dkrPool.Client.StartExec(exec.ID, docker.StartExecOptions{ -// Context: ctx, -// Detach: false, -// OutputStream: &outBuf, -// ErrorStream: &errBuf, -// }) -// s.Require().NoErrorf( -// err, -// "failed connect chains; stdout: %s, stderr: %s", outBuf.String(), errBuf.String(), -// ) - -// s.T().Logf("connected %s and %s chains via IBC", s.chainA.id, s.chainB.id) -// } - -// func (s *IntegrationTestSuite) testIBCTokenTransfer() { -// s.Run("send_uatom_to_chainB", func() { -// // require the recipient account receives the IBC tokens (IBC packets ACKd) -// var ( -// balances sdk.Coins -// err error -// beforeBalance int64 -// ibcStakeDenom string -// ) - -// address := s.chainA.validators[0].keyInfo.GetAddress() -// sender := address.String() - -// address = s.chainB.validators[0].keyInfo.GetAddress() -// recipient := address.String() - -// chainBAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainB.id][0].GetHostPort("1317/tcp")) - -// s.Require().Eventually( -// func() bool { -// balances, err = queryGaiaAllBalances(chainBAPIEndpoint, recipient) -// s.Require().NoError(err) -// return balances.Len() != 0 -// }, -// time.Minute, -// 5*time.Second, -// ) -// for _, c := range balances { -// if strings.Contains(c.Denom, "ibc/") { -// beforeBalance = c.Amount.Int64() -// break -// } -// } - -// tokenAmt := 3300000000 -// s.sendIBC(s.chainA, 0, sender, recipient, strconv.Itoa(tokenAmt)+uatomDenom, standardFees.String(), "") - -// s.Require().Eventually( -// func() bool { -// balances, err = queryGaiaAllBalances(chainBAPIEndpoint, recipient) -// s.Require().NoError(err) -// return balances.Len() != 0 -// }, -// time.Minute, -// 5*time.Second, -// ) -// for _, c := range balances { -// if strings.Contains(c.Denom, "ibc/") { -// ibcStakeDenom = c.Denom -// s.Require().Equal((int64(tokenAmt) + beforeBalance), c.Amount.Int64()) -// break -// } -// } - -// s.Require().NotEmpty(ibcStakeDenom) -// }) -// } - -// /* -// TestMultihopIBCTokenTransfer tests that sending an IBC transfer using the IBC Packet Forward Middleware accepts a port, channel and account address - -// Steps: -// 1. Check balance of Account 1 on Chain 1 -// 2. Check balance of Account 2 on Chain 1 -// 3. Account 1 on Chain 1 sends x tokens to Account 2 on Chain 1 via Account 1 on Chain 2 -// 4. Check Balance of Account 1 on Chain 1, confirm it is original minus x tokens -// 5. Check Balance of Account 2 on Chain 1, confirm it is original plus x tokens - -// */ -// // TODO: Add back only if packet forward middleware has a working version compatible with IBC v3.0.x -// func (s *IntegrationTestSuite) testMultihopIBCTokenTransfer() { -// time.Sleep(30 * time.Second) - -// s.Run("send_successful_multihop_uatom_to_chainA_from_chainA", func() { -// // require the recipient account receives the IBC tokens (IBC packets ACKd) -// var ( -// err error -// ) - -// address := s.chainA.validators[0].keyInfo.GetAddress() -// sender := address.String() - -// address = s.chainB.validators[0].keyInfo.GetAddress() -// middlehop := address.String() - -// address = s.chainA.validators[1].keyInfo.GetAddress() -// recipient := address.String() - -// forwardPort := "transfer" -// forwardChannel := "channel-0" - -// tokenAmt := 3300000000 - -// chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) - -// var ( -// beforeSenderUAtomBalance sdk.Coin -// beforeRecipientUAtomBalance sdk.Coin -// ) - -// s.Require().Eventually( -// func() bool { -// beforeSenderUAtomBalance, err = getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) -// s.Require().NoError(err) -// fmt.Println("beforeSenderUAtomBalance", beforeSenderUAtomBalance) - -// beforeRecipientUAtomBalance, err = getSpecificBalance(chainAAPIEndpoint, recipient, uatomDenom) -// s.Require().NoError(err) -// fmt.Print("beforeRecipientUAtomBalance", beforeRecipientUAtomBalance) - -// return beforeSenderUAtomBalance.IsValid() && beforeRecipientUAtomBalance.IsValid() -// }, -// 1*time.Minute, -// 5*time.Second, -// ) - -// firstHopMetadata := &PacketMetadata{ -// Forward: &ForwardMetadata{ -// Receiver: recipient, -// Channel: forwardChannel, -// Port: forwardPort, -// }, -// } - -// memo, err := json.Marshal(firstHopMetadata) -// s.Require().NoError(err) - -// s.sendIBC(s.chainA, 0, sender, middlehop, strconv.Itoa(tokenAmt)+uatomDenom, standardFees.String(), string(memo)) - -// s.Require().Eventually( -// func() bool { -// afterSenderUAtomBalance, err := getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) -// s.Require().NoError(err) - -// afterRecipientUAtomBalance, err := getSpecificBalance(chainAAPIEndpoint, recipient, uatomDenom) -// s.Require().NoError(err) - -// decremented := beforeSenderUAtomBalance.Sub(tokenAmount).Sub(standardFees).IsEqual(afterSenderUAtomBalance) -// incremented := beforeRecipientUAtomBalance.Add(tokenAmount).IsEqual(afterRecipientUAtomBalance) - -// return decremented && incremented -// }, -// 1*time.Minute, -// 5*time.Second, -// ) -// }) -// } - -// /* -// TestFailedMultihopIBCTokenTransfer tests that sending a failing IBC transfer using the IBC Packet Forward -// Middleware will send the tokens back to the original account after failing. -// */ -// func (s *IntegrationTestSuite) testFailedMultihopIBCTokenTransfer() { -// time.Sleep(30 * time.Second) - -// s.Run("send_failed_multihop_uatom_to_chainA_from_chainA", func() { -// address := s.chainA.validators[0].keyInfo.GetAddress() -// sender := address.String() - -// address = s.chainB.validators[0].keyInfo.GetAddress() -// middlehop := address.String() - -// address = s.chainA.validators[1].keyInfo.GetAddress() -// recipient := strings.Replace(address.String(), "cosmos", "foobar", 1) // this should be an invalid recipient to force the tx to fail - -// forwardPort := "transfer" -// forwardChannel := "channel-0" - -// tokenAmt := 3300000000 - -// chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) - -// var ( -// beforeSenderUAtomBalance sdk.Coin -// err error -// ) - -// s.Require().Eventually( -// func() bool { -// beforeSenderUAtomBalance, err = getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) -// s.Require().NoError(err) - -// return beforeSenderUAtomBalance.IsValid() -// }, -// 1*time.Minute, -// 5*time.Second, -// ) - -// firstHopMetadata := &PacketMetadata{ -// Forward: &ForwardMetadata{ -// Receiver: recipient, -// Channel: forwardChannel, -// Port: forwardPort, -// }, -// } - -// memo, err := json.Marshal(firstHopMetadata) -// s.Require().NoError(err) - -// s.sendIBC(s.chainA, 0, sender, middlehop, strconv.Itoa(tokenAmt)+uatomDenom, standardFees.String(), string(memo)) - -// // Sender account should be initially decremented the full amount -// s.Require().Eventually( -// func() bool { -// afterSenderUAtomBalance, err := getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) -// s.Require().NoError(err) - -// returned := beforeSenderUAtomBalance.Sub(tokenAmount).Sub(standardFees).IsEqual(afterSenderUAtomBalance) - -// return returned -// }, -// 1*time.Minute, -// 1*time.Second, -// ) - -// // since the forward receiving account is invalid, it should be refunded to the original sender (minus the original fee) -// s.Require().Eventually( -// func() bool { -// afterSenderUAtomBalance, err := getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) -// s.Require().NoError(err) - -// returned := beforeSenderUAtomBalance.Sub(standardFees).IsEqual(afterSenderUAtomBalance) - -// return returned -// }, -// 5*time.Minute, -// 5*time.Second, -// ) -// }) -// } +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "os" + "path" + "path/filepath" + "strconv" + "strings" + "time" + + "github.com/cosmos/cosmos-sdk/client/flags" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ory/dockertest/v3" + "github.com/ory/dockertest/v3/docker" +) + +type ForwardMetadata struct { + Receiver string `json:"receiver"` + Port string `json:"port"` + Channel string `json:"channel"` + // Timeout time.Duration `json:"timeout"` + // Retries *uint8 `json:"retries,omitempty"` + // Next *string `json:"next,omitempty"` + // RefundSequence *uint64 `json:"refund_sequence,omitempty"` +} + +type PacketMetadata struct { + Forward *ForwardMetadata `json:"forward"` +} + +func (s *IntegrationTestSuite) runIBCRelayer() { + s.T().Log("starting Hermes relayer container...") + + tmpDir, err := os.MkdirTemp("", "gaia-e2e-testnet-hermes-") + s.Require().NoError(err) + s.tmpDirs = append(s.tmpDirs, tmpDir) + + gaiaAVal := s.chainA.validators[0] + gaiaBVal := s.chainB.validators[0] + + gaiaARly := s.chainA.genesisAccounts[relayerAccountIndex] + gaiaBRly := s.chainB.genesisAccounts[relayerAccountIndex] + + hermesCfgPath := path.Join(tmpDir, "hermes") + + s.Require().NoError(os.MkdirAll(hermesCfgPath, 0o755)) + _, err = copyFile( + filepath.Join("./scripts/", "hermes_bootstrap.sh"), + filepath.Join(hermesCfgPath, "hermes_bootstrap.sh"), + ) + s.Require().NoError(err) + + s.hermesResource, err = s.dkrPool.RunWithOptions( + &dockertest.RunOptions{ + Name: fmt.Sprintf("%s-%s-relayer", s.chainA.id, s.chainB.id), + Repository: "ghcr.io/informalsystems/hermes", + Tag: "1.4.1", + NetworkID: s.dkrNet.Network.ID, + Mounts: []string{ + fmt.Sprintf("%s/:/root/hermes", hermesCfgPath), + }, + PortBindings: map[docker.Port][]docker.PortBinding{ + "3031/tcp": {{HostIP: "", HostPort: "3031"}}, + }, + Env: []string{ + fmt.Sprintf("GAIA_A_E2E_CHAIN_ID=%s", s.chainA.id), + fmt.Sprintf("GAIA_B_E2E_CHAIN_ID=%s", s.chainB.id), + fmt.Sprintf("GAIA_A_E2E_VAL_MNEMONIC=%s", gaiaAVal.mnemonic), + fmt.Sprintf("GAIA_B_E2E_VAL_MNEMONIC=%s", gaiaBVal.mnemonic), + fmt.Sprintf("GAIA_A_E2E_RLY_MNEMONIC=%s", gaiaARly.mnemonic), + fmt.Sprintf("GAIA_B_E2E_RLY_MNEMONIC=%s", gaiaBRly.mnemonic), + fmt.Sprintf("GAIA_A_E2E_VAL_HOST=%s", s.valResources[s.chainA.id][0].Container.Name[1:]), + fmt.Sprintf("GAIA_B_E2E_VAL_HOST=%s", s.valResources[s.chainB.id][0].Container.Name[1:]), + }, + User: "root", + Entrypoint: []string{ + "sh", + "-c", + "chmod +x /root/hermes/hermes_bootstrap.sh && /root/hermes/hermes_bootstrap.sh", + }, + }, + noRestart, + ) + s.Require().NoError(err) + + // TODO: debug relayer REST endpoint + // endpoint := fmt.Sprintf("http://%s/state", s.hermesResource.GetHostPort("3031/tcp")) + // s.Require().Eventually( + // func() bool { + // resp, err := http.Get(endpoint) //nolint:gosec // this is a test + // if err != nil { + // return false + // } + + // defer resp.Body.Close() + + // bz, err := io.ReadAll(resp.Body) + // if err != nil { + // return false + // } + + // var respBody map[string]interface{} + // if err := json.Unmarshal(bz, &respBody); err != nil { + // return false + // } + + // status := respBody["status"].(string) + // result := respBody["result"].(map[string]interface{}) + + // return status == "success" && len(result["chains"].([]interface{})) == 2 + // }, + // 5*time.Minute, + // time.Second, + // "hermes relayer not healthy", + // ) + + s.T().Logf("started Hermes relayer container: %s", s.hermesResource.Container.ID) + + // XXX: Give time to both networks to start, otherwise we might see gRPC + // transport errors. + time.Sleep(10 * time.Second) + + // create the client, connection and channel between the two Gaia chains + s.createConnection() + time.Sleep(10 * time.Second) + s.createChannel() +} + +func (s *IntegrationTestSuite) sendIBC(c *chain, valIdx int, sender, recipient, token, fees, note string) { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + ibcCmd := []string{ + gaiadBinary, + txCommand, + "ibc-transfer", + "transfer", + "transfer", + "channel-0", + recipient, + token, + fmt.Sprintf("--from=%s", sender), + fmt.Sprintf("--%s=%s", flags.FlagFees, fees), + fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), + // fmt.Sprintf("--%s=%s", flags.FlagNote, note), + fmt.Sprintf("--memo=%s", note), + "--keyring-backend=test", + "--broadcast-mode=sync", + "--output=json", + "-y", + } + s.T().Logf("sending %s from %s (%s) to %s (%s) with memo %s", token, s.chainA.id, sender, s.chainB.id, recipient, note) + s.executeGaiaTxCommand(ctx, c, ibcCmd, valIdx, s.defaultExecValidation(c, valIdx)) + s.T().Log("successfully sent IBC tokens") +} + +func (s *IntegrationTestSuite) createConnection() { + s.T().Logf("connecting %s and %s chains via IBC", s.chainA.id, s.chainB.id) + + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + exec, err := s.dkrPool.Client.CreateExec(docker.CreateExecOptions{ + Context: ctx, + AttachStdout: true, + AttachStderr: true, + Container: s.hermesResource.Container.ID, + User: "root", + Cmd: []string{ + "hermes", + "create", + "connection", + "--a-chain", + s.chainA.id, + "--b-chain", + s.chainB.id, + }, + }) + s.Require().NoError(err) + + var ( + outBuf bytes.Buffer + errBuf bytes.Buffer + ) + + err = s.dkrPool.Client.StartExec(exec.ID, docker.StartExecOptions{ + Context: ctx, + Detach: false, + OutputStream: &outBuf, + ErrorStream: &errBuf, + }) + s.Require().NoErrorf( + err, + "failed connect chains; stdout: %s, stderr: %s", outBuf.String(), errBuf.String(), + ) + + s.T().Logf("connected %s and %s chains via IBC", s.chainA.id, s.chainB.id) +} + +func (s *IntegrationTestSuite) createChannel() { + s.T().Logf("connecting %s and %s chains via IBC", s.chainA.id, s.chainB.id) + + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + exec, err := s.dkrPool.Client.CreateExec(docker.CreateExecOptions{ + Context: ctx, + AttachStdout: true, + AttachStderr: true, + Container: s.hermesResource.Container.ID, + User: "root", + Cmd: []string{ + "hermes", + txCommand, + "chan-open-init", + "--dst-chain", + s.chainA.id, + "--src-chain", + s.chainB.id, + "--dst-connection", + "connection-0", + "--src-port=transfer", + "--dst-port=transfer", + }, + }) + + s.Require().NoError(err) + + var ( + outBuf bytes.Buffer + errBuf bytes.Buffer + ) + + err = s.dkrPool.Client.StartExec(exec.ID, docker.StartExecOptions{ + Context: ctx, + Detach: false, + OutputStream: &outBuf, + ErrorStream: &errBuf, + }) + + s.Require().NoErrorf( + err, + "failed connect chains; stdout: %s, stderr: %s", outBuf.String(), errBuf.String(), + ) + + s.T().Logf("connected %s and %s chains via IBC", s.chainA.id, s.chainB.id) +} + +func (s *IntegrationTestSuite) testIBCTokenTransfer() { + time.Sleep(30 * time.Second) + s.Run("send_uatom_to_chainB", func() { + // require the recipient account receives the IBC tokens (IBC packets ACKd) + var ( + balances sdk.Coins + err error + beforeBalance int64 + ibcStakeDenom string + ) + + address, _ := s.chainA.validators[0].keyInfo.GetAddress() + sender := address.String() + + address, _ = s.chainB.validators[0].keyInfo.GetAddress() + recipient := address.String() + + chainBAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainB.id][0].GetHostPort("1317/tcp")) + + s.Require().Eventually( + func() bool { + balances, err = queryGaiaAllBalances(chainBAPIEndpoint, recipient) + s.Require().NoError(err) + return balances.Len() != 0 + }, + time.Minute, + 5*time.Second, + ) + for _, c := range balances { + if strings.Contains(c.Denom, "ibc/") { + beforeBalance = c.Amount.Int64() + break + } + } + + tokenAmt := 3300000000 + s.sendIBC(s.chainA, 0, sender, recipient, strconv.Itoa(tokenAmt)+uatomDenom, standardFees.String(), "") + + s.Require().Eventually( + func() bool { + balances, err = queryGaiaAllBalances(chainBAPIEndpoint, recipient) + s.Require().NoError(err) + return balances.Len() != 0 + }, + time.Minute, + 5*time.Second, + ) + for _, c := range balances { + if strings.Contains(c.Denom, "ibc/") { + ibcStakeDenom = c.Denom + s.Require().Equal((int64(tokenAmt) + beforeBalance), c.Amount.Int64()) + break + } + } + + s.Require().NotEmpty(ibcStakeDenom) + }) +} + +/* +TestMultihopIBCTokenTransfer tests that sending an IBC transfer using the IBC Packet Forward Middleware accepts a port, channel and account address + +Steps: +1. Check balance of Account 1 on Chain 1 +2. Check balance of Account 2 on Chain 1 +3. Account 1 on Chain 1 sends x tokens to Account 2 on Chain 1 via Account 1 on Chain 2 +4. Check Balance of Account 1 on Chain 1, confirm it is original minus x tokens +5. Check Balance of Account 2 on Chain 1, confirm it is original plus x tokens + +*/ +// TODO: Add back only if packet forward middleware has a working version compatible with IBC v3.0.x +func (s *IntegrationTestSuite) testMultihopIBCTokenTransfer() { + time.Sleep(30 * time.Second) + + s.Run("send_successful_multihop_uatom_to_chainA_from_chainA", func() { + // require the recipient account receives the IBC tokens (IBC packets ACKd) + var ( + err error + ) + + address, _ := s.chainA.validators[0].keyInfo.GetAddress() + sender := address.String() + + address, _ = s.chainB.validators[0].keyInfo.GetAddress() + middlehop := address.String() + + address, _ = s.chainA.validators[1].keyInfo.GetAddress() + recipient := address.String() + + forwardPort := "transfer" + forwardChannel := "channel-0" + + tokenAmt := 3300000000 + + chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) + + var ( + beforeSenderUAtomBalance sdk.Coin + beforeRecipientUAtomBalance sdk.Coin + ) + + s.Require().Eventually( + func() bool { + beforeSenderUAtomBalance, err = getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) + s.Require().NoError(err) + + beforeRecipientUAtomBalance, err = getSpecificBalance(chainAAPIEndpoint, recipient, uatomDenom) + s.Require().NoError(err) + + return beforeSenderUAtomBalance.IsValid() && beforeRecipientUAtomBalance.IsValid() + }, + 1*time.Minute, + 5*time.Second, + ) + + firstHopMetadata := &PacketMetadata{ + Forward: &ForwardMetadata{ + Receiver: recipient, + Channel: forwardChannel, + Port: forwardPort, + }, + } + + memo, err := json.Marshal(firstHopMetadata) + s.Require().NoError(err) + + s.sendIBC(s.chainA, 0, sender, middlehop, strconv.Itoa(tokenAmt)+uatomDenom, standardFees.String(), string(memo)) + + s.Require().Eventually( + func() bool { + afterSenderUAtomBalance, err := getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) + s.Require().NoError(err) + + afterRecipientUAtomBalance, err := getSpecificBalance(chainAAPIEndpoint, recipient, uatomDenom) + s.Require().NoError(err) + + decremented := beforeSenderUAtomBalance.Sub(tokenAmount).Sub(standardFees).IsEqual(afterSenderUAtomBalance) + incremented := beforeRecipientUAtomBalance.Add(tokenAmount).IsEqual(afterRecipientUAtomBalance) + + return decremented && incremented + }, + 1*time.Minute, + 5*time.Second, + ) + }) +} + +/* +TestFailedMultihopIBCTokenTransfer tests that sending a failing IBC transfer using the IBC Packet Forward +Middleware will send the tokens back to the original account after failing. +*/ +func (s *IntegrationTestSuite) testFailedMultihopIBCTokenTransfer() { + time.Sleep(30 * time.Second) + + s.Run("send_failed_multihop_uatom_to_chainA_from_chainA", func() { + address, _ := s.chainA.validators[0].keyInfo.GetAddress() + sender := address.String() + + address, _ = s.chainB.validators[0].keyInfo.GetAddress() + middlehop := address.String() + + address, _ = s.chainA.validators[1].keyInfo.GetAddress() + recipient := strings.Replace(address.String(), "cosmos", "foobar", 1) // this should be an invalid recipient to force the tx to fail + + forwardPort := "transfer" + forwardChannel := "channel-0" + + tokenAmt := 3300000000 + + chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) + + var ( + beforeSenderUAtomBalance sdk.Coin + err error + ) + + s.Require().Eventually( + func() bool { + beforeSenderUAtomBalance, err = getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) + s.Require().NoError(err) + + return beforeSenderUAtomBalance.IsValid() + }, + 1*time.Minute, + 5*time.Second, + ) + + firstHopMetadata := &PacketMetadata{ + Forward: &ForwardMetadata{ + Receiver: recipient, + Channel: forwardChannel, + Port: forwardPort, + }, + } + + memo, err := json.Marshal(firstHopMetadata) + s.Require().NoError(err) + + s.sendIBC(s.chainA, 0, sender, middlehop, strconv.Itoa(tokenAmt)+uatomDenom, standardFees.String(), string(memo)) + + // Sender account should be initially decremented the full amount + s.Require().Eventually( + func() bool { + afterSenderUAtomBalance, err := getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) + s.Require().NoError(err) + + returned := beforeSenderUAtomBalance.Sub(tokenAmount).Sub(standardFees).IsEqual(afterSenderUAtomBalance) + + return returned + }, + 1*time.Minute, + 1*time.Second, + ) + + // since the forward receiving account is invalid, it should be refunded to the original sender (minus the original fee) + s.Require().Eventually( + func() bool { + afterSenderUAtomBalance, err := getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) + s.Require().NoError(err) + + returned := beforeSenderUAtomBalance.Sub(standardFees).IsEqual(afterSenderUAtomBalance) + + return returned + }, + 5*time.Minute, + 5*time.Second, + ) + }) +} diff --git a/tests/e2e/e2e_rest_regression_test.go b/tests/e2e/e2e_rest_regression_test.go index aa0c2b2f18..3ded9e0977 100644 --- a/tests/e2e/e2e_rest_regression_test.go +++ b/tests/e2e/e2e_rest_regression_test.go @@ -1,12 +1,11 @@ package e2e -// -// import ( -// "fmt" -// "net/http" -//) -// -///* +import ( + "fmt" + "net/http" +) + +// /* // RestRegression tests the continuity of critical endpoints that node operators, block explorers, and ecosystem participants depend on. // Test Node REST Endpoints: // 1. http://host:1317/validatorsets/latest @@ -26,65 +25,64 @@ package e2e // 7. Slashing params // 8. Staking params // */ -// -// const ( -// valSetLatestPath = "/validatorsets/latest" -// valSetHeightPath = "/validatorsets/1" -// blocksLatestPath = "/blocks/latest" -// blocksHeightPath = "/blocks/1" -// syncingPath = "/syncing" -// nodeInfoPath = "/node_info" -// transactionsPath = "/txs" -// bankTotalModuleQueryPath = "/bank/total" -// authParamsModuleQueryPath = "/auth/params" -// distributionCommPoolModuleQueryPath = "/distribution/community_pool" -// evidenceModuleQueryPath = "/evidence" -// govPropsModuleQueryPath = "/gov/proposals" -// mintingParamsModuleQueryPath = "/minting/parameters" -// slashingParamsModuleQueryPath = "/slashing/parameters" -// stakingParamsModuleQueryPath = "/staking/parameters" -// missingPath = "/missing_endpoint" -//) -// -// func (s *IntegrationTestSuite) testRestInterfaces() { -// s.Run("test rest interfaces", func() { -// var ( -// valIdx = 0 -// c = s.chainA -// endpointURL = fmt.Sprintf("http://%s", s.valResources[c.id][valIdx].GetHostPort("1317/tcp")) -// testEndpoints = []struct { -// Path string -// ExpectedStatus int -// }{ -// // Client Endpoints -// {nodeInfoPath, 200}, -// {syncingPath, 200}, -// {valSetLatestPath, 200}, -// {valSetHeightPath, 200}, -// {blocksLatestPath, 200}, -// {blocksHeightPath, 200}, -// {transactionsPath, 200}, -// // Module Endpoints -// {bankTotalModuleQueryPath, 200}, -// {authParamsModuleQueryPath, 200}, -// {distributionCommPoolModuleQueryPath, 200}, -// {evidenceModuleQueryPath, 200}, -// {govPropsModuleQueryPath, 200}, -// {mintingParamsModuleQueryPath, 200}, -// {slashingParamsModuleQueryPath, 200}, -// {stakingParamsModuleQueryPath, 200}, -// {missingPath, 501}, -// } -// ) -// -// for _, endpoint := range testEndpoints { -// resp, err := http.Get(fmt.Sprintf("%s%s", endpointURL, endpoint.Path)) -// s.NoError(err, fmt.Sprintf("failed to get endpoint: %s%s", endpointURL, endpoint.Path)) -// -// _, err = readJSON(resp) -// s.NoError(err, fmt.Sprintf("failed to read body of endpoint: %s%s", endpointURL, endpoint.Path)) -// -// s.EqualValues(resp.StatusCode, endpoint.ExpectedStatus) -// } -// }) -//} +const ( + valSetLatestPath = "/cosmos/base/tendermint/v1beta1/validatorsets/latest" + valSetHeightPath = "/cosmos/base/tendermint/v1beta1/validatorsets/1" + blocksLatestPath = "/cosmos/base/tendermint/v1beta1/blocks/latest" + blocksHeightPath = "/cosmos/base/tendermint/v1beta1/blocks/1" + syncingPath = "/cosmos/base/tendermint/v1beta1/syncing" + nodeInfoPath = "/cosmos/base/tendermint/v1beta1/node_info" + transactionsPath = "/cosmos/tx/v1beta1/txs?events=tx.height=9999999999" + bankTotalModuleQueryPath = "/cosmos/bank/v1beta1/supply" + authParamsModuleQueryPath = "/cosmos/auth/v1beta1/params" + distributionCommPoolModuleQueryPath = "/cosmos/distribution/v1beta1/community_pool" + evidenceModuleQueryPath = "/cosmos/evidence/v1beta1/evidence" + govPropsModuleQueryPath = "/cosmos/gov/v1beta1/proposals" + mintParamsModuleQueryPath = "/cosmos/mint/v1beta1/params" + slashingParamsModuleQueryPath = "/cosmos/slashing/v1beta1/params" + stakingParamsModuleQueryPath = "/cosmos/staking/v1beta1/params" + missingPath = "/missing_endpoint" +) + +func (s *IntegrationTestSuite) testRestInterfaces() { + s.Run("test rest interfaces", func() { + var ( + valIdx = 0 + c = s.chainA + endpointURL = fmt.Sprintf("http://%s", s.valResources[c.id][valIdx].GetHostPort("1317/tcp")) + testEndpoints = []struct { + Path string + ExpectedStatus int + }{ + // Client Endpoints + {nodeInfoPath, 200}, + {syncingPath, 200}, + {valSetLatestPath, 200}, + {valSetHeightPath, 200}, + {blocksLatestPath, 200}, + {blocksHeightPath, 200}, + {transactionsPath, 200}, + // Module Endpoints + {bankTotalModuleQueryPath, 200}, + {authParamsModuleQueryPath, 200}, + {distributionCommPoolModuleQueryPath, 200}, + {evidenceModuleQueryPath, 200}, + {govPropsModuleQueryPath, 200}, + {mintParamsModuleQueryPath, 200}, + {slashingParamsModuleQueryPath, 200}, + {stakingParamsModuleQueryPath, 200}, + {missingPath, 501}, + } + ) + + for _, endpoint := range testEndpoints { + resp, err := http.Get(fmt.Sprintf("%s%s", endpointURL, endpoint.Path)) + s.NoError(err, fmt.Sprintf("failed to get endpoint: %s%s", endpointURL, endpoint.Path)) + + _, err = readJSON(resp) + s.NoError(err, fmt.Sprintf("failed to read body of endpoint: %s%s", endpointURL, endpoint.Path)) + + s.EqualValues(resp.StatusCode, endpoint.ExpectedStatus, fmt.Sprintf("invalid status from endpoint: : %s%s", endpointURL, endpoint.Path)) + } + }) +} diff --git a/tests/e2e/e2e_setup_test.go b/tests/e2e/e2e_setup_test.go index 34c1c166ba..dac245a6ae 100644 --- a/tests/e2e/e2e_setup_test.go +++ b/tests/e2e/e2e_setup_test.go @@ -1,766 +1,603 @@ package e2e -// import ( -// "context" -// "encoding/json" -// "fmt" -// "io" -// "net/http" -// "os" -// "os/exec" -// "path" -// "path/filepath" -// "strconv" -// "strings" -// "testing" -// "time" - -// ccvprovider "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" - -// codectypes "github.com/cosmos/cosmos-sdk/codec/types" -// "github.com/cosmos/cosmos-sdk/crypto/hd" -// "github.com/cosmos/cosmos-sdk/crypto/keyring" -// "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" -// "github.com/cosmos/cosmos-sdk/server" -// srvconfig "github.com/cosmos/cosmos-sdk/server/config" -// 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" -// 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" -// stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" -// ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" -// "github.com/ory/dockertest/v3" -// "github.com/ory/dockertest/v3/docker" -// "github.com/spf13/viper" -// "github.com/stretchr/testify/suite" -// tmconfig "github.com/tendermint/tendermint/config" -// tmjson "github.com/tendermint/tendermint/libs/json" -// "github.com/tendermint/tendermint/libs/rand" -// rpchttp "github.com/tendermint/tendermint/rpc/client/http" -// ) - -// const ( -// gaiadBinary = "gaiad" -// txCommand = "tx" -// queryCommand = "query" -// keysCommand = "keys" -// gaiaHomePath = "/home/nonroot/.gaia" -// photonDenom = "photon" -// uatomDenom = "uatom" -// stakeDenom = "stake" -// initBalanceStr = "110000000000stake,100000000000000000photon,100000000000000000uatom" -// minGasPrice = "0.00001" -// // the test globalfee in genesis is the same as minGasPrice -// // global fee lower/higher than min_gas_price -// initialGlobalFeeAmt = "0.00001" -// lowGlobalFeesAmt = "0.000001" -// highGlobalFeeAmt = "0.0001" -// maxTotalBypassMinFeeMsgGasUsage = "1" -// gas = 200000 -// govProposalBlockBuffer = 35 -// relayerAccountIndexHermes0 = 0 -// relayerAccountIndexHermes1 = 1 -// numberOfEvidences = 10 -// slashingShares int64 = 10000 - -// proposalGlobalFeeFilename = "proposal_globalfee.json" -// proposalBypassMsgFilename = "proposal_bypass_msg.json" -// proposalMaxTotalBypassFilename = "proposal_max_total_bypass.json" -// proposalCommunitySpendFilename = "proposal_community_spend.json" -// proposalAddConsumerChainFilename = "proposal_add_consumer.json" -// proposalRemoveConsumerChainFilename = "proposal_remove_consumer.json" - -// hermesBinary = "hermes" -// hermesConfigWithGasPrices = "/root/.hermes/config.toml" -// hermesConfigNoGasPrices = "/root/.hermes/config-zero.toml" -// transferChannel = "channel-0" -// ) - -// var ( -// gaiaConfigPath = filepath.Join(gaiaHomePath, "config") -// stakingAmount = sdk.NewInt(100000000000) -// stakingAmountCoin = sdk.NewCoin(uatomDenom, stakingAmount) -// tokenAmount = sdk.NewCoin(uatomDenom, sdk.NewInt(3300000000)) // 3,300uatom -// standardFees = sdk.NewCoin(uatomDenom, sdk.NewInt(330000)) // 0.33uatom -// depositAmount = sdk.NewCoin(uatomDenom, sdk.NewInt(330000000)) // 3,300uatom -// distModuleAddress = authtypes.NewModuleAddress(distrtypes.ModuleName).String() -// proposalCounter = 0 -// HermesResource0Purged = false -// ) - -// type IntegrationTestSuite struct { -// suite.Suite - -// tmpDirs []string -// chainA *chain -// chainB *chain -// dkrPool *dockertest.Pool -// dkrNet *dockertest.Network -// hermesResource0 *dockertest.Resource -// hermesResource1 *dockertest.Resource - -// valResources map[string][]*dockertest.Resource -// } - -// type AddressResponse struct { -// Name string `json:"name"` -// Type string `json:"type"` -// Address string `json:"address"` -// Mnemonic string `json:"mnemonic"` -// } - -// func TestIntegrationTestSuite(t *testing.T) { -// suite.Run(t, new(IntegrationTestSuite)) -// } - -// func (s *IntegrationTestSuite) SetupSuite() { -// s.T().Log("setting up e2e integration test suite...") - -// var err error -// s.chainA, err = newChain() -// s.Require().NoError(err) - -// s.chainB, err = newChain() -// s.Require().NoError(err) - -// s.dkrPool, err = dockertest.NewPool("") -// s.Require().NoError(err) - -// s.dkrNet, err = s.dkrPool.CreateNetwork(fmt.Sprintf("%s-%s-testnet", s.chainA.id, s.chainB.id)) -// s.Require().NoError(err) - -// s.valResources = make(map[string][]*dockertest.Resource) - -// vestingMnemonic, err := createMnemonic() -// s.Require().NoError(err) - -// jailedValMnemonic, err := createMnemonic() -// s.Require().NoError(err) - -// // The boostrapping phase is as follows: -// // -// // 1. Initialize Gaia validator nodes. -// // 2. Create and initialize Gaia validator genesis files (both chains) -// // 3. Start both networks. -// // 4. Create and run IBC relayer (Hermes) containers. - -// s.T().Logf("starting e2e infrastructure for chain A; chain-id: %s; datadir: %s", s.chainA.id, s.chainA.dataDir) -// s.initNodes(s.chainA) -// s.initGenesis(s.chainA, vestingMnemonic, jailedValMnemonic) -// s.initValidatorConfigs(s.chainA) -// s.runValidators(s.chainA, 0) - -// s.T().Logf("starting e2e infrastructure for chain B; chain-id: %s; datadir: %s", s.chainB.id, s.chainB.dataDir) -// s.initNodes(s.chainB) -// s.initGenesis(s.chainB, vestingMnemonic, jailedValMnemonic) -// s.initValidatorConfigs(s.chainB) -// s.runValidators(s.chainB, 10) - -// time.Sleep(10 * time.Second) -// s.runIBCRelayer0() -// s.runIBCRelayer1() -// } - -// func (s *IntegrationTestSuite) TearDownSuite() { -// if str := os.Getenv("GAIA_E2E_SKIP_CLEANUP"); len(str) > 0 { -// skipCleanup, err := strconv.ParseBool(str) -// s.Require().NoError(err) - -// if skipCleanup { -// return -// } -// } - -// s.T().Log("tearing down e2e integration test suite...") - -// s.Require().NoError(s.dkrPool.Purge(s.hermesResource1)) -// // if runIBCTest, s.hermesResource0 already purged in TestIBC() -// // in GovSoftwareUpgrade test, s.TearDownSuite() then s.SetupSuite() -// // if IBCTest runs before GovSoftwareUpgrade, s.hermesResource0 is already purged. -// if !HermesResource0Purged { -// s.Require().NoError(s.dkrPool.Purge(s.hermesResource0)) -// } - -// for _, vr := range s.valResources { -// for _, r := range vr { -// s.Require().NoError(s.dkrPool.Purge(r)) -// } -// } - -// s.Require().NoError(s.dkrPool.RemoveNetwork(s.dkrNet)) - -// os.RemoveAll(s.chainA.dataDir) -// os.RemoveAll(s.chainB.dataDir) - -// for _, td := range s.tmpDirs { -// os.RemoveAll(td) -// } -// } - -// func (s *IntegrationTestSuite) initNodes(c *chain) { -// s.Require().NoError(c.createAndInitValidators(2)) -// /* Adding 4 accounts to val0 local directory -// c.genesisAccounts[0]: Relayer0 Wallet -// c.genesisAccounts[1]: ICA Owner -// c.genesisAccounts[2]: Test Account 1 -// c.genesisAccounts[3]: Test Account 2 -// c.genesisAccounts[4]: Relayer1 Wallet -// */ -// s.Require().NoError(c.addAccountFromMnemonic(5)) -// // Initialize a genesis file for the first validator -// val0ConfigDir := c.validators[0].configDir() -// var addrAll []sdk.AccAddress -// for _, val := range c.validators { -// address := val.keyInfo.GetAddress() -// addrAll = append(addrAll, address) -// } - -// for _, addr := range c.genesisAccounts { -// acctAddr := addr.keyInfo.GetAddress() -// addrAll = append(addrAll, acctAddr) -// } - -// s.Require().NoError( -// modifyGenesis(val0ConfigDir, "", initBalanceStr, addrAll, initialGlobalFeeAmt+uatomDenom, uatomDenom), -// ) -// // copy the genesis file to the remaining validators -// for _, val := range c.validators[1:] { -// _, err := copyFile( -// filepath.Join(val0ConfigDir, "config", "genesis.json"), -// filepath.Join(val.configDir(), "config", "genesis.json"), -// ) -// s.Require().NoError(err) -// } -// } - -// // TODO find a better way to manipulate accounts to add genesis accounts -// func (s *IntegrationTestSuite) addGenesisVestingAndJailedAccounts( -// c *chain, -// valConfigDir, -// vestingMnemonic, -// jailedValMnemonic string, -// appGenState map[string]json.RawMessage, -// ) map[string]json.RawMessage { -// var ( -// authGenState = authtypes.GetGenesisStateFromAppState(cdc, appGenState) -// bankGenState = banktypes.GetGenesisStateFromAppState(cdc, appGenState) -// stakingGenState = stakingtypes.GetGenesisStateFromAppState(cdc, appGenState) -// ) - -// // create genesis vesting accounts keys -// kb, err := keyring.New(keyringAppName, keyring.BackendTest, valConfigDir, nil) -// s.Require().NoError(err) - -// keyringAlgos, _ := kb.SupportedAlgorithms() -// algo, err := keyring.NewSigningAlgoFromString(string(hd.Secp256k1Type), keyringAlgos) -// s.Require().NoError(err) - -// // create jailed validator account keys -// jailedValKey, err := kb.NewAccount(jailedValidatorKey, jailedValMnemonic, "", sdk.FullFundraiserPath, algo) -// s.Require().NoError(err) - -// // create genesis vesting accounts keys -// c.genesisVestingAccounts = make(map[string]sdk.AccAddress) -// for i, key := range genesisVestingKeys { -// // Use the first wallet from the same mnemonic by HD path -// acc, err := kb.NewAccount(key, vestingMnemonic, "", HDPath(i), algo) -// s.Require().NoError(err) -// c.genesisVestingAccounts[key] = acc.GetAddress() -// s.T().Logf("created %s genesis account %s\n", key, c.genesisVestingAccounts[key].String()) -// } -// var ( -// continuousVestingAcc = c.genesisVestingAccounts[continuousVestingKey] -// delayedVestingAcc = c.genesisVestingAccounts[delayedVestingKey] -// ) - -// // add jailed validator to staking store -// pubKey := jailedValKey.GetPubKey() -// jailedValAcc := jailedValKey.GetAddress() -// jailedValAddr := sdk.ValAddress(jailedValAcc) -// val, err := stakingtypes.NewValidator( -// jailedValAddr, -// pubKey, -// stakingtypes.NewDescription("jailed", "", "", "", ""), -// ) -// s.Require().NoError(err) -// val.Jailed = true -// val.Tokens = sdk.NewInt(slashingShares) -// val.DelegatorShares = sdk.NewDec(slashingShares) -// stakingGenState.Validators = append(stakingGenState.Validators, val) - -// // add jailed validator delegations -// stakingGenState.Delegations = append(stakingGenState.Delegations, stakingtypes.Delegation{ -// DelegatorAddress: jailedValAcc.String(), -// ValidatorAddress: jailedValAddr.String(), -// Shares: sdk.NewDec(slashingShares), -// }) - -// appGenState[stakingtypes.ModuleName], err = cdc.MarshalJSON(stakingGenState) -// s.Require().NoError(err) - -// // add jailed account to the genesis -// baseJailedAccount := authtypes.NewBaseAccount(jailedValAcc, pubKey, 0, 0) -// s.Require().NoError(baseJailedAccount.Validate()) - -// // add continuous vesting account to the genesis -// baseVestingContinuousAccount := authtypes.NewBaseAccount( -// continuousVestingAcc, nil, 0, 0) -// vestingContinuousGenAccount := authvesting.NewContinuousVestingAccountRaw( -// authvesting.NewBaseVestingAccount( -// baseVestingContinuousAccount, -// sdk.NewCoins(vestingAmountVested), -// time.Now().Add(time.Duration(rand.Intn(80)+150)*time.Second).Unix(), -// ), -// time.Now().Add(time.Duration(rand.Intn(40)+90)*time.Second).Unix(), -// ) -// s.Require().NoError(vestingContinuousGenAccount.Validate()) - -// // add delayed vesting account to the genesis -// baseVestingDelayedAccount := authtypes.NewBaseAccount( -// delayedVestingAcc, nil, 0, 0) -// vestingDelayedGenAccount := authvesting.NewDelayedVestingAccountRaw( -// authvesting.NewBaseVestingAccount( -// baseVestingDelayedAccount, -// sdk.NewCoins(vestingAmountVested), -// time.Now().Add(time.Duration(rand.Intn(40)+90)*time.Second).Unix(), -// ), -// ) -// s.Require().NoError(vestingDelayedGenAccount.Validate()) - -// // unpack and append accounts -// accs, err := authtypes.UnpackAccounts(authGenState.Accounts) -// s.Require().NoError(err) -// accs = append(accs, vestingContinuousGenAccount, vestingDelayedGenAccount, baseJailedAccount) -// accs = authtypes.SanitizeGenesisAccounts(accs) -// genAccs, err := authtypes.PackAccounts(accs) -// s.Require().NoError(err) -// authGenState.Accounts = genAccs - -// // update auth module state -// appGenState[authtypes.ModuleName], err = cdc.MarshalJSON(&authGenState) -// s.Require().NoError(err) - -// // update balances -// vestingContinuousBalances := banktypes.Balance{ -// Address: continuousVestingAcc.String(), -// Coins: vestingBalance, -// } -// vestingDelayedBalances := banktypes.Balance{ -// Address: delayedVestingAcc.String(), -// Coins: vestingBalance, -// } -// jailedValidatorBalances := banktypes.Balance{ -// Address: jailedValAcc.String(), -// Coins: sdk.NewCoins(tokenAmount), -// } -// stakingModuleBalances := banktypes.Balance{ -// Address: authtypes.NewModuleAddress(stakingtypes.NotBondedPoolName).String(), -// Coins: sdk.NewCoins(sdk.NewCoin(uatomDenom, sdk.NewInt(slashingShares))), -// } -// bankGenState.Balances = append( -// bankGenState.Balances, -// vestingContinuousBalances, -// vestingDelayedBalances, -// jailedValidatorBalances, -// stakingModuleBalances, -// ) -// bankGenState.Balances = banktypes.SanitizeGenesisBalances(bankGenState.Balances) - -// // update the denom metadata for the bank module -// bankGenState.DenomMetadata = append(bankGenState.DenomMetadata, banktypes.Metadata{ -// Description: "An example stable token", -// Display: uatomDenom, -// Base: uatomDenom, -// Symbol: uatomDenom, -// Name: uatomDenom, -// DenomUnits: []*banktypes.DenomUnit{ -// { -// Denom: uatomDenom, -// Exponent: 0, -// }, -// }, -// }) - -// // update bank module state -// appGenState[banktypes.ModuleName], err = cdc.MarshalJSON(bankGenState) -// s.Require().NoError(err) - -// return appGenState -// } - -// func (s *IntegrationTestSuite) initGenesis(c *chain, vestingMnemonic, jailedValMnemonic string) { -// var ( -// serverCtx = server.NewDefaultContext() -// config = serverCtx.Config -// validator = c.validators[0] -// ) - -// config.SetRoot(validator.configDir()) -// config.Moniker = validator.moniker - -// genFilePath := config.GenesisFile() -// appGenState, genDoc, err := genutiltypes.GenesisStateFromGenFile(genFilePath) -// s.Require().NoError(err) - -// appGenState = s.addGenesisVestingAndJailedAccounts( -// c, -// validator.configDir(), -// vestingMnemonic, -// jailedValMnemonic, -// appGenState, -// ) - -// var evidenceGenState evidencetypes.GenesisState -// s.Require().NoError(cdc.UnmarshalJSON(appGenState[evidencetypes.ModuleName], &evidenceGenState)) - -// evidenceGenState.Evidence = make([]*codectypes.Any, numberOfEvidences) -// for i := range evidenceGenState.Evidence { -// pk := ed25519.GenPrivKey() -// evidence := &evidencetypes.Equivocation{ -// Height: 1, -// Power: 100, -// Time: time.Now().UTC(), -// ConsensusAddress: sdk.ConsAddress(pk.PubKey().Address().Bytes()).String(), -// } -// evidenceGenState.Evidence[i], err = codectypes.NewAnyWithValue(evidence) -// s.Require().NoError(err) -// } - -// appGenState[evidencetypes.ModuleName], err = cdc.MarshalJSON(&evidenceGenState) -// s.Require().NoError(err) - -// var genUtilGenState genutiltypes.GenesisState -// s.Require().NoError(cdc.UnmarshalJSON(appGenState[genutiltypes.ModuleName], &genUtilGenState)) - -// // generate genesis txs -// genTxs := make([]json.RawMessage, len(c.validators)) -// for i, val := range c.validators { -// createValmsg, err := val.buildCreateValidatorMsg(stakingAmountCoin) -// s.Require().NoError(err) -// signedTx, err := val.signMsg(createValmsg) - -// s.Require().NoError(err) - -// txRaw, err := cdc.MarshalJSON(signedTx) -// s.Require().NoError(err) - -// genTxs[i] = txRaw -// } - -// genUtilGenState.GenTxs = genTxs - -// appGenState[genutiltypes.ModuleName], err = cdc.MarshalJSON(&genUtilGenState) -// s.Require().NoError(err) - -// genDoc.AppState, err = json.MarshalIndent(appGenState, "", " ") -// s.Require().NoError(err) - -// bz, err := tmjson.MarshalIndent(genDoc, "", " ") -// s.Require().NoError(err) - -// vestingPeriod, err := generateVestingPeriod() -// s.Require().NoError(err) - -// rawTx, _, err := buildRawTx() -// s.Require().NoError(err) - -// // write the updated genesis file to each validator. -// for _, val := range c.validators { -// err = writeFile(filepath.Join(val.configDir(), "config", "genesis.json"), bz) -// s.Require().NoError(err) - -// err = writeFile(filepath.Join(val.configDir(), vestingPeriodFile), vestingPeriod) -// s.Require().NoError(err) - -// err = writeFile(filepath.Join(val.configDir(), rawTxFile), rawTx) -// s.Require().NoError(err) -// } -// } - -// // initValidatorConfigs initializes the validator configs for the given chain. -// func (s *IntegrationTestSuite) initValidatorConfigs(c *chain) { -// for i, val := range c.validators { -// tmCfgPath := filepath.Join(val.configDir(), "config", "config.toml") - -// vpr := viper.New() -// vpr.SetConfigFile(tmCfgPath) -// s.Require().NoError(vpr.ReadInConfig()) - -// valConfig := tmconfig.DefaultConfig() - -// s.Require().NoError(vpr.Unmarshal(valConfig)) - -// valConfig.P2P.ListenAddress = "tcp://0.0.0.0:26656" -// valConfig.P2P.AddrBookStrict = false -// valConfig.P2P.ExternalAddress = fmt.Sprintf("%s:%d", val.instanceName(), 26656) -// valConfig.RPC.ListenAddress = "tcp://0.0.0.0:26657" -// valConfig.StateSync.Enable = false -// valConfig.LogLevel = "info" - -// var peers []string - -// for j := 0; j < len(c.validators); j++ { -// if i == j { -// continue -// } - -// peer := c.validators[j] -// peerID := fmt.Sprintf("%s@%s%d:26656", peer.nodeKey.ID(), peer.moniker, j) -// peers = append(peers, peerID) -// } - -// valConfig.P2P.PersistentPeers = strings.Join(peers, ",") - -// tmconfig.WriteConfigFile(tmCfgPath, valConfig) - -// // set application configuration -// appCfgPath := filepath.Join(val.configDir(), "config", "app.toml") - -// appConfig := srvconfig.DefaultConfig() -// appConfig.API.Enable = true -// appConfig.MinGasPrices = fmt.Sprintf("%s%s", minGasPrice, uatomDenom) - -// srvconfig.SetConfigTemplate(srvconfig.DefaultConfigTemplate) -// srvconfig.WriteConfigFile(appCfgPath, appConfig) -// } -// } - -// // runValidators runs the validators in the chain -// func (s *IntegrationTestSuite) runValidators(c *chain, portOffset int) { -// s.T().Logf("starting Gaia %s validator containers...", c.id) - -// s.valResources[c.id] = make([]*dockertest.Resource, len(c.validators)) -// for i, val := range c.validators { -// runOpts := &dockertest.RunOptions{ -// Name: val.instanceName(), -// NetworkID: s.dkrNet.Network.ID, -// Mounts: []string{ -// fmt.Sprintf("%s/:%s", val.configDir(), gaiaHomePath), -// }, -// Repository: "cosmos/gaiad-e2e", -// } - -// s.Require().NoError(exec.Command("chmod", "-R", "0777", val.configDir()).Run()) //nolint:gosec // this is a test - -// // expose the first validator for debugging and communication -// if val.index == 0 { -// runOpts.PortBindings = map[docker.Port][]docker.PortBinding{ -// "1317/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 1317+portOffset)}}, -// "6060/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 6060+portOffset)}}, -// "6061/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 6061+portOffset)}}, -// "6062/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 6062+portOffset)}}, -// "6063/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 6063+portOffset)}}, -// "6064/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 6064+portOffset)}}, -// "6065/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 6065+portOffset)}}, -// "9090/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 9090+portOffset)}}, -// "26656/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 26656+portOffset)}}, -// "26657/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 26657+portOffset)}}, -// } -// } - -// resource, err := s.dkrPool.RunWithOptions(runOpts, noRestart) -// s.Require().NoError(err) - -// s.valResources[c.id][i] = resource -// s.T().Logf("started Gaia %s validator container: %s", c.id, resource.Container.ID) -// } - -// rpcClient, err := rpchttp.New("tcp://localhost:26657", "/websocket") -// s.Require().NoError(err) - -// s.Require().Eventually( -// func() bool { -// ctx, cancel := context.WithTimeout(context.Background(), time.Second*5) -// defer cancel() - -// status, err := rpcClient.Status(ctx) -// if err != nil { -// return false -// } - -// // let the node produce a few blocks -// if status.SyncInfo.CatchingUp || status.SyncInfo.LatestBlockHeight < 3 { -// return false -// } - -// return true -// }, -// 5*time.Minute, -// time.Second, -// "Gaia node failed to produce blocks", -// ) -// } - -// func noRestart(config *docker.HostConfig) { -// // in this case we don't want the nodes to restart on failure -// config.RestartPolicy = docker.RestartPolicy{ -// Name: "no", -// } -// } - -// // hermes0 is for ibc and packet-forward-middleware(PFM) test, hermes0 is keep running during the ibc and PFM test. -// func (s *IntegrationTestSuite) runIBCRelayer0() { -// s.T().Log("starting Hermes relayer container 0...") - -// tmpDir, err := os.MkdirTemp("", "gaia-e2e-testnet-hermes-") -// s.Require().NoError(err) -// s.tmpDirs = append(s.tmpDirs, tmpDir) - -// gaiaAVal := s.chainA.validators[0] -// gaiaBVal := s.chainB.validators[0] - -// gaiaARly := s.chainA.genesisAccounts[relayerAccountIndexHermes0] -// gaiaBRly := s.chainB.genesisAccounts[relayerAccountIndexHermes0] - -// hermesCfgPath := path.Join(tmpDir, "hermes") - -// s.Require().NoError(os.MkdirAll(hermesCfgPath, 0o755)) -// _, err = copyFile( -// filepath.Join("./scripts/", "hermes_bootstrap.sh"), -// filepath.Join(hermesCfgPath, "hermes_bootstrap.sh"), -// ) -// s.Require().NoError(err) - -// s.hermesResource0, err = s.dkrPool.RunWithOptions( -// &dockertest.RunOptions{ -// Name: fmt.Sprintf("%s-%s-relayer-0", s.chainA.id, s.chainB.id), -// Repository: "ghcr.io/cosmos/hermes-e2e", -// Tag: "1.0.0", -// NetworkID: s.dkrNet.Network.ID, -// Mounts: []string{ -// fmt.Sprintf("%s/:/root/hermes", hermesCfgPath), -// }, -// PortBindings: map[docker.Port][]docker.PortBinding{ -// "3031/tcp": {{HostIP: "", HostPort: "3031"}}, -// }, -// Env: []string{ -// fmt.Sprintf("GAIA_A_E2E_CHAIN_ID=%s", s.chainA.id), -// fmt.Sprintf("GAIA_B_E2E_CHAIN_ID=%s", s.chainB.id), -// fmt.Sprintf("GAIA_A_E2E_VAL_MNEMONIC=%s", gaiaAVal.mnemonic), -// fmt.Sprintf("GAIA_B_E2E_VAL_MNEMONIC=%s", gaiaBVal.mnemonic), -// fmt.Sprintf("GAIA_A_E2E_RLY_MNEMONIC=%s", gaiaARly.mnemonic), -// fmt.Sprintf("GAIA_B_E2E_RLY_MNEMONIC=%s", gaiaBRly.mnemonic), -// fmt.Sprintf("GAIA_A_E2E_VAL_HOST=%s", s.valResources[s.chainA.id][0].Container.Name[1:]), -// fmt.Sprintf("GAIA_B_E2E_VAL_HOST=%s", s.valResources[s.chainB.id][0].Container.Name[1:]), -// }, -// Entrypoint: []string{ -// "sh", -// "-c", -// "chmod +x /root/hermes/hermes_bootstrap.sh && /root/hermes/hermes_bootstrap.sh", -// }, -// }, -// noRestart, -// ) -// s.Require().NoError(err) - -// endpoint := fmt.Sprintf("http://%s/state", s.hermesResource0.GetHostPort("3031/tcp")) -// s.Require().Eventually( -// func() bool { -// resp, err := http.Get(endpoint) //nolint:gosec // this is a test -// if err != nil { -// return false -// } - -// defer resp.Body.Close() - -// bz, err := io.ReadAll(resp.Body) -// if err != nil { -// return false -// } - -// var respBody map[string]interface{} -// if err := json.Unmarshal(bz, &respBody); err != nil { -// return false -// } - -// status := respBody["status"].(string) -// result := respBody["result"].(map[string]interface{}) - -// return status == "success" && len(result["chains"].([]interface{})) == 2 -// }, -// 5*time.Minute, -// time.Second, -// "hermes relayer not healthy", -// ) - -// s.T().Logf("started Hermes relayer 0 container: %s", s.hermesResource0.Container.ID) - -// // XXX: Give time to both networks to start, otherwise we might see gRPC -// // transport errors. -// time.Sleep(10 * time.Second) - -// // create the client, connection and channel between the two Gaia chains -// s.createConnection() -// time.Sleep(10 * time.Second) -// s.createChannel() -// } - -// // hermes1 is for bypass-msg test. Hermes1 is to process asynchronous transactions, -// // Hermes1 has access to two Hermes configurations: one configuration allows paying fees, while the other does not. -// // With Hermes1, better control can be achieved regarding whether fees are paid when clearing transactions. -// func (s *IntegrationTestSuite) runIBCRelayer1() { -// s.T().Log("starting Hermes relayer container 1...") - -// tmpDir, err := os.MkdirTemp("", "gaia-e2e-testnet-hermes-") -// s.Require().NoError(err) -// s.tmpDirs = append(s.tmpDirs, tmpDir) - -// gaiaAVal := s.chainA.validators[0] -// gaiaBVal := s.chainB.validators[0] - -// gaiaARly := s.chainA.genesisAccounts[relayerAccountIndexHermes1] -// gaiaBRly := s.chainB.genesisAccounts[relayerAccountIndexHermes1] - -// hermesCfgPath := path.Join(tmpDir, "hermes") - -// s.Require().NoError(os.MkdirAll(hermesCfgPath, 0o755)) -// _, err = copyFile( -// filepath.Join("./scripts/", "hermes1_bootstrap.sh"), -// filepath.Join(hermesCfgPath, "hermes1_bootstrap.sh"), -// ) -// s.Require().NoError(err) - -// s.hermesResource1, err = s.dkrPool.RunWithOptions( -// &dockertest.RunOptions{ -// Name: fmt.Sprintf("%s-%s-relayer-1", s.chainA.id, s.chainB.id), -// Repository: "ghcr.io/cosmos/hermes-e2e", -// Tag: "1.0.0", -// NetworkID: s.dkrNet.Network.ID, -// Mounts: []string{ -// fmt.Sprintf("%s/:/root/hermes", hermesCfgPath), -// }, -// PortBindings: map[docker.Port][]docker.PortBinding{ -// "3032/tcp": {{HostIP: "", HostPort: "3032"}}, -// }, -// Env: []string{ -// fmt.Sprintf("GAIA_A_E2E_CHAIN_ID=%s", s.chainA.id), -// fmt.Sprintf("GAIA_B_E2E_CHAIN_ID=%s", s.chainB.id), -// fmt.Sprintf("GAIA_A_E2E_VAL_MNEMONIC=%s", gaiaAVal.mnemonic), -// fmt.Sprintf("GAIA_B_E2E_VAL_MNEMONIC=%s", gaiaBVal.mnemonic), -// fmt.Sprintf("GAIA_A_E2E_RLY_MNEMONIC=%s", gaiaARly.mnemonic), -// fmt.Sprintf("GAIA_B_E2E_RLY_MNEMONIC=%s", gaiaBRly.mnemonic), -// fmt.Sprintf("GAIA_A_E2E_VAL_HOST=%s", s.valResources[s.chainA.id][0].Container.Name[1:]), -// fmt.Sprintf("GAIA_B_E2E_VAL_HOST=%s", s.valResources[s.chainB.id][0].Container.Name[1:]), -// }, -// Entrypoint: []string{ -// "sh", -// "-c", -// "chmod +x /root/hermes/hermes1_bootstrap.sh && /root/hermes/hermes1_bootstrap.sh && tail -f /dev/null", -// }, -// }, -// noRestart, -// ) -// s.Require().NoError(err) - -// s.T().Logf("started Hermes relayer 1 container: %s", s.hermesResource1.Container.ID) - -// // XXX: Give time to both networks to start, otherwise we might see gRPC -// // transport errors. -// time.Sleep(10 * time.Second) -// } +import ( + "context" + "encoding/json" + "fmt" + "math/rand" + "os" + "os/exec" + "path/filepath" + "strconv" + "strings" + "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" + + 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" + "github.com/cosmos/cosmos-sdk/server" + srvconfig "github.com/cosmos/cosmos-sdk/server/config" + 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" + 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" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/ory/dockertest/v3" + "github.com/stretchr/testify/suite" + + // // ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + // "github.com/cosmos/cosmos-sdk/crypto/hd" + // "github.com/cosmos/cosmos-sdk/crypto/keyring" + "github.com/ory/dockertest/v3/docker" + "github.com/spf13/viper" +) + +const ( + gaiadBinary = "gaiad" + txCommand = "tx" + queryCommand = "query" + keysCommand = "keys" + gaiaHomePath = "/home/nonroot/.gaia" + // photonDenom = "photon" + uatomDenom = "uatom" + stakeDenom = "stake" + initBalanceStr = "110000000000stake,100000000000000000photon,100000000000000000uatom" + minGasPrice = "0.00001" + // // the test globalfee in genesis is the same as minGasPrice + // // global fee lower/higher than min_gas_price + initialGlobalFeeAmt = "0.00001" + // lowGlobalFeesAmt = "0.000001" + // highGlobalFeeAmt = "0.0001" + // maxTotalBypassMinFeeMsgGasUsage = "1" + gas = 200000 + + govProposalBlockBuffer = 35 + relayerAccountIndex = 0 + numberOfEvidences = 10 + slashingShares int64 = 10000 + + // proposalGlobalFeeFilename = "proposal_globalfee.json" + // proposalBypassMsgFilename = "proposal_bypass_msg.json" + // proposalMaxTotalBypassFilename = "proposal_max_total_bypass.json" + proposalCommunitySpendFilename = "proposal_community_spend.json" + +// proposalAddConsumerChainFilename = "proposal_add_consumer.json" +// proposalRemoveConsumerChainFilename = "proposal_remove_consumer.json" +) + +var ( + gaiaConfigPath = filepath.Join(gaiaHomePath, "config") + stakingAmount = sdk.NewInt(100000000000) + stakingAmountCoin = sdk.NewCoin(uatomDenom, stakingAmount) + tokenAmount = sdk.NewCoin(uatomDenom, sdk.NewInt(3300000000)) // 3,300uatom + standardFees = sdk.NewCoin(uatomDenom, sdk.NewInt(330000)) // 0.33uatom + depositAmount = sdk.NewCoin(uatomDenom, sdk.NewInt(330000000)) // 3,300uatom + distModuleAddress = authtypes.NewModuleAddress(distrtypes.ModuleName).String() + govModuleAddress = authtypes.NewModuleAddress(govtypes.ModuleName).String() + proposalCounter = 0 +) + +type IntegrationTestSuite struct { + suite.Suite + tmpDirs []string + chainA *chain + chainB *chain + dkrPool *dockertest.Pool + dkrNet *dockertest.Network + hermesResource *dockertest.Resource + valResources map[string][]*dockertest.Resource +} + +type AddressResponse struct { + Name string `json:"name"` + Type string `json:"type"` + Address string `json:"address"` + Mnemonic string `json:"mnemonic"` +} + +func TestIntegrationTestSuite(t *testing.T) { + suite.Run(t, new(IntegrationTestSuite)) +} + +func (s *IntegrationTestSuite) SetupSuite() { + s.T().Log("setting up e2e integration test suite...") + + var err error + s.chainA, err = newChain() + s.Require().NoError(err) + + s.chainB, err = newChain() + s.Require().NoError(err) + + s.dkrPool, err = dockertest.NewPool("") + s.Require().NoError(err) + + s.dkrNet, err = s.dkrPool.CreateNetwork(fmt.Sprintf("%s-%s-testnet", s.chainA.id, s.chainB.id)) + s.Require().NoError(err) + + s.valResources = make(map[string][]*dockertest.Resource) + + vestingMnemonic, err := createMnemonic() + s.Require().NoError(err) + + jailedValMnemonic, err := createMnemonic() + s.Require().NoError(err) + + // The boostrapping phase is as follows: + // + // 1. Initialize Gaia validator nodes. + // 2. Create and initialize Gaia validator genesis files (both chains) + // 3. Start both networks. + // 4. Create and run IBC relayer (Hermes) containers. + + s.T().Logf("starting e2e infrastructure for chain A; chain-id: %s; datadir: %s", s.chainA.id, s.chainA.dataDir) + s.initNodes(s.chainA) + s.initGenesis(s.chainA, vestingMnemonic, jailedValMnemonic) + s.initValidatorConfigs(s.chainA) + s.runValidators(s.chainA, 0) + + s.T().Logf("starting e2e infrastructure for chain B; chain-id: %s; datadir: %s", s.chainB.id, s.chainB.dataDir) + s.initNodes(s.chainB) + s.initGenesis(s.chainB, vestingMnemonic, jailedValMnemonic) + s.initValidatorConfigs(s.chainB) + s.runValidators(s.chainB, 10) + + time.Sleep(10 * time.Second) + s.runIBCRelayer() +} + +func (s *IntegrationTestSuite) TearDownSuite() { + if str := os.Getenv("GAIA_E2E_SKIP_CLEANUP"); len(str) > 0 { + skipCleanup, err := strconv.ParseBool(str) + s.Require().NoError(err) + + if skipCleanup { + return + } + } + + s.T().Log("tearing down e2e integration test suite...") + + if runIBCTest { + s.Require().NoError(s.dkrPool.Purge(s.hermesResource)) + } + + for _, vr := range s.valResources { + for _, r := range vr { + s.Require().NoError(s.dkrPool.Purge(r)) + } + } + + s.Require().NoError(s.dkrPool.RemoveNetwork(s.dkrNet)) + + os.RemoveAll(s.chainA.dataDir) + os.RemoveAll(s.chainB.dataDir) + + for _, td := range s.tmpDirs { + os.RemoveAll(td) + } +} + +func (s *IntegrationTestSuite) initNodes(c *chain) { + s.Require().NoError(c.createAndInitValidators(2)) + /* Adding 4 accounts to val0 local directory + c.genesisAccounts[0]: Relayer Wallet + c.genesisAccounts[1]: ICA Owner + c.genesisAccounts[2]: Test Account 1 + c.genesisAccounts[3]: Test Account 2 + */ + s.Require().NoError(c.addAccountFromMnemonic(4)) + // Initialize a genesis file for the first validator + val0ConfigDir := c.validators[0].configDir() + var addrAll []sdk.AccAddress + for _, val := range c.validators { + addr, err := val.keyInfo.GetAddress() + s.Require().NoError(err) + addrAll = append(addrAll, addr) + } + + for _, addr := range c.genesisAccounts { + acctAddr, err := addr.keyInfo.GetAddress() + s.Require().NoError(err) + addrAll = append(addrAll, acctAddr) + } + + s.Require().NoError( + modifyGenesis(val0ConfigDir, "", initBalanceStr, addrAll, initialGlobalFeeAmt+uatomDenom, uatomDenom), + ) + // copy the genesis file to the remaining validators + for _, val := range c.validators[1:] { + _, err := copyFile( + filepath.Join(val0ConfigDir, "config", "genesis.json"), + filepath.Join(val.configDir(), "config", "genesis.json"), + ) + s.Require().NoError(err) + } +} + +// TODO find a better way to manipulate accounts to add genesis accounts +func (s *IntegrationTestSuite) addGenesisVestingAndJailedAccounts( + c *chain, + valConfigDir, + vestingMnemonic, + jailedValMnemonic string, + appGenState map[string]json.RawMessage, +) map[string]json.RawMessage { + var ( + authGenState = authtypes.GetGenesisStateFromAppState(cdc, appGenState) + bankGenState = banktypes.GetGenesisStateFromAppState(cdc, appGenState) + stakingGenState = stakingtypes.GetGenesisStateFromAppState(cdc, appGenState) + ) + + // create genesis vesting accounts keys + kb, err := keyring.New(keyringAppName, keyring.BackendTest, valConfigDir, nil, cdc) + s.Require().NoError(err) + + keyringAlgos, _ := kb.SupportedAlgorithms() + algo, err := keyring.NewSigningAlgoFromString(string(hd.Secp256k1Type), keyringAlgos) + s.Require().NoError(err) + + // create jailed validator account keys + jailedValKey, err := kb.NewAccount(jailedValidatorKey, jailedValMnemonic, "", sdk.FullFundraiserPath, algo) + s.Require().NoError(err) + + // create genesis vesting accounts keys + c.genesisVestingAccounts = make(map[string]sdk.AccAddress) + for i, key := range genesisVestingKeys { + // Use the first wallet from the same mnemonic by HD path + acc, err := kb.NewAccount(key, vestingMnemonic, "", HDPath(i), algo) + s.Require().NoError(err) + c.genesisVestingAccounts[key], err = acc.GetAddress() + s.Require().NoError(err) + s.T().Logf("created %s genesis account %s\n", key, c.genesisVestingAccounts[key].String()) + } + var ( + continuousVestingAcc = c.genesisVestingAccounts[continuousVestingKey] + delayedVestingAcc = c.genesisVestingAccounts[delayedVestingKey] + ) + + // add jailed validator to staking store + pubKey, err := jailedValKey.GetPubKey() + s.Require().NoError(err) + + jailedValAcc, err := jailedValKey.GetAddress() + s.Require().NoError(err) + + jailedValAddr := sdk.ValAddress(jailedValAcc) + val, err := stakingtypes.NewValidator( + jailedValAddr, + pubKey, + stakingtypes.NewDescription("jailed", "", "", "", ""), + ) + s.Require().NoError(err) + val.Jailed = true + val.Tokens = sdk.NewInt(slashingShares) + val.DelegatorShares = sdk.NewDec(slashingShares) + stakingGenState.Validators = append(stakingGenState.Validators, val) + + // add jailed validator delegations + stakingGenState.Delegations = append(stakingGenState.Delegations, stakingtypes.Delegation{ + DelegatorAddress: jailedValAcc.String(), + ValidatorAddress: jailedValAddr.String(), + Shares: sdk.NewDec(slashingShares), + }) + + appGenState[stakingtypes.ModuleName], err = cdc.MarshalJSON(stakingGenState) + s.Require().NoError(err) + + // add jailed account to the genesis + baseJailedAccount := authtypes.NewBaseAccount(jailedValAcc, pubKey, 0, 0) + s.Require().NoError(baseJailedAccount.Validate()) + + // add continuous vesting account to the genesis + baseVestingContinuousAccount := authtypes.NewBaseAccount( + continuousVestingAcc, nil, 0, 0) + vestingContinuousGenAccount := authvesting.NewContinuousVestingAccountRaw( + authvesting.NewBaseVestingAccount( + baseVestingContinuousAccount, + sdk.NewCoins(vestingAmountVested), + time.Now().Add(time.Duration(rand.Intn(80)+150)*time.Second).Unix(), + ), + time.Now().Add(time.Duration(rand.Intn(40)+90)*time.Second).Unix(), + ) + s.Require().NoError(vestingContinuousGenAccount.Validate()) + + // add delayed vesting account to the genesis + baseVestingDelayedAccount := authtypes.NewBaseAccount( + delayedVestingAcc, nil, 0, 0) + vestingDelayedGenAccount := authvesting.NewDelayedVestingAccountRaw( + authvesting.NewBaseVestingAccount( + baseVestingDelayedAccount, + sdk.NewCoins(vestingAmountVested), + time.Now().Add(time.Duration(rand.Intn(40)+90)*time.Second).Unix(), + ), + ) + s.Require().NoError(vestingDelayedGenAccount.Validate()) + + // unpack and append accounts + accs, err := authtypes.UnpackAccounts(authGenState.Accounts) + s.Require().NoError(err) + accs = append(accs, vestingContinuousGenAccount, vestingDelayedGenAccount, baseJailedAccount) + accs = authtypes.SanitizeGenesisAccounts(accs) + genAccs, err := authtypes.PackAccounts(accs) + s.Require().NoError(err) + authGenState.Accounts = genAccs + + // update auth module state + appGenState[authtypes.ModuleName], err = cdc.MarshalJSON(&authGenState) + s.Require().NoError(err) + + // update balances + vestingContinuousBalances := banktypes.Balance{ + Address: continuousVestingAcc.String(), + Coins: vestingBalance, + } + vestingDelayedBalances := banktypes.Balance{ + Address: delayedVestingAcc.String(), + Coins: vestingBalance, + } + jailedValidatorBalances := banktypes.Balance{ + Address: jailedValAcc.String(), + Coins: sdk.NewCoins(tokenAmount), + } + stakingModuleBalances := banktypes.Balance{ + Address: authtypes.NewModuleAddress(stakingtypes.NotBondedPoolName).String(), + Coins: sdk.NewCoins(sdk.NewCoin(uatomDenom, sdk.NewInt(slashingShares))), + } + bankGenState.Balances = append( + bankGenState.Balances, + vestingContinuousBalances, + vestingDelayedBalances, + jailedValidatorBalances, + stakingModuleBalances, + ) + bankGenState.Balances = banktypes.SanitizeGenesisBalances(bankGenState.Balances) + + // update the denom metadata for the bank module + bankGenState.DenomMetadata = append(bankGenState.DenomMetadata, banktypes.Metadata{ + Description: "An example stable token", + Display: uatomDenom, + Base: uatomDenom, + Symbol: uatomDenom, + Name: uatomDenom, + DenomUnits: []*banktypes.DenomUnit{ + { + Denom: uatomDenom, + Exponent: 0, + }, + }, + }) + + // update bank module state + appGenState[banktypes.ModuleName], err = cdc.MarshalJSON(bankGenState) + s.Require().NoError(err) + + return appGenState +} + +func (s *IntegrationTestSuite) initGenesis(c *chain, vestingMnemonic, jailedValMnemonic string) { + var ( + serverCtx = server.NewDefaultContext() + config = serverCtx.Config + validator = c.validators[0] + ) + + config.SetRoot(validator.configDir()) + config.Moniker = validator.moniker + + genFilePath := config.GenesisFile() + appGenState, genDoc, err := genutiltypes.GenesisStateFromGenFile(genFilePath) + s.Require().NoError(err) + + appGenState = s.addGenesisVestingAndJailedAccounts( + c, + validator.configDir(), + vestingMnemonic, + jailedValMnemonic, + appGenState, + ) + + var evidenceGenState evidencetypes.GenesisState + s.Require().NoError(cdc.UnmarshalJSON(appGenState[evidencetypes.ModuleName], &evidenceGenState)) + + evidenceGenState.Evidence = make([]*codectypes.Any, numberOfEvidences) + for i := range evidenceGenState.Evidence { + pk := ed25519.GenPrivKey() + evidence := &evidencetypes.Equivocation{ + Height: 1, + Power: 100, + Time: time.Now().UTC(), + ConsensusAddress: sdk.ConsAddress(pk.PubKey().Address().Bytes()).String(), + } + evidenceGenState.Evidence[i], err = codectypes.NewAnyWithValue(evidence) + s.Require().NoError(err) + } + + appGenState[evidencetypes.ModuleName], err = cdc.MarshalJSON(&evidenceGenState) + s.Require().NoError(err) + + var genUtilGenState genutiltypes.GenesisState + s.Require().NoError(cdc.UnmarshalJSON(appGenState[genutiltypes.ModuleName], &genUtilGenState)) + + // generate genesis txs + genTxs := make([]json.RawMessage, len(c.validators)) + for i, val := range c.validators { + createValmsg, err := val.buildCreateValidatorMsg(stakingAmountCoin) + s.Require().NoError(err) + signedTx, err := val.signMsg(createValmsg) + + s.Require().NoError(err) + + txRaw, err := cdc.MarshalJSON(signedTx) + s.Require().NoError(err) + + genTxs[i] = txRaw + } + + genUtilGenState.GenTxs = genTxs + + appGenState[genutiltypes.ModuleName], err = cdc.MarshalJSON(&genUtilGenState) + s.Require().NoError(err) + + genDoc.AppState, err = json.MarshalIndent(appGenState, "", " ") + s.Require().NoError(err) + + bz, err := tmjson.MarshalIndent(genDoc, "", " ") + s.Require().NoError(err) + + vestingPeriod, err := generateVestingPeriod() + s.Require().NoError(err) + + rawTx, _, err := buildRawTx() + s.Require().NoError(err) + + // write the updated genesis file to each validator. + for _, val := range c.validators { + err = writeFile(filepath.Join(val.configDir(), "config", "genesis.json"), bz) + s.Require().NoError(err) + + err = writeFile(filepath.Join(val.configDir(), vestingPeriodFile), vestingPeriod) + s.Require().NoError(err) + + err = writeFile(filepath.Join(val.configDir(), rawTxFile), rawTx) + s.Require().NoError(err) + } +} + +// initValidatorConfigs initializes the validator configs for the given chain. +func (s *IntegrationTestSuite) initValidatorConfigs(c *chain) { + for i, val := range c.validators { + tmCfgPath := filepath.Join(val.configDir(), "config", "config.toml") + + vpr := viper.New() + vpr.SetConfigFile(tmCfgPath) + s.Require().NoError(vpr.ReadInConfig()) + + valConfig := tmconfig.DefaultConfig() + + s.Require().NoError(vpr.Unmarshal(valConfig)) + + valConfig.P2P.ListenAddress = "tcp://0.0.0.0:26656" + valConfig.P2P.AddrBookStrict = false + valConfig.P2P.ExternalAddress = fmt.Sprintf("%s:%d", val.instanceName(), 26656) + valConfig.RPC.ListenAddress = "tcp://0.0.0.0:26657" + valConfig.StateSync.Enable = false + valConfig.LogLevel = "info" + + var peers []string + + for j := 0; j < len(c.validators); j++ { + if i == j { + continue + } + + peer := c.validators[j] + peerID := fmt.Sprintf("%s@%s%d:26656", peer.nodeKey.ID(), peer.moniker, j) + peers = append(peers, peerID) + } + + valConfig.P2P.PersistentPeers = strings.Join(peers, ",") + + tmconfig.WriteConfigFile(tmCfgPath, valConfig) + + // set application configuration + appCfgPath := filepath.Join(val.configDir(), "config", "app.toml") + + appConfig := srvconfig.DefaultConfig() + appConfig.API.Enable = true + appConfig.API.Address = "tcp://0.0.0.0:1317" + appConfig.MinGasPrices = fmt.Sprintf("%s%s", minGasPrice, uatomDenom) + appConfig.GRPC.Address = "0.0.0.0:9090" + + srvconfig.SetConfigTemplate(srvconfig.DefaultConfigTemplate) + srvconfig.WriteConfigFile(appCfgPath, appConfig) + } +} + +// runValidators runs the validators in the chain +func (s *IntegrationTestSuite) runValidators(c *chain, portOffset int) { + s.T().Logf("starting Gaia %s validator containers...", c.id) + + s.valResources[c.id] = make([]*dockertest.Resource, len(c.validators)) + for i, val := range c.validators { + runOpts := &dockertest.RunOptions{ + Name: val.instanceName(), + NetworkID: s.dkrNet.Network.ID, + Mounts: []string{ + fmt.Sprintf("%s/:%s", val.configDir(), gaiaHomePath), + }, + Repository: "cosmos/gaiad-e2e", + } + + s.Require().NoError(exec.Command("chmod", "-R", "0777", val.configDir()).Run()) //nolint:gosec // this is a test + + // expose the first validator for debugging and communication + if val.index == 0 { + runOpts.PortBindings = map[docker.Port][]docker.PortBinding{ + "1317/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 1317+portOffset)}}, + "6060/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 6060+portOffset)}}, + "6061/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 6061+portOffset)}}, + "6062/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 6062+portOffset)}}, + "6063/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 6063+portOffset)}}, + "6064/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 6064+portOffset)}}, + "6065/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 6065+portOffset)}}, + "9090/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 9090+portOffset)}}, + "26656/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 26656+portOffset)}}, + "26657/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 26657+portOffset)}}, + } + } + + resource, err := s.dkrPool.RunWithOptions(runOpts, noRestart) + s.Require().NoError(err) + + s.valResources[c.id][i] = resource + s.T().Logf("started Gaia %s validator container: %s", c.id, resource.Container.ID) + } + + rpcClient, err := rpchttp.New("tcp://localhost:26657", "/websocket") + s.Require().NoError(err) + + s.Require().Eventually( + func() bool { + ctx, cancel := context.WithTimeout(context.Background(), time.Second*5) + defer cancel() + + status, err := rpcClient.Status(ctx) + if err != nil { + return false + } + + // let the node produce a few blocks + if status.SyncInfo.CatchingUp || status.SyncInfo.LatestBlockHeight < 3 { + return false + } + + return true + }, + 5*time.Minute, + time.Second, + "Gaia node failed to produce blocks", + ) +} + +func noRestart(config *docker.HostConfig) { + // in this case we don't want the nodes to restart on failure + config.RestartPolicy = docker.RestartPolicy{ + Name: "no", + } +} // func (s *IntegrationTestSuite) writeGovParamChangeProposalGlobalFees(c *chain, coins sdk.DecCoins) { // type ParamInfo struct { @@ -852,9 +689,45 @@ package e2e // }, "", " ") // s.Require().NoError(err) -// err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalMaxTotalBypassFilename), paramChangeProposalBody) -// s.Require().NoError(err) -// } +// err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalMaxTotalBypassFilename), paramChangeProposalBody) +// s.Require().NoError(err) +// } +func (s *IntegrationTestSuite) writeGovCommunitySpendProposal(c *chain, amount sdk.Coin, recipient string) { + msg := &distrtypes.MsgCommunityPoolSpend{ + Authority: govModuleAddress, + Recipient: recipient, + Amount: sdk.Coins{amount}, + } + + proposalCommSpend, err := govv1.NewMsgSubmitProposal( + []sdk.Msg{msg}, + sdk.Coins{sdk.NewCoin(uatomDenom, sdk.NewInt(100))}, + "JohnGalt", + "Community Pool Spend", + "Fund Team!", + "summary", + ) + s.Require().NoError(err) + res, err := cdc.MarshalInterfaceJSON(proposalCommSpend) + s.Require().NoError(err) + + err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalCommunitySpendFilename), res) + s.Require().NoError(err) +} + +func (s *IntegrationTestSuite) writeGovLegProposal(c *chain, height int64, name string) { + prop := &upgradetypes.Plan{ + Name: name, + Height: height, + Info: `{"binaries":{"os1/arch1":"url1","os2/arch2":"url2"}}`, + } + + commSpendBody, err := json.MarshalIndent(prop, "", " ") + s.Require().NoError(err) + + err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalCommunitySpendFilename), commSpendBody) + s.Require().NoError(err) +} // func (s *IntegrationTestSuite) writeGovCommunitySpendProposal(c *chain, amount string, recipient string) { // proposalCommSpend := &distrtypes.CommunityPoolSpendProposalWithDeposit{ @@ -871,65 +744,64 @@ package e2e // s.Require().NoError(err) // } -// type ConsumerAdditionProposalWithDeposit struct { -// ccvprovider.ConsumerAdditionProposal -// Deposit string `json:"deposit"` -// } - -// type ConsumerRemovalProposalWithDeposit struct { -// ccvprovider.ConsumerRemovalProposal -// Deposit string `json:"deposit"` -// } - -// func (s *IntegrationTestSuite) writeAddRemoveConsumerProposals(c *chain, consumerChainID string) { -// hash, _ := json.Marshal("Z2VuX2hhc2g=") -// addProp := &ccvprovider.ConsumerAdditionProposal{ -// Title: "Create consumer chain", -// Description: "First consumer chain", -// ChainId: consumerChainID, -// InitialHeight: ibcclienttypes.Height{ -// RevisionHeight: 1, -// }, -// GenesisHash: hash, -// BinaryHash: hash, -// SpawnTime: time.Now(), -// UnbondingPeriod: time.Duration(100000000000), -// CcvTimeoutPeriod: time.Duration(100000000000), -// TransferTimeoutPeriod: time.Duration(100000000000), -// ConsumerRedistributionFraction: "0.75", -// BlocksPerDistributionTransmission: 10, -// HistoricalEntries: 10000, -// } -// addPropWithDeposit := ConsumerAdditionProposalWithDeposit{ -// ConsumerAdditionProposal: *addProp, -// Deposit: "1000uatom", -// } - -// removeProp := &ccvprovider.ConsumerRemovalProposal{ -// Title: "Remove consumer chain", -// Description: "Removing consumer chain", -// ChainId: consumerChainID, -// StopTime: time.Now(), -// } - -// removePropWithDeposit := ConsumerRemovalProposalWithDeposit{ -// ConsumerRemovalProposal: *removeProp, -// Deposit: "1000uatom", -// } - -// consumerAddBody, err := json.MarshalIndent(addPropWithDeposit, "", " ") -// s.Require().NoError(err) - -// consumerRemoveBody, err := json.MarshalIndent(removePropWithDeposit, "", " ") -// s.Require().NoError(err) - -// err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalAddConsumerChainFilename), consumerAddBody) -// s.Require().NoError(err) -// err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalRemoveConsumerChainFilename), consumerRemoveBody) -// s.Require().NoError(err) -// } - -// func configFile(filename string) string { -// filepath := filepath.Join(gaiaConfigPath, filename) -// return filepath -// } +// type ConsumerAdditionProposalWithDeposit struct { +// ccvprovider.ConsumerAdditionProposal +// Deposit string `json:"deposit"` +// } +// +// type ConsumerRemovalProposalWithDeposit struct { +// ccvprovider.ConsumerRemovalProposal +// Deposit string `json:"deposit"` +// } +// +// func (s *IntegrationTestSuite) writeAddRemoveConsumerProposals(c *chain, consumerChainID string) { +// hash, _ := json.Marshal("Z2VuX2hhc2g=") +// addProp := &ccvprovider.ConsumerAdditionProposal{ +// Title: "Create consumer chain", +// Description: "First consumer chain", +// ChainId: consumerChainID, +// InitialHeight: ibcclienttypes.Height{ +// RevisionHeight: 1, +// }, +// GenesisHash: hash, +// BinaryHash: hash, +// SpawnTime: time.Now(), +// UnbondingPeriod: time.Duration(100000000000), +// CcvTimeoutPeriod: time.Duration(100000000000), +// TransferTimeoutPeriod: time.Duration(100000000000), +// ConsumerRedistributionFraction: "0.75", +// BlocksPerDistributionTransmission: 10, +// HistoricalEntries: 10000, +// } +// addPropWithDeposit := ConsumerAdditionProposalWithDeposit{ +// ConsumerAdditionProposal: *addProp, +// Deposit: "1000uatom", +// } +// +// removeProp := &ccvprovider.ConsumerRemovalProposal{ +// Title: "Remove consumer chain", +// Description: "Removing consumer chain", +// ChainId: consumerChainID, +// StopTime: time.Now(), +// } +// +// removePropWithDeposit := ConsumerRemovalProposalWithDeposit{ +// ConsumerRemovalProposal: *removeProp, +// Deposit: "1000uatom", +// } +// +// consumerAddBody, err := json.MarshalIndent(addPropWithDeposit, "", " ") +// s.Require().NoError(err) +// +// consumerRemoveBody, err := json.MarshalIndent(removePropWithDeposit, "", " ") +// s.Require().NoError(err) +// +// err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalAddConsumerChainFilename), consumerAddBody) +// s.Require().NoError(err) +// err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalRemoveConsumerChainFilename), consumerRemoveBody) +// s.Require().NoError(err) +// } +func configFile(filename string) string { + filepath := filepath.Join(gaiaConfigPath, filename) + return filepath +} diff --git a/tests/e2e/e2e_slashing_test.go b/tests/e2e/e2e_slashing_test.go index 614e2c2768..8974495187 100644 --- a/tests/e2e/e2e_slashing_test.go +++ b/tests/e2e/e2e_slashing_test.go @@ -1,24 +1,23 @@ package e2e -// -// const jailedValidatorKey = "jailed" -// -// func (s *IntegrationTestSuite) testSlashing(chainEndpoint string) { -// s.Run("test unjail validator", func() { -// validators, err := queryValidators(chainEndpoint) -// s.Require().NoError(err) -// -// for _, val := range validators { -// if val.Jailed { -// s.execUnjail( -// s.chainA, -// withKeyValue(flagFrom, jailedValidatorKey), -// ) -// -// valQ, err := queryValidator(chainEndpoint, val.OperatorAddress) -// s.Require().NoError(err) -// s.Require().False(valQ.Jailed) -// } -// } -// }) -//} +const jailedValidatorKey = "jailed" + +func (s *IntegrationTestSuite) testSlashing(chainEndpoint string) { + s.Run("test unjail validator", func() { + validators, err := queryValidators(chainEndpoint) + s.Require().NoError(err) + + for _, val := range validators { + if val.Jailed { + s.execUnjail( + s.chainA, + withKeyValue(flagFrom, jailedValidatorKey), + ) + + valQ, err := queryValidator(chainEndpoint, val.OperatorAddress) + s.Require().NoError(err) + s.Require().False(valQ.Jailed) + } + } + }) +} diff --git a/tests/e2e/e2e_staking_test.go b/tests/e2e/e2e_staking_test.go index 10f62fca4f..e9ab52ab9e 100644 --- a/tests/e2e/e2e_staking_test.go +++ b/tests/e2e/e2e_staking_test.go @@ -1,60 +1,59 @@ package e2e -// -// import ( -// "fmt" -// "time" -// -// sdk "github.com/cosmos/cosmos-sdk/types" -//) -// -// func (s *IntegrationTestSuite) testStaking() { -// chainEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) -// -// validatorA := s.chainA.validators[0] -// validatorB := s.chainA.validators[1] -// validatorAAddr := validatorA.keyInfo.GetAddress() -// validatorBAddr := validatorB.keyInfo.GetAddress() -// -// validatorAddressA := sdk.ValAddress(validatorAAddr).String() -// validatorAddressB := sdk.ValAddress(validatorBAddr).String() -// -// delegatorAddress := s.chainA.genesisAccounts[2].keyInfo.GetAddress().String() -// -// fees := sdk.NewCoin(uatomDenom, sdk.NewInt(1)) -// -// delegationAmount := sdk.NewInt(500000000) -// delegation := sdk.NewCoin(uatomDenom, delegationAmount) // 500 atom -// -// // Alice delegate uatom to Validator A -// s.executeDelegate(s.chainA, 0, delegation.String(), validatorAddressA, delegatorAddress, gaiaHomePath, fees.String()) -// -// // Validate delegation successful -// s.Require().Eventually( -// func() bool { -// res, err := queryDelegation(chainEndpoint, validatorAddressA, delegatorAddress) -// amt := res.GetDelegationResponse().GetDelegation().GetShares() -// s.Require().NoError(err) -// -// return amt.Equal(sdk.NewDecFromInt(delegationAmount)) -// }, -// 20*time.Second, -// 5*time.Second, -// ) -// -// // Alice re-delegate uatom from Validator A to Validator B -// s.executeRedelegate(s.chainA, 0, delegation.String(), validatorAddressA, validatorAddressB, delegatorAddress, gaiaHomePath, fees.String()) -// -// // Validate re-delegation successful -// s.Require().Eventually( -// func() bool { -// res, err := queryDelegation(chainEndpoint, validatorAddressB, delegatorAddress) -// amt := res.GetDelegationResponse().GetDelegation().GetShares() -// s.Require().NoError(err) -// -// return amt.Equal(sdk.NewDecFromInt(delegationAmount)) -// }, -// 20*time.Second, -// 5*time.Second, -// ) -//} +import ( + "fmt" + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (s *IntegrationTestSuite) testStaking() { + chainEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) + + validatorA := s.chainA.validators[0] + validatorB := s.chainA.validators[1] + validatorAAddr, _ := validatorA.keyInfo.GetAddress() + validatorBAddr, _ := validatorB.keyInfo.GetAddress() + + validatorAddressA := sdk.ValAddress(validatorAAddr).String() + validatorAddressB := sdk.ValAddress(validatorBAddr).String() + + delegatorAddress, _ := s.chainA.genesisAccounts[2].keyInfo.GetAddress() + + fees := sdk.NewCoin(uatomDenom, sdk.NewInt(1)) + + delegationAmount := sdk.NewInt(500000000) + delegation := sdk.NewCoin(uatomDenom, delegationAmount) // 500 atom + + // Alice delegate uatom to Validator A + s.executeDelegate(s.chainA, 0, delegation.String(), validatorAddressA, delegatorAddress.String(), gaiaHomePath, fees.String()) + + // Validate delegation successful + s.Require().Eventually( + func() bool { + res, err := queryDelegation(chainEndpoint, validatorAddressA, delegatorAddress.String()) + amt := res.GetDelegationResponse().GetDelegation().GetShares() + s.Require().NoError(err) + + return amt.Equal(sdk.NewDecFromInt(delegationAmount)) + }, + 20*time.Second, + 5*time.Second, + ) + + // Alice re-delegate uatom from Validator A to Validator B + s.executeRedelegate(s.chainA, 0, delegation.String(), validatorAddressA, validatorAddressB, delegatorAddress.String(), gaiaHomePath, fees.String()) + + // Validate re-delegation successful + s.Require().Eventually( + func() bool { + res, err := queryDelegation(chainEndpoint, validatorAddressB, delegatorAddress.String()) + amt := res.GetDelegationResponse().GetDelegation().GetShares() + s.Require().NoError(err) + + return amt.Equal(sdk.NewDecFromInt(delegationAmount)) + }, + 20*time.Second, + 5*time.Second, + ) +} diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go index 955d5a8bea..c6727543ef 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/e2e/e2e_test.go @@ -1,123 +1,117 @@ package e2e -// import ( -// "fmt" -// ) +import "fmt" -// var ( -// runBankTest = true -// runBypassMinFeeTest = true -// runEncodeTest = true -// runEvidenceTest = true -// runFeeGrantTest = true -// runGlobalFeesTest = true -// runGovTest = true -// runIBCTest = true -// runSlashingTest = true -// runStakingAndDistributionTest = true -// runVestingTest = true -// runRestInterfacesTest = true -// ) +var ( + runBankTest = true + // runBypassMinFeeTest = true + runEncodeTest = true + runEvidenceTest = true + runFeeGrantTest = true + // runGlobalFeesTest = true + runGovTest = true + runIBCTest = true + runSlashingTest = true + runStakingAndDistributionTest = true + runVestingTest = true + runRestInterfacesTest = true +) -// func (s *IntegrationTestSuite) TestRestInterfaces() { -// if !runRestInterfacesTest { -// s.T().Skip() -// } -// s.testRestInterfaces() -// } +func (s *IntegrationTestSuite) TestRestInterfaces() { + if !runRestInterfacesTest { + s.T().Skip() + } + s.testRestInterfaces() +} -// func (s *IntegrationTestSuite) TestBank() { -// if !runBankTest { -// s.T().Skip() -// } -// s.testBankTokenTransfer() -// } +func (s *IntegrationTestSuite) TestBank() { + if !runBankTest { + s.T().Skip() + } + s.testBankTokenTransfer() +} -// func (s *IntegrationTestSuite) TestByPassMinFee() { -// if !runBypassMinFeeTest { -// s.T().Skip() -// } -// chainAPI := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) -// s.testBypassMinFeeWithdrawReward(chainAPI) -// } +// func (s *IntegrationTestSuite) TestByPassMinFee() { +// if !runBypassMinFeeTest { +// s.T().Skip() +// } +// chainAPI := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) +// s.testBypassMinFeeWithdrawReward(chainAPI) +// } -// func (s *IntegrationTestSuite) TestEncode() { -// if !runEncodeTest { -// s.T().Skip() -// } -// s.testEncode() -// s.testDecode() -// } +func (s *IntegrationTestSuite) TestEncode() { + if !runEncodeTest { + s.T().Skip() + } + s.testEncode() + s.testDecode() +} -// func (s *IntegrationTestSuite) TestEvidence() { -// if !runEvidenceTest { -// s.T().Skip() -// } -// s.testEvidence() -// } +func (s *IntegrationTestSuite) TestEvidence() { + if !runEvidenceTest { + s.T().Skip() + } + s.testEvidence() +} -// func (s *IntegrationTestSuite) TestFeeGrant() { -// if !runFeeGrantTest { -// s.T().Skip() -// } -// s.testFeeGrant() -// } +func (s *IntegrationTestSuite) TestFeeGrant() { + if !runFeeGrantTest { + s.T().Skip() + } + s.testFeeGrant() +} -// func (s *IntegrationTestSuite) TestGlobalFees() { -// if !runGlobalFeesTest { -// s.T().Skip() -// } -// s.testGlobalFees() -// s.testQueryGlobalFeesInGenesis() -// } +// func (s *IntegrationTestSuite) TestGlobalFees() { +// if !runGlobalFeesTest { +// s.T().Skip() +// } +// s.testGlobalFees() +// s.testQueryGlobalFeesInGenesis() +// } +// -// func (s *IntegrationTestSuite) TestGov() { -// if !runGovTest { -// s.T().Skip() -// } -// s.GovSoftwareUpgrade() -// s.GovCancelSoftwareUpgrade() -// s.GovCommunityPoolSpend() -// s.AddRemoveConsumerChain() -// } +func (s *IntegrationTestSuite) TestGov() { + if !runGovTest { + s.T().Skip() + } + s.GovSoftwareUpgrade() + s.GovCancelSoftwareUpgrade() + s.GovCommunityPoolSpend() + // s.AddRemoveConsumerChain() +} -// func (s *IntegrationTestSuite) TestIBC() { -// if !runIBCTest { -// s.T().Skip() -// } -// s.testIBCTokenTransfer() -// s.testMultihopIBCTokenTransfer() -// s.testFailedMultihopIBCTokenTransfer() +func (s *IntegrationTestSuite) TestIBC() { + if !runIBCTest { + s.T().Skip() + } + s.testIBCTokenTransfer() + s.testMultihopIBCTokenTransfer() + s.testFailedMultihopIBCTokenTransfer() +} -// // stop hermes0 to prevent hermes0 relaying transactions -// s.Require().NoError(s.dkrPool.Purge(s.hermesResource0)) -// HermesResource0Purged = true -// s.testIBCBypassMsg() -// } +func (s *IntegrationTestSuite) TestSlashing() { + if !runSlashingTest { + s.T().Skip() + } + chainAPI := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) + s.testSlashing(chainAPI) +} -// func (s *IntegrationTestSuite) TestSlashing() { -// if !runSlashingTest { -// s.T().Skip() -// } -// chainAPI := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) -// s.testSlashing(chainAPI) -// } +// todo add fee test with wrong denom order +func (s *IntegrationTestSuite) TestStakingAndDistribution() { + if !runStakingAndDistributionTest { + s.T().Skip() + } + s.testStaking() + s.testDistribution() +} -// // todo add fee test with wrong denom order -// func (s *IntegrationTestSuite) TestStakingAndDistribution() { -// if !runStakingAndDistributionTest { -// s.T().Skip() -// } -// s.testStaking() -// s.testDistribution() -// } - -// func (s *IntegrationTestSuite) TestVesting() { -// if !runVestingTest { -// s.T().Skip() -// } -// chainAAPI := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) -// s.testDelayedVestingAccount(chainAAPI) -// s.testContinuousVestingAccount(chainAAPI) -// // s.testPeriodicVestingAccount(chainAAPI) TODO: add back when v0.45 adds the missing CLI command. -// } +func (s *IntegrationTestSuite) TestVesting() { + if !runVestingTest { + s.T().Skip() + } + chainAAPI := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) + s.testDelayedVestingAccount(chainAAPI) + s.testContinuousVestingAccount(chainAAPI) + // s.testPeriodicVestingAccount(chainAAPI) TODO: add back when v0.45 adds the missing CLI command. +} diff --git a/tests/e2e/e2e_vesting_test.go b/tests/e2e/e2e_vesting_test.go index c68a91c54d..0483cb8343 100644 --- a/tests/e2e/e2e_vesting_test.go +++ b/tests/e2e/e2e_vesting_test.go @@ -1,336 +1,336 @@ package e2e -// import ( -// "encoding/json" -// "math/rand" -// "path/filepath" -// "time" - -// sdk "github.com/cosmos/cosmos-sdk/types" - -// "github.com/cosmos/gaia/v11/x/globalfee/ante" -// ) - -// const ( -// delayedVestingKey = "delayed_vesting" -// continuousVestingKey = "continuous_vesting" -// lockedVestingKey = "locker_vesting" -// periodicVestingKey = "periodic_vesting" - -// vestingPeriodFile = "test_period.json" -// vestingTxDelay = 5 -// ) - -// type ( -// vestingPeriod struct { -// StartTime int64 `json:"start_time"` -// Periods []period `json:"periods"` -// } -// period struct { -// Coins string `json:"coins"` -// Length int64 `json:"length_seconds"` -// } -// ) - -// var ( -// genesisVestingKeys = []string{continuousVestingKey, delayedVestingKey, lockedVestingKey, periodicVestingKey} -// vestingAmountVested = sdk.NewCoin(uatomDenom, sdk.NewInt(99900000000)) -// vestingAmount = sdk.NewCoin(uatomDenom, sdk.NewInt(350000)) -// vestingBalance = sdk.NewCoins(vestingAmountVested).Add(vestingAmount) -// vestingDelegationAmount = sdk.NewCoin(uatomDenom, sdk.NewInt(500000000)) -// vestingDelegationFees = sdk.NewCoin(uatomDenom, sdk.NewInt(1)) -// ) - -// func (s *IntegrationTestSuite) testDelayedVestingAccount(api string) { -// var ( -// valIdx = 0 -// chain = s.chainA -// val = chain.validators[valIdx] -// vestingDelayedAcc = chain.genesisVestingAccounts[delayedVestingKey] -// ) -// sender := val.keyInfo.GetAddress() -// valOpAddr := sdk.ValAddress(sender).String() - -// s.Run("test delayed vesting genesis account", func() { -// acc, err := queryDelayedVestingAccount(api, vestingDelayedAcc.String()) -// s.Require().NoError(err) - -// // Check address balance -// balance, err := getSpecificBalance(api, vestingDelayedAcc.String(), uatomDenom) -// s.Require().NoError(err) -// s.Require().Equal(vestingBalance.AmountOf(uatomDenom), balance.Amount) - -// // Delegate coins should succeed -// s.executeDelegate(chain, valIdx, vestingDelegationAmount.String(), valOpAddr, -// vestingDelayedAcc.String(), gaiaHomePath, vestingDelegationFees.String()) - -// // Validate delegation successful -// s.Require().Eventually( -// func() bool { -// res, err := queryDelegation(api, valOpAddr, vestingDelayedAcc.String()) -// amt := res.GetDelegationResponse().GetDelegation().GetShares() -// s.Require().NoError(err) - -// return amt.Equal(sdk.NewDecFromInt(vestingDelegationAmount.Amount)) -// }, -// 20*time.Second, -// 5*time.Second, -// ) - -// waitTime := acc.EndTime - time.Now().Unix() -// if waitTime > vestingTxDelay { -// // Transfer coins should fail -// balance, err := getSpecificBalance(api, vestingDelayedAcc.String(), uatomDenom) -// s.Require().NoError(err) -// s.execBankSend( -// chain, -// valIdx, -// vestingDelayedAcc.String(), -// Address(), -// balance.Sub(standardFees).String(), -// standardFees.String(), -// true, -// ) -// waitTime = acc.EndTime - time.Now().Unix() + vestingTxDelay -// time.Sleep(time.Duration(waitTime) * time.Second) -// } - -// // Transfer coins should succeed -// balance, err = getSpecificBalance(api, vestingDelayedAcc.String(), uatomDenom) -// s.Require().NoError(err) -// s.execBankSend( -// chain, -// valIdx, -// vestingDelayedAcc.String(), -// Address(), -// balance.Sub(standardFees).String(), -// standardFees.String(), -// false, -// ) -// }) -// } - -// func (s *IntegrationTestSuite) testContinuousVestingAccount(api string) { -// s.Run("test continuous vesting genesis account", func() { -// var ( -// valIdx = 0 -// chain = s.chainA -// val = chain.validators[valIdx] -// continuousVestingAcc = chain.genesisVestingAccounts[continuousVestingKey] -// ) -// sender := val.keyInfo.GetAddress() -// valOpAddr := sdk.ValAddress(sender).String() - -// acc, err := queryContinuousVestingAccount(api, continuousVestingAcc.String()) -// s.Require().NoError(err) - -// // Check address balance -// balance, err := getSpecificBalance(api, continuousVestingAcc.String(), uatomDenom) -// s.Require().NoError(err) -// s.Require().Equal(vestingBalance.AmountOf(uatomDenom), balance.Amount) - -// // Delegate coins should succeed -// s.executeDelegate(chain, valIdx, vestingDelegationAmount.String(), -// valOpAddr, continuousVestingAcc.String(), gaiaHomePath, vestingDelegationFees.String()) - -// // Validate delegation successful -// s.Require().Eventually( -// func() bool { -// res, err := queryDelegation(api, valOpAddr, continuousVestingAcc.String()) -// amt := res.GetDelegationResponse().GetDelegation().GetShares() -// s.Require().NoError(err) - -// return amt.Equal(sdk.NewDecFromInt(vestingDelegationAmount.Amount)) -// }, -// 20*time.Second, -// 5*time.Second, -// ) - -// waitStartTime := acc.StartTime - time.Now().Unix() -// if waitStartTime > vestingTxDelay { -// // Transfer coins should fail -// balance, err := getSpecificBalance(api, continuousVestingAcc.String(), uatomDenom) -// s.Require().NoError(err) -// s.execBankSend( -// chain, -// valIdx, -// continuousVestingAcc.String(), -// Address(), -// balance.Sub(standardFees).String(), -// standardFees.String(), -// true, -// ) -// waitStartTime = acc.StartTime - time.Now().Unix() + vestingTxDelay -// time.Sleep(time.Duration(waitStartTime) * time.Second) -// } - -// waitEndTime := acc.EndTime - time.Now().Unix() -// if waitEndTime > vestingTxDelay { -// // Transfer coins should fail -// balance, err := getSpecificBalance(api, continuousVestingAcc.String(), uatomDenom) -// s.Require().NoError(err) -// s.execBankSend( -// chain, -// valIdx, -// continuousVestingAcc.String(), -// Address(), -// balance.Sub(standardFees).String(), -// standardFees.String(), -// true, -// ) -// waitEndTime = acc.EndTime - time.Now().Unix() + vestingTxDelay -// time.Sleep(time.Duration(waitEndTime) * time.Second) -// } - -// // Transfer coins should succeed -// balance, err = getSpecificBalance(api, continuousVestingAcc.String(), uatomDenom) -// s.Require().NoError(err) -// s.execBankSend( -// chain, -// valIdx, -// continuousVestingAcc.String(), -// Address(), -// balance.Sub(standardFees).String(), -// standardFees.String(), -// false, -// ) -// }) -// } - -// func (s *IntegrationTestSuite) testPeriodicVestingAccount(api string) { //nolint:unused -// s.Run("test periodic vesting genesis account", func() { -// var ( -// valIdx = 0 -// chain = s.chainA -// val = chain.validators[valIdx] -// periodicVestingAddr = chain.genesisVestingAccounts[periodicVestingKey].String() -// ) -// sender := val.keyInfo.GetAddress() -// valOpAddr := sdk.ValAddress(sender).String() - -// s.execCreatePeriodicVestingAccount( -// chain, -// periodicVestingAddr, -// filepath.Join(gaiaHomePath, vestingPeriodFile), -// withKeyValue(flagFrom, sender.String()), -// ) - -// acc, err := queryPeriodicVestingAccount(api, periodicVestingAddr) -// s.Require().NoError(err) - -// // Check address balance -// balance, err := getSpecificBalance(api, periodicVestingAddr, uatomDenom) -// s.Require().NoError(err) - -// expectedBalance := sdk.NewCoin(uatomDenom, sdk.NewInt(0)) -// for _, period := range acc.VestingPeriods { -// _, coin := ante.Find(period.Amount, uatomDenom) -// expectedBalance = expectedBalance.Add(coin) -// } -// s.Require().Equal(expectedBalance, balance) - -// waitStartTime := acc.StartTime - time.Now().Unix() -// if waitStartTime > vestingTxDelay { -// // Transfer coins should fail -// balance, err = getSpecificBalance(api, periodicVestingAddr, uatomDenom) -// s.Require().NoError(err) -// s.execBankSend( -// chain, -// valIdx, -// periodicVestingAddr, -// Address(), -// balance.Sub(standardFees).String(), -// standardFees.String(), -// true, -// ) -// waitStartTime = acc.StartTime - time.Now().Unix() + vestingTxDelay -// time.Sleep(time.Duration(waitStartTime) * time.Second) -// } - -// firstPeriod := acc.StartTime + acc.VestingPeriods[0].Length -// waitFirstPeriod := firstPeriod - time.Now().Unix() -// if waitFirstPeriod > vestingTxDelay { -// // Transfer coins should fail -// balance, err = getSpecificBalance(api, periodicVestingAddr, uatomDenom) -// s.Require().NoError(err) -// s.execBankSend( -// chain, -// valIdx, -// periodicVestingAddr, -// Address(), -// balance.Sub(standardFees).String(), -// standardFees.String(), -// true, -// ) -// waitFirstPeriod = firstPeriod - time.Now().Unix() + vestingTxDelay -// time.Sleep(time.Duration(waitFirstPeriod) * time.Second) -// } - -// // Delegate coins should succeed -// s.executeDelegate(chain, valIdx, vestingDelegationAmount.String(), valOpAddr, -// periodicVestingAddr, gaiaHomePath, vestingDelegationFees.String()) - -// // Validate delegation successful -// s.Require().Eventually( -// func() bool { -// res, err := queryDelegation(api, valOpAddr, periodicVestingAddr) -// amt := res.GetDelegationResponse().GetDelegation().GetShares() -// s.Require().NoError(err) - -// return amt.Equal(sdk.NewDecFromInt(vestingDelegationAmount.Amount)) -// }, -// 20*time.Second, -// 5*time.Second, -// ) - -// // Transfer coins should succeed -// balance, err = getSpecificBalance(api, periodicVestingAddr, uatomDenom) -// s.Require().NoError(err) -// s.execBankSend( -// chain, -// valIdx, -// periodicVestingAddr, -// Address(), -// balance.Sub(standardFees).String(), -// standardFees.String(), -// false, -// ) - -// secondPeriod := firstPeriod + acc.VestingPeriods[1].Length -// waitSecondPeriod := secondPeriod - time.Now().Unix() -// if waitSecondPeriod > vestingTxDelay { -// time.Sleep(time.Duration(waitSecondPeriod) * time.Second) - -// // Transfer coins should succeed -// balance, err = getSpecificBalance(api, periodicVestingAddr, uatomDenom) -// s.Require().NoError(err) -// s.execBankSend( -// chain, -// valIdx, -// periodicVestingAddr, -// Address(), -// balance.Sub(standardFees).String(), -// standardFees.String(), -// false, -// ) -// } -// }) -// } - -// // generateVestingPeriod generate the vesting period file -// func generateVestingPeriod() ([]byte, error) { -// p := vestingPeriod{ -// StartTime: time.Now().Add(time.Duration(rand.Intn(20)+95) * time.Second).Unix(), -// Periods: []period{ -// { -// Coins: "850000000" + uatomDenom, -// Length: 35, -// }, -// { -// Coins: "2000000000" + uatomDenom, -// Length: 35, -// }, -// }, -// } -// return json.Marshal(p) -// } +import ( + "encoding/json" + "math/rand" + "path/filepath" + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +const ( + delayedVestingKey = "delayed_vesting" + continuousVestingKey = "continuous_vesting" + lockedVestingKey = "locker_vesting" + periodicVestingKey = "periodic_vesting" + + vestingPeriodFile = "test_period.json" + vestingTxDelay = 5 +) + +type ( + vestingPeriod struct { + StartTime int64 `json:"start_time"` + Periods []period `json:"periods"` + } + period struct { + Coins string `json:"coins"` + Length int64 `json:"length_seconds"` + } +) + +var ( + genesisVestingKeys = []string{continuousVestingKey, delayedVestingKey, lockedVestingKey, periodicVestingKey} + vestingAmountVested = sdk.NewCoin(uatomDenom, sdk.NewInt(99900000000)) + vestingAmount = sdk.NewCoin(uatomDenom, sdk.NewInt(350000)) + vestingBalance = sdk.NewCoins(vestingAmountVested).Add(vestingAmount) + vestingDelegationAmount = sdk.NewCoin(uatomDenom, sdk.NewInt(500000000)) + vestingDelegationFees = sdk.NewCoin(uatomDenom, sdk.NewInt(1)) +) + +func (s *IntegrationTestSuite) testDelayedVestingAccount(api string) { + var ( + valIdx = 0 + chain = s.chainA + val = chain.validators[valIdx] + vestingDelayedAcc = chain.genesisVestingAccounts[delayedVestingKey] + ) + sender, _ := val.keyInfo.GetAddress() + valOpAddr := sdk.ValAddress(sender).String() + + s.Run("test delayed vesting genesis account", func() { + acc, err := queryDelayedVestingAccount(api, vestingDelayedAcc.String()) + s.Require().NoError(err) + + // Check address balance + balance, err := getSpecificBalance(api, vestingDelayedAcc.String(), uatomDenom) + s.Require().NoError(err) + s.Require().Equal(vestingBalance.AmountOf(uatomDenom), balance.Amount) + + // Delegate coins should succeed + s.executeDelegate(chain, valIdx, vestingDelegationAmount.String(), valOpAddr, + vestingDelayedAcc.String(), gaiaHomePath, vestingDelegationFees.String()) + + // Validate delegation successful + s.Require().Eventually( + func() bool { + res, err := queryDelegation(api, valOpAddr, vestingDelayedAcc.String()) + amt := res.GetDelegationResponse().GetDelegation().GetShares() + s.Require().NoError(err) + + return amt.Equal(sdk.NewDecFromInt(vestingDelegationAmount.Amount)) + }, + 20*time.Second, + 5*time.Second, + ) + + waitTime := acc.EndTime - time.Now().Unix() + if waitTime > vestingTxDelay { + // Transfer coins should fail + balance, err := getSpecificBalance(api, vestingDelayedAcc.String(), uatomDenom) + s.Require().NoError(err) + s.execBankSend( + chain, + valIdx, + vestingDelayedAcc.String(), + Address(), + balance.Sub(standardFees).String(), + standardFees.String(), + true, + ) + waitTime = acc.EndTime - time.Now().Unix() + vestingTxDelay + time.Sleep(time.Duration(waitTime) * time.Second) + } + + // Transfer coins should succeed + balance, err = getSpecificBalance(api, vestingDelayedAcc.String(), uatomDenom) + s.Require().NoError(err) + s.execBankSend( + chain, + valIdx, + vestingDelayedAcc.String(), + Address(), + balance.Sub(standardFees).String(), + standardFees.String(), + false, + ) + }) +} + +func (s *IntegrationTestSuite) testContinuousVestingAccount(api string) { + s.Run("test continuous vesting genesis account", func() { + var ( + valIdx = 0 + chain = s.chainA + val = chain.validators[valIdx] + continuousVestingAcc = chain.genesisVestingAccounts[continuousVestingKey] + ) + sender, _ := val.keyInfo.GetAddress() + valOpAddr := sdk.ValAddress(sender).String() + + acc, err := queryContinuousVestingAccount(api, continuousVestingAcc.String()) + s.Require().NoError(err) + + // Check address balance + balance, err := getSpecificBalance(api, continuousVestingAcc.String(), uatomDenom) + s.Require().NoError(err) + s.Require().Equal(vestingBalance.AmountOf(uatomDenom), balance.Amount) + + // Delegate coins should succeed + s.executeDelegate(chain, valIdx, vestingDelegationAmount.String(), + valOpAddr, continuousVestingAcc.String(), gaiaHomePath, vestingDelegationFees.String()) + + // Validate delegation successful + s.Require().Eventually( + func() bool { + res, err := queryDelegation(api, valOpAddr, continuousVestingAcc.String()) + amt := res.GetDelegationResponse().GetDelegation().GetShares() + s.Require().NoError(err) + + return amt.Equal(sdk.NewDecFromInt(vestingDelegationAmount.Amount)) + }, + 20*time.Second, + 5*time.Second, + ) + + waitStartTime := acc.StartTime - time.Now().Unix() + if waitStartTime > vestingTxDelay { + // Transfer coins should fail + balance, err := getSpecificBalance(api, continuousVestingAcc.String(), uatomDenom) + s.Require().NoError(err) + s.execBankSend( + chain, + valIdx, + continuousVestingAcc.String(), + Address(), + balance.Sub(standardFees).String(), + standardFees.String(), + true, + ) + waitStartTime = acc.StartTime - time.Now().Unix() + vestingTxDelay + time.Sleep(time.Duration(waitStartTime) * time.Second) + } + + waitEndTime := acc.EndTime - time.Now().Unix() + if waitEndTime > vestingTxDelay { + // Transfer coins should fail + balance, err := getSpecificBalance(api, continuousVestingAcc.String(), uatomDenom) + s.Require().NoError(err) + s.execBankSend( + chain, + valIdx, + continuousVestingAcc.String(), + Address(), + balance.Sub(standardFees).String(), + standardFees.String(), + true, + ) + waitEndTime = acc.EndTime - time.Now().Unix() + vestingTxDelay + time.Sleep(time.Duration(waitEndTime) * time.Second) + } + + // Transfer coins should succeed + balance, err = getSpecificBalance(api, continuousVestingAcc.String(), uatomDenom) + s.Require().NoError(err) + s.execBankSend( + chain, + valIdx, + continuousVestingAcc.String(), + Address(), + balance.Sub(standardFees).String(), + standardFees.String(), + false, + ) + }) +} + +func (s *IntegrationTestSuite) testPeriodicVestingAccount(api string) { //nolint:unused + + s.Run("test periodic vesting genesis account", func() { + var ( + valIdx = 0 + chain = s.chainA + val = chain.validators[valIdx] + periodicVestingAddr = chain.genesisVestingAccounts[periodicVestingKey].String() + ) + sender, _ := val.keyInfo.GetAddress() + valOpAddr := sdk.ValAddress(sender).String() + + s.execCreatePeriodicVestingAccount( + chain, + periodicVestingAddr, + filepath.Join(gaiaHomePath, vestingPeriodFile), + withKeyValue(flagFrom, sender.String()), + ) + + acc, err := queryPeriodicVestingAccount(api, periodicVestingAddr) + s.Require().NoError(err) + + // Check address balance + balance, err := getSpecificBalance(api, periodicVestingAddr, uatomDenom) + s.Require().NoError(err) + + expectedBalance := sdk.NewCoin(uatomDenom, sdk.NewInt(0)) + for _, period := range acc.VestingPeriods { + // _, coin := ante.Find(period.Amount, uatomDenom) + _, coin := period.Amount.Find(uatomDenom) + expectedBalance = expectedBalance.Add(coin) + } + s.Require().Equal(expectedBalance, balance) + + waitStartTime := acc.StartTime - time.Now().Unix() + if waitStartTime > vestingTxDelay { + // Transfer coins should fail + balance, err = getSpecificBalance(api, periodicVestingAddr, uatomDenom) + s.Require().NoError(err) + s.execBankSend( + chain, + valIdx, + periodicVestingAddr, + Address(), + balance.Sub(standardFees).String(), + standardFees.String(), + true, + ) + waitStartTime = acc.StartTime - time.Now().Unix() + vestingTxDelay + time.Sleep(time.Duration(waitStartTime) * time.Second) + } + + firstPeriod := acc.StartTime + acc.VestingPeriods[0].Length + waitFirstPeriod := firstPeriod - time.Now().Unix() + if waitFirstPeriod > vestingTxDelay { + // Transfer coins should fail + balance, err = getSpecificBalance(api, periodicVestingAddr, uatomDenom) + s.Require().NoError(err) + s.execBankSend( + chain, + valIdx, + periodicVestingAddr, + Address(), + balance.Sub(standardFees).String(), + standardFees.String(), + true, + ) + waitFirstPeriod = firstPeriod - time.Now().Unix() + vestingTxDelay + time.Sleep(time.Duration(waitFirstPeriod) * time.Second) + } + + // Delegate coins should succeed + s.executeDelegate(chain, valIdx, vestingDelegationAmount.String(), valOpAddr, + periodicVestingAddr, gaiaHomePath, vestingDelegationFees.String()) + + // Validate delegation successful + s.Require().Eventually( + func() bool { + res, err := queryDelegation(api, valOpAddr, periodicVestingAddr) + amt := res.GetDelegationResponse().GetDelegation().GetShares() + s.Require().NoError(err) + + return amt.Equal(sdk.NewDecFromInt(vestingDelegationAmount.Amount)) + }, + 20*time.Second, + 5*time.Second, + ) + + // Transfer coins should succeed + balance, err = getSpecificBalance(api, periodicVestingAddr, uatomDenom) + s.Require().NoError(err) + s.execBankSend( + chain, + valIdx, + periodicVestingAddr, + Address(), + balance.Sub(standardFees).String(), + standardFees.String(), + false, + ) + + secondPeriod := firstPeriod + acc.VestingPeriods[1].Length + waitSecondPeriod := secondPeriod - time.Now().Unix() + if waitSecondPeriod > vestingTxDelay { + time.Sleep(time.Duration(waitSecondPeriod) * time.Second) + + // Transfer coins should succeed + balance, err = getSpecificBalance(api, periodicVestingAddr, uatomDenom) + s.Require().NoError(err) + s.execBankSend( + chain, + valIdx, + periodicVestingAddr, + Address(), + balance.Sub(standardFees).String(), + standardFees.String(), + false, + ) + } + }) +} + +// generateVestingPeriod generate the vesting period file +func generateVestingPeriod() ([]byte, error) { + p := vestingPeriod{ + StartTime: time.Now().Add(time.Duration(rand.Intn(20)+95) * time.Second).Unix(), + Periods: []period{ + { + Coins: "850000000" + uatomDenom, + Length: 35, + }, + { + Coins: "2000000000" + uatomDenom, + Length: 35, + }, + }, + } + return json.Marshal(p) +} diff --git a/tests/e2e/genesis.go b/tests/e2e/genesis.go index 37f50e2e8e..00ea348bdb 100644 --- a/tests/e2e/genesis.go +++ b/tests/e2e/genesis.go @@ -1,202 +1,220 @@ package e2e -// import ( -// "encoding/json" -// "fmt" -// "os" -// "time" - -// "github.com/cosmos/cosmos-sdk/server" -// 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" -// "github.com/cosmos/cosmos-sdk/x/genutil" -// genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" -// govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" -// stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" -// icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" -// tmtypes "github.com/tendermint/tendermint/types" - -// globfeetypes "github.com/cosmos/gaia/v11/x/globalfee/types" -// ) - -// func getGenDoc(path string) (*tmtypes.GenesisDoc, error) { -// serverCtx := server.NewDefaultContext() -// config := serverCtx.Config -// config.SetRoot(path) - -// genFile := config.GenesisFile() -// doc := &tmtypes.GenesisDoc{} - -// if _, err := os.Stat(genFile); err != nil { -// if !os.IsNotExist(err) { -// return nil, err -// } -// } else { -// var err error - -// doc, err = tmtypes.GenesisDocFromFile(genFile) -// if err != nil { -// return nil, fmt.Errorf("failed to read genesis doc from file: %w", err) -// } -// } - -// return doc, nil -// } - -// func modifyGenesis(path, moniker, amountStr string, addrAll []sdk.AccAddress, globfees string, denom string) error { -// serverCtx := server.NewDefaultContext() -// config := serverCtx.Config -// config.SetRoot(path) -// config.Moniker = moniker - -// coins, err := sdk.ParseCoinsNormalized(amountStr) -// if err != nil { -// return fmt.Errorf("failed to parse coins: %w", err) -// } - -// var balances []banktypes.Balance -// var genAccounts []*authtypes.BaseAccount -// for _, addr := range addrAll { -// balance := banktypes.Balance{Address: addr.String(), Coins: coins.Sort()} -// balances = append(balances, balance) -// genAccount := authtypes.NewBaseAccount(addr, nil, 0, 0) -// genAccounts = append(genAccounts, genAccount) -// } - -// 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(cdc, appState) -// accs, err := authtypes.UnpackAccounts(authGenState.Accounts) -// if err != nil { -// return fmt.Errorf("failed to get accounts from any: %w", err) -// } - -// for _, addr := range addrAll { -// if accs.Contains(addr) { -// return fmt.Errorf("failed to add account to genesis state; account already exists: %s", addr) -// } -// } - -// // Add the new account to the set of genesis accounts and sanitize the -// // accounts afterwards. -// for _, genAcct := range genAccounts { -// accs = append(accs, genAcct) -// 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 := cdc.MarshalJSON(&authGenState) -// if err != nil { -// return fmt.Errorf("failed to marshal auth genesis state: %w", err) -// } -// appState[authtypes.ModuleName] = authGenStateBz - -// bankGenState := banktypes.GetGenesisStateFromAppState(cdc, appState) -// bankGenState.Balances = append(bankGenState.Balances, balances...) -// bankGenState.Balances = banktypes.SanitizeGenesisBalances(bankGenState.Balances) - -// bankGenStateBz, err := cdc.MarshalJSON(bankGenState) -// if err != nil { -// return fmt.Errorf("failed to marshal bank genesis state: %w", err) -// } -// appState[banktypes.ModuleName] = bankGenStateBz - -// // add ica host allowed msg types -// var icaGenesisState icatypes.GenesisState - -// if appState[icatypes.ModuleName] != nil { -// cdc.MustUnmarshalJSON(appState[icatypes.ModuleName], &icaGenesisState) -// } - -// icaGenesisState.HostGenesisState.Params.AllowMessages = []string{ -// "/cosmos.authz.v1beta1.MsgExec", -// "/cosmos.authz.v1beta1.MsgGrant", -// "/cosmos.authz.v1beta1.MsgRevoke", -// "/cosmos.bank.v1beta1.MsgSend", -// "/cosmos.bank.v1beta1.MsgMultiSend", -// "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", -// "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", -// "/cosmos.distribution.v1beta1.MsgFundCommunityPool", -// "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", -// "/cosmos.feegrant.v1beta1.MsgGrantAllowance", -// "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", -// "/cosmos.gov.v1beta1.MsgVoteWeighted", -// "/cosmos.gov.v1beta1.MsgSubmitProposal", -// "/cosmos.gov.v1beta1.MsgDeposit", -// "/cosmos.gov.v1beta1.MsgVote", -// "/cosmos.staking.v1beta1.MsgEditValidator", -// "/cosmos.staking.v1beta1.MsgDelegate", -// "/cosmos.staking.v1beta1.MsgUndelegate", -// "/cosmos.staking.v1beta1.MsgBeginRedelegate", -// "/cosmos.staking.v1beta1.MsgCreateValidator", -// "/cosmos.vesting.v1beta1.MsgCreateVestingAccount", -// "/ibc.applications.transfer.v1.MsgTransfer", -// "/tendermint.liquidity.v1beta1.MsgCreatePool", -// "/tendermint.liquidity.v1beta1.MsgSwapWithinBatch", -// "/tendermint.liquidity.v1beta1.MsgDepositWithinBatch", -// "/tendermint.liquidity.v1beta1.MsgWithdrawWithinBatch", -// } - -// icaGenesisStateBz, err := cdc.MarshalJSON(&icaGenesisState) -// if err != nil { -// return fmt.Errorf("failed to marshal interchain accounts genesis state: %w", err) -// } -// appState[icatypes.ModuleName] = icaGenesisStateBz - -// // setup global fee in genesis -// globfeeState := globfeetypes.GetGenesisStateFromAppState(cdc, appState) -// minGases, err := sdk.ParseDecCoins(globfees) -// if err != nil { -// return fmt.Errorf("failed to parse fee coins: %w", err) -// } -// globfeeState.Params.MinimumGasPrices = minGases -// globFeeStateBz, err := cdc.MarshalJSON(globfeeState) -// if err != nil { -// return fmt.Errorf("failed to marshal global fee genesis state: %w", err) -// } -// appState[globfeetypes.ModuleName] = globFeeStateBz - -// stakingGenState := stakingtypes.GetGenesisStateFromAppState(cdc, appState) -// stakingGenState.Params.BondDenom = denom -// stakingGenStateBz, err := cdc.MarshalJSON(stakingGenState) -// if err != nil { -// return fmt.Errorf("failed to marshal staking genesis state: %s", err) -// } -// appState[stakingtypes.ModuleName] = stakingGenStateBz - -// // Refactor to separate method -// amnt := sdk.NewInt(10000) -// quorum, _ := sdk.NewDecFromStr("0.000000000000000001") -// threshold, _ := sdk.NewDecFromStr("0.000000000000000001") - -// govState := govtypes.NewGenesisState(1, -// govtypes.NewDepositParams(sdk.NewCoins(sdk.NewCoin(denom, amnt)), 10*time.Minute), -// govtypes.NewVotingParams(15*time.Second), -// govtypes.NewTallyParams(quorum, threshold, govtypes.DefaultVetoThreshold), -// ) - -// govGenStateBz, err := cdc.MarshalJSON(govState) -// if err != nil { -// return fmt.Errorf("failed to marshal gov genesis state: %w", err) -// } -// appState[govtypes.ModuleName] = govGenStateBz - -// 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) -// } +import ( + "encoding/json" + "fmt" + "os" + "time" + + tmtypes "github.com/cometbft/cometbft/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" + 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/v11/x/globalfee/types" +) + +func getGenDoc(path string) (*tmtypes.GenesisDoc, error) { + serverCtx := server.NewDefaultContext() + config := serverCtx.Config + config.SetRoot(path) + + genFile := config.GenesisFile() + doc := &tmtypes.GenesisDoc{} + + if _, err := os.Stat(genFile); err != nil { + if !os.IsNotExist(err) { + return nil, err + } + } else { + var err error + + doc, err = tmtypes.GenesisDocFromFile(genFile) + if err != nil { + return nil, fmt.Errorf("failed to read genesis doc from file: %w", err) + } + } + + return doc, nil +} + +func modifyGenesis(path, moniker, amountStr string, addrAll []sdk.AccAddress, globfees string, denom string) error { //nolint:unparam + serverCtx := server.NewDefaultContext() + config := serverCtx.Config + config.SetRoot(path) + config.Moniker = moniker + + coins, err := sdk.ParseCoinsNormalized(amountStr) + if err != nil { + return fmt.Errorf("failed to parse coins: %w", err) + } + + var balances []banktypes.Balance + var genAccounts []*authtypes.BaseAccount + for _, addr := range addrAll { + balance := banktypes.Balance{Address: addr.String(), Coins: coins.Sort()} + balances = append(balances, balance) + genAccount := authtypes.NewBaseAccount(addr, nil, 0, 0) + genAccounts = append(genAccounts, genAccount) + } + + 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(cdc, appState) + accs, err := authtypes.UnpackAccounts(authGenState.Accounts) + if err != nil { + return fmt.Errorf("failed to get accounts from any: %w", err) + } + + for _, addr := range addrAll { + if accs.Contains(addr) { + return fmt.Errorf("failed to add account to genesis state; account already exists: %s", addr) + } + } + + // Add the new account to the set of genesis accounts and sanitize the + // accounts afterwards. + for _, genAcct := range genAccounts { + accs = append(accs, genAcct) + 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 := cdc.MarshalJSON(&authGenState) + if err != nil { + return fmt.Errorf("failed to marshal auth genesis state: %w", err) + } + appState[authtypes.ModuleName] = authGenStateBz + + bankGenState := banktypes.GetGenesisStateFromAppState(cdc, appState) + bankGenState.Balances = append(bankGenState.Balances, balances...) + bankGenState.Balances = banktypes.SanitizeGenesisBalances(bankGenState.Balances) + + bankGenStateBz, err := cdc.MarshalJSON(bankGenState) + if err != nil { + return fmt.Errorf("failed to marshal bank genesis state: %w", err) + } + appState[banktypes.ModuleName] = bankGenStateBz + + // add ica host allowed msg types + var icaGenesisState icagen.GenesisState + + if appState[icatypes.ModuleName] != nil { + cdc.MustUnmarshalJSON(appState[icatypes.ModuleName], &icaGenesisState) + } + + icaGenesisState.HostGenesisState.Params.AllowMessages = []string{ + "/cosmos.authz.v1beta1.MsgExec", + "/cosmos.authz.v1beta1.MsgGrant", + "/cosmos.authz.v1beta1.MsgRevoke", + "/cosmos.bank.v1beta1.MsgSend", + "/cosmos.bank.v1beta1.MsgMultiSend", + "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", + "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", + "/cosmos.distribution.v1beta1.MsgFundCommunityPool", + "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", + "/cosmos.feegrant.v1beta1.MsgGrantAllowance", + "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", + "/cosmos.gov.v1beta1.MsgVoteWeighted", + "/cosmos.gov.v1beta1.MsgSubmitProposal", + "/cosmos.gov.v1beta1.MsgDeposit", + "/cosmos.gov.v1beta1.MsgVote", + "/cosmos.staking.v1beta1.MsgEditValidator", + "/cosmos.staking.v1beta1.MsgDelegate", + "/cosmos.staking.v1beta1.MsgUndelegate", + "/cosmos.staking.v1beta1.MsgBeginRedelegate", + "/cosmos.staking.v1beta1.MsgCreateValidator", + "/cosmos.vesting.v1beta1.MsgCreateVestingAccount", + "/ibc.applications.transfer.v1.MsgTransfer", + "/tendermint.liquidity.v1beta1.MsgCreatePool", + "/tendermint.liquidity.v1beta1.MsgSwapWithinBatch", + "/tendermint.liquidity.v1beta1.MsgDepositWithinBatch", + "/tendermint.liquidity.v1beta1.MsgWithdrawWithinBatch", + } + + icaGenesisStateBz, err := cdc.MarshalJSON(&icaGenesisState) + if err != nil { + return fmt.Errorf("failed to marshal interchain accounts genesis state: %w", err) + } + appState[icatypes.ModuleName] = icaGenesisStateBz + + // setup global fee in genesis + // globfeeState := globfeetypes.GetGenesisStateFromAppState(cdc, appState) + // minGases, err := sdk.ParseDecCoins(globfees) + // if err != nil { + // return fmt.Errorf("failed to parse fee coins: %w", err) + // } + // globfeeState.Params.MinimumGasPrices = minGases + // globFeeStateBz, err := cdc.MarshalJSON(globfeeState) + // if err != nil { + // return fmt.Errorf("failed to marshal global fee genesis state: %w", err) + // } + // appState[globfeetypes.ModuleName] = globFeeStateBz + + stakingGenState := stakingtypes.GetGenesisStateFromAppState(cdc, appState) + stakingGenState.Params.BondDenom = denom + stakingGenStateBz, err := cdc.MarshalJSON(stakingGenState) + if err != nil { + return fmt.Errorf("failed to marshal staking genesis state: %s", err) + } + appState[stakingtypes.ModuleName] = stakingGenStateBz + + // Refactor to separate method + amnt := sdk.NewInt(10000) + quorum, _ := sdk.NewDecFromStr("0.000000000000000001") + threshold, _ := sdk.NewDecFromStr("0.000000000000000001") + + maxDepositPeriod := 10 * time.Minute + votingPeriod := 15 * time.Second + + govStateLegacy := govlegacytypes.NewGenesisState(1, + govlegacytypes.NewDepositParams(sdk.NewCoins(sdk.NewCoin(denom, amnt)), maxDepositPeriod), + govlegacytypes.NewVotingParams(votingPeriod), + govlegacytypes.NewTallyParams(quorum, threshold, govlegacytypes.DefaultVetoThreshold), + ) + + govStateV3, err := govmigrv3.MigrateJSON(govStateLegacy) + if err != nil { + return fmt.Errorf("failed to migrate v1beta1 gov genesis state to v3: %w", err) + } + + govStateV4, err := govmigrv4.MigrateJSON(govStateV3) + if err != nil { + return fmt.Errorf("failed to migrate v1beta1 gov genesis state to v4: %w", err) + } + + govGenStateBz, err := cdc.MarshalJSON(govStateV4) + if err != nil { + return fmt.Errorf("failed to marshal gov genesis state: %w", err) + } + appState[govtypes.ModuleName] = govGenStateBz + + 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) +} diff --git a/tests/e2e/http_util.go b/tests/e2e/http_util.go index 539eea4dc6..593759ac8b 100644 --- a/tests/e2e/http_util.go +++ b/tests/e2e/http_util.go @@ -1,40 +1,40 @@ package e2e -// import ( -// "encoding/json" -// "fmt" -// "io" -// "net/http" -// ) - -// func httpGet(endpoint string) ([]byte, error) { -// resp, err := http.Get(endpoint) //nolint:gosec // this is only used during tests -// if err != nil { -// return nil, fmt.Errorf("failed to execute HTTP request: %w", err) -// } -// defer resp.Body.Close() - -// body, err := io.ReadAll(resp.Body) -// if err != nil { -// return nil, err -// } - -// return body, nil -// } - -// func readJSON(resp *http.Response) (map[string]interface{}, error) { -// defer resp.Body.Close() - -// body, readErr := io.ReadAll(resp.Body) -// if readErr != nil { -// return nil, fmt.Errorf("failed to read Body") -// } - -// var data map[string]interface{} -// err := json.Unmarshal(body, &data) -// if err != nil { -// return nil, fmt.Errorf("failed to unmarshal response body") -// } - -// return data, nil -// } +import ( + "encoding/json" + "fmt" + "io" + "net/http" +) + +func httpGet(endpoint string) ([]byte, error) { + resp, err := http.Get(endpoint) //nolint:gosec // this is only used during tests + if err != nil { + return nil, fmt.Errorf("failed to execute HTTP request: %w", err) + } + defer resp.Body.Close() + + body, err := io.ReadAll(resp.Body) + if err != nil { + return nil, err + } + + return body, nil +} + +func readJSON(resp *http.Response) (map[string]interface{}, error) { + defer resp.Body.Close() + + body, readErr := io.ReadAll(resp.Body) + if readErr != nil { + return nil, fmt.Errorf("failed to read Body") + } + + var data map[string]interface{} + err := json.Unmarshal(body, &data) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal response body") + } + + return data, nil +} diff --git a/tests/e2e/io.go b/tests/e2e/io.go index e9b58ab366..40b316bec4 100644 --- a/tests/e2e/io.go +++ b/tests/e2e/io.go @@ -1,44 +1,44 @@ package e2e -// import ( -// "fmt" -// "io" -// "os" -// ) - -// // copyFile copy file from src to dst -// func copyFile(src, dst string) (int64, error) { -// sourceFileStat, err := os.Stat(src) -// if err != nil { -// return 0, err -// } - -// if !sourceFileStat.Mode().IsRegular() { -// return 0, fmt.Errorf("%s is not a regular file", src) -// } - -// source, err := os.Open(src) -// if err != nil { -// return 0, err -// } -// defer source.Close() - -// destination, err := os.Create(dst) -// if err != nil { -// return 0, err -// } -// defer destination.Close() - -// nBytes, err := io.Copy(destination, source) -// return nBytes, err -// } - -// // writeFile write a byte slice into a file path -// func writeFile(path string, body []byte) error { -// _, err := os.Create(path) -// if err != nil { -// return err -// } - -// return os.WriteFile(path, body, 0o600) -// } +import ( + "fmt" + "io" + "os" +) + +// copyFile copy file from src to dst +func copyFile(src, dst string) (int64, error) { //nolint:unparam + sourceFileStat, err := os.Stat(src) + if err != nil { + return 0, err + } + + if !sourceFileStat.Mode().IsRegular() { + return 0, fmt.Errorf("%s is not a regular file", src) + } + + source, err := os.Open(src) + if err != nil { + return 0, err + } + defer source.Close() + + destination, err := os.Create(dst) + if err != nil { + return 0, err + } + defer destination.Close() + + nBytes, err := io.Copy(destination, source) + return nBytes, err +} + +// writeFile write a byte slice into a file path +func writeFile(path string, body []byte) error { + _, err := os.Create(path) + if err != nil { + return err + } + + return os.WriteFile(path, body, 0o600) +} diff --git a/tests/e2e/keys.go b/tests/e2e/keys.go index 53740d5d71..d47a7ce59d 100644 --- a/tests/e2e/keys.go +++ b/tests/e2e/keys.go @@ -1,21 +1,20 @@ package e2e -// -// import ( -// "github.com/cosmos/go-bip39" -//) -// -//// createMnemonic creates a random string mnemonic -// func createMnemonic() (string, error) { -// entropySeed, err := bip39.NewEntropy(256) -// if err != nil { -// return "", err -// } -// -// mnemonic, err := bip39.NewMnemonic(entropySeed) -// if err != nil { -// return "", err -// } -// -// return mnemonic, nil -//} +import ( + "github.com/cosmos/go-bip39" +) + +// createMnemonic creates a random string mnemonic +func createMnemonic() (string, error) { + entropySeed, err := bip39.NewEntropy(256) + if err != nil { + return "", err + } + + mnemonic, err := bip39.NewMnemonic(entropySeed) + if err != nil { + return "", err + } + + return mnemonic, nil +} diff --git a/tests/e2e/query.go b/tests/e2e/query.go index 6aa90e921f..433385b1ff 100644 --- a/tests/e2e/query.go +++ b/tests/e2e/query.go @@ -1,78 +1,77 @@ package e2e -// import ( -// "encoding/json" -// "fmt" -// "io" -// "net/http" -// "strings" - -// 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" -// disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types" -// evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" - -// govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" -// stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - -// "github.com/cosmos/gaia/v11/x/globalfee/types" -// ) - -// func queryGaiaTx(endpoint, txHash string) error { -// resp, err := http.Get(fmt.Sprintf("%s/cosmos/tx/v1beta1/txs/%s", endpoint, txHash)) -// if err != nil { -// return fmt.Errorf("failed to execute HTTP request: %w", err) -// } - -// defer resp.Body.Close() - -// if resp.StatusCode != 200 { -// return fmt.Errorf("tx query returned non-200 status: %d", resp.StatusCode) -// } - -// var result map[string]interface{} -// if err := json.NewDecoder(resp.Body).Decode(&result); err != nil { -// return fmt.Errorf("failed to read response body: %w", err) -// } - -// txResp := result["tx_response"].(map[string]interface{}) -// if v := txResp["code"]; v.(float64) != 0 { -// return fmt.Errorf("tx %s failed with status code %v", txHash, v) -// } - -// return nil -// } - -// // if coin is zero, return empty coin. -// func getSpecificBalance(endpoint, addr, denom string) (amt sdk.Coin, err error) { -// balances, err := queryGaiaAllBalances(endpoint, addr) -// if err != nil { -// return amt, err -// } -// for _, c := range balances { -// if strings.Contains(c.Denom, denom) { -// amt = c -// break -// } -// } -// return amt, nil -// } - -// func queryGaiaAllBalances(endpoint, addr string) (sdk.Coins, error) { -// body, err := httpGet(fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s", endpoint, addr)) -// if err != nil { -// return nil, fmt.Errorf("failed to execute HTTP request: %w", err) -// } - -// var balancesResp banktypes.QueryAllBalancesResponse -// if err := cdc.UnmarshalJSON(body, &balancesResp); err != nil { -// return nil, err -// } - -// return balancesResp.Balances, nil -// } +import ( + "encoding/json" + "fmt" + "io" + "net/http" + "strings" + + 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" + disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + govtypesv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + + evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" + + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +func queryGaiaTx(endpoint, txHash string) error { + resp, err := http.Get(fmt.Sprintf("%s/cosmos/tx/v1beta1/txs/%s", endpoint, txHash)) + if err != nil { + return fmt.Errorf("failed to execute HTTP request: %w", err) + } + + defer resp.Body.Close() + + if resp.StatusCode != 200 { + return fmt.Errorf("tx query returned non-200 status: %d", resp.StatusCode) + } + + var result map[string]interface{} + if err := json.NewDecoder(resp.Body).Decode(&result); err != nil { + return fmt.Errorf("failed to read response body: %w", err) + } + + txResp := result["tx_response"].(map[string]interface{}) + if v := txResp["code"]; v.(float64) != 0 { + return fmt.Errorf("tx %s failed with status code %v", txHash, v) + } + + return nil +} + +// if coin is zero, return empty coin. +func getSpecificBalance(endpoint, addr, denom string) (amt sdk.Coin, err error) { + balances, err := queryGaiaAllBalances(endpoint, addr) + if err != nil { + return amt, err + } + for _, c := range balances { + if strings.Contains(c.Denom, denom) { + amt = c + break + } + } + return amt, nil +} + +func queryGaiaAllBalances(endpoint, addr string) (sdk.Coins, error) { + body, err := httpGet(fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s", endpoint, addr)) + if err != nil { + return nil, fmt.Errorf("failed to execute HTTP request: %w", err) + } + + var balancesResp banktypes.QueryAllBalancesResponse + if err := cdc.UnmarshalJSON(body, &balancesResp); err != nil { + return nil, err + } + + return balancesResp.Balances, nil +} // func queryGlobalFeeParams(endpoint string) (types.QueryParamsResponse, error) { // body, err := httpGet(fmt.Sprintf("%s/gaia/globalfee/v1beta1/params", endpoint)) @@ -106,108 +105,108 @@ package e2e // return p.Params.MaxTotalBypassMinFeeMsgGasUsage, err // } -// func queryDelegation(endpoint string, validatorAddr string, delegatorAddr string) (stakingtypes.QueryDelegationResponse, error) { -// var res stakingtypes.QueryDelegationResponse - -// body, err := httpGet(fmt.Sprintf("%s/cosmos/staking/v1beta1/validators/%s/delegations/%s", endpoint, validatorAddr, delegatorAddr)) -// if err != nil { -// return res, err -// } - -// if err = cdc.UnmarshalJSON(body, &res); err != nil { -// return res, err -// } -// return res, nil -// } - -// func queryDelegatorWithdrawalAddress(endpoint string, delegatorAddr string) (disttypes.QueryDelegatorWithdrawAddressResponse, error) { -// var res disttypes.QueryDelegatorWithdrawAddressResponse - -// body, err := httpGet(fmt.Sprintf("%s/cosmos/distribution/v1beta1/delegators/%s/withdraw_address", endpoint, delegatorAddr)) -// if err != nil { -// return res, err -// } - -// if err = cdc.UnmarshalJSON(body, &res); err != nil { -// return res, err -// } -// return res, nil -// } - -// func queryDelegatorTotalRewards(endpoint, delegatorAddr string) (disttypes.QueryDelegationTotalRewardsResponse, error) { -// var res disttypes.QueryDelegationTotalRewardsResponse - -// body, err := httpGet(fmt.Sprintf("%s/cosmos/distribution/v1beta1/delegators/%s/rewards", endpoint, delegatorAddr)) -// if err != nil { -// return res, err -// } - -// if err = cdc.UnmarshalJSON(body, &res); err != nil { -// return res, err -// } - -// return res, nil -// } - -// func queryGovProposal(endpoint string, proposalID int) (govtypes.QueryProposalResponse, error) { -// var govProposalResp govtypes.QueryProposalResponse - -// path := fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%d", endpoint, proposalID) - -// body, err := httpGet(path) -// if err != nil { -// return govProposalResp, fmt.Errorf("failed to execute HTTP request: %w", err) -// } -// if err := cdc.UnmarshalJSON(body, &govProposalResp); err != nil { -// return govProposalResp, err -// } - -// return govProposalResp, nil -// } - -// func queryAccount(endpoint, address string) (acc authtypes.AccountI, err error) { -// var res authtypes.QueryAccountResponse -// resp, err := http.Get(fmt.Sprintf("%s/cosmos/auth/v1beta1/accounts/%s", endpoint, address)) -// if err != nil { -// return nil, fmt.Errorf("failed to execute HTTP request: %w", err) -// } -// defer resp.Body.Close() - -// bz, err := io.ReadAll(resp.Body) -// if err != nil { -// return nil, err -// } -// if err := cdc.UnmarshalJSON(bz, &res); err != nil { -// return nil, err -// } -// return acc, cdc.UnpackAny(res.Account, &acc) -// } - -// func queryDelayedVestingAccount(endpoint, address string) (authvesting.DelayedVestingAccount, error) { -// baseAcc, err := queryAccount(endpoint, address) -// if err != nil { -// return authvesting.DelayedVestingAccount{}, err -// } -// acc, ok := baseAcc.(*authvesting.DelayedVestingAccount) -// if !ok { -// return authvesting.DelayedVestingAccount{}, -// fmt.Errorf("cannot cast %v to DelayedVestingAccount", baseAcc) -// } -// return *acc, nil -// } - -// func queryContinuousVestingAccount(endpoint, address string) (authvesting.ContinuousVestingAccount, error) { -// baseAcc, err := queryAccount(endpoint, address) -// if err != nil { -// return authvesting.ContinuousVestingAccount{}, err -// } -// acc, ok := baseAcc.(*authvesting.ContinuousVestingAccount) -// if !ok { -// return authvesting.ContinuousVestingAccount{}, -// fmt.Errorf("cannot cast %v to ContinuousVestingAccount", baseAcc) -// } -// return *acc, nil -// } +func queryDelegation(endpoint string, validatorAddr string, delegatorAddr string) (stakingtypes.QueryDelegationResponse, error) { + var res stakingtypes.QueryDelegationResponse + + body, err := httpGet(fmt.Sprintf("%s/cosmos/staking/v1beta1/validators/%s/delegations/%s", endpoint, validatorAddr, delegatorAddr)) + if err != nil { + return res, err + } + + if err = cdc.UnmarshalJSON(body, &res); err != nil { + return res, err + } + return res, nil +} + +func queryDelegatorWithdrawalAddress(endpoint string, delegatorAddr string) (disttypes.QueryDelegatorWithdrawAddressResponse, error) { + var res disttypes.QueryDelegatorWithdrawAddressResponse + + body, err := httpGet(fmt.Sprintf("%s/cosmos/distribution/v1beta1/delegators/%s/withdraw_address", endpoint, delegatorAddr)) + if err != nil { + return res, err + } + + if err = cdc.UnmarshalJSON(body, &res); err != nil { + return res, err + } + return res, nil +} + +func queryDelegatorTotalRewards(endpoint, delegatorAddr string) (disttypes.QueryDelegationTotalRewardsResponse, error) { //nolint:unused + var res disttypes.QueryDelegationTotalRewardsResponse + + body, err := httpGet(fmt.Sprintf("%s/cosmos/distribution/v1beta1/delegators/%s/rewards", endpoint, delegatorAddr)) + if err != nil { + return res, err + } + + if err = cdc.UnmarshalJSON(body, &res); err != nil { + return res, err + } + + return res, nil +} + +func queryGovProposal(endpoint string, proposalID int) (govtypesv1beta1.QueryProposalResponse, error) { + var govProposalResp govtypesv1beta1.QueryProposalResponse + + path := fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%d", endpoint, proposalID) + + body, err := httpGet(path) + if err != nil { + return govProposalResp, fmt.Errorf("failed to execute HTTP request: %w", err) + } + if err := cdc.UnmarshalJSON(body, &govProposalResp); err != nil { + return govProposalResp, err + } + + return govProposalResp, nil +} + +func queryAccount(endpoint, address string) (acc authtypes.AccountI, err error) { + var res authtypes.QueryAccountResponse + resp, err := http.Get(fmt.Sprintf("%s/cosmos/auth/v1beta1/accounts/%s", endpoint, address)) + if err != nil { + return nil, fmt.Errorf("failed to execute HTTP request: %w", err) + } + defer resp.Body.Close() + + bz, err := io.ReadAll(resp.Body) + if err != nil { + return nil, err + } + if err := cdc.UnmarshalJSON(bz, &res); err != nil { + return nil, err + } + return acc, cdc.UnpackAny(res.Account, &acc) +} + +func queryDelayedVestingAccount(endpoint, address string) (authvesting.DelayedVestingAccount, error) { + baseAcc, err := queryAccount(endpoint, address) + if err != nil { + return authvesting.DelayedVestingAccount{}, err + } + acc, ok := baseAcc.(*authvesting.DelayedVestingAccount) + if !ok { + return authvesting.DelayedVestingAccount{}, + fmt.Errorf("cannot cast %v to DelayedVestingAccount", baseAcc) + } + return *acc, nil +} + +func queryContinuousVestingAccount(endpoint, address string) (authvesting.ContinuousVestingAccount, error) { + baseAcc, err := queryAccount(endpoint, address) + if err != nil { + return authvesting.ContinuousVestingAccount{}, err + } + acc, ok := baseAcc.(*authvesting.ContinuousVestingAccount) + if !ok { + return authvesting.ContinuousVestingAccount{}, + fmt.Errorf("cannot cast %v to ContinuousVestingAccount", baseAcc) + } + return *acc, nil +} // func queryPermanentLockedAccount(endpoint, address string) (authvesting.PermanentLockedAccount, error) { //nolint:unused // this is called during e2e tests // baseAcc, err := queryAccount(endpoint, address) @@ -222,68 +221,68 @@ package e2e // return *acc, nil // } -// func queryPeriodicVestingAccount(endpoint, address string) (authvesting.PeriodicVestingAccount, error) { //nolint:unused // this is called during e2e tests -// baseAcc, err := queryAccount(endpoint, address) -// if err != nil { -// return authvesting.PeriodicVestingAccount{}, err -// } -// acc, ok := baseAcc.(*authvesting.PeriodicVestingAccount) -// if !ok { -// return authvesting.PeriodicVestingAccount{}, -// fmt.Errorf("cannot cast %v to PeriodicVestingAccount", baseAcc) -// } -// return *acc, nil -// } - -// func queryValidator(endpoint, address string) (stakingtypes.Validator, error) { -// var res stakingtypes.QueryValidatorResponse - -// body, err := httpGet(fmt.Sprintf("%s/cosmos/staking/v1beta1/validators/%s", endpoint, address)) -// if err != nil { -// return stakingtypes.Validator{}, fmt.Errorf("failed to execute HTTP request: %w", err) -// } - -// if err := cdc.UnmarshalJSON(body, &res); err != nil { -// return stakingtypes.Validator{}, err -// } -// return res.Validator, nil -// } - -// func queryValidators(endpoint string) (stakingtypes.Validators, error) { -// var res stakingtypes.QueryValidatorsResponse -// body, err := httpGet(fmt.Sprintf("%s/cosmos/staking/v1beta1/validators", endpoint)) -// if err != nil { -// return nil, fmt.Errorf("failed to execute HTTP request: %w", err) -// } - -// if err := cdc.UnmarshalJSON(body, &res); err != nil { -// return nil, err -// } -// return res.Validators, nil -// } - -// func queryEvidence(endpoint, hash string) (evidencetypes.QueryEvidenceResponse, error) { //nolint:unused // this is called during e2e tests -// var res evidencetypes.QueryEvidenceResponse -// body, err := httpGet(fmt.Sprintf("%s/cosmos/evidence/v1beta1/evidence/%s", endpoint, hash)) -// if err != nil { -// return res, err -// } - -// if err = cdc.UnmarshalJSON(body, &res); err != nil { -// return res, err -// } -// return res, nil -// } - -// func queryAllEvidence(endpoint string) (evidencetypes.QueryAllEvidenceResponse, error) { -// var res evidencetypes.QueryAllEvidenceResponse -// body, err := httpGet(fmt.Sprintf("%s/cosmos/evidence/v1beta1/evidence", endpoint)) -// if err != nil { -// return res, err -// } - -// if err = cdc.UnmarshalJSON(body, &res); err != nil { -// return res, err -// } -// return res, nil -// } +func queryPeriodicVestingAccount(endpoint, address string) (authvesting.PeriodicVestingAccount, error) { //nolint:unused // this is called during e2e tests + baseAcc, err := queryAccount(endpoint, address) + if err != nil { + return authvesting.PeriodicVestingAccount{}, err + } + acc, ok := baseAcc.(*authvesting.PeriodicVestingAccount) + if !ok { + return authvesting.PeriodicVestingAccount{}, + fmt.Errorf("cannot cast %v to PeriodicVestingAccount", baseAcc) + } + return *acc, nil +} + +func queryValidator(endpoint, address string) (stakingtypes.Validator, error) { + var res stakingtypes.QueryValidatorResponse + + body, err := httpGet(fmt.Sprintf("%s/cosmos/staking/v1beta1/validators/%s", endpoint, address)) + if err != nil { + return stakingtypes.Validator{}, fmt.Errorf("failed to execute HTTP request: %w", err) + } + + if err := cdc.UnmarshalJSON(body, &res); err != nil { + return stakingtypes.Validator{}, err + } + return res.Validator, nil +} + +func queryValidators(endpoint string) (stakingtypes.Validators, error) { + var res stakingtypes.QueryValidatorsResponse + body, err := httpGet(fmt.Sprintf("%s/cosmos/staking/v1beta1/validators", endpoint)) + if err != nil { + return nil, fmt.Errorf("failed to execute HTTP request: %w", err) + } + + if err := cdc.UnmarshalJSON(body, &res); err != nil { + return nil, err + } + return res.Validators, nil +} + +func queryEvidence(endpoint, hash string) (evidencetypes.QueryEvidenceResponse, error) { //nolint:unused // this is called during e2e tests + var res evidencetypes.QueryEvidenceResponse + body, err := httpGet(fmt.Sprintf("%s/cosmos/evidence/v1beta1/evidence/%s", endpoint, hash)) + if err != nil { + return res, err + } + + if err = cdc.UnmarshalJSON(body, &res); err != nil { + return res, err + } + return res, nil +} + +func queryAllEvidence(endpoint string) (evidencetypes.QueryAllEvidenceResponse, error) { + var res evidencetypes.QueryAllEvidenceResponse + body, err := httpGet(fmt.Sprintf("%s/cosmos/evidence/v1beta1/evidence", endpoint)) + if err != nil { + return res, err + } + + if err = cdc.UnmarshalJSON(body, &res); err != nil { + return res, err + } + return res, nil +} diff --git a/tests/e2e/scripts/hermes_bootstrap.sh b/tests/e2e/scripts/hermes_bootstrap.sh index dac73d254e..cc360b759b 100755 --- a/tests/e2e/scripts/hermes_bootstrap.sh +++ b/tests/e2e/scripts/hermes_bootstrap.sh @@ -83,3 +83,4 @@ hermes keys add --key-name rly01-gaia-a --chain $GAIA_A_E2E_CHAIN_ID --mnemoni sleep 5 # start Hermes relayer hermes start +# hermes listen --chain $GAIA_B_E2E_CHAIN_ID \ No newline at end of file diff --git a/tests/e2e/util.go b/tests/e2e/util.go index aae773f18e..ae136313e3 100644 --- a/tests/e2e/util.go +++ b/tests/e2e/util.go @@ -1,53 +1,52 @@ package e2e -// -// import ( -// "fmt" -// -// "github.com/cosmos/cosmos-sdk/codec/unknownproto" -// sdktx "github.com/cosmos/cosmos-sdk/types/tx" -//) -// -// func decodeTx(txBytes []byte) (*sdktx.Tx, error) { -// var raw sdktx.TxRaw -// -// // reject all unknown proto fields in the root TxRaw -// err := unknownproto.RejectUnknownFieldsStrict(txBytes, &raw, encodingConfig.InterfaceRegistry) -// if err != nil { -// return nil, fmt.Errorf("failed to reject unknown fields: %w", err) -// } -// -// if err := cdc.Unmarshal(txBytes, &raw); err != nil { -// return nil, err -// } -// -// var body sdktx.TxBody -// if err := cdc.Unmarshal(raw.BodyBytes, &body); err != nil { -// return nil, fmt.Errorf("failed to decode tx: %w", err) -// } -// -// var authInfo sdktx.AuthInfo -// -// // reject all unknown proto fields in AuthInfo -// err = unknownproto.RejectUnknownFieldsStrict(raw.AuthInfoBytes, &authInfo, encodingConfig.InterfaceRegistry) -// if err != nil { -// return nil, fmt.Errorf("failed to reject unknown fields: %w", err) -// } -// -// if err := cdc.Unmarshal(raw.AuthInfoBytes, &authInfo); err != nil { -// return nil, fmt.Errorf("failed to decode auth info: %w", err) -// } -// -// return &sdktx.Tx{ -// Body: &body, -// AuthInfo: &authInfo, -// Signatures: raw.Signatures, -// }, nil -//} -// -// func concatFlags(originalCollection []string, commandFlags []string, generalFlags []string) []string { -// originalCollection = append(originalCollection, commandFlags...) -// originalCollection = append(originalCollection, generalFlags...) -// -// return originalCollection -//} +import ( + "fmt" + + "github.com/cosmos/cosmos-sdk/codec/unknownproto" + sdktx "github.com/cosmos/cosmos-sdk/types/tx" +) + +func decodeTx(txBytes []byte) (*sdktx.Tx, error) { + var raw sdktx.TxRaw + + // reject all unknown proto fields in the root TxRaw + err := unknownproto.RejectUnknownFieldsStrict(txBytes, &raw, encodingConfig.InterfaceRegistry) + if err != nil { + return nil, fmt.Errorf("failed to reject unknown fields: %w", err) + } + + if err := cdc.Unmarshal(txBytes, &raw); err != nil { + return nil, err + } + + var body sdktx.TxBody + if err := cdc.Unmarshal(raw.BodyBytes, &body); err != nil { + return nil, fmt.Errorf("failed to decode tx: %w", err) + } + + var authInfo sdktx.AuthInfo + + // reject all unknown proto fields in AuthInfo + err = unknownproto.RejectUnknownFieldsStrict(raw.AuthInfoBytes, &authInfo, encodingConfig.InterfaceRegistry) + if err != nil { + return nil, fmt.Errorf("failed to reject unknown fields: %w", err) + } + + if err := cdc.Unmarshal(raw.AuthInfoBytes, &authInfo); err != nil { + return nil, fmt.Errorf("failed to decode auth info: %w", err) + } + + return &sdktx.Tx{ + Body: &body, + AuthInfo: &authInfo, + Signatures: raw.Signatures, + }, nil +} + +func concatFlags(originalCollection []string, commandFlags []string, generalFlags []string) []string { + originalCollection = append(originalCollection, commandFlags...) + originalCollection = append(originalCollection, generalFlags...) + + return originalCollection +} diff --git a/tests/e2e/validator.go b/tests/e2e/validator.go index 2e81c1251b..c9583bf425 100644 --- a/tests/e2e/validator.go +++ b/tests/e2e/validator.go @@ -1,319 +1,338 @@ package e2e -// import ( -// "encoding/json" -// "fmt" -// "os" -// "path" -// "path/filepath" - -// sdkcrypto "github.com/cosmos/cosmos-sdk/crypto" -// cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" -// "github.com/cosmos/cosmos-sdk/crypto/hd" -// "github.com/cosmos/cosmos-sdk/crypto/keyring" -// cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" -// "github.com/cosmos/cosmos-sdk/server" -// 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" -// tmcfg "github.com/tendermint/tendermint/config" -// tmos "github.com/tendermint/tendermint/libs/os" -// "github.com/tendermint/tendermint/p2p" -// "github.com/tendermint/tendermint/privval" - -// gaia "github.com/cosmos/gaia/v11/app" -// ) - -// //nolint:unused -// type validator struct { -// chain *chain -// index int -// moniker string -// mnemonic string -// keyInfo keyring.Info -// privateKey cryptotypes.PrivKey -// consensusKey privval.FilePVKey -// consensusPrivKey cryptotypes.PrivKey -// nodeKey p2p.NodeKey -// } - -// type account struct { -// moniker string //nolint:unused -// mnemonic string -// keyInfo keyring.Info -// privateKey cryptotypes.PrivKey -// } - -// func (v *validator) instanceName() string { -// return fmt.Sprintf("%s%d", v.moniker, v.index) -// } - -// func (v *validator) configDir() string { -// return fmt.Sprintf("%s/%s", v.chain.configDir(), v.instanceName()) -// } - -// func (v *validator) createConfig() error { -// p := path.Join(v.configDir(), "config") -// return os.MkdirAll(p, 0o755) -// } - -// func (v *validator) init() error { -// if err := v.createConfig(); err != nil { -// return err -// } - -// serverCtx := server.NewDefaultContext() -// config := serverCtx.Config - -// config.SetRoot(v.configDir()) -// config.Moniker = v.moniker - -// genDoc, err := getGenDoc(v.configDir()) -// if err != nil { -// return err -// } - -// appState, err := json.MarshalIndent(gaia.ModuleBasics.DefaultGenesis(cdc), "", " ") -// if err != nil { -// return fmt.Errorf("failed to JSON encode app genesis state: %w", err) -// } - -// genDoc.ChainID = v.chain.id -// genDoc.Validators = nil -// genDoc.AppState = appState - -// if err = genutil.ExportGenesisFile(genDoc, config.GenesisFile()); err != nil { -// return fmt.Errorf("failed to export app genesis state: %w", err) -// } - -// tmcfg.WriteConfigFile(filepath.Join(config.RootDir, "config", "config.toml"), config) -// return nil -// } - -// func (v *validator) createNodeKey() error { -// serverCtx := server.NewDefaultContext() -// config := serverCtx.Config - -// config.SetRoot(v.configDir()) -// config.Moniker = v.moniker - -// nodeKey, err := p2p.LoadOrGenNodeKey(config.NodeKeyFile()) -// if err != nil { -// return err -// } - -// v.nodeKey = *nodeKey -// return nil -// } - -// func (v *validator) createConsensusKey() error { -// serverCtx := server.NewDefaultContext() -// config := serverCtx.Config - -// config.SetRoot(v.configDir()) -// config.Moniker = v.moniker - -// pvKeyFile := config.PrivValidatorKeyFile() -// if err := tmos.EnsureDir(filepath.Dir(pvKeyFile), 0o777); err != nil { -// return err -// } - -// pvStateFile := config.PrivValidatorStateFile() -// if err := tmos.EnsureDir(filepath.Dir(pvStateFile), 0o777); err != nil { -// return err -// } - -// filePV := privval.LoadOrGenFilePV(pvKeyFile, pvStateFile) -// v.consensusKey = filePV.Key - -// return nil -// } - -// func (v *validator) createKeyFromMnemonic(name, mnemonic string) error { -// dir := v.configDir() -// kb, err := keyring.New(keyringAppName, keyring.BackendTest, dir, nil) -// if err != nil { -// return err -// } - -// keyringAlgos, _ := kb.SupportedAlgorithms() -// algo, err := keyring.NewSigningAlgoFromString(string(hd.Secp256k1Type), keyringAlgos) -// if err != nil { -// return err -// } - -// info, err := kb.NewAccount(name, mnemonic, "", sdk.FullFundraiserPath, algo) -// if err != nil { -// return err -// } - -// privKeyArmor, err := kb.ExportPrivKeyArmor(name, keyringPassphrase) -// if err != nil { -// return err -// } - -// privKey, _, err := sdkcrypto.UnarmorDecryptPrivKey(privKeyArmor, keyringPassphrase) -// if err != nil { -// return err -// } - -// v.keyInfo = info -// v.mnemonic = mnemonic -// v.privateKey = privKey - -// return nil -// } - -// func (c *chain) addAccountFromMnemonic(counts int) error { -// val0ConfigDir := c.validators[0].configDir() -// kb, err := keyring.New(keyringAppName, keyring.BackendTest, val0ConfigDir, nil) -// if err != nil { -// return err -// } - -// keyringAlgos, _ := kb.SupportedAlgorithms() -// algo, err := keyring.NewSigningAlgoFromString(string(hd.Secp256k1Type), keyringAlgos) -// if err != nil { -// return err -// } - -// for i := 0; i < counts; i++ { -// name := fmt.Sprintf("acct-%d", i) -// mnemonic, err := createMnemonic() -// if err != nil { -// return err -// } -// info, err := kb.NewAccount(name, mnemonic, "", sdk.FullFundraiserPath, algo) -// if err != nil { -// return err -// } - -// privKeyArmor, err := kb.ExportPrivKeyArmor(name, keyringPassphrase) -// if err != nil { -// return err -// } - -// privKey, _, err := sdkcrypto.UnarmorDecryptPrivKey(privKeyArmor, keyringPassphrase) -// if err != nil { -// return err -// } -// acct := account{} -// acct.keyInfo = info -// acct.mnemonic = mnemonic -// acct.privateKey = privKey -// c.genesisAccounts = append(c.genesisAccounts, &acct) -// } - -// return nil -// } - -// func (v *validator) createKey(name string) error { -// mnemonic, err := createMnemonic() -// if err != nil { -// return err -// } - -// return v.createKeyFromMnemonic(name, mnemonic) -// } - -// func (v *validator) buildCreateValidatorMsg(amount sdk.Coin) (sdk.Msg, error) { -// description := stakingtypes.NewDescription(v.moniker, "", "", "", "") -// commissionRates := stakingtypes.CommissionRates{ -// Rate: sdk.MustNewDecFromStr("0.1"), -// MaxRate: sdk.MustNewDecFromStr("0.2"), -// MaxChangeRate: sdk.MustNewDecFromStr("0.01"), -// } - -// // get the initial validator min self delegation -// minSelfDelegation := sdk.OneInt() - -// valPubKey, err := cryptocodec.FromTmPubKeyInterface(v.consensusKey.PubKey) -// if err != nil { -// return nil, err -// } - -// return stakingtypes.NewMsgCreateValidator( -// sdk.ValAddress(v.keyInfo.GetAddress()), -// valPubKey, -// amount, -// description, -// commissionRates, -// minSelfDelegation, -// ) -// } - -// func (v *validator) signMsg(msgs ...sdk.Msg) (*sdktx.Tx, error) { -// txBuilder := encodingConfig.TxConfig.NewTxBuilder() - -// if err := txBuilder.SetMsgs(msgs...); err != nil { -// return nil, err -// } - -// txBuilder.SetMemo(fmt.Sprintf("%s@%s:26656", v.nodeKey.ID(), v.instanceName())) -// txBuilder.SetFeeAmount(sdk.NewCoins()) -// txBuilder.SetGasLimit(200000) - -// signerData := authsigning.SignerData{ -// ChainID: v.chain.id, -// AccountNumber: 0, -// Sequence: 0, -// } - -// // For SIGN_MODE_DIRECT, calling SetSignatures calls setSignerInfos on -// // TxBuilder under the hood, and SignerInfos is needed to generate the sign -// // bytes. This is the reason for setting SetSignatures here, with a nil -// // signature. -// // -// // Note: This line is not needed for SIGN_MODE_LEGACY_AMINO, but putting it -// // also doesn't affect its generated sign bytes, so for code's simplicity -// // sake, we put it here. -// sig := txsigning.SignatureV2{ -// PubKey: v.keyInfo.GetPubKey(), -// Data: &txsigning.SingleSignatureData{ -// SignMode: txsigning.SignMode_SIGN_MODE_DIRECT, -// Signature: nil, -// }, -// Sequence: 0, -// } - -// if err := txBuilder.SetSignatures(sig); err != nil { -// return nil, err -// } - -// bytesToSign, err := encodingConfig.TxConfig.SignModeHandler().GetSignBytes( -// txsigning.SignMode_SIGN_MODE_DIRECT, -// signerData, -// txBuilder.GetTx(), -// ) -// if err != nil { -// return nil, err -// } - -// sigBytes, err := v.privateKey.Sign(bytesToSign) -// if err != nil { -// return nil, err -// } - -// sig = txsigning.SignatureV2{ -// PubKey: v.keyInfo.GetPubKey(), -// Data: &txsigning.SingleSignatureData{ -// SignMode: txsigning.SignMode_SIGN_MODE_DIRECT, -// Signature: sigBytes, -// }, -// Sequence: 0, -// } -// if err := txBuilder.SetSignatures(sig); err != nil { -// return nil, err -// } - -// signedTx := txBuilder.GetTx() -// bz, err := encodingConfig.TxConfig.TxEncoder()(signedTx) -// if err != nil { -// return nil, err -// } - -// return decodeTx(bz) -// } +import ( + "encoding/json" + "fmt" + "os" + "path" + "path/filepath" + + tmcfg "github.com/cometbft/cometbft/config" + tmos "github.com/cometbft/cometbft/libs/os" + "github.com/cometbft/cometbft/p2p" + "github.com/cometbft/cometbft/privval" + + sdkcrypto "github.com/cosmos/cosmos-sdk/crypto" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + "github.com/cosmos/cosmos-sdk/crypto/hd" + "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" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + gaia "github.com/cosmos/gaia/v11/app" +) + +// +//nolint:unused +type validator struct { + chain *chain + index int + moniker string + mnemonic string + keyInfo keyring.Record + privateKey cryptotypes.PrivKey + consensusKey privval.FilePVKey + consensusPrivKey cryptotypes.PrivKey + nodeKey p2p.NodeKey +} + +type account struct { + moniker string //nolint:unused + mnemonic string + keyInfo keyring.Record + privateKey cryptotypes.PrivKey +} + +func (v *validator) instanceName() string { + return fmt.Sprintf("%s%d", v.moniker, v.index) +} + +func (v *validator) configDir() string { + return fmt.Sprintf("%s/%s", v.chain.configDir(), v.instanceName()) +} + +func (v *validator) createConfig() error { + p := path.Join(v.configDir(), "config") + return os.MkdirAll(p, 0o755) +} + +func (v *validator) init() error { + if err := v.createConfig(); err != nil { + return err + } + + serverCtx := server.NewDefaultContext() + config := serverCtx.Config + + config.SetRoot(v.configDir()) + config.Moniker = v.moniker + + genDoc, err := getGenDoc(v.configDir()) + if err != nil { + return err + } + + appState, err := json.MarshalIndent(gaia.ModuleBasics.DefaultGenesis(cdc), "", " ") + if err != nil { + return fmt.Errorf("failed to JSON encode app genesis state: %w", err) + } + + genDoc.ChainID = v.chain.id + genDoc.Validators = nil + genDoc.AppState = appState + + if err = genutil.ExportGenesisFile(genDoc, config.GenesisFile()); err != nil { + return fmt.Errorf("failed to export app genesis state: %w", err) + } + + tmcfg.WriteConfigFile(filepath.Join(config.RootDir, "config", "config.toml"), config) + return nil +} + +func (v *validator) createNodeKey() error { + serverCtx := server.NewDefaultContext() + config := serverCtx.Config + + config.SetRoot(v.configDir()) + config.Moniker = v.moniker + + nodeKey, err := p2p.LoadOrGenNodeKey(config.NodeKeyFile()) + if err != nil { + return err + } + + v.nodeKey = *nodeKey + return nil +} + +func (v *validator) createConsensusKey() error { + serverCtx := server.NewDefaultContext() + config := serverCtx.Config + + config.SetRoot(v.configDir()) + config.Moniker = v.moniker + + pvKeyFile := config.PrivValidatorKeyFile() + if err := tmos.EnsureDir(filepath.Dir(pvKeyFile), 0o777); err != nil { + return err + } + + pvStateFile := config.PrivValidatorStateFile() + if err := tmos.EnsureDir(filepath.Dir(pvStateFile), 0o777); err != nil { + return err + } + + filePV := privval.LoadOrGenFilePV(pvKeyFile, pvStateFile) + v.consensusKey = filePV.Key + + return nil +} + +func (v *validator) createKeyFromMnemonic(name, mnemonic string) error { + dir := v.configDir() + kb, err := keyring.New(keyringAppName, keyring.BackendTest, dir, nil, cdc) + if err != nil { + return err + } + + keyringAlgos, _ := kb.SupportedAlgorithms() + algo, err := keyring.NewSigningAlgoFromString(string(hd.Secp256k1Type), keyringAlgos) + if err != nil { + return err + } + + info, err := kb.NewAccount(name, mnemonic, "", sdk.FullFundraiserPath, algo) + if err != nil { + return err + } + + privKeyArmor, err := kb.ExportPrivKeyArmor(name, keyringPassphrase) + if err != nil { + return err + } + + privKey, _, err := sdkcrypto.UnarmorDecryptPrivKey(privKeyArmor, keyringPassphrase) + if err != nil { + return err + } + + v.keyInfo = *info + v.mnemonic = mnemonic + v.privateKey = privKey + + return nil +} + +func (c *chain) addAccountFromMnemonic(counts int) error { + val0ConfigDir := c.validators[0].configDir() + kb, err := keyring.New(keyringAppName, keyring.BackendTest, val0ConfigDir, nil, cdc) + if err != nil { + return err + } + + keyringAlgos, _ := kb.SupportedAlgorithms() + algo, err := keyring.NewSigningAlgoFromString(string(hd.Secp256k1Type), keyringAlgos) + if err != nil { + return err + } + + for i := 0; i < counts; i++ { + name := fmt.Sprintf("acct-%d", i) + mnemonic, err := createMnemonic() + if err != nil { + return err + } + info, err := kb.NewAccount(name, mnemonic, "", sdk.FullFundraiserPath, algo) + if err != nil { + return err + } + + privKeyArmor, err := kb.ExportPrivKeyArmor(name, keyringPassphrase) + if err != nil { + return err + } + + privKey, _, err := sdkcrypto.UnarmorDecryptPrivKey(privKeyArmor, keyringPassphrase) + if err != nil { + return err + } + acct := account{} + acct.keyInfo = *info + acct.mnemonic = mnemonic + acct.privateKey = privKey + c.genesisAccounts = append(c.genesisAccounts, &acct) + } + + return nil +} + +func (v *validator) createKey(name string) error { + mnemonic, err := createMnemonic() + if err != nil { + return err + } + + return v.createKeyFromMnemonic(name, mnemonic) +} + +func (v *validator) buildCreateValidatorMsg(amount sdk.Coin) (sdk.Msg, error) { + description := stakingtypes.NewDescription(v.moniker, "", "", "", "") + commissionRates := stakingtypes.CommissionRates{ + Rate: sdk.MustNewDecFromStr("0.1"), + MaxRate: sdk.MustNewDecFromStr("0.2"), + MaxChangeRate: sdk.MustNewDecFromStr("0.01"), + } + + // get the initial validator min self delegation + minSelfDelegation := sdk.OneInt() + + valPubKey, err := cryptocodec.FromTmPubKeyInterface(v.consensusKey.PubKey) + if err != nil { + return nil, err + } + + addr, err := v.keyInfo.GetAddress() + if err != nil { + return nil, err + } + + return stakingtypes.NewMsgCreateValidator( + sdk.ValAddress(addr), + valPubKey, + amount, + description, + commissionRates, + minSelfDelegation, + ) +} + +func (v *validator) signMsg(msgs ...sdk.Msg) (*sdktx.Tx, error) { + txBuilder := encodingConfig.TxConfig.NewTxBuilder() + + if err := txBuilder.SetMsgs(msgs...); err != nil { + return nil, err + } + + txBuilder.SetMemo(fmt.Sprintf("%s@%s:26656", v.nodeKey.ID(), v.instanceName())) + txBuilder.SetFeeAmount(sdk.NewCoins()) + txBuilder.SetGasLimit(200000) + + signerData := authsigning.SignerData{ + ChainID: v.chain.id, + AccountNumber: 0, + Sequence: 0, + } + + // For SIGN_MODE_DIRECT, calling SetSignatures calls setSignerInfos on + // TxBuilder under the hood, and SignerInfos is needed to generate the sign + // bytes. This is the reason for setting SetSignatures here, with a nil + // signature. + // + // Note: This line is not needed for SIGN_MODE_LEGACY_AMINO, but putting it + // also doesn't affect its generated sign bytes, so for code's simplicity + // sake, we put it here. + pk, err := v.keyInfo.GetPubKey() + if err != nil { + return nil, err + } + + sig := txsigning.SignatureV2{ + PubKey: pk, + Data: &txsigning.SingleSignatureData{ + SignMode: txsigning.SignMode_SIGN_MODE_DIRECT, + Signature: nil, + }, + Sequence: 0, + } + + if err := txBuilder.SetSignatures(sig); err != nil { + return nil, err + } + + bytesToSign, err := encodingConfig.TxConfig.SignModeHandler().GetSignBytes( + txsigning.SignMode_SIGN_MODE_DIRECT, + signerData, + txBuilder.GetTx(), + ) + if err != nil { + return nil, err + } + + sigBytes, err := v.privateKey.Sign(bytesToSign) + if err != nil { + return nil, err + } + + pk, err = v.keyInfo.GetPubKey() + if err != nil { + return nil, err + } + + sig = txsigning.SignatureV2{ + PubKey: pk, + Data: &txsigning.SingleSignatureData{ + SignMode: txsigning.SignMode_SIGN_MODE_DIRECT, + Signature: sigBytes, + }, + Sequence: 0, + } + if err := txBuilder.SetSignatures(sig); err != nil { + return nil, err + } + + signedTx := txBuilder.GetTx() + bz, err := encodingConfig.TxConfig.TxEncoder()(signedTx) + if err != nil { + return nil, err + } + + return decodeTx(bz) +} diff --git a/tests/ics/interchain_security_test.go b/tests/ics/interchain_security_test.go index 5a5179b701..cf6679f505 100644 --- a/tests/ics/interchain_security_test.go +++ b/tests/ics/interchain_security_test.go @@ -9,7 +9,7 @@ import ( icstestingutils "github.com/cosmos/interchain-security/v3/testutil/ibc_testing" "github.com/stretchr/testify/suite" - cmdb "github.com/cometbft/cometbft-db" + tmdb "github.com/cometbft/cometbft-db" "github.com/cometbft/cometbft/libs/log" ibctesting "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/testing" @@ -33,7 +33,7 @@ func GaiaAppIniter() (ibctesting.TestingApp, map[string]json.RawMessage) { encoding := gaiaApp.RegisterEncodingConfig() app := gaiaApp.NewGaiaApp( log.NewNopLogger(), - cmdb.NewMemDB(), + tmdb.NewMemDB(), nil, true, map[int64]bool{}, From 0510ee7b9cd538ec98b1c37cdbff889504511a6c Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Mon, 24 Jul 2023 16:15:00 +0200 Subject: [PATCH 04/43] feat: refactor global fee module for SDK v47 (#2660) * save * upgrade GlobalFee module w UTs * make pass BypassFee e2e with sdk FeeChecker Tx priority * full e2e pass wo bypass msg hermes * pass bypass fee e2e tests * update Hermes Dockerfile * build Hermes image in CI * fix Hermes Builder * fix Hermes Builder * test local min gas prices REST query * fix linter and typos * add FeeCheck ante handler comment --------- Co-authored-by: yaruwangway <69694322+yaruwangway@users.noreply.github.com> --- .../2629-add-query-local-min-gas-prices.md | 3 + .github/workflows/test.yml | 4 +- Makefile | 2 +- ante/ante.go | 18 +- ante/gov_ante_test.go | 91 +- app/app.go | 30 +- app/keepers/keepers.go | 10 +- app/modules.go | 13 +- go.mod | 8 +- proto/gaia/globalfee/v1beta1/genesis.proto | 88 +- proto/gaia/globalfee/v1beta1/query.proto | 52 +- tests/e2e/chain.go | 5 +- tests/e2e/docker/hermes.Dockerfile | 7 +- tests/e2e/e2e_bypassminfee_test.go | 365 ++-- tests/e2e/e2e_exec_test.go | 128 +- tests/e2e/e2e_globalfee_proposal_test.go | 243 ++- tests/e2e/e2e_globalfee_test.go | 665 ++++--- tests/e2e/e2e_ibc_test.go | 222 +-- tests/e2e/e2e_rest_regression_test.go | 2 + tests/e2e/e2e_setup_test.go | 468 +++-- tests/e2e/e2e_test.go | 46 +- tests/e2e/query.go | 52 +- x/globalfee/alias.go | 12 +- x/globalfee/ante/antetest/fee_test.go | 1607 ++++++++--------- x/globalfee/ante/antetest/fee_test_setup.go | 241 ++- x/globalfee/ante/fee.go | 526 +++--- x/globalfee/ante/fee_utils.go | 209 +-- x/globalfee/ante/fee_utils_test.go | 593 +++--- x/globalfee/client/cli/query.go | 82 +- x/globalfee/keeper/migrations.go | 34 +- x/globalfee/migrations/v2/migration.go | 37 +- .../migrations/v2/v2_test/migration_test.go | 211 +-- x/globalfee/module.go | 276 ++- x/globalfee/querier.go | 100 +- x/globalfee/types/genesis.go | 76 +- x/globalfee/types/genesis.pb.go | 609 ++++++- x/globalfee/types/keys.go | 13 +- x/globalfee/types/params.go | 303 ++-- x/globalfee/types/params_test.go | 309 ++-- x/globalfee/types/query.pb.go | 523 +++++- x/globalfee/types/query.pb.gw.go | 153 ++ 41 files changed, 4947 insertions(+), 3489 deletions(-) create mode 100644 .changelog/unreleased/features/2629-add-query-local-min-gas-prices.md create mode 100644 x/globalfee/types/query.pb.gw.go diff --git a/.changelog/unreleased/features/2629-add-query-local-min-gas-prices.md b/.changelog/unreleased/features/2629-add-query-local-min-gas-prices.md new file mode 100644 index 0000000000..2ad2b3700d --- /dev/null +++ b/.changelog/unreleased/features/2629-add-query-local-min-gas-prices.md @@ -0,0 +1,3 @@ +- register NodeService to enable query /cosmos/base/node/v1beta1/config + gRPC query to disclose node operator's configured minimum-gas-price. + ([\#2629](https://github.com/cosmos/gaia/issues/2629)) \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e480bac1d3..93a4300717 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -73,8 +73,10 @@ jobs: **/**.go go.mod go.sum - - name: Build Docker Image + - name: Build Gaia Docker Image run: make docker-build-debug + - name: Build Hermes Docker Image + run: make docker-build-hermes - name: Test E2E run: make test-e2e diff --git a/Makefile b/Makefile index 45beabd3f9..ae9f349444 100644 --- a/Makefile +++ b/Makefile @@ -234,7 +234,7 @@ docker-build-debug: # TODO: Push this to the Cosmos Dockerhub so we don't have to keep building it # in CI. docker-build-hermes: - @cd tests/e2e/docker; docker build -t cosmos/hermes-e2e:latest -f hermes.Dockerfile . + @cd tests/e2e/docker; docker build -t ghcr.io/cosmos/hermes-e2e:1.4.1 -f hermes.Dockerfile . docker-build-all: docker-build-debug docker-build-hermes diff --git a/ante/ante.go b/ante/ante.go index 5a53c94952..be5ceb890c 100644 --- a/ante/ante.go +++ b/ante/ante.go @@ -7,11 +7,12 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/ante" 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/v11/types/errors" - // gaiafeeante "github.com/cosmos/gaia/v11/x/globalfee/ante" + gaiafeeante "github.com/cosmos/gaia/v11/x/globalfee/ante" ) // HandlerOptions extend the SDK's AnteHandler options by requiring the IBC @@ -22,7 +23,8 @@ type HandlerOptions struct { GovKeeper *govkeeper.Keeper IBCkeeper *ibckeeper.Keeper GlobalFeeSubspace paramtypes.Subspace - StakingSubspace paramtypes.Subspace + StakingKeeper *stakingkeeper.Keeper + TxFeeChecker ante.TxFeeChecker } func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) { @@ -39,10 +41,11 @@ func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) { return nil, errorsmod.Wrap(gaiaerrors.ErrLogic, "IBC keeper is required for AnteHandler") } // TODO: Enable with Globalfee - // if opts.GlobalFeeSubspace.Name() == "" { - // return nil, errorsmod.Wrap(gaiaerrors.ErrNotFound, "globalfee param store is required for AnteHandler") - // } - if opts.StakingSubspace.Name() == "" { + if opts.GlobalFeeSubspace.Name() == "" { + return nil, errorsmod.Wrap(gaiaerrors.ErrNotFound, "globalfee param store is required for AnteHandler") + } + + if opts.StakingKeeper == nil { return nil, errorsmod.Wrap(gaiaerrors.ErrNotFound, "staking param store is required for AnteHandler") } if opts.GovKeeper == nil { @@ -62,8 +65,7 @@ func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) { ante.NewValidateMemoDecorator(opts.AccountKeeper), ante.NewConsumeGasForTxSizeDecorator(opts.AccountKeeper), NewGovPreventSpamDecorator(opts.Codec, opts.GovKeeper), - // TODO: Enable with GlobalFee - // gaiafeeante.NewFeeDecorator(opts.GlobalFeeSubspace, opts.StakingSubspace), + gaiafeeante.NewFeeDecorator(opts.GlobalFeeSubspace, opts.StakingKeeper), ante.NewDeductFeeDecorator(opts.AccountKeeper, opts.BankKeeper, opts.FeegrantKeeper, opts.TxFeeChecker), ante.NewSetPubKeyDecorator(opts.AccountKeeper), // SetPubKeyDecorator must be called before all signature verification decorators ante.NewValidateSigCountDecorator(opts.AccountKeeper), diff --git a/ante/gov_ante_test.go b/ante/gov_ante_test.go index fbfd86dccd..9f3b0ceb9d 100644 --- a/ante/gov_ante_test.go +++ b/ante/gov_ante_test.go @@ -12,18 +12,20 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/testutil/testdata" - // "github.com/cosmos/gaia/v11/ante" + govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + + "github.com/cosmos/gaia/v11/ante" gaiahelpers "github.com/cosmos/gaia/v11/app/helpers" gaiaapp "github.com/cosmos/gaia/v11/app" ) -// var ( -// insufficientCoins = sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 100)) -// minCoins = sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 1000000)) -// moreThanMinCoins = sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 2500000)) -// testAddr = sdk.AccAddress("test1") -// ) +var ( + insufficientCoins = sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 100)) + minCoins = sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 1000000)) + moreThanMinCoins = sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 2500000)) + testAddr = sdk.AccAddress("test1") +) type GovAnteHandlerTestSuite struct { suite.Suite @@ -53,41 +55,40 @@ func TestGovSpamPreventionSuite(t *testing.T) { suite.Run(t, new(GovAnteHandlerTestSuite)) } -// TODO: Enable with Global Fee -// func (s *GovAnteHandlerTestSuite) TestGlobalFeeMinimumGasFeeAnteHandler() { -// // setup test -// s.SetupTest() -// tests := []struct { -// title, description string -// proposalType string -// proposerAddr sdk.AccAddress -// initialDeposit sdk.Coins -// expectPass bool -// }{ -// {"Passing proposal 1", "the purpose of this proposal is to pass", govv1beta1.ProposalTypeText, testAddr, minCoins, true}, -// {"Passing proposal 2", "the purpose of this proposal is to pass with more coins than minimum", govv1beta1.ProposalTypeText, testAddr, moreThanMinCoins, true}, -// {"Failing proposal", "the purpose of this proposal is to fail", govv1beta1.ProposalTypeText, testAddr, insufficientCoins, false}, -// } -// -// decorator := ante.NewGovPreventSpamDecorator(s.app.AppCodec(), &s.app.GovKeeper) -// -// for _, tc := range tests { -// content, _ := govv1beta1.ContentFromProposalType(tc.title, tc.description, tc.proposalType) -// s.Require().NotNil(content) -// -// msg, err := govv1beta1.NewMsgSubmitProposal( -// content, -// tc.initialDeposit, -// tc.proposerAddr, -// ) -// -// s.Require().NoError(err) -// -// err = decorator.ValidateGovMsgs(s.ctx, []sdk.Msg{msg}) -// if tc.expectPass { -// s.Require().NoError(err, "expected %v to pass", tc.title) -// } else { -// s.Require().Error(err, "expected %v to fail", tc.title) -// } -// } -//} +func (s *GovAnteHandlerTestSuite) TestGlobalFeeMinimumGasFeeAnteHandler() { + // setup test + s.SetupTest() + tests := []struct { + title, description string + proposalType string + proposerAddr sdk.AccAddress + initialDeposit sdk.Coins + expectPass bool + }{ + {"Passing proposal 1", "the purpose of this proposal is to pass", govv1beta1.ProposalTypeText, testAddr, minCoins, true}, + {"Passing proposal 2", "the purpose of this proposal is to pass with more coins than minimum", govv1beta1.ProposalTypeText, testAddr, moreThanMinCoins, true}, + {"Failing proposal", "the purpose of this proposal is to fail", govv1beta1.ProposalTypeText, testAddr, insufficientCoins, false}, + } + + decorator := ante.NewGovPreventSpamDecorator(s.app.AppCodec(), &s.app.GovKeeper) + + for _, tc := range tests { + content, _ := govv1beta1.ContentFromProposalType(tc.title, tc.description, tc.proposalType) + s.Require().NotNil(content) + + msg, err := govv1beta1.NewMsgSubmitProposal( + content, + tc.initialDeposit, + tc.proposerAddr, + ) + + s.Require().NoError(err) + + err = decorator.ValidateGovMsgs(s.ctx, []sdk.Msg{msg}) + if tc.expectPass { + s.Require().NoError(err, "expected %v to pass", tc.title) + } else { + s.Require().Error(err, "expected %v to fail", tc.title) + } + } +} diff --git a/app/app.go b/app/app.go index 9534a22d12..aaedd09e7c 100644 --- a/app/app.go +++ b/app/app.go @@ -16,6 +16,7 @@ import ( "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/testutil/testdata" + errorsmod "cosmossdk.io/errors" dbm "github.com/cometbft/cometbft-db" abci "github.com/cometbft/cometbft/abci/types" tmjson "github.com/cometbft/cometbft/libs/json" @@ -32,6 +33,7 @@ import ( "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/x/auth/ante" @@ -39,7 +41,6 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/crisis" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ibctesting "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/testing" providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" @@ -52,7 +53,7 @@ import ( "github.com/cosmos/gaia/v11/app/upgrades" v11 "github.com/cosmos/gaia/v11/app/upgrades/v11" - // "github.com/cosmos/gaia/v11/x/globalfee" + "github.com/cosmos/gaia/v11/x/globalfee" // unnamed import of statik for swagger UI support _ "github.com/cosmos/cosmos-sdk/client/docs/statik" @@ -222,11 +223,14 @@ func NewGaiaApp( SignModeHandler: encodingConfig.TxConfig.SignModeHandler(), SigGasConsumer: ante.DefaultSigVerificationGasConsumer, }, - Codec: appCodec, - IBCkeeper: app.IBCKeeper, - GovKeeper: &app.GovKeeper, - // GlobalFeeSubspace: app.GetSubspace(globalfee.ModuleName), - StakingSubspace: app.GetSubspace(stakingtypes.ModuleName), + Codec: appCodec, + IBCkeeper: app.IBCKeeper, + GovKeeper: &app.GovKeeper, + GlobalFeeSubspace: app.GetSubspace(globalfee.ModuleName), + StakingKeeper: app.StakingKeeper, + // If TxFeeChecker is nil the default ante TxFeeChecker is used + // so we use this no-op to keep the global fee module behaviour unchanged + TxFeeChecker: noOpTxFeeChecker, }, ) if err != nil { @@ -364,6 +368,7 @@ func (app *GaiaApp) RegisterTendermintService(clientCtx client.Context) { ) } +// RegisterTxService allows query minimum-gas-prices in app.toml func (app *GaiaApp) RegisterNodeService(clientCtx client.Context) { nodeservice.RegisterNodeService(clientCtx, app.GRPCQueryRouter()) } @@ -435,3 +440,14 @@ type EmptyAppOptions struct{} func (ao EmptyAppOptions) Get(_ string) interface{} { return nil } + +// noOpTxFeeChecker is an ante TxFeeChecker for the DeductFeeDecorator, see x/auth/ante/fee.go, +// it performs a no-op by not checking tx fees and always returns a zero tx priority +func noOpTxFeeChecker(_ sdk.Context, tx sdk.Tx) (sdk.Coins, int64, error) { + feeTx, ok := tx.(sdk.FeeTx) + if !ok { + return nil, 0, errorsmod.Wrap(sdkerrors.ErrTxDecode, "Tx must be a FeeTx") + } + + return feeTx.GetFee(), 0, nil +} diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index c558157537..fa38439529 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -31,6 +31,8 @@ import ( govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" + "github.com/cosmos/gaia/v11/x/globalfee" + providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" @@ -435,7 +437,10 @@ func NewAppKeeper( // GetSubspace returns a param subspace for a given module name. func (appKeepers *AppKeepers) GetSubspace(moduleName string) paramstypes.Subspace { - subspace, _ := appKeepers.ParamsKeeper.GetSubspace(moduleName) + subspace, ok := appKeepers.ParamsKeeper.GetSubspace(moduleName) + if !ok { + panic("couldn't load subspace for module: " + moduleName) + } return subspace } @@ -457,8 +462,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino paramsKeeper.Subspace(icahosttypes.SubModuleName) paramsKeeper.Subspace(pfmroutertypes.ModuleName).WithKeyTable(pfmroutertypes.ParamKeyTable()) - // TODO: Enable with Globalfee - // paramsKeeper.Subspace(globalfee.ModuleName) + paramsKeeper.Subspace(globalfee.ModuleName) paramsKeeper.Subspace(providertypes.ModuleName) return paramsKeeper diff --git a/app/modules.go b/app/modules.go index 43fc7944a8..c4ea6437ad 100644 --- a/app/modules.go +++ b/app/modules.go @@ -56,7 +56,7 @@ import ( routertypes "github.com/strangelove-ventures/packet-forward-middleware/v7/router/types" gaiaparams "github.com/cosmos/gaia/v11/app/params" - // "github.com/cosmos/gaia/v11/x/globalfee" + "github.com/cosmos/gaia/v11/x/globalfee" ) var maccPerms = map[string][]string{ @@ -108,8 +108,7 @@ var ModuleBasics = module.NewBasicManager( vesting.AppModuleBasic{}, router.AppModuleBasic{}, ica.AppModuleBasic{}, - // TODO: Enable with Global Fee - // globalfee.AppModule{}, + globalfee.AppModule{}, ibcprovider.AppModuleBasic{}, consensus.AppModuleBasic{}, ) @@ -144,7 +143,7 @@ func appModules( authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), ibc.NewAppModule(app.IBCKeeper), sdkparams.NewAppModule(app.ParamsKeeper), - // globalfee.NewAppModule(app.GetSubspace(globalfee.ModuleName)), + globalfee.NewAppModule(app.GetSubspace(globalfee.ModuleName)), app.TransferModule, app.ICAModule, app.PFMRouterModule, @@ -216,7 +215,7 @@ func orderBeginBlockers() []string { feegrant.ModuleName, paramstypes.ModuleName, vestingtypes.ModuleName, - // globalfee.ModuleName, + globalfee.ModuleName, providertypes.ModuleName, consensusparamtypes.ModuleName, } @@ -252,7 +251,7 @@ func orderEndBlockers() []string { paramstypes.ModuleName, upgradetypes.ModuleName, vestingtypes.ModuleName, - // globalfee.ModuleName, + globalfee.ModuleName, providertypes.ModuleName, consensusparamtypes.ModuleName, } @@ -296,7 +295,7 @@ func orderInitBlockers() []string { // To resolve this issue, we should initialize the globalfee module after genutil, ensuring that the global // min fee is empty when gentx is called. // For more details, please refer to the following link: https://github.com/cosmos/gaia/issues/2489 - // globalfee.ModuleName, + globalfee.ModuleName, providertypes.ModuleName, consensusparamtypes.ModuleName, } diff --git a/go.mod b/go.mod index 15837fde7d..2e25abfaaf 100644 --- a/go.mod +++ b/go.mod @@ -35,11 +35,11 @@ require ( cloud.google.com/go/compute/metadata v0.2.3 // indirect cloud.google.com/go/iam v0.13.0 // indirect cloud.google.com/go/storage v1.29.0 // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/protobuf v1.5.3 // github.com/gravity-devs/liquidity v1.6.0 - github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect - google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect - google.golang.org/grpc v1.55.0 // indirect + github.com/grpc-ecosystem/grpc-gateway v1.16.0 + google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 + google.golang.org/grpc v1.55.0 ) require ( diff --git a/proto/gaia/globalfee/v1beta1/genesis.proto b/proto/gaia/globalfee/v1beta1/genesis.proto index 8368518261..93f3196521 100644 --- a/proto/gaia/globalfee/v1beta1/genesis.proto +++ b/proto/gaia/globalfee/v1beta1/genesis.proto @@ -1,47 +1,43 @@ syntax = "proto3"; -// package gaia.globalfee.v1beta1; -// -// import "gogoproto/gogo.proto"; -// import "cosmos/base/v1beta1/coin.proto"; -// -// option go_package = "github.com/cosmos/gaia/x/globalfee/types"; -// -//// GenesisState - initial state of module -// message GenesisState { -// // Params of this module -// Params params = 1 [ -// (gogoproto.nullable) = false, -// (gogoproto.jsontag) = "params,omitempty" -// ]; -// } -// -//// Params defines the set of module parameters. -// message Params { -// // minimum_gas_prices stores the minimum gas price(s) for all TX on the -// chain. -// // When multiple coins are defined then they are accepted alternatively. -// // The list must be sorted by denoms asc. No duplicate denoms or zero -// amount -// // values allowed. For more information see -// // https://docs.cosmos.network/main/modules/auth#concepts -// repeated cosmos.base.v1beta1.DecCoin minimum_gas_prices = 1 [ -// (gogoproto.nullable) = false, -// (gogoproto.jsontag) = "minimum_gas_prices,omitempty", -// (gogoproto.moretags) = "yaml:\"minimum_gas_prices\"", -// (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" -// ]; -// -// // bypass_min_fee_msg_types defines a list of message type urls -// // that are free of fee charge. -// repeated string bypass_min_fee_msg_types = 2 [ -// (gogoproto.jsontag) = "bypass_min_fee_msg_types,omitempty", -// (gogoproto.moretags) = "yaml:\"bypass_min_fee_msg_types\"" -// ]; -// -// // max_total_bypass_min_fee_msg_gas_usage defines the total maximum gas -// usage -// // allowed for a transaction containing only messages of types in -// bypass_min_fee_msg_types -// // to bypass fee charge. -// uint64 max_total_bypass_min_fee_msg_gas_usage = 3; -// } +package gaia.globalfee.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/cosmos/gaia/x/globalfee/types"; + +// GenesisState - initial state of module +message GenesisState { + // Params of this module + Params params = 1 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "params,omitempty" + ]; +} + +// Params defines the set of module parameters. +message Params { + // minimum_gas_prices stores the minimum gas price(s) for all TX on the chain. + // When multiple coins are defined then they are accepted alternatively. + // The list must be sorted by denoms asc. No duplicate denoms or zero amount + // values allowed. For more information see + // https://docs.cosmos.network/main/modules/auth#concepts + repeated cosmos.base.v1beta1.DecCoin minimum_gas_prices = 1 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "minimum_gas_prices,omitempty", + (gogoproto.moretags) = "yaml:\"minimum_gas_prices\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" + ]; + + // bypass_min_fee_msg_types defines a list of message type urls + // that are free of fee charge. + repeated string bypass_min_fee_msg_types = 2 [ + (gogoproto.jsontag) = "bypass_min_fee_msg_types,omitempty", + (gogoproto.moretags) = "yaml:\"bypass_min_fee_msg_types\"" + ]; + + // max_total_bypass_min_fee_msg_gas_usage defines the total maximum gas usage + // allowed for a transaction containing only messages of types in bypass_min_fee_msg_types + // to bypass fee charge. + uint64 max_total_bypass_min_fee_msg_gas_usage = 3; +} diff --git a/proto/gaia/globalfee/v1beta1/query.proto b/proto/gaia/globalfee/v1beta1/query.proto index e6fb7f592c..f797eb67f7 100644 --- a/proto/gaia/globalfee/v1beta1/query.proto +++ b/proto/gaia/globalfee/v1beta1/query.proto @@ -1,27 +1,27 @@ syntax = "proto3"; -// package gaia.globalfee.v1beta1; -// -// import "gogoproto/gogo.proto"; -// import "google/api/annotations.proto"; -// import "gaia/globalfee/v1beta1/genesis.proto"; -// -// option go_package = "github.com/cosmos/gaia/x/globalfee/types"; -// -//// Query defines the gRPC querier service. -// service Query { -// rpc Params(QueryParamsRequest) -// returns (QueryParamsResponse) { -// option (google.api.http).get = -// "/gaia/globalfee/v1beta1/params"; -// } -// } -// -//// QueryMinimumGasPricesRequest is the request type for the -//// Query/MinimumGasPrices RPC method. -// message QueryParamsRequest {} -// -//// QueryMinimumGasPricesResponse is the response type for the -//// Query/MinimumGasPrices RPC method. -// message QueryParamsResponse { -// Params params = 1 [(gogoproto.nullable) = false]; -// } +package gaia.globalfee.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "gaia/globalfee/v1beta1/genesis.proto"; + +option go_package = "github.com/cosmos/gaia/x/globalfee/types"; + +// Query defines the gRPC querier service. +service Query { + rpc Params(QueryParamsRequest) + returns (QueryParamsResponse) { + option (google.api.http).get = + "/gaia/globalfee/v1beta1/params"; + } +} + +// QueryMinimumGasPricesRequest is the request type for the +// Query/MinimumGasPrices RPC method. +message QueryParamsRequest {} + +// QueryMinimumGasPricesResponse is the response type for the +// Query/MinimumGasPrices RPC method. +message QueryParamsResponse { + Params params = 1 [(gogoproto.nullable) = false]; +} \ No newline at end of file diff --git a/tests/e2e/chain.go b/tests/e2e/chain.go index 81706d36a5..c8a8eb4346 100644 --- a/tests/e2e/chain.go +++ b/tests/e2e/chain.go @@ -5,6 +5,7 @@ import ( "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" "github.com/cosmos/cosmos-sdk/client" @@ -16,8 +17,8 @@ import ( evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" govv1types "github.com/cosmos/cosmos-sdk/x/gov/types/v1" 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" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" gaiaparams "github.com/cosmos/gaia/v11/app/params" ) @@ -42,6 +43,8 @@ func init() { cryptocodec.RegisterInterfaces(encodingConfig.InterfaceRegistry) govv1types.RegisterInterfaces(encodingConfig.InterfaceRegistry) govv1beta1types.RegisterInterfaces(encodingConfig.InterfaceRegistry) + paramsproptypes.RegisterInterfaces(encodingConfig.InterfaceRegistry) + paramsproptypes.RegisterLegacyAminoCodec(encodingConfig.Amino) upgradetypes.RegisterInterfaces(encodingConfig.InterfaceRegistry) distribtypes.RegisterInterfaces(encodingConfig.InterfaceRegistry) diff --git a/tests/e2e/docker/hermes.Dockerfile b/tests/e2e/docker/hermes.Dockerfile index f6086acf86..8230f1f22b 100644 --- a/tests/e2e/docker/hermes.Dockerfile +++ b/tests/e2e/docker/hermes.Dockerfile @@ -1,12 +1,9 @@ -FROM informalsystems/hermes:1.4.0 AS hermes-builder +FROM informalsystems/hermes:1.4.1 AS hermes-builder FROM debian:buster-slim USER root -COPY --chown=0:0 --from=hermes-builder /usr/lib/x86_64-linux-gnu/libssl.so.1.1 /usr/lib/x86_64-linux-gnu/libssl.so.1.1 -COPY --chown=0:0 --from=hermes-builder /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 COPY --from=hermes-builder /usr/bin/hermes /usr/local/bin/ RUN chmod +x /usr/local/bin/hermes -EXPOSE 3031 -# ENTRYPOINT ["hermes", "start"] +EXPOSE 3031 \ No newline at end of file diff --git a/tests/e2e/e2e_bypassminfee_test.go b/tests/e2e/e2e_bypassminfee_test.go index 6e27305c3b..0913b1a8f0 100644 --- a/tests/e2e/e2e_bypassminfee_test.go +++ b/tests/e2e/e2e_bypassminfee_test.go @@ -1,184 +1,185 @@ package e2e -// import ( -// "time" - -// "cosmossdk.io/math" -// sdk "github.com/cosmos/cosmos-sdk/types" -// distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/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" -// ) - -// func (s *IntegrationTestSuite) testBypassMinFeeWithdrawReward(endpoint string) { -// // submit gov prop to change bypass-msg param to MsgWithdrawDelegatorReward -// submitterAddr := s.chainA.validators[0].keyInfo.GetAddress() -// submitter := submitterAddr.String() -// proposalCounter++ -// s.govProposeNewBypassMsgs([]string{sdk.MsgTypeURL(&distributiontypes.MsgWithdrawDelegatorReward{})}, proposalCounter, submitter, standardFees.String()) - -// paidFeeAmt := math.LegacyMustNewDecFromStr(minGasPrice).Mul(math.LegacyNewDec(gas)).String() -// payee := s.chainA.validators[0].keyInfo.GetAddress() - -// testCases := []struct { -// name string -// fee string -// changeMaxBypassGasUsage bool -// expErr bool -// }{ -// { -// "bypass-msg with fee in the denom of global fee, pass", -// paidFeeAmt + uatomDenom, -// false, -// false, -// }, -// { -// "bypass-msg with zero coin in the denom of global fee, pass", -// "0" + uatomDenom, -// false, -// false, -// }, -// { -// "bypass-msg with zero coin not in the denom of global fee, pass", -// "0" + photonDenom, -// false, -// false, -// }, -// { -// "bypass-msg with non-zero coin not in the denom of global fee, fail", -// paidFeeAmt + photonDenom, -// false, -// true, -// }, -// { -// "bypass-msg with zero coin in the denom of global fee and maxTotalBypassMinFeeMsgGasUsage set to 1, fail", -// "0" + uatomDenom, -// true, -// true, -// }, -// { -// "bypass-msg with non zero coin in the denom of global fee and maxTotalBypassMinFeeMsgGasUsage set to 1, pass", -// paidFeeAmt + uatomDenom, -// false, -// false, -// }, -// } - -// for _, tc := range testCases { - -// if tc.changeMaxBypassGasUsage { -// proposalCounter++ -// // change MaxTotalBypassMinFeeMsgGasUsage through governance proposal from 1_000_0000 to 1 -// s.govProposeNewMaxTotalBypassMinFeeMsgGasUsage(1, proposalCounter, submitter) -// } - -// // get delegator rewards -// rewards, err := queryDelegatorTotalRewards(endpoint, payee.String()) -// s.Require().NoError(err) - -// // get delegator stake balance -// oldBalance, err := getSpecificBalance(endpoint, payee.String(), stakeDenom) -// s.Require().NoError(err) - -// // withdraw rewards -// s.Run(tc.name, func() { -// s.execWithdrawAllRewards(s.chainA, 0, payee.String(), tc.fee, tc.expErr) -// }) - -// if !tc.expErr { -// // get updated balance -// incrBalance, err := getSpecificBalance(endpoint, payee.String(), stakeDenom) -// s.Require().NoError(err) - -// // compute sum of old balance and stake token rewards -// oldBalancePlusReward := rewards.GetTotal().Add(sdk.NewDecCoinFromCoin(oldBalance)) -// s.Require().Equal(oldBalancePlusReward[0].Denom, stakeDenom) - -// // check updated balance got increased by at least oldBalancePlusReward -// s.Require().True(sdk.NewDecCoinFromCoin(incrBalance).IsGTE(oldBalancePlusReward[0])) -// } -// } -// } - -// func (s *IntegrationTestSuite) testIBCBypassMsg() { -// // submit gov proposal to change bypass-msg param to -// // ["/ibc.core.channel.v1.MsgRecvPacket", -// // "/ibc.core.channel.v1.MsgAcknowledgement", -// // "/ibc.core.client.v1.MsgUpdateClient"] -// submitterAddr := s.chainA.validators[0].keyInfo.GetAddress() -// submitter := submitterAddr.String() -// proposalCounter++ -// s.govProposeNewBypassMsgs([]string{ -// sdk.MsgTypeURL(&ibcchanneltypes.MsgRecvPacket{}), -// sdk.MsgTypeURL(&ibcchanneltypes.MsgAcknowledgement{}), -// sdk.MsgTypeURL(&ibcclienttypes.MsgUpdateClient{}), -// }, proposalCounter, submitter, standardFees.String()) - -// // use hermes1 to test default ibc bypass-msg -// // -// // test 1: transaction only contains bypass-msgs, pass -// s.testTxContainsOnlyIBCBypassMsg() -// // test 2: test transactions contains both bypass and non-bypass msgs (sdk.MsgTypeURL(&ibcchanneltypes.MsgTimeout{}) -// s.testTxContainsMixBypassNonBypassMsg() -// // test 3: test bypass-msgs exceed the MaxBypassGasUsage -// s.testBypassMsgsExceedMaxBypassGasLimit() - -// // set the default bypass-msg back -// proposalCounter++ -// s.govProposeNewBypassMsgs([]string{ -// sdk.MsgTypeURL(&ibcchanneltypes.MsgRecvPacket{}), -// sdk.MsgTypeURL(&ibcchanneltypes.MsgAcknowledgement{}), -// sdk.MsgTypeURL(&ibcclienttypes.MsgUpdateClient{}), -// sdk.MsgTypeURL(&ibcchanneltypes.MsgTimeout{}), -// sdk.MsgTypeURL(&ibcchanneltypes.MsgTimeoutOnClose{}), -// }, proposalCounter, submitter, standardFees.String()) -// } - -// func (s *IntegrationTestSuite) testTxContainsOnlyIBCBypassMsg() { -// s.T().Logf("testing transaction contains only ibc bypass messages") -// ok := s.hermesTransfer(hermesConfigWithGasPrices, s.chainA.id, s.chainB.id, transferChannel, uatomDenom, 100, 1000, 1) -// s.Require().True(ok) - -// scrRelayerBalanceBefore, dstRelayerBalanceBefore := s.queryRelayerWalletsBalances() - -// pass := s.hermesClearPacket(hermesConfigNoGasPrices, s.chainA.id, transferChannel) -// s.Require().True(pass) -// pendingPacketsExist := s.hermesPendingPackets(hermesConfigNoGasPrices, s.chainA.id, transferChannel) -// s.Require().False(pendingPacketsExist) - -// // confirm relayer wallets do not pay fees -// scrRelayerBalanceAfter, dstRelayerBalanceAfter := s.queryRelayerWalletsBalances() -// s.Require().Equal(scrRelayerBalanceBefore.String(), scrRelayerBalanceAfter.String()) -// s.Require().Equal(dstRelayerBalanceBefore.String(), dstRelayerBalanceAfter.String()) -// } - -// func (s *IntegrationTestSuite) testTxContainsMixBypassNonBypassMsg() { -// s.T().Logf("testing transaction contains both bypass and non-bypass messages") -// // hermesTransfer with --timeout-height-offset=1 -// ok := s.hermesTransfer(hermesConfigWithGasPrices, s.chainA.id, s.chainB.id, transferChannel, uatomDenom, 100, 1, 1) -// s.Require().True(ok) -// // make sure that the transaction is timeout -// time.Sleep(3 * time.Second) -// pendingPacketsExist := s.hermesPendingPackets(hermesConfigNoGasPrices, s.chainA.id, transferChannel) -// s.Require().True(pendingPacketsExist) - -// pass := s.hermesClearPacket(hermesConfigNoGasPrices, s.chainA.id, transferChannel) -// s.Require().False(pass) -// // clear packets with paying fee, to not influence the next transaction -// pass = s.hermesClearPacket(hermesConfigWithGasPrices, s.chainA.id, transferChannel) -// s.Require().True(pass) -// } - -// func (s *IntegrationTestSuite) testBypassMsgsExceedMaxBypassGasLimit() { -// s.T().Logf("testing bypass messages exceed MaxBypassGasUsage") -// ok := s.hermesTransfer(hermesConfigWithGasPrices, s.chainA.id, s.chainB.id, transferChannel, uatomDenom, 100, 1000, 12) -// s.Require().True(ok) -// pass := s.hermesClearPacket(hermesConfigNoGasPrices, s.chainA.id, transferChannel) -// s.Require().False(pass) - -// pendingPacketsExist := s.hermesPendingPackets(hermesConfigNoGasPrices, s.chainA.id, transferChannel) -// s.Require().True(pendingPacketsExist) - -// pass = s.hermesClearPacket(hermesConfigWithGasPrices, s.chainA.id, transferChannel) -// s.Require().True(pass) -// } +import ( + "time" + + ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + 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" +) + +func (s *IntegrationTestSuite) testBypassMinFeeWithdrawReward(endpoint string) { + // submit gov prop to change bypass-msg param to MsgWithdrawDelegatorReward + submitterAddr, _ := s.chainA.validators[0].keyInfo.GetAddress() + submitter := submitterAddr.String() + proposalCounter++ + s.govProposeNewBypassMsgs([]string{sdk.MsgTypeURL(&distributiontypes.MsgWithdrawDelegatorReward{})}, proposalCounter, submitter, standardFees.String()) + + paidFeeAmt := math.LegacyMustNewDecFromStr(minGasPrice).Mul(math.LegacyNewDec(gas)).String() + payee, _ := s.chainA.validators[0].keyInfo.GetAddress() + + testCases := []struct { + name string + fee string + changeMaxBypassGasUsage bool + expErr bool + }{ + { + "bypass-msg with fee in the denom of global fee, pass", + paidFeeAmt + uatomDenom, + false, + false, + }, + { + "bypass-msg with zero coin in the denom of global fee, pass", + "0" + uatomDenom, + false, + false, + }, + { + "bypass-msg with zero coin not in the denom of global fee, pass", + "0" + photonDenom, + false, + false, + }, + { + "bypass-msg with non-zero coin not in the denom of global fee, fail", + paidFeeAmt + photonDenom, + false, + true, + }, + { + "bypass-msg with zero coin in the denom of global fee and maxTotalBypassMinFeeMsgGasUsage set to 1, fail", + "0" + uatomDenom, + true, + true, + }, + { + "bypass-msg with non zero coin in the denom of global fee and maxTotalBypassMinFeeMsgGasUsage set to 1, pass", + paidFeeAmt + uatomDenom, + false, + false, + }, + } + + for _, tc := range testCases { + + if tc.changeMaxBypassGasUsage { + proposalCounter++ + // change MaxTotalBypassMinFeeMsgGasUsage through governance proposal from 1_000_0000 to 1 + s.govProposeNewMaxTotalBypassMinFeeMsgGasUsage(1, proposalCounter, submitter) + } + + // get delegator rewards + rewards, err := queryDelegatorTotalRewards(endpoint, payee.String()) + s.Require().NoError(err) + + // get delegator stake balance + oldBalance, err := getSpecificBalance(endpoint, payee.String(), stakeDenom) + s.Require().NoError(err) + + // withdraw rewards + s.Run(tc.name, func() { + s.execWithdrawAllRewards(s.chainA, 0, payee.String(), tc.fee, tc.expErr) + }) + + if !tc.expErr { + // get updated balance + incrBalance, err := getSpecificBalance(endpoint, payee.String(), stakeDenom) + s.Require().NoError(err) + + // compute sum of old balance and stake token rewards + oldBalancePlusReward := rewards.GetTotal().Add(sdk.NewDecCoinFromCoin(oldBalance)) + s.Require().Equal(oldBalancePlusReward[0].Denom, stakeDenom) + + // check updated balance got increased by at least oldBalancePlusReward + s.Require().True(sdk.NewDecCoinFromCoin(incrBalance).IsGTE(oldBalancePlusReward[0])) + } + } +} + +func (s *IntegrationTestSuite) testIBCBypassMsg() { + // submit gov proposal to change bypass-msg param to + // ["/ibc.core.channel.v1.MsgRecvPacket", + // "/ibc.core.channel.v1.MsgAcknowledgement", + // "/ibc.core.client.v1.MsgUpdateClient"] + submitterAddr, _ := s.chainA.validators[0].keyInfo.GetAddress() + submitter := submitterAddr.String() + proposalCounter++ + s.govProposeNewBypassMsgs([]string{ + sdk.MsgTypeURL(&ibcchanneltypes.MsgRecvPacket{}), + sdk.MsgTypeURL(&ibcchanneltypes.MsgAcknowledgement{}), + sdk.MsgTypeURL(&ibcclienttypes.MsgUpdateClient{}), + }, proposalCounter, submitter, standardFees.String()) + + // use hermes1 to test default ibc bypass-msg + // + // test 1: transaction only contains bypass-msgs, pass + s.testTxContainsOnlyIBCBypassMsg() + // test 2: test transactions contains both bypass and non-bypass msgs (sdk.MsgTypeURL(&ibcchanneltypes.MsgTimeout{}) + s.testTxContainsMixBypassNonBypassMsg() + // test 3: test bypass-msgs exceed the MaxBypassGasUsage + s.testBypassMsgsExceedMaxBypassGasLimit() + + // set the default bypass-msg back + proposalCounter++ + s.govProposeNewBypassMsgs([]string{ + sdk.MsgTypeURL(&ibcchanneltypes.MsgRecvPacket{}), + sdk.MsgTypeURL(&ibcchanneltypes.MsgAcknowledgement{}), + sdk.MsgTypeURL(&ibcclienttypes.MsgUpdateClient{}), + sdk.MsgTypeURL(&ibcchanneltypes.MsgTimeout{}), + sdk.MsgTypeURL(&ibcchanneltypes.MsgTimeoutOnClose{}), + }, proposalCounter, submitter, standardFees.String()) +} + +func (s *IntegrationTestSuite) testTxContainsOnlyIBCBypassMsg() { + s.T().Logf("testing transaction contains only ibc bypass messages") + ok := s.hermesTransfer(hermesConfigWithGasPrices, s.chainA.id, s.chainB.id, transferChannel, uatomDenom, 100, 1000, 1) + s.Require().True(ok) + + scrRelayerBalanceBefore, dstRelayerBalanceBefore := s.queryRelayerWalletsBalances() + + pass := s.hermesClearPacket(hermesConfigNoGasPrices, s.chainA.id, transferChannel) + s.Require().True(pass) + pendingPacketsExist := s.hermesPendingPackets(hermesConfigNoGasPrices, s.chainA.id, transferChannel) + s.Require().False(pendingPacketsExist) + + // confirm relayer wallets do not pay fees + scrRelayerBalanceAfter, dstRelayerBalanceAfter := s.queryRelayerWalletsBalances() + s.Require().Equal(scrRelayerBalanceBefore.String(), scrRelayerBalanceAfter.String()) + s.Require().Equal(dstRelayerBalanceBefore.String(), dstRelayerBalanceAfter.String()) +} + +func (s *IntegrationTestSuite) testTxContainsMixBypassNonBypassMsg() { + s.T().Logf("testing transaction contains both bypass and non-bypass messages") + // hermesTransfer with --timeout-height-offset=1 + ok := s.hermesTransfer(hermesConfigWithGasPrices, s.chainA.id, s.chainB.id, transferChannel, uatomDenom, 100, 1, 1) + s.Require().True(ok) + // make sure that the transaction is timeout + time.Sleep(3 * time.Second) + pendingPacketsExist := s.hermesPendingPackets(hermesConfigNoGasPrices, s.chainA.id, transferChannel) + s.Require().True(pendingPacketsExist) + + pass := s.hermesClearPacket(hermesConfigNoGasPrices, s.chainA.id, transferChannel) + s.Require().False(pass) + // clear packets with paying fee, to not influence the next transaction + pass = s.hermesClearPacket(hermesConfigWithGasPrices, s.chainA.id, transferChannel) + s.Require().True(pass) +} + +func (s *IntegrationTestSuite) testBypassMsgsExceedMaxBypassGasLimit() { + s.T().Logf("testing bypass messages exceed MaxBypassGasUsage") + ok := s.hermesTransfer(hermesConfigWithGasPrices, s.chainA.id, s.chainB.id, transferChannel, uatomDenom, 100, 1000, 12) + s.Require().True(ok) + pass := s.hermesClearPacket(hermesConfigNoGasPrices, s.chainA.id, transferChannel) + s.Require().False(pass) + + pendingPacketsExist := s.hermesPendingPackets(hermesConfigNoGasPrices, s.chainA.id, transferChannel) + s.Require().True(pendingPacketsExist) + + pass = s.hermesClearPacket(hermesConfigWithGasPrices, s.chainA.id, transferChannel) + s.Require().True(pass) +} diff --git a/tests/e2e/e2e_exec_test.go b/tests/e2e/e2e_exec_test.go index da499a8702..7d6ecb8fc6 100644 --- a/tests/e2e/e2e_exec_test.go +++ b/tests/e2e/e2e_exec_test.go @@ -284,57 +284,56 @@ func (s *IntegrationTestSuite) execBankSend( s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.expectErrExecValidation(c, valIdx, expectErr)) } -// type txBankSend struct { -// from string -// to string -// amt string -// fees string -// log string -// expectErr bool -// } +type txBankSend struct { + from string + to string + amt string + fees string + log string + expectErr bool +} + +func (s *IntegrationTestSuite) execBankSendBatch( + c *chain, + valIdx int, //nolint:unparam + txs ...txBankSend, +) int { + sucessBankSendCount := 0 + + for i := range txs { + s.T().Logf(txs[i].log) + + s.execBankSend(c, valIdx, txs[i].from, txs[i].to, txs[i].amt, txs[i].fees, txs[i].expectErr) + if !txs[i].expectErr { + if !txs[i].expectErr { + sucessBankSendCount++ + } + } + } + + return sucessBankSendCount +} + +func (s *IntegrationTestSuite) execWithdrawAllRewards(c *chain, valIdx int, payee, fees string, expectErr bool) { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + gaiaCommand := []string{ + gaiadBinary, + txCommand, + distributiontypes.ModuleName, + "withdraw-all-rewards", + fmt.Sprintf("--%s=%s", flags.FlagFrom, payee), + fmt.Sprintf("--%s=%s", flags.FlagGasPrices, fees), + fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), + "--keyring-backend=test", + "--output=json", + "-y", + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.expectErrExecValidation(c, valIdx, expectErr)) +} -// func (s *IntegrationTestSuite) execBankSendBatch( -// -// c *chain, -// valIdx int, //nolint:unparam -// txs ...txBankSend, -// -// ) int { -// sucessBankSendCount := 0 -// -// for i := range txs { -// s.T().Logf(txs[i].log) -// -// s.execBankSend(c, valIdx, txs[i].from, txs[i].to, txs[i].amt, txs[i].fees, txs[i].expectErr) -// if !txs[i].expectErr { -// if !txs[i].expectErr { -// sucessBankSendCount++ -// } -// } -// } -// -// return sucessBankSendCount -// } -// -// func (s *IntegrationTestSuite) execWithdrawAllRewards(c *chain, valIdx int, payee, fees string, expectErr bool) { -// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) -// defer cancel() -// -// gaiaCommand := []string{ -// gaiadBinary, -// txCommand, -// distributiontypes.ModuleName, -// "withdraw-all-rewards", -// fmt.Sprintf("--%s=%s", flags.FlagFrom, payee), -// fmt.Sprintf("--%s=%s", flags.FlagGasPrices, fees), -// fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), -// "--keyring-backend=test", -// "--output=json", -// "-y", -// } -// -// s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.expectErrExecValidation(c, valIdx, expectErr)) -// } func (s *IntegrationTestSuite) execDistributionFundCommunityPool(c *chain, valIdx int, from, amt, fees string) { ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() @@ -624,6 +623,35 @@ func (s *IntegrationTestSuite) executeGaiaTxCommand(ctx context.Context, c *chai } } +func (s *IntegrationTestSuite) executeHermesCommand(ctx context.Context, hermesCmd []string) ([]byte, []byte) { + var ( + outBuf bytes.Buffer + errBuf bytes.Buffer + ) + exec, err := s.dkrPool.Client.CreateExec(docker.CreateExecOptions{ + Context: ctx, + AttachStdout: true, + AttachStderr: true, + Container: s.hermesResource1.Container.ID, + User: "root", + Cmd: hermesCmd, + }) + s.Require().NoError(err) + + err = s.dkrPool.Client.StartExec(exec.ID, docker.StartExecOptions{ + Context: ctx, + Detach: false, + OutputStream: &outBuf, + ErrorStream: &errBuf, + }) + s.Require().NoError(err) + + stdOut := outBuf.Bytes() + stdErr := errBuf.Bytes() + + return stdOut, stdErr +} + func (s *IntegrationTestSuite) expectErrExecValidation(chain *chain, valIdx int, expectErr bool) func([]byte, []byte) bool { return func(stdOut []byte, stdErr []byte) bool { var txResp sdk.TxResponse diff --git a/tests/e2e/e2e_globalfee_proposal_test.go b/tests/e2e/e2e_globalfee_proposal_test.go index bb3e5fe5ad..df26e7a376 100644 --- a/tests/e2e/e2e_globalfee_proposal_test.go +++ b/tests/e2e/e2e_globalfee_proposal_test.go @@ -1,124 +1,123 @@ package e2e -// -// import ( -// "fmt" -// "strconv" -// "time" -// -// sdk "github.com/cosmos/cosmos-sdk/types" -// gov "github.com/cosmos/cosmos-sdk/x/gov/types" -// paramtypes "github.com/cosmos/cosmos-sdk/x/params/types/proposal" -//) -// -// func (s *IntegrationTestSuite) govProposeNewGlobalfee(newGlobalfee sdk.DecCoins, proposalCounter int, submitter string, _ string) { -// s.writeGovParamChangeProposalGlobalFees(s.chainA, newGlobalfee) -// chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) -// submitGovFlags := []string{"param-change", configFile(proposalGlobalFeeFilename)} -// depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} -// voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} -// -// // gov proposing new fees -// s.T().Logf("Proposal number: %d", proposalCounter) -// s.T().Logf("Submitting, deposit and vote legacy Gov Proposal: change global fee to %s", newGlobalfee.String()) -// s.runGovProcess(chainAAPIEndpoint, submitter, proposalCounter, paramtypes.ProposalTypeChange, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false) -// -// // query the proposal status and new fee -// s.Require().Eventually( -// func() bool { -// proposal, err := queryGovProposal(chainAAPIEndpoint, proposalCounter) -// s.Require().NoError(err) -// return proposal.GetProposal().Status == gov.StatusPassed -// }, -// 15*time.Second, -// 5*time.Second, -// ) -// -// s.Require().Eventually( -// func() bool { -// globalFees, err := queryGlobalFees(chainAAPIEndpoint) -// s.T().Logf("After gov new global fee proposal: %s", globalFees.String()) -// s.Require().NoError(err) -// -// // attention: if global fee is empty, when query globalfee, it shows empty rather than default ante.DefaultZeroGlobalFee() = 0uatom. -// return globalFees.IsEqual(newGlobalfee) -// }, -// 15*time.Second, -// 5*time.Second, -// ) -//} -// -// func (s *IntegrationTestSuite) govProposeNewBypassMsgs(newBypassMsgs []string, proposalCounter int, submitter string, fees string) { //nolint:unparam -// s.writeGovParamChangeProposalBypassMsgs(s.chainA, newBypassMsgs) -// chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) -// submitGovFlags := []string{"param-change", configFile(proposalBypassMsgFilename)} -// depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} -// voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} -// -// // gov proposing new fees -// s.T().Logf("Proposal number: %d", proposalCounter) -// s.T().Logf("Submitting, deposit and vote legacy Gov Proposal: change bypass min fee msg types to %s", newBypassMsgs) -// s.runGovProcess(chainAAPIEndpoint, submitter, proposalCounter, paramtypes.ProposalTypeChange, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false) -// -// // query the proposal status and new fee -// s.Require().Eventually( -// func() bool { -// proposal, err := queryGovProposal(chainAAPIEndpoint, proposalCounter) -// s.Require().NoError(err) -// return proposal.GetProposal().Status == gov.StatusPassed -// }, -// 15*time.Second, -// 5*time.Second, -// ) -// -// s.Require().Eventually( -// func() bool { -// bypassMsgs, err := queryBypassMsgs(chainAAPIEndpoint) -// s.T().Logf("After gov new global fee proposal: %s", newBypassMsgs) -// s.Require().NoError(err) -// -// // attention: if global fee is empty, when query globalfee, it shows empty rather than default ante.DefaultZeroGlobalFee() = 0uatom. -// s.Require().Equal(newBypassMsgs, bypassMsgs) -// return true -// }, -// 15*time.Second, -// 5*time.Second, -// ) -//} -// -// func (s *IntegrationTestSuite) govProposeNewMaxTotalBypassMinFeeMsgGasUsage(newGas uint64, proposalCounter int, submitter string) { -// s.writeGovParamChangeProposalMaxTotalBypass(s.chainA, newGas) -// chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) -// submitGovFlags := []string{"param-change", configFile(proposalMaxTotalBypassFilename)} -// depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} -// voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} -// -// // gov proposing new max gas usage for bypass msgs -// s.T().Logf("Proposal number: %d", proposalCounter) -// s.T().Logf("Submitting, deposit and vote legacy Gov Proposal: change maxTotalBypassMinFeeMsgGasUsage to %d", newGas) -// s.runGovProcess(chainAAPIEndpoint, submitter, proposalCounter, paramtypes.ProposalTypeChange, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false) -// -// // query the proposal status and max gas usage for bypass msgs -// s.Require().Eventually( -// func() bool { -// proposal, err := queryGovProposal(chainAAPIEndpoint, proposalCounter) -// s.Require().NoError(err) -// return proposal.GetProposal().Status == gov.StatusPassed -// }, -// 15*time.Second, -// 5*time.Second, -// ) -// -// s.Require().Eventually( -// func() bool { -// gas, err := queryMaxTotalBypassMinFeeMsgGasUsage(chainAAPIEndpoint) -// s.T().Logf("After gov new global fee proposal: %d", gas) -// s.Require().NoError(err) -// -// s.Require().Equal(newGas, gas) -// return true -// }, -// 15*time.Second, -// 5*time.Second, -// ) -//} +import ( + "fmt" + "strconv" + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" + govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types/proposal" +) + +func (s *IntegrationTestSuite) govProposeNewGlobalfee(newGlobalfee sdk.DecCoins, proposalCounter int, submitter string, _ string) { + s.writeGovParamChangeProposalGlobalFees(s.chainA, newGlobalfee) + chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) + submitGovFlags := []string{"param-change", configFile(proposalGlobalFeeFilename)} + depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} + voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} + + // gov proposing new fees + s.T().Logf("Proposal number: %d", proposalCounter) + s.T().Logf("Submitting, deposit and vote legacy Gov Proposal: change global fee to %s", newGlobalfee.String()) + s.runGovProcess(chainAAPIEndpoint, submitter, proposalCounter, paramtypes.ProposalTypeChange, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false) + + // query the proposal status and new fee + s.Require().Eventually( + func() bool { + proposal, err := queryGovProposal(chainAAPIEndpoint, proposalCounter) + s.Require().NoError(err) + return proposal.GetProposal().Status == govv1beta1.StatusPassed + }, + 15*time.Second, + 5*time.Second, + ) + + s.Require().Eventually( + func() bool { + globalFees, err := queryGlobalFees(chainAAPIEndpoint) + s.T().Logf("After gov new global fee proposal: %s", globalFees.String()) + s.Require().NoError(err) + + // attention: if global fee is empty, when query globalfee, it shows empty rather than default ante.DefaultZeroGlobalFee() = 0uatom. + return globalFees.IsEqual(newGlobalfee) + }, + 15*time.Second, + 5*time.Second, + ) +} + +func (s *IntegrationTestSuite) govProposeNewBypassMsgs(newBypassMsgs []string, proposalCounter int, submitter string, fees string) { //nolint:unparam + s.writeGovParamChangeProposalBypassMsgs(s.chainA, newBypassMsgs) + chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) + submitGovFlags := []string{"param-change", configFile(proposalBypassMsgFilename)} + depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} + voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} + + // gov proposing new fees + s.T().Logf("Proposal number: %d", proposalCounter) + s.T().Logf("Submitting, deposit and vote legacy Gov Proposal: change bypass min fee msg types to %s", newBypassMsgs) + s.runGovProcess(chainAAPIEndpoint, submitter, proposalCounter, paramtypes.ProposalTypeChange, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false) + + // query the proposal status and new fee + s.Require().Eventually( + func() bool { + proposal, err := queryGovProposal(chainAAPIEndpoint, proposalCounter) + s.Require().NoError(err) + return proposal.GetProposal().Status == govv1beta1.StatusPassed + }, + 15*time.Second, + 5*time.Second, + ) + + s.Require().Eventually( + func() bool { + bypassMsgs, err := queryBypassMsgs(chainAAPIEndpoint) + s.T().Logf("After gov new global fee proposal: %s", newBypassMsgs) + s.Require().NoError(err) + + // attention: if global fee is empty, when query globalfee, it shows empty rather than default ante.DefaultZeroGlobalFee() = 0uatom. + s.Require().Equal(newBypassMsgs, bypassMsgs) + return true + }, + 15*time.Second, + 5*time.Second, + ) +} + +func (s *IntegrationTestSuite) govProposeNewMaxTotalBypassMinFeeMsgGasUsage(newGas uint64, proposalCounter int, submitter string) { + s.writeGovParamChangeProposalMaxTotalBypass(s.chainA, newGas) + chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) + submitGovFlags := []string{"param-change", configFile(proposalMaxTotalBypassFilename)} + depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} + voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} + + // gov proposing new max gas usage for bypass msgs + s.T().Logf("Proposal number: %d", proposalCounter) + s.T().Logf("Submitting, deposit and vote legacy Gov Proposal: change maxTotalBypassMinFeeMsgGasUsage to %d", newGas) + s.runGovProcess(chainAAPIEndpoint, submitter, proposalCounter, paramtypes.ProposalTypeChange, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false) + + // query the proposal status and max gas usage for bypass msgs + s.Require().Eventually( + func() bool { + proposal, err := queryGovProposal(chainAAPIEndpoint, proposalCounter) + s.Require().NoError(err) + return proposal.GetProposal().Status == govv1beta1.StatusPassed + }, + 15*time.Second, + 5*time.Second, + ) + + s.Require().Eventually( + func() bool { + gas, err := queryMaxTotalBypassMinFeeMsgGasUsage(chainAAPIEndpoint) + s.T().Logf("After gov new global fee proposal: %d", gas) + s.Require().NoError(err) + + s.Require().Equal(newGas, gas) + return true + }, + 15*time.Second, + 5*time.Second, + ) +} diff --git a/tests/e2e/e2e_globalfee_test.go b/tests/e2e/e2e_globalfee_test.go index 27ab9f1e97..bcfffa5b4b 100644 --- a/tests/e2e/e2e_globalfee_test.go +++ b/tests/e2e/e2e_globalfee_test.go @@ -1,335 +1,334 @@ package e2e -// -// import ( -// "fmt" -// "time" -// -// "cosmossdk.io/math" -// sdk "github.com/cosmos/cosmos-sdk/types" -//) -// -//// globalfee in genesis is set to be "0.00001uatom" -// func (s *IntegrationTestSuite) testQueryGlobalFeesInGenesis() { -// chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) -// feeInGenesis, err := sdk.ParseDecCoins(initialGlobalFeeAmt + uatomDenom) -// s.Require().NoError(err) -// s.Require().Eventually( -// func() bool { -// fees, err := queryGlobalFees(chainAAPIEndpoint) -// s.T().Logf("Global Fees in Genesis: %s", fees.String()) -// s.Require().NoError(err) -// -// return fees.IsEqual(feeInGenesis) -// }, -// 15*time.Second, -// 5*time.Second, -// ) -//} -// -///* -// global fee e2e tests: -// initial setup: initial globalfee = 0.00001uatom, min_gas_price = 0.00001uatom -// (This initial value setup is to pass other e2e tests) -// -//test1: gov proposal globalfee = [], min_gas_price=0.00001uatom, query globalfee still get empty -//- tx with fee denom photon, fail -//- tx with zero fee denom photon, fail -//- tx with fee denom uatom, pass -//- tx with fee empty, fail -// -//test2: gov propose globalfee = 0.000001uatom(lower than min_gas_price) -//- tx with fee higher than 0.000001uatom but lower than 0.00001uatom, fail -//- tx with fee higher than/equal to 0.00001uatom, pass -//- tx with fee photon fail -// -//test3: gov propose globalfee = 0.0001uatom (higher than min_gas_price) -//- tx with fee equal to 0.0001uatom, pass -//- tx with fee equal to 0.00001uatom, fail -// -//test4: gov propose globalfee = 0.000001uatom (lower than min_gas_price), 0photon -//- tx with fee 0.0000001photon, fail -//- tx with fee 0.000001photon, pass -//- tx with empty fee, pass -//- tx with fee photon pass -//- tx with fee 0photon, 0.000005uatom fail -//- tx with fee 0photon, 0.00001uatom pass -//test5: check balance correct: all the successful bank sent tokens are received -//test6: gov propose change back to initial globalfee = 0.00001photon, This is for not influence other e2e tests. -// */ -// func (s *IntegrationTestSuite) testGlobalFees() { -// chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) -// -// submitterAddr := s.chainA.validators[0].keyInfo.GetAddress() -// submitter := submitterAddr.String() -// recipientAddress := s.chainA.validators[1].keyInfo.GetAddress() -// recipient := recipientAddress.String() -// -// var beforeRecipientPhotonBalance sdk.Coin -// s.Require().Eventually( -// func() bool { -// var err error -// beforeRecipientPhotonBalance, err = getSpecificBalance(chainAAPIEndpoint, recipient, photonDenom) -// s.Require().NoError(err) -// -// return beforeRecipientPhotonBalance.IsValid() -// }, -// 10*time.Second, -// 5*time.Second, -// ) -// if beforeRecipientPhotonBalance.Equal(sdk.Coin{}) { -// beforeRecipientPhotonBalance = sdk.NewCoin(photonDenom, sdk.ZeroInt()) -// } -// -// sendAmt := int64(1000) -// token := sdk.NewInt64Coin(photonDenom, sendAmt) // send 1000photon each time -// sucessBankSendCount := 0 -// -// // ---------------------------- test1: globalfee empty -------------------------------------------- -// // prepare gov globalfee proposal -// emptyGlobalFee := sdk.DecCoins{} -// proposalCounter++ -// s.govProposeNewGlobalfee(emptyGlobalFee, proposalCounter, submitter, standardFees.String()) -// paidFeeAmt := math.LegacyMustNewDecFromStr(minGasPrice).Mul(math.LegacyNewDec(gas)).String() -// -// s.T().Logf("test case: empty global fee, globalfee=%s, min_gas_price=%s", emptyGlobalFee.String(), minGasPrice+uatomDenom) -// txBankSends := []txBankSend{ -// { -// from: submitter, -// to: recipient, -// amt: token.String(), -// fees: "0" + uatomDenom, -// log: "Tx fee is zero coin with correct denom: uatom, fail", -// expectErr: true, -// }, -// { -// from: submitter, -// to: recipient, -// amt: token.String(), -// fees: "", -// log: "Tx fee is empty, fail", -// expectErr: true, -// }, -// { -// from: submitter, -// to: recipient, -// amt: token.String(), -// fees: "4" + photonDenom, -// log: "Tx with wrong denom: photon, fail", -// expectErr: true, -// }, -// { -// from: submitter, -// to: recipient, -// amt: token.String(), -// fees: "0" + photonDenom, -// log: "Tx fee is zero coins of wrong denom: photon, fail", -// expectErr: true, -// }, -// { -// from: submitter, -// to: recipient, -// amt: token.String(), -// fees: paidFeeAmt + uatomDenom, -// log: "Tx fee is higher than min_gas_price, pass", -// expectErr: false, -// }, -// } -// sucessBankSendCount += s.execBankSendBatch(s.chainA, 0, txBankSends...) -// -// // ------------------ test2: globalfee lower than min_gas_price ----------------------------------- -// // prepare gov globalfee proposal -// lowGlobalFee := sdk.DecCoins{sdk.NewDecCoinFromDec(uatomDenom, sdk.MustNewDecFromStr(lowGlobalFeesAmt))} -// proposalCounter++ -// s.govProposeNewGlobalfee(lowGlobalFee, proposalCounter, submitter, standardFees.String()) -// -// paidFeeAmt = math.LegacyMustNewDecFromStr(minGasPrice).Mul(math.LegacyNewDec(gas)).String() -// paidFeeAmtLowMinGasHighGlobalFee := math.LegacyMustNewDecFromStr(lowGlobalFeesAmt). -// Mul(math.LegacyNewDec(2)). -// Mul(math.LegacyNewDec(gas)). -// String() -// paidFeeAmtLowGlobalFee := math.LegacyMustNewDecFromStr(lowGlobalFeesAmt).Quo(math.LegacyNewDec(2)).String() -// -// s.T().Logf("test case: global fee is lower than min_gas_price, globalfee=%s, min_gas_price=%s", lowGlobalFee.String(), minGasPrice+uatomDenom) -// txBankSends = []txBankSend{ -// { -// from: submitter, -// to: recipient, -// amt: token.String(), -// fees: paidFeeAmt + uatomDenom, -// log: "Tx fee higher than/equal to min_gas_price and global fee, pass", -// expectErr: false, -// }, -// { -// from: submitter, -// to: recipient, -// amt: token.String(), -// fees: paidFeeAmtLowGlobalFee + uatomDenom, -// log: "Tx fee lower than/equal to min_gas_price and global fee, pass", -// expectErr: true, -// }, -// { -// from: submitter, -// to: recipient, -// amt: token.String(), -// fees: paidFeeAmtLowMinGasHighGlobalFee + uatomDenom, -// log: "Tx fee lower than/equal global fee and lower than min_gas_price, fail", -// expectErr: true, -// }, -// { -// from: submitter, -// to: recipient, -// amt: token.String(), -// fees: paidFeeAmt + photonDenom, -// log: "Tx fee has wrong denom, fail", -// expectErr: true, -// }, -// } -// sucessBankSendCount += s.execBankSendBatch(s.chainA, 0, txBankSends...) -// -// // ------------------ test3: globalfee higher than min_gas_price ---------------------------------- -// // prepare gov globalfee proposal -// highGlobalFee := sdk.DecCoins{sdk.NewDecCoinFromDec(uatomDenom, sdk.MustNewDecFromStr(highGlobalFeeAmt))} -// proposalCounter++ -// s.govProposeNewGlobalfee(highGlobalFee, proposalCounter, submitter, paidFeeAmt+uatomDenom) -// -// paidFeeAmt = math.LegacyMustNewDecFromStr(highGlobalFeeAmt).Mul(math.LegacyNewDec(gas)).String() -// paidFeeAmtHigherMinGasLowerGalobalFee := math.LegacyMustNewDecFromStr(minGasPrice). -// Quo(math.LegacyNewDec(2)).String() -// -// s.T().Logf("test case: global fee is higher than min_gas_price, globalfee=%s, min_gas_price=%s", highGlobalFee.String(), minGasPrice+uatomDenom) -// txBankSends = []txBankSend{ -// { -// from: submitter, -// to: recipient, -// amt: token.String(), -// fees: paidFeeAmt + uatomDenom, -// log: "Tx fee is higher than/equal to global fee and min_gas_price, pass", -// expectErr: false, -// }, -// { -// from: submitter, -// to: recipient, -// amt: token.String(), -// fees: paidFeeAmtHigherMinGasLowerGalobalFee + uatomDenom, -// log: "Tx fee is higher than/equal to min_gas_price but lower than global fee, fail", -// expectErr: true, -// }, -// } -// sucessBankSendCount += s.execBankSendBatch(s.chainA, 0, txBankSends...) -// -// // ---------------------------- test4: global fee with two denoms ----------------------------------- -// // prepare gov globalfee proposal -// mixGlobalFee := sdk.DecCoins{ -// sdk.NewDecCoinFromDec(photonDenom, sdk.NewDec(0)), -// sdk.NewDecCoinFromDec(uatomDenom, sdk.MustNewDecFromStr(lowGlobalFeesAmt)), -// }.Sort() -// proposalCounter++ -// s.govProposeNewGlobalfee(mixGlobalFee, proposalCounter, submitter, paidFeeAmt+uatomDenom) -// -// // equal to min_gas_price -// paidFeeAmt = math.LegacyMustNewDecFromStr(minGasPrice).Mul(math.LegacyNewDec(gas)).String() -// paidFeeAmtLow := math.LegacyMustNewDecFromStr(lowGlobalFeesAmt). -// Quo(math.LegacyNewDec(2)). -// Mul(math.LegacyNewDec(gas)). -// String() -// -// s.T().Logf("test case: global fees contain multiple denoms: one zero coin, one non-zero coin, globalfee=%s, min_gas_price=%s", mixGlobalFee.String(), minGasPrice+uatomDenom) -// txBankSends = []txBankSend{ -// { -// from: submitter, -// to: recipient, -// amt: token.String(), -// fees: paidFeeAmt + uatomDenom, -// log: "Tx with fee higher than/equal to one of denom's amount the global fee, pass", -// expectErr: false, -// }, -// { -// from: submitter, -// to: recipient, -// amt: token.String(), -// fees: paidFeeAmtLow + uatomDenom, -// log: "Tx with fee lower than one of denom's amount the global fee, fail", -// expectErr: true, -// }, -// { -// from: submitter, -// to: recipient, -// amt: token.String(), -// fees: "", -// log: "Tx with fee empty fee, pass", -// expectErr: false, -// }, -// { -// from: submitter, -// to: recipient, -// amt: token.String(), -// fees: "0" + photonDenom, -// log: "Tx with zero coin in the denom of zero coin of global fee, pass", -// expectErr: false, -// }, -// { -// from: submitter, -// to: recipient, -// amt: token.String(), -// fees: "0" + photonDenom, -// log: "Tx with zero coin in the denom of zero coin of global fee, pass", -// expectErr: false, -// }, -// { -// from: submitter, -// to: recipient, -// amt: token.String(), -// fees: "2" + photonDenom, -// log: "Tx with non-zero coin in the denom of zero coin of global fee, pass", -// expectErr: false, -// }, -// { -// from: submitter, -// to: recipient, -// amt: token.String(), -// fees: "0" + photonDenom + "," + paidFeeAmtLow + uatomDenom, -// log: "Tx with multiple fee coins, zero coin and low fee, fail", -// expectErr: true, -// }, -// { -// from: submitter, -// to: recipient, -// amt: token.String(), -// fees: "0" + photonDenom + "," + paidFeeAmt + uatomDenom, -// log: "Tx with multiple fee coins, zero coin and high fee, pass", -// expectErr: false, -// }, -// -// { -// from: submitter, -// to: recipient, -// amt: token.String(), -// fees: "2" + photonDenom + "," + paidFeeAmt + uatomDenom, -// log: "Tx with multiple fee coins, all higher than global fee and min_gas_price", -// expectErr: false, -// }, -// } -// sucessBankSendCount += s.execBankSendBatch(s.chainA, 0, txBankSends...) -// -// // --------------------------------------------------------------------------- -// // check the balance is correct after previous txs -// s.Require().Eventually( -// func() bool { -// afterRecipientPhotonBalance, err := getSpecificBalance(chainAAPIEndpoint, recipient, photonDenom) -// s.Require().NoError(err) -// IncrementedPhoton := afterRecipientPhotonBalance.Sub(beforeRecipientPhotonBalance) -// photonSent := sdk.NewInt64Coin(photonDenom, sendAmt*int64(sucessBankSendCount)) -// return IncrementedPhoton.IsEqual(photonSent) -// }, -// time.Minute, -// 5*time.Second, -// ) -// -// // gov proposing to change back to original global fee -// s.T().Logf("Propose to change back to original global fees: %s", initialGlobalFeeAmt+uatomDenom) -// oldfees, err := sdk.ParseDecCoins(initialGlobalFeeAmt + uatomDenom) -// s.Require().NoError(err) -// proposalCounter++ -// s.govProposeNewGlobalfee(oldfees, proposalCounter, submitter, paidFeeAmt+photonDenom) -//} +import ( + "fmt" + "time" + + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// globalfee in genesis is set to be "0.00001uatom" +func (s *IntegrationTestSuite) testQueryGlobalFeesInGenesis() { + chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) + feeInGenesis, err := sdk.ParseDecCoins(initialGlobalFeeAmt + uatomDenom) + s.Require().NoError(err) + s.Require().Eventually( + func() bool { + fees, err := queryGlobalFees(chainAAPIEndpoint) + s.T().Logf("Global Fees in Genesis: %s", fees.String()) + s.Require().NoError(err) + + return fees.IsEqual(feeInGenesis) + }, + 15*time.Second, + 5*time.Second, + ) +} + +/* +global fee e2e tests: +initial setup: initial globalfee = 0.00001uatom, min_gas_price = 0.00001uatom +(This initial value setup is to pass other e2e tests) + +test1: gov proposal globalfee = [], min_gas_price=0.00001uatom, query globalfee still get empty +- tx with fee denom photon, fail +- tx with zero fee denom photon, fail +- tx with fee denom uatom, pass +- tx with fee empty, fail + +test2: gov propose globalfee = 0.000001uatom(lower than min_gas_price) +- tx with fee higher than 0.000001uatom but lower than 0.00001uatom, fail +- tx with fee higher than/equal to 0.00001uatom, pass +- tx with fee photon fail + +test3: gov propose globalfee = 0.0001uatom (higher than min_gas_price) +- tx with fee equal to 0.0001uatom, pass +- tx with fee equal to 0.00001uatom, fail + +test4: gov propose globalfee = 0.000001uatom (lower than min_gas_price), 0photon +- tx with fee 0.0000001photon, fail +- tx with fee 0.000001photon, pass +- tx with empty fee, pass +- tx with fee photon pass +- tx with fee 0photon, 0.000005uatom fail +- tx with fee 0photon, 0.00001uatom pass +test5: check balance correct: all the successful bank sent tokens are received +test6: gov propose change back to initial globalfee = 0.00001photon, This is for not influence other e2e tests. +*/ +func (s *IntegrationTestSuite) testGlobalFees() { + chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) + + submitterAddr, _ := s.chainA.validators[0].keyInfo.GetAddress() + submitter := submitterAddr.String() + recipientAddress, _ := s.chainA.validators[1].keyInfo.GetAddress() + recipient := recipientAddress.String() + + var beforeRecipientPhotonBalance sdk.Coin + s.Require().Eventually( + func() bool { + var err error + beforeRecipientPhotonBalance, err = getSpecificBalance(chainAAPIEndpoint, recipient, photonDenom) + s.Require().NoError(err) + + return beforeRecipientPhotonBalance.IsValid() + }, + 10*time.Second, + 5*time.Second, + ) + if beforeRecipientPhotonBalance.Equal(sdk.Coin{}) { + beforeRecipientPhotonBalance = sdk.NewCoin(photonDenom, sdk.ZeroInt()) + } + + sendAmt := int64(1000) + token := sdk.NewInt64Coin(photonDenom, sendAmt) // send 1000photon each time + sucessBankSendCount := 0 + + // ---------------------------- test1: globalfee empty -------------------------------------------- + // prepare gov globalfee proposal + emptyGlobalFee := sdk.DecCoins{} + proposalCounter++ + s.govProposeNewGlobalfee(emptyGlobalFee, proposalCounter, submitter, standardFees.String()) + paidFeeAmt := math.LegacyMustNewDecFromStr(minGasPrice).Mul(math.LegacyNewDec(gas)).String() + + s.T().Logf("test case: empty global fee, globalfee=%s, min_gas_price=%s", emptyGlobalFee.String(), minGasPrice+uatomDenom) + txBankSends := []txBankSend{ + { + from: submitter, + to: recipient, + amt: token.String(), + fees: "0" + uatomDenom, + log: "Tx fee is zero coin with correct denom: uatom, fail", + expectErr: true, + }, + { + from: submitter, + to: recipient, + amt: token.String(), + fees: "", + log: "Tx fee is empty, fail", + expectErr: true, + }, + { + from: submitter, + to: recipient, + amt: token.String(), + fees: "4" + photonDenom, + log: "Tx with wrong denom: photon, fail", + expectErr: true, + }, + { + from: submitter, + to: recipient, + amt: token.String(), + fees: "0" + photonDenom, + log: "Tx fee is zero coins of wrong denom: photon, fail", + expectErr: true, + }, + { + from: submitter, + to: recipient, + amt: token.String(), + fees: paidFeeAmt + uatomDenom, + log: "Tx fee is higher than min_gas_price, pass", + expectErr: false, + }, + } + sucessBankSendCount += s.execBankSendBatch(s.chainA, 0, txBankSends...) + + // ------------------ test2: globalfee lower than min_gas_price ----------------------------------- + // prepare gov globalfee proposal + lowGlobalFee := sdk.DecCoins{sdk.NewDecCoinFromDec(uatomDenom, sdk.MustNewDecFromStr(lowGlobalFeesAmt))} + proposalCounter++ + s.govProposeNewGlobalfee(lowGlobalFee, proposalCounter, submitter, standardFees.String()) + + paidFeeAmt = math.LegacyMustNewDecFromStr(minGasPrice).Mul(math.LegacyNewDec(gas)).String() + paidFeeAmtLowMinGasHighGlobalFee := math.LegacyMustNewDecFromStr(lowGlobalFeesAmt). + Mul(math.LegacyNewDec(2)). + Mul(math.LegacyNewDec(gas)). + String() + paidFeeAmtLowGlobalFee := math.LegacyMustNewDecFromStr(lowGlobalFeesAmt).Quo(math.LegacyNewDec(2)).String() + + s.T().Logf("test case: global fee is lower than min_gas_price, globalfee=%s, min_gas_price=%s", lowGlobalFee.String(), minGasPrice+uatomDenom) + txBankSends = []txBankSend{ + { + from: submitter, + to: recipient, + amt: token.String(), + fees: paidFeeAmt + uatomDenom, + log: "Tx fee higher than/equal to min_gas_price and global fee, pass", + expectErr: false, + }, + { + from: submitter, + to: recipient, + amt: token.String(), + fees: paidFeeAmtLowGlobalFee + uatomDenom, + log: "Tx fee lower than/equal to min_gas_price and global fee, pass", + expectErr: true, + }, + { + from: submitter, + to: recipient, + amt: token.String(), + fees: paidFeeAmtLowMinGasHighGlobalFee + uatomDenom, + log: "Tx fee lower than/equal global fee and lower than min_gas_price, fail", + expectErr: true, + }, + { + from: submitter, + to: recipient, + amt: token.String(), + fees: paidFeeAmt + photonDenom, + log: "Tx fee has wrong denom, fail", + expectErr: true, + }, + } + sucessBankSendCount += s.execBankSendBatch(s.chainA, 0, txBankSends...) + + // ------------------ test3: globalfee higher than min_gas_price ---------------------------------- + // prepare gov globalfee proposal + highGlobalFee := sdk.DecCoins{sdk.NewDecCoinFromDec(uatomDenom, sdk.MustNewDecFromStr(highGlobalFeeAmt))} + proposalCounter++ + s.govProposeNewGlobalfee(highGlobalFee, proposalCounter, submitter, paidFeeAmt+uatomDenom) + + paidFeeAmt = math.LegacyMustNewDecFromStr(highGlobalFeeAmt).Mul(math.LegacyNewDec(gas)).String() + paidFeeAmtHigherMinGasLowerGalobalFee := math.LegacyMustNewDecFromStr(minGasPrice). + Quo(math.LegacyNewDec(2)).String() + + s.T().Logf("test case: global fee is higher than min_gas_price, globalfee=%s, min_gas_price=%s", highGlobalFee.String(), minGasPrice+uatomDenom) + txBankSends = []txBankSend{ + { + from: submitter, + to: recipient, + amt: token.String(), + fees: paidFeeAmt + uatomDenom, + log: "Tx fee is higher than/equal to global fee and min_gas_price, pass", + expectErr: false, + }, + { + from: submitter, + to: recipient, + amt: token.String(), + fees: paidFeeAmtHigherMinGasLowerGalobalFee + uatomDenom, + log: "Tx fee is higher than/equal to min_gas_price but lower than global fee, fail", + expectErr: true, + }, + } + sucessBankSendCount += s.execBankSendBatch(s.chainA, 0, txBankSends...) + + // ---------------------------- test4: global fee with two denoms ----------------------------------- + // prepare gov globalfee proposal + mixGlobalFee := sdk.DecCoins{ + sdk.NewDecCoinFromDec(photonDenom, sdk.NewDec(0)), + sdk.NewDecCoinFromDec(uatomDenom, sdk.MustNewDecFromStr(lowGlobalFeesAmt)), + }.Sort() + proposalCounter++ + s.govProposeNewGlobalfee(mixGlobalFee, proposalCounter, submitter, paidFeeAmt+uatomDenom) + + // equal to min_gas_price + paidFeeAmt = math.LegacyMustNewDecFromStr(minGasPrice).Mul(math.LegacyNewDec(gas)).String() + paidFeeAmtLow := math.LegacyMustNewDecFromStr(lowGlobalFeesAmt). + Quo(math.LegacyNewDec(2)). + Mul(math.LegacyNewDec(gas)). + String() + + s.T().Logf("test case: global fees contain multiple denoms: one zero coin, one non-zero coin, globalfee=%s, min_gas_price=%s", mixGlobalFee.String(), minGasPrice+uatomDenom) + txBankSends = []txBankSend{ + { + from: submitter, + to: recipient, + amt: token.String(), + fees: paidFeeAmt + uatomDenom, + log: "Tx with fee higher than/equal to one of denom's amount the global fee, pass", + expectErr: false, + }, + { + from: submitter, + to: recipient, + amt: token.String(), + fees: paidFeeAmtLow + uatomDenom, + log: "Tx with fee lower than one of denom's amount the global fee, fail", + expectErr: true, + }, + { + from: submitter, + to: recipient, + amt: token.String(), + fees: "", + log: "Tx with fee empty fee, pass", + expectErr: false, + }, + { + from: submitter, + to: recipient, + amt: token.String(), + fees: "0" + photonDenom, + log: "Tx with zero coin in the denom of zero coin of global fee, pass", + expectErr: false, + }, + { + from: submitter, + to: recipient, + amt: token.String(), + fees: "0" + photonDenom, + log: "Tx with zero coin in the denom of zero coin of global fee, pass", + expectErr: false, + }, + { + from: submitter, + to: recipient, + amt: token.String(), + fees: "2" + photonDenom, + log: "Tx with non-zero coin in the denom of zero coin of global fee, pass", + expectErr: false, + }, + { + from: submitter, + to: recipient, + amt: token.String(), + fees: "0" + photonDenom + "," + paidFeeAmtLow + uatomDenom, + log: "Tx with multiple fee coins, zero coin and low fee, fail", + expectErr: true, + }, + { + from: submitter, + to: recipient, + amt: token.String(), + fees: "0" + photonDenom + "," + paidFeeAmt + uatomDenom, + log: "Tx with multiple fee coins, zero coin and high fee, pass", + expectErr: false, + }, + + { + from: submitter, + to: recipient, + amt: token.String(), + fees: "2" + photonDenom + "," + paidFeeAmt + uatomDenom, + log: "Tx with multiple fee coins, all higher than global fee and min_gas_price", + expectErr: false, + }, + } + sucessBankSendCount += s.execBankSendBatch(s.chainA, 0, txBankSends...) + + // --------------------------------------------------------------------------- + // check the balance is correct after previous txs + s.Require().Eventually( + func() bool { + afterRecipientPhotonBalance, err := getSpecificBalance(chainAAPIEndpoint, recipient, photonDenom) + s.Require().NoError(err) + IncrementedPhoton := afterRecipientPhotonBalance.Sub(beforeRecipientPhotonBalance) + photonSent := sdk.NewInt64Coin(photonDenom, sendAmt*int64(sucessBankSendCount)) + return IncrementedPhoton.IsEqual(photonSent) + }, + time.Minute, + 5*time.Second, + ) + + // gov proposing to change back to original global fee + s.T().Logf("Propose to change back to original global fees: %s", initialGlobalFeeAmt+uatomDenom) + oldfees, err := sdk.ParseDecCoins(initialGlobalFeeAmt + uatomDenom) + s.Require().NoError(err) + proposalCounter++ + s.govProposeNewGlobalfee(oldfees, proposalCounter, submitter, paidFeeAmt+photonDenom) +} diff --git a/tests/e2e/e2e_ibc_test.go b/tests/e2e/e2e_ibc_test.go index 2f2ce19ddb..ea90f49ab6 100644 --- a/tests/e2e/e2e_ibc_test.go +++ b/tests/e2e/e2e_ibc_test.go @@ -1,20 +1,17 @@ package e2e import ( + "bufio" "bytes" "context" "encoding/json" "fmt" - "os" - "path" - "path/filepath" "strconv" "strings" "time" "github.com/cosmos/cosmos-sdk/client/flags" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/ory/dockertest/v3" "github.com/ory/dockertest/v3/docker" ) @@ -32,104 +29,6 @@ type PacketMetadata struct { Forward *ForwardMetadata `json:"forward"` } -func (s *IntegrationTestSuite) runIBCRelayer() { - s.T().Log("starting Hermes relayer container...") - - tmpDir, err := os.MkdirTemp("", "gaia-e2e-testnet-hermes-") - s.Require().NoError(err) - s.tmpDirs = append(s.tmpDirs, tmpDir) - - gaiaAVal := s.chainA.validators[0] - gaiaBVal := s.chainB.validators[0] - - gaiaARly := s.chainA.genesisAccounts[relayerAccountIndex] - gaiaBRly := s.chainB.genesisAccounts[relayerAccountIndex] - - hermesCfgPath := path.Join(tmpDir, "hermes") - - s.Require().NoError(os.MkdirAll(hermesCfgPath, 0o755)) - _, err = copyFile( - filepath.Join("./scripts/", "hermes_bootstrap.sh"), - filepath.Join(hermesCfgPath, "hermes_bootstrap.sh"), - ) - s.Require().NoError(err) - - s.hermesResource, err = s.dkrPool.RunWithOptions( - &dockertest.RunOptions{ - Name: fmt.Sprintf("%s-%s-relayer", s.chainA.id, s.chainB.id), - Repository: "ghcr.io/informalsystems/hermes", - Tag: "1.4.1", - NetworkID: s.dkrNet.Network.ID, - Mounts: []string{ - fmt.Sprintf("%s/:/root/hermes", hermesCfgPath), - }, - PortBindings: map[docker.Port][]docker.PortBinding{ - "3031/tcp": {{HostIP: "", HostPort: "3031"}}, - }, - Env: []string{ - fmt.Sprintf("GAIA_A_E2E_CHAIN_ID=%s", s.chainA.id), - fmt.Sprintf("GAIA_B_E2E_CHAIN_ID=%s", s.chainB.id), - fmt.Sprintf("GAIA_A_E2E_VAL_MNEMONIC=%s", gaiaAVal.mnemonic), - fmt.Sprintf("GAIA_B_E2E_VAL_MNEMONIC=%s", gaiaBVal.mnemonic), - fmt.Sprintf("GAIA_A_E2E_RLY_MNEMONIC=%s", gaiaARly.mnemonic), - fmt.Sprintf("GAIA_B_E2E_RLY_MNEMONIC=%s", gaiaBRly.mnemonic), - fmt.Sprintf("GAIA_A_E2E_VAL_HOST=%s", s.valResources[s.chainA.id][0].Container.Name[1:]), - fmt.Sprintf("GAIA_B_E2E_VAL_HOST=%s", s.valResources[s.chainB.id][0].Container.Name[1:]), - }, - User: "root", - Entrypoint: []string{ - "sh", - "-c", - "chmod +x /root/hermes/hermes_bootstrap.sh && /root/hermes/hermes_bootstrap.sh", - }, - }, - noRestart, - ) - s.Require().NoError(err) - - // TODO: debug relayer REST endpoint - // endpoint := fmt.Sprintf("http://%s/state", s.hermesResource.GetHostPort("3031/tcp")) - // s.Require().Eventually( - // func() bool { - // resp, err := http.Get(endpoint) //nolint:gosec // this is a test - // if err != nil { - // return false - // } - - // defer resp.Body.Close() - - // bz, err := io.ReadAll(resp.Body) - // if err != nil { - // return false - // } - - // var respBody map[string]interface{} - // if err := json.Unmarshal(bz, &respBody); err != nil { - // return false - // } - - // status := respBody["status"].(string) - // result := respBody["result"].(map[string]interface{}) - - // return status == "success" && len(result["chains"].([]interface{})) == 2 - // }, - // 5*time.Minute, - // time.Second, - // "hermes relayer not healthy", - // ) - - s.T().Logf("started Hermes relayer container: %s", s.hermesResource.Container.ID) - - // XXX: Give time to both networks to start, otherwise we might see gRPC - // transport errors. - time.Sleep(10 * time.Second) - - // create the client, connection and channel between the two Gaia chains - s.createConnection() - time.Sleep(10 * time.Second) - s.createChannel() -} - func (s *IntegrationTestSuite) sendIBC(c *chain, valIdx int, sender, recipient, token, fees, note string) { ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() @@ -158,6 +57,120 @@ func (s *IntegrationTestSuite) sendIBC(c *chain, valIdx int, sender, recipient, s.T().Log("successfully sent IBC tokens") } +func (s *IntegrationTestSuite) hermesTransfer(configPath, srcChainID, dstChainID, srcChannelID, denom string, sendAmt, timeOutOffset, numMsg int) (success bool) { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + hermesCmd := []string{ + hermesBinary, + fmt.Sprintf("--config=%s", configPath), + "tx", + "ft-transfer", + fmt.Sprintf("--dst-chain=%s", dstChainID), + fmt.Sprintf("--src-chain=%s", srcChainID), + fmt.Sprintf("--src-channel=%s", srcChannelID), + fmt.Sprintf("--src-port=%s", "transfer"), + fmt.Sprintf("--amount=%v", sendAmt), + fmt.Sprintf("--denom=%s", denom), + fmt.Sprintf("--timeout-height-offset=%v", timeOutOffset), + fmt.Sprintf("--number-msgs=%v", numMsg), + } + + stdout, stderr := s.executeHermesCommand(ctx, hermesCmd) + if strings.Contains(string(stdout), "ERROR") || strings.Contains(string(stderr), "ERROR") { + return false + } + + return true +} + +func (s *IntegrationTestSuite) hermesClearPacket(configPath, chainID, channelID string) (success bool) { //nolint:unparam + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + hermesCmd := []string{ + hermesBinary, + fmt.Sprintf("--config=%s", configPath), + "clear", + "packets", + fmt.Sprintf("--chain=%s", chainID), + fmt.Sprintf("--channel=%s", channelID), + fmt.Sprintf("--port=%s", "transfer"), + } + + stdout, stderr := s.executeHermesCommand(ctx, hermesCmd) + + if strings.Contains(string(stdout), "ERROR") || strings.Contains(string(stderr), "ERROR") { + return false + } + + return true +} + +type RelayerPacketsOutput struct { + Result struct { + Dst struct { + UnreceivedPackets []uint64 `json:"unreceived_packets"` + } `json:"dst"` + Src struct { + UnreceivedPackets []uint64 `json:"unreceived_packets"` + } `json:"src"` + } `json:"result"` + Status string `json:"status"` +} + +func (s *IntegrationTestSuite) hermesPendingPackets(configPath, chainID, channelID string) (pendingPackets bool) { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + hermesCmd := []string{ + hermesBinary, + "--json", + fmt.Sprintf("--config=%s", configPath), + "query", + "packet", + "pending", + fmt.Sprintf("--chain=%s", chainID), + fmt.Sprintf("--channel=%s", channelID), + fmt.Sprintf("--port=%s", "transfer"), + } + + stdout, _ := s.executeHermesCommand(ctx, hermesCmd) + reader := bytes.NewReader(stdout) + sc := bufio.NewScanner(reader) + + var relayerPacketsOutput RelayerPacketsOutput + + // TODO: check why no error is never returned + // works atm because the last line of stdout is always the query output + for sc.Scan() { + sc.Bytes() + _ = json.Unmarshal(sc.Bytes(), &relayerPacketsOutput) + } + + // Check if "unreceived_packets" exists in "src" + return len(relayerPacketsOutput.Result.Src.UnreceivedPackets) != 0 +} + +func (s *IntegrationTestSuite) queryRelayerWalletsBalances() (sdk.Coin, sdk.Coin) { + chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) + acctAddrChainA, _ := s.chainA.genesisAccounts[relayerAccountIndexHermes1].keyInfo.GetAddress() + scrRelayerBalance, err := getSpecificBalance( + chainAAPIEndpoint, + acctAddrChainA.String(), + uatomDenom) + s.Require().NoError(err) + + chainBAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainB.id][0].GetHostPort("1317/tcp")) + acctAddrChainB, _ := s.chainB.genesisAccounts[relayerAccountIndexHermes1].keyInfo.GetAddress() + dstRelayerBalance, err := getSpecificBalance( + chainBAPIEndpoint, + acctAddrChainB.String(), + uatomDenom) + s.Require().NoError(err) + + return scrRelayerBalance, dstRelayerBalance +} + func (s *IntegrationTestSuite) createConnection() { s.T().Logf("connecting %s and %s chains via IBC", s.chainA.id, s.chainB.id) @@ -168,7 +181,7 @@ func (s *IntegrationTestSuite) createConnection() { Context: ctx, AttachStdout: true, AttachStderr: true, - Container: s.hermesResource.Container.ID, + Container: s.hermesResource0.Container.ID, User: "root", Cmd: []string{ "hermes", @@ -211,7 +224,7 @@ func (s *IntegrationTestSuite) createChannel() { Context: ctx, AttachStdout: true, AttachStderr: true, - Container: s.hermesResource.Container.ID, + Container: s.hermesResource0.Container.ID, User: "root", Cmd: []string{ "hermes", @@ -251,7 +264,6 @@ func (s *IntegrationTestSuite) createChannel() { } func (s *IntegrationTestSuite) testIBCTokenTransfer() { - time.Sleep(30 * time.Second) s.Run("send_uatom_to_chainB", func() { // require the recipient account receives the IBC tokens (IBC packets ACKd) var ( diff --git a/tests/e2e/e2e_rest_regression_test.go b/tests/e2e/e2e_rest_regression_test.go index 3ded9e0977..b5cfb97764 100644 --- a/tests/e2e/e2e_rest_regression_test.go +++ b/tests/e2e/e2e_rest_regression_test.go @@ -42,6 +42,7 @@ const ( slashingParamsModuleQueryPath = "/cosmos/slashing/v1beta1/params" stakingParamsModuleQueryPath = "/cosmos/staking/v1beta1/params" missingPath = "/missing_endpoint" + localMinGasPriceQueryPath = "/cosmos/base/node/v1beta1/config" ) func (s *IntegrationTestSuite) testRestInterfaces() { @@ -72,6 +73,7 @@ func (s *IntegrationTestSuite) testRestInterfaces() { {slashingParamsModuleQueryPath, 200}, {stakingParamsModuleQueryPath, 200}, {missingPath, 501}, + {localMinGasPriceQueryPath, 200}, } ) diff --git a/tests/e2e/e2e_setup_test.go b/tests/e2e/e2e_setup_test.go index dac245a6ae..84bdf6499e 100644 --- a/tests/e2e/e2e_setup_test.go +++ b/tests/e2e/e2e_setup_test.go @@ -7,6 +7,7 @@ import ( "math/rand" "os" "os/exec" + "path" "path/filepath" "strconv" "strings" @@ -45,59 +46,69 @@ import ( ) const ( - gaiadBinary = "gaiad" - txCommand = "tx" - queryCommand = "query" - keysCommand = "keys" - gaiaHomePath = "/home/nonroot/.gaia" - // photonDenom = "photon" + gaiadBinary = "gaiad" + txCommand = "tx" + queryCommand = "query" + keysCommand = "keys" + gaiaHomePath = "/home/nonroot/.gaia" + photonDenom = "photon" uatomDenom = "uatom" stakeDenom = "stake" initBalanceStr = "110000000000stake,100000000000000000photon,100000000000000000uatom" minGasPrice = "0.00001" // // the test globalfee in genesis is the same as minGasPrice // // global fee lower/higher than min_gas_price - initialGlobalFeeAmt = "0.00001" - // lowGlobalFeesAmt = "0.000001" - // highGlobalFeeAmt = "0.0001" - // maxTotalBypassMinFeeMsgGasUsage = "1" - gas = 200000 - - govProposalBlockBuffer = 35 - relayerAccountIndex = 0 - numberOfEvidences = 10 - slashingShares int64 = 10000 - - // proposalGlobalFeeFilename = "proposal_globalfee.json" - // proposalBypassMsgFilename = "proposal_bypass_msg.json" - // proposalMaxTotalBypassFilename = "proposal_max_total_bypass.json" + initialGlobalFeeAmt = "0.00001" + lowGlobalFeesAmt = "0.000001" + highGlobalFeeAmt = "0.0001" + maxTotalBypassMinFeeMsgGasUsage = "1" + gas = 200000 + + govProposalBlockBuffer = 35 + relayerAccountIndexHermes0 = 0 + relayerAccountIndexHermes1 = 1 + numberOfEvidences = 10 + slashingShares int64 = 10000 + + proposalGlobalFeeFilename = "proposal_globalfee.json" + proposalBypassMsgFilename = "proposal_bypass_msg.json" + proposalMaxTotalBypassFilename = "proposal_max_total_bypass.json" proposalCommunitySpendFilename = "proposal_community_spend.json" -// proposalAddConsumerChainFilename = "proposal_add_consumer.json" -// proposalRemoveConsumerChainFilename = "proposal_remove_consumer.json" + // proposalAddConsumerChainFilename = "proposal_add_consumer.json" + // proposalRemoveConsumerChainFilename = "proposal_remove_consumer.json" + + hermesBinary = "hermes" + hermesConfigWithGasPrices = "/root/.hermes/config.toml" + hermesConfigNoGasPrices = "/root/.hermes/config-zero.toml" + transferChannel = "channel-0" ) var ( - gaiaConfigPath = filepath.Join(gaiaHomePath, "config") - stakingAmount = sdk.NewInt(100000000000) - stakingAmountCoin = sdk.NewCoin(uatomDenom, stakingAmount) - tokenAmount = sdk.NewCoin(uatomDenom, sdk.NewInt(3300000000)) // 3,300uatom - standardFees = sdk.NewCoin(uatomDenom, sdk.NewInt(330000)) // 0.33uatom - depositAmount = sdk.NewCoin(uatomDenom, sdk.NewInt(330000000)) // 3,300uatom - distModuleAddress = authtypes.NewModuleAddress(distrtypes.ModuleName).String() - govModuleAddress = authtypes.NewModuleAddress(govtypes.ModuleName).String() - proposalCounter = 0 + gaiaConfigPath = filepath.Join(gaiaHomePath, "config") + stakingAmount = sdk.NewInt(100000000000) + stakingAmountCoin = sdk.NewCoin(uatomDenom, stakingAmount) + tokenAmount = sdk.NewCoin(uatomDenom, sdk.NewInt(3300000000)) // 3,300uatom + standardFees = sdk.NewCoin(uatomDenom, sdk.NewInt(330000)) // 0.33uatom + depositAmount = sdk.NewCoin(uatomDenom, sdk.NewInt(330000000)) // 3,300uatom + distModuleAddress = authtypes.NewModuleAddress(distrtypes.ModuleName).String() + govModuleAddress = authtypes.NewModuleAddress(govtypes.ModuleName).String() + proposalCounter = 0 + HermesResource0Purged = false ) type IntegrationTestSuite struct { suite.Suite - tmpDirs []string - chainA *chain - chainB *chain - dkrPool *dockertest.Pool - dkrNet *dockertest.Network - hermesResource *dockertest.Resource - valResources map[string][]*dockertest.Resource + + tmpDirs []string + chainA *chain + chainB *chain + dkrPool *dockertest.Pool + dkrNet *dockertest.Network + hermesResource0 *dockertest.Resource + hermesResource1 *dockertest.Resource + + valResources map[string][]*dockertest.Resource } type AddressResponse struct { @@ -155,7 +166,8 @@ func (s *IntegrationTestSuite) SetupSuite() { s.runValidators(s.chainB, 10) time.Sleep(10 * time.Second) - s.runIBCRelayer() + s.runIBCRelayer0() + s.runIBCRelayer1() } func (s *IntegrationTestSuite) TearDownSuite() { @@ -170,8 +182,12 @@ func (s *IntegrationTestSuite) TearDownSuite() { s.T().Log("tearing down e2e integration test suite...") - if runIBCTest { - s.Require().NoError(s.dkrPool.Purge(s.hermesResource)) + s.Require().NoError(s.dkrPool.Purge(s.hermesResource1)) + // if runIBCTest, s.hermesResource0 already purged in TestIBC() + // in GovSoftwareUpgrade test, s.TearDownSuite() then s.SetupSuite() + // if IBCTest runs before GovSoftwareUpgrade, s.hermesResource0 is already purged. + if !HermesResource0Purged { + s.Require().NoError(s.dkrPool.Purge(s.hermesResource0)) } for _, vr := range s.valResources { @@ -193,12 +209,13 @@ func (s *IntegrationTestSuite) TearDownSuite() { func (s *IntegrationTestSuite) initNodes(c *chain) { s.Require().NoError(c.createAndInitValidators(2)) /* Adding 4 accounts to val0 local directory - c.genesisAccounts[0]: Relayer Wallet + c.genesisAccounts[0]: Relayer0 Wallet c.genesisAccounts[1]: ICA Owner c.genesisAccounts[2]: Test Account 1 c.genesisAccounts[3]: Test Account 2 + c.genesisAccounts[4]: Relayer1 Wallet */ - s.Require().NoError(c.addAccountFromMnemonic(4)) + s.Require().NoError(c.addAccountFromMnemonic(5)) // Initialize a genesis file for the first validator val0ConfigDir := c.validators[0].configDir() var addrAll []sdk.AccAddress @@ -599,99 +616,263 @@ func noRestart(config *docker.HostConfig) { } } -// func (s *IntegrationTestSuite) writeGovParamChangeProposalGlobalFees(c *chain, coins sdk.DecCoins) { -// type ParamInfo struct { -// Subspace string `json:"subspace"` -// Key string `json:"key"` -// Value sdk.DecCoins `json:"value"` -// } - -// type ParamChangeMessage struct { -// Title string `json:"title"` -// Description string `json:"description"` -// Changes []ParamInfo `json:"changes"` -// Deposit string `json:"deposit"` -// } - -// paramChangeProposalBody, err := json.MarshalIndent(ParamChangeMessage{ -// Title: "global fee test", -// Description: "global fee change", -// Changes: []ParamInfo{ -// { -// Subspace: "globalfee", -// Key: "MinimumGasPricesParam", -// Value: coins, -// }, -// }, -// Deposit: "1000uatom", -// }, "", " ") -// s.Require().NoError(err) - -// err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalGlobalFeeFilename), paramChangeProposalBody) -// s.Require().NoError(err) -// } - -// func (s *IntegrationTestSuite) writeGovParamChangeProposalBypassMsgs(c *chain, msgs []string) { -// type ParamInfo struct { -// Subspace string `json:"subspace"` -// Key string `json:"key"` -// Value []string `json:"value"` -// } - -// type ParamChangeMessage struct { -// Title string `json:"title"` -// Description string `json:"description"` -// Changes []ParamInfo `json:"changes"` -// Deposit string `json:"deposit"` -// } -// paramChangeProposalBody, err := json.MarshalIndent(ParamChangeMessage{ -// Title: "ChangeProposalBypassMsgs", -// Description: "global fee change", -// Changes: []ParamInfo{ -// { -// Subspace: "globalfee", -// Key: "BypassMinFeeMsgTypes", -// Value: msgs, -// }, -// }, -// Deposit: "1000uatom", -// }, "", " ") -// s.Require().NoError(err) - -// err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalBypassMsgFilename), paramChangeProposalBody) -// s.Require().NoError(err) -// } - -// func (s *IntegrationTestSuite) writeGovParamChangeProposalMaxTotalBypass(c *chain, gas uint64) { -// type ParamInfo struct { -// Subspace string `json:"subspace"` -// Key string `json:"key"` -// Value string `json:"value"` -// } - -// type ParamChangeMessage struct { -// Title string `json:"title"` -// Description string `json:"description"` -// Changes []ParamInfo `json:"changes"` -// Deposit string `json:"deposit"` -// } -// paramChangeProposalBody, err := json.MarshalIndent(ParamChangeMessage{ -// Title: "ChangeProposalMaxTotalBypass", -// Description: "global fee change", -// Changes: []ParamInfo{ -// { -// Subspace: "globalfee", -// Key: "MaxTotalBypassMinFeeMsgGasUsage", -// Value: strconv.FormatInt(int64(gas), 10), -// }, -// }, -// Deposit: "1000uatom", -// }, "", " ") -// s.Require().NoError(err) - -// err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalMaxTotalBypassFilename), paramChangeProposalBody) -// s.Require().NoError(err) -// } +// hermes0 is for ibc and packet-forward-middleware(PFM) test, hermes0 is keep running during the ibc and PFM test. +func (s *IntegrationTestSuite) runIBCRelayer0() { + s.T().Log("starting Hermes relayer container 0...") + + tmpDir, err := os.MkdirTemp("", "gaia-e2e-testnet-hermes-") + s.Require().NoError(err) + s.tmpDirs = append(s.tmpDirs, tmpDir) + + gaiaAVal := s.chainA.validators[0] + gaiaBVal := s.chainB.validators[0] + + gaiaARly := s.chainA.genesisAccounts[relayerAccountIndexHermes0] + gaiaBRly := s.chainB.genesisAccounts[relayerAccountIndexHermes0] + + hermesCfgPath := path.Join(tmpDir, "hermes") + + s.Require().NoError(os.MkdirAll(hermesCfgPath, 0o755)) + _, err = copyFile( + filepath.Join("./scripts/", "hermes_bootstrap.sh"), + filepath.Join(hermesCfgPath, "hermes_bootstrap.sh"), + ) + s.Require().NoError(err) + + s.hermesResource0, err = s.dkrPool.RunWithOptions( + &dockertest.RunOptions{ + Name: fmt.Sprintf("%s-%s-relayer-0", s.chainA.id, s.chainB.id), + Repository: "ghcr.io/cosmos/hermes-e2e", + Tag: "1.4.1", + NetworkID: s.dkrNet.Network.ID, + Mounts: []string{ + fmt.Sprintf("%s/:/root/hermes", hermesCfgPath), + }, + PortBindings: map[docker.Port][]docker.PortBinding{ + "3031/tcp": {{HostIP: "", HostPort: "3031"}}, + }, + Env: []string{ + fmt.Sprintf("GAIA_A_E2E_CHAIN_ID=%s", s.chainA.id), + fmt.Sprintf("GAIA_B_E2E_CHAIN_ID=%s", s.chainB.id), + fmt.Sprintf("GAIA_A_E2E_VAL_MNEMONIC=%s", gaiaAVal.mnemonic), + fmt.Sprintf("GAIA_B_E2E_VAL_MNEMONIC=%s", gaiaBVal.mnemonic), + fmt.Sprintf("GAIA_A_E2E_RLY_MNEMONIC=%s", gaiaARly.mnemonic), + fmt.Sprintf("GAIA_B_E2E_RLY_MNEMONIC=%s", gaiaBRly.mnemonic), + fmt.Sprintf("GAIA_A_E2E_VAL_HOST=%s", s.valResources[s.chainA.id][0].Container.Name[1:]), + fmt.Sprintf("GAIA_B_E2E_VAL_HOST=%s", s.valResources[s.chainB.id][0].Container.Name[1:]), + }, + User: "root", + Entrypoint: []string{ + "sh", + "-c", + "chmod +x /root/hermes/hermes_bootstrap.sh && /root/hermes/hermes_bootstrap.sh", + }, + }, + noRestart, + ) + s.Require().NoError(err) + // TODO: fix Hermes container REST endpoint + // endpoint := fmt.Sprintf("http://%s/state", s.hermesResource0.GetHostPort("3031/tcp")) + // s.Require().Eventually( + // func() bool { + // resp, err := http.Get(endpoint) //nolint:gosec // this is a test + // if err != nil { + // return false + // } + + // defer resp.Body.Close() + + // bz, err := io.ReadAll(resp.Body) + // if err != nil { + // return false + // } + + // var respBody map[string]interface{} + // if err := json.Unmarshal(bz, &respBody); err != nil { + // return false + // } + + // status := respBody["status"].(string) + // result := respBody["result"].(map[string]interface{}) + + // return status == "success" && len(result["chains"].([]interface{})) == 2 + // }, + // 5*time.Minute, + // time.Second, + // "hermes relayer not healthy", + // ) + + s.T().Logf("started Hermes relayer 0 container: %s", s.hermesResource0.Container.ID) + + // XXX: Give time to both networks to start, otherwise we might see gRPC + // transport errors. + time.Sleep(10 * time.Second) + + // create the client, connection and channel between the two Gaia chains + s.createConnection() + time.Sleep(10 * time.Second) + s.createChannel() +} + +// hermes1 is for bypass-msg test. Hermes1 is to process asynchronous transactions, +// Hermes1 has access to two Hermes configurations: one configuration allows paying fees, while the other does not. +// With Hermes1, better control can be achieved regarding whether fees are paid when clearing transactions. +func (s *IntegrationTestSuite) runIBCRelayer1() { + s.T().Log("starting Hermes relayer container 1...") + + tmpDir, err := os.MkdirTemp("", "gaia-e2e-testnet-hermes-") + s.Require().NoError(err) + s.tmpDirs = append(s.tmpDirs, tmpDir) + + gaiaAVal := s.chainA.validators[0] + gaiaBVal := s.chainB.validators[0] + + gaiaARly := s.chainA.genesisAccounts[relayerAccountIndexHermes1] + gaiaBRly := s.chainB.genesisAccounts[relayerAccountIndexHermes1] + + hermesCfgPath := path.Join(tmpDir, "hermes") + + s.Require().NoError(os.MkdirAll(hermesCfgPath, 0o755)) + _, err = copyFile( + filepath.Join("./scripts/", "hermes1_bootstrap.sh"), + filepath.Join(hermesCfgPath, "hermes1_bootstrap.sh"), + ) + s.Require().NoError(err) + + s.hermesResource1, err = s.dkrPool.RunWithOptions( + &dockertest.RunOptions{ + Name: fmt.Sprintf("%s-%s-relayer-1", s.chainA.id, s.chainB.id), + Repository: "ghcr.io/cosmos/hermes-e2e", + Tag: "1.4.1", + NetworkID: s.dkrNet.Network.ID, + Mounts: []string{ + fmt.Sprintf("%s/:/root/hermes", hermesCfgPath), + }, + PortBindings: map[docker.Port][]docker.PortBinding{ + "3032/tcp": {{HostIP: "", HostPort: "3032"}}, + }, + Env: []string{ + fmt.Sprintf("GAIA_A_E2E_CHAIN_ID=%s", s.chainA.id), + fmt.Sprintf("GAIA_B_E2E_CHAIN_ID=%s", s.chainB.id), + fmt.Sprintf("GAIA_A_E2E_VAL_MNEMONIC=%s", gaiaAVal.mnemonic), + fmt.Sprintf("GAIA_B_E2E_VAL_MNEMONIC=%s", gaiaBVal.mnemonic), + fmt.Sprintf("GAIA_A_E2E_RLY_MNEMONIC=%s", gaiaARly.mnemonic), + fmt.Sprintf("GAIA_B_E2E_RLY_MNEMONIC=%s", gaiaBRly.mnemonic), + fmt.Sprintf("GAIA_A_E2E_VAL_HOST=%s", s.valResources[s.chainA.id][0].Container.Name[1:]), + fmt.Sprintf("GAIA_B_E2E_VAL_HOST=%s", s.valResources[s.chainB.id][0].Container.Name[1:]), + }, + User: "root", + Entrypoint: []string{ + "sh", + "-c", + "chmod +x /root/hermes/hermes1_bootstrap.sh && /root/hermes/hermes1_bootstrap.sh && tail -f /dev/null", + }, + }, + noRestart, + ) + s.Require().NoError(err) + + s.T().Logf("started Hermes relayer 1 container: %s", s.hermesResource1.Container.ID) + + // XXX: Give time to both networks to start, otherwise we might see gRPC + // transport errors. + time.Sleep(10 * time.Second) +} + +func (s *IntegrationTestSuite) writeGovParamChangeProposalGlobalFees(c *chain, coins sdk.DecCoins) { + type ParamInfo struct { + Subspace string `json:"subspace"` + Key string `json:"key"` + Value sdk.DecCoins `json:"value"` + } + + type ParamChangeMessage struct { + Title string `json:"title"` + Description string `json:"description"` + Changes []ParamInfo `json:"changes"` + Deposit string `json:"deposit"` + } + + paramChangeProposalBody, err := json.MarshalIndent(ParamChangeMessage{ + Title: "global fee test", + Description: "global fee change", + Changes: []ParamInfo{ + { + Subspace: "globalfee", + Key: "MinimumGasPricesParam", + Value: coins, + }, + }, + Deposit: "1000uatom", + }, "", " ") + s.Require().NoError(err) + + err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalGlobalFeeFilename), paramChangeProposalBody) + s.Require().NoError(err) +} + +func (s *IntegrationTestSuite) writeGovParamChangeProposalBypassMsgs(c *chain, msgs []string) { + type ParamInfo struct { + Subspace string `json:"subspace"` + Key string `json:"key"` + Value []string `json:"value"` + } + + type ParamChangeMessage struct { + Title string `json:"title"` + Description string `json:"description"` + Changes []ParamInfo `json:"changes"` + Deposit string `json:"deposit"` + } + paramChangeProposalBody, err := json.MarshalIndent(ParamChangeMessage{ + Title: "ChangeProposalBypassMsgs", + Description: "global fee change", + Changes: []ParamInfo{ + { + Subspace: "globalfee", + Key: "BypassMinFeeMsgTypes", + Value: msgs, + }, + }, + Deposit: "1000uatom", + }, "", " ") + s.Require().NoError(err) + + err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalBypassMsgFilename), paramChangeProposalBody) + s.Require().NoError(err) +} + +func (s *IntegrationTestSuite) writeGovParamChangeProposalMaxTotalBypass(c *chain, gas uint64) { + type ParamInfo struct { + Subspace string `json:"subspace"` + Key string `json:"key"` + Value string `json:"value"` + } + + type ParamChangeMessage struct { + Title string `json:"title"` + Description string `json:"description"` + Changes []ParamInfo `json:"changes"` + Deposit string `json:"deposit"` + } + paramChangeProposalBody, err := json.MarshalIndent(ParamChangeMessage{ + Title: "ChangeProposalMaxTotalBypass", + Description: "global fee change", + Changes: []ParamInfo{ + { + Subspace: "globalfee", + Key: "MaxTotalBypassMinFeeMsgGasUsage", + Value: strconv.FormatInt(int64(gas), 10), + }, + }, + Deposit: "1000uatom", + }, "", " ") + s.Require().NoError(err) + + err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalMaxTotalBypassFilename), paramChangeProposalBody) + s.Require().NoError(err) +} + func (s *IntegrationTestSuite) writeGovCommunitySpendProposal(c *chain, amount sdk.Coin, recipient string) { msg := &distrtypes.MsgCommunityPoolSpend{ Authority: govModuleAddress, @@ -729,21 +910,6 @@ func (s *IntegrationTestSuite) writeGovLegProposal(c *chain, height int64, name s.Require().NoError(err) } -// func (s *IntegrationTestSuite) writeGovCommunitySpendProposal(c *chain, amount string, recipient string) { -// proposalCommSpend := &distrtypes.CommunityPoolSpendProposalWithDeposit{ -// Title: "Community Pool Spend", -// Description: "Fund Team!", -// Recipient: recipient, -// Amount: amount, -// Deposit: "1000uatom", -// } -// commSpendBody, err := json.MarshalIndent(proposalCommSpend, "", " ") -// s.Require().NoError(err) - -// err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalCommunitySpendFilename), commSpendBody) -// s.Require().NoError(err) -// } - // type ConsumerAdditionProposalWithDeposit struct { // ccvprovider.ConsumerAdditionProposal // Deposit string `json:"deposit"` diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go index c6727543ef..daf20a21a8 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/e2e/e2e_test.go @@ -3,12 +3,12 @@ package e2e import "fmt" var ( - runBankTest = true - // runBypassMinFeeTest = true - runEncodeTest = true - runEvidenceTest = true - runFeeGrantTest = true - // runGlobalFeesTest = true + runBankTest = true + runBypassMinFeeTest = true + runEncodeTest = true + runEvidenceTest = true + runFeeGrantTest = true + runGlobalFeesTest = true runGovTest = true runIBCTest = true runSlashingTest = true @@ -31,13 +31,13 @@ func (s *IntegrationTestSuite) TestBank() { s.testBankTokenTransfer() } -// func (s *IntegrationTestSuite) TestByPassMinFee() { -// if !runBypassMinFeeTest { -// s.T().Skip() -// } -// chainAPI := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) -// s.testBypassMinFeeWithdrawReward(chainAPI) -// } +func (s *IntegrationTestSuite) TestByPassMinFee() { + if !runBypassMinFeeTest { + s.T().Skip() + } + chainAPI := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) + s.testBypassMinFeeWithdrawReward(chainAPI) +} func (s *IntegrationTestSuite) TestEncode() { if !runEncodeTest { @@ -61,14 +61,13 @@ func (s *IntegrationTestSuite) TestFeeGrant() { s.testFeeGrant() } -// func (s *IntegrationTestSuite) TestGlobalFees() { -// if !runGlobalFeesTest { -// s.T().Skip() -// } -// s.testGlobalFees() -// s.testQueryGlobalFeesInGenesis() -// } -// +func (s *IntegrationTestSuite) TestGlobalFees() { + if !runGlobalFeesTest { + s.T().Skip() + } + s.testGlobalFees() + s.testQueryGlobalFeesInGenesis() +} func (s *IntegrationTestSuite) TestGov() { if !runGovTest { @@ -87,6 +86,11 @@ func (s *IntegrationTestSuite) TestIBC() { s.testIBCTokenTransfer() s.testMultihopIBCTokenTransfer() s.testFailedMultihopIBCTokenTransfer() + + // stop hermes0 to prevent hermes0 relaying transactions + s.Require().NoError(s.dkrPool.Purge(s.hermesResource0)) + HermesResource0Purged = true + s.testIBCBypassMsg() } func (s *IntegrationTestSuite) TestSlashing() { diff --git a/tests/e2e/query.go b/tests/e2e/query.go index 433385b1ff..15d4e10aa4 100644 --- a/tests/e2e/query.go +++ b/tests/e2e/query.go @@ -14,6 +14,8 @@ import ( disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types" govtypesv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "github.com/cosmos/gaia/v11/x/globalfee/types" + evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -24,7 +26,6 @@ func queryGaiaTx(endpoint, txHash string) error { if err != nil { return fmt.Errorf("failed to execute HTTP request: %w", err) } - defer resp.Body.Close() if resp.StatusCode != 200 { @@ -37,6 +38,7 @@ func queryGaiaTx(endpoint, txHash string) error { } txResp := result["tx_response"].(map[string]interface{}) + if v := txResp["code"]; v.(float64) != 0 { return fmt.Errorf("tx %s failed with status code %v", txHash, v) } @@ -73,37 +75,37 @@ func queryGaiaAllBalances(endpoint, addr string) (sdk.Coins, error) { return balancesResp.Balances, nil } -// func queryGlobalFeeParams(endpoint string) (types.QueryParamsResponse, error) { -// body, err := httpGet(fmt.Sprintf("%s/gaia/globalfee/v1beta1/params", endpoint)) -// if err != nil { -// return types.QueryParamsResponse{}, fmt.Errorf("failed to execute HTTP request: %w", err) -// } +func queryGlobalFeeParams(endpoint string) (types.QueryParamsResponse, error) { + body, err := httpGet(fmt.Sprintf("%s/gaia/globalfee/v1beta1/params", endpoint)) + if err != nil { + return types.QueryParamsResponse{}, fmt.Errorf("failed to execute HTTP request: %w", err) + } -// var params types.QueryParamsResponse -// if err := cdc.UnmarshalJSON(body, ¶ms); err != nil { -// return types.QueryParamsResponse{}, err -// } + var params types.QueryParamsResponse + if err := cdc.UnmarshalJSON(body, ¶ms); err != nil { + return types.QueryParamsResponse{}, err + } -// return params, nil -// } + return params, nil +} -// func queryGlobalFees(endpoint string) (sdk.DecCoins, error) { -// p, err := queryGlobalFeeParams(endpoint) +func queryGlobalFees(endpoint string) (sdk.DecCoins, error) { + p, err := queryGlobalFeeParams(endpoint) -// return p.Params.MinimumGasPrices, err -// } + return p.Params.MinimumGasPrices, err +} -// func queryBypassMsgs(endpoint string) ([]string, error) { -// p, err := queryGlobalFeeParams(endpoint) +func queryBypassMsgs(endpoint string) ([]string, error) { + p, err := queryGlobalFeeParams(endpoint) -// return p.Params.BypassMinFeeMsgTypes, err -// } + return p.Params.BypassMinFeeMsgTypes, err +} -// func queryMaxTotalBypassMinFeeMsgGasUsage(endpoint string) (uint64, error) { -// p, err := queryGlobalFeeParams(endpoint) +func queryMaxTotalBypassMinFeeMsgGasUsage(endpoint string) (uint64, error) { + p, err := queryGlobalFeeParams(endpoint) -// return p.Params.MaxTotalBypassMinFeeMsgGasUsage, err -// } + return p.Params.MaxTotalBypassMinFeeMsgGasUsage, err +} func queryDelegation(endpoint string, validatorAddr string, delegatorAddr string) (stakingtypes.QueryDelegationResponse, error) { var res stakingtypes.QueryDelegationResponse @@ -133,7 +135,7 @@ func queryDelegatorWithdrawalAddress(endpoint string, delegatorAddr string) (dis return res, nil } -func queryDelegatorTotalRewards(endpoint, delegatorAddr string) (disttypes.QueryDelegationTotalRewardsResponse, error) { //nolint:unused +func queryDelegatorTotalRewards(endpoint, delegatorAddr string) (disttypes.QueryDelegationTotalRewardsResponse, error) { var res disttypes.QueryDelegationTotalRewardsResponse body, err := httpGet(fmt.Sprintf("%s/cosmos/distribution/v1beta1/delegators/%s/rewards", endpoint, delegatorAddr)) diff --git a/x/globalfee/alias.go b/x/globalfee/alias.go index 11458c0b8d..594fce105e 100644 --- a/x/globalfee/alias.go +++ b/x/globalfee/alias.go @@ -1,9 +1,9 @@ package globalfee -// import ( -// "github.com/cosmos/gaia/v11/x/globalfee/types" -// ) +import ( + "github.com/cosmos/gaia/v11/x/globalfee/types" +) -// const ( -// ModuleName = types.ModuleName -// ) +const ( + ModuleName = types.ModuleName +) diff --git a/x/globalfee/ante/antetest/fee_test.go b/x/globalfee/ante/antetest/fee_test.go index 662bc61be5..a94c4fc0f4 100644 --- a/x/globalfee/ante/antetest/fee_test.go +++ b/x/globalfee/ante/antetest/fee_test.go @@ -1,815 +1,796 @@ package antetest -// import ( -// "testing" - -// 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" -// "github.com/stretchr/testify/suite" - -// gaiafeeante "github.com/cosmos/gaia/v11/x/globalfee/ante" -// globfeetypes "github.com/cosmos/gaia/v11/x/globalfee/types" -// ) - -// var testGasLimit uint64 = 200_000 - -// func TestIntegrationTestSuite(t *testing.T) { -// suite.Run(t, new(IntegrationTestSuite)) -// } - -// func (s *IntegrationTestSuite) TestGetDefaultGlobalFees() { -// // set globalfees and min gas price -// feeDecorator, _ := s.SetupTestGlobalFeeStoreAndMinGasPrice([]sdk.DecCoin{}, &globfeetypes.Params{}) -// defaultGlobalFees, err := feeDecorator.DefaultZeroGlobalFee(s.ctx) -// s.Require().NoError(err) -// s.Require().Greater(len(defaultGlobalFees), 0) - -// if defaultGlobalFees[0].Denom != testBondDenom { -// s.T().Fatalf("bond denom: %s, default global fee denom: %s", testBondDenom, defaultGlobalFees[0].Denom) -// } -// } - -// // Test global fees and min_gas_price with bypass msg types. -// // Please note even globalfee=0, min_gas_price=0, we do not let fee=0random_denom pass. -// // Paid fees are already sanitized by removing zero coins(through feeFlag parsing), so use sdk.NewCoins() to create it. -// func (s *IntegrationTestSuite) TestGlobalFeeMinimumGasFeeAnteHandler() { -// s.txBuilder = s.clientCtx.TxConfig.NewTxBuilder() -// priv1, _, addr1 := testdata.KeyTestPubAddr() -// privs, accNums, accSeqs := []cryptotypes.PrivKey{priv1}, []uint64{0}, []uint64{0} - -// denominator := int64(100000) -// high := sdk.NewDec(400).Quo(sdk.NewDec(denominator)) // 0.004 -// med := sdk.NewDec(200).Quo(sdk.NewDec(denominator)) // 0.002 -// low := sdk.NewDec(100).Quo(sdk.NewDec(denominator)) // 0.001 - -// highFeeAmt := sdk.NewInt(high.MulInt64(int64(2) * denominator).RoundInt64()) -// medFeeAmt := sdk.NewInt(med.MulInt64(int64(2) * denominator).RoundInt64()) -// lowFeeAmt := sdk.NewInt(low.MulInt64(int64(2) * denominator).RoundInt64()) - -// globalfeeParamsEmpty := []sdk.DecCoin{} -// minGasPriceEmpty := []sdk.DecCoin{} -// globalfeeParams0 := []sdk.DecCoin{ -// sdk.NewDecCoinFromDec("photon", sdk.NewDec(0)), -// sdk.NewDecCoinFromDec("uatom", sdk.NewDec(0)), -// } -// globalfeeParamsContain0 := []sdk.DecCoin{ -// sdk.NewDecCoinFromDec("photon", med), -// sdk.NewDecCoinFromDec("uatom", sdk.NewDec(0)), -// } -// minGasPrice0 := []sdk.DecCoin{ -// sdk.NewDecCoinFromDec("stake", sdk.NewDec(0)), -// sdk.NewDecCoinFromDec("uatom", sdk.NewDec(0)), -// } -// globalfeeParamsHigh := []sdk.DecCoin{ -// sdk.NewDecCoinFromDec("uatom", high), -// } -// minGasPrice := []sdk.DecCoin{ -// sdk.NewDecCoinFromDec("uatom", med), -// sdk.NewDecCoinFromDec("stake", med), -// } -// globalfeeParamsLow := []sdk.DecCoin{ -// sdk.NewDecCoinFromDec("uatom", low), -// } -// // global fee must be sorted in denom -// globalfeeParamsNewDenom := []sdk.DecCoin{ -// sdk.NewDecCoinFromDec("photon", high), -// sdk.NewDecCoinFromDec("quark", high), -// } - -// testCases := map[string]struct { -// minGasPrice []sdk.DecCoin -// globalFee []sdk.DecCoin -// gasPrice sdk.Coins -// gasLimit sdk.Gas -// txMsg sdk.Msg -// txCheck bool -// expErr bool -// }{ -// // test fees -// // empty min_gas_price or empty global fee -// "empty min_gas_price, nonempty global fee, fee higher/equal than global_fee": { -// minGasPrice: minGasPriceEmpty, -// globalFee: globalfeeParamsHigh, -// // sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()) -// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", highFeeAmt)), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: false, -// }, -// "empty min_gas_price, nonempty global fee, fee lower than global_fee": { -// minGasPrice: minGasPriceEmpty, -// globalFee: globalfeeParamsHigh, -// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: true, -// }, -// "nonempty min_gas_price with defaultGlobalFee denom, empty global fee, fee higher/equal than min_gas_price": { -// minGasPrice: minGasPrice, -// globalFee: globalfeeParamsEmpty, // default 0uatom -// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", medFeeAmt)), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: false, -// }, -// "nonempty min_gas_price with defaultGlobalFee denom, empty global fee, fee lower than min_gas_price": { -// minGasPrice: minGasPrice, -// globalFee: globalfeeParamsEmpty, -// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: true, -// }, -// "empty min_gas_price, empty global fee, empty fee": { -// minGasPrice: minGasPriceEmpty, -// globalFee: globalfeeParamsEmpty, -// gasPrice: sdk.Coins{}, -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: false, -// }, -// // zero min_gas_price or zero global fee -// "zero min_gas_price, zero global fee, zero fee in global fee denom": { -// minGasPrice: minGasPrice0, -// globalFee: globalfeeParams0, -// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt()), sdk.NewCoin("photon", sdk.ZeroInt())), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: false, -// }, -// "zero min_gas_price, zero global fee, empty fee": { -// minGasPrice: minGasPrice0, -// globalFee: globalfeeParams0, -// gasPrice: sdk.Coins{}, -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: false, -// }, -// // zero global fee -// "zero min_gas_price, zero global fee, zero fee not in globalfee denom": { -// minGasPrice: minGasPrice0, -// globalFee: globalfeeParams0, -// gasPrice: sdk.NewCoins(sdk.NewCoin("stake", sdk.ZeroInt())), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: false, -// }, -// "zero min_gas_price, zero global fee, zero fees one in, one not in globalfee denom": { -// minGasPrice: minGasPrice0, -// globalFee: globalfeeParams0, -// gasPrice: sdk.NewCoins( -// sdk.NewCoin("stake", sdk.ZeroInt()), -// sdk.NewCoin("uatom", sdk.ZeroInt())), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: false, -// }, -// // zero min_gas_price and empty global fee -// "zero min_gas_price, empty global fee, zero fee in min_gas_price_denom": { -// minGasPrice: minGasPrice0, -// globalFee: globalfeeParamsEmpty, -// gasPrice: sdk.NewCoins(sdk.NewCoin("stake", sdk.ZeroInt())), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: false, -// }, -// "zero min_gas_price, empty global fee, zero fee not in min_gas_price denom, not in defaultZeroGlobalFee denom": { -// minGasPrice: minGasPrice0, -// globalFee: globalfeeParamsEmpty, -// gasPrice: sdk.NewCoins(sdk.NewCoin("quark", sdk.ZeroInt())), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: false, -// }, -// "zero min_gas_price, empty global fee, zero fee in defaultZeroGlobalFee denom": { -// minGasPrice: minGasPrice0, -// globalFee: globalfeeParamsEmpty, -// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: false, -// }, -// "zero min_gas_price, empty global fee, nonzero fee in defaultZeroGlobalFee denom": { -// minGasPrice: minGasPrice0, -// globalFee: globalfeeParamsEmpty, -// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: false, -// }, -// "zero min_gas_price, empty global fee, nonzero fee not in defaultZeroGlobalFee denom": { -// minGasPrice: minGasPrice0, -// globalFee: globalfeeParamsEmpty, -// gasPrice: sdk.NewCoins(sdk.NewCoin("quark", highFeeAmt)), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: true, -// }, -// // empty min_gas_price, zero global fee -// "empty min_gas_price, zero global fee, zero fee in global fee denom": { -// minGasPrice: minGasPriceEmpty, -// globalFee: globalfeeParams0, -// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: false, -// }, -// "empty min_gas_price, zero global fee, zero fee not in global fee denom": { -// minGasPrice: minGasPriceEmpty, -// globalFee: globalfeeParams0, -// gasPrice: sdk.NewCoins(sdk.NewCoin("stake", sdk.ZeroInt())), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: false, -// }, -// "empty min_gas_price, zero global fee, nonzero fee in global fee denom": { -// minGasPrice: minGasPriceEmpty, -// globalFee: globalfeeParams0, -// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: false, -// }, -// "empty min_gas_price, zero global fee, nonzero fee not in global fee denom": { -// minGasPrice: minGasPriceEmpty, -// globalFee: globalfeeParams0, -// gasPrice: sdk.NewCoins(sdk.NewCoin("stake", highFeeAmt)), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: true, -// }, -// // zero min_gas_price, nonzero global fee -// "zero min_gas_price, nonzero global fee, fee is higher than global fee": { -// minGasPrice: minGasPrice0, -// globalFee: globalfeeParamsLow, -// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: false, -// }, -// // nonzero min_gas_price, nonzero global fee -// "fee higher/equal than globalfee and min_gas_price": { -// minGasPrice: minGasPrice, -// globalFee: globalfeeParamsHigh, -// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", highFeeAmt)), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: false, -// }, -// "fee lower than globalfee and min_gas_price": { -// minGasPrice: minGasPrice, -// globalFee: globalfeeParamsHigh, -// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: true, -// }, -// "fee with one denom higher/equal, one denom lower than globalfee and min_gas_price": { -// minGasPrice: minGasPrice, -// globalFee: globalfeeParamsNewDenom, -// gasPrice: sdk.NewCoins( -// sdk.NewCoin("photon", lowFeeAmt), -// sdk.NewCoin("quark", highFeeAmt)), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: false, -// }, -// "globalfee > min_gas_price, fee higher/equal than min_gas_price, lower than globalfee": { -// minGasPrice: minGasPrice, -// globalFee: globalfeeParamsHigh, -// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", medFeeAmt)), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: true, -// }, -// "globalfee < min_gas_price, fee higher/equal than globalfee and lower than min_gas_price": { -// minGasPrice: minGasPrice, -// globalFee: globalfeeParamsLow, -// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: true, -// }, -// // nonzero min_gas_price, zero global fee -// "nonzero min_gas_price, zero global fee, fee is in global fee denom and lower than min_gas_price": { -// minGasPrice: minGasPrice, -// globalFee: globalfeeParams0, -// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: true, -// }, -// "nonzero min_gas_price, zero global fee, fee is in global fee denom and higher/equal than min_gas_price": { -// minGasPrice: minGasPrice, -// globalFee: globalfeeParams0, -// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", medFeeAmt)), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: false, -// }, -// "nonzero min_gas_price, zero global fee, fee is in min_gas_price denom which is not in global fee default, but higher/equal than min_gas_price": { -// minGasPrice: minGasPrice, -// globalFee: globalfeeParams0, -// gasPrice: sdk.NewCoins(sdk.NewCoin("stake", highFeeAmt)), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: true, -// }, -// // fee denom tests -// "min_gas_price denom is not subset of global fee denom , fee paying in global fee denom": { -// minGasPrice: minGasPrice, -// globalFee: globalfeeParamsNewDenom, -// gasPrice: sdk.NewCoins(sdk.NewCoin("photon", highFeeAmt)), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: false, -// }, -// "min_gas_price denom is not subset of global fee denom, fee paying in min_gas_price denom": { -// minGasPrice: minGasPrice, -// globalFee: globalfeeParamsNewDenom, -// gasPrice: sdk.NewCoins(sdk.NewCoin("stake", highFeeAmt)), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: true, -// }, -// "fees contain denom not in globalfee": { -// minGasPrice: minGasPrice, -// globalFee: globalfeeParamsLow, -// gasPrice: sdk.NewCoins( -// sdk.NewCoin("uatom", highFeeAmt), -// sdk.NewCoin("quark", highFeeAmt)), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: true, -// }, -// "fees contain denom not in globalfee with zero amount": { -// minGasPrice: minGasPrice, -// globalFee: globalfeeParamsLow, -// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", highFeeAmt), -// sdk.NewCoin("quark", sdk.ZeroInt())), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: false, -// }, -// // cases from https://github.com/cosmos/gaia/pull/1570#issuecomment-1190524402 -// // note: this is kind of a silly scenario but technically correct -// // if there is a zero coin in the globalfee, the user could pay 0fees -// // if the user includes any fee at all in the non-zero denom, it must be higher than that non-zero fee -// // unlikely we will ever see zero and non-zero together but technically possible -// "globalfee contains zero coin and non-zero coin, fee is lower than the nonzero coin": { -// minGasPrice: minGasPrice0, -// globalFee: globalfeeParamsContain0, -// gasPrice: sdk.NewCoins(sdk.NewCoin("photon", lowFeeAmt)), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: true, -// }, -// "globalfee contains zero coin, fee contains zero coins of the same denom and a lower fee of the other denom in global fee": { -// minGasPrice: minGasPrice0, -// globalFee: globalfeeParamsContain0, -// gasPrice: sdk.NewCoins( -// sdk.NewCoin("photon", lowFeeAmt), -// sdk.NewCoin("uatom", sdk.ZeroInt())), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: true, -// }, -// "globalfee contains zero coin, fee is empty": { -// minGasPrice: minGasPrice0, -// globalFee: globalfeeParamsContain0, -// gasPrice: sdk.Coins{}, -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: false, -// }, -// "globalfee contains zero coin, fee contains lower fee of zero coins's denom, globalfee also contains nonzero coin,fee contains higher fee of nonzero coins's denom, ": { -// minGasPrice: minGasPrice0, -// globalFee: globalfeeParamsContain0, -// gasPrice: sdk.NewCoins( -// sdk.NewCoin("photon", lowFeeAmt), -// sdk.NewCoin("uatom", highFeeAmt)), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: false, -// }, -// "globalfee contains zero coin, fee is all zero coins but in global fee's denom": { -// minGasPrice: minGasPrice0, -// globalFee: globalfeeParamsContain0, -// gasPrice: sdk.NewCoins( -// sdk.NewCoin("photon", sdk.ZeroInt()), -// sdk.NewCoin("uatom", sdk.ZeroInt()), -// ), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: false, -// }, -// "globalfee contains zero coin, fee is higher than the nonzero coin": { -// minGasPrice: minGasPrice0, -// globalFee: globalfeeParamsContain0, -// gasPrice: sdk.NewCoins(sdk.NewCoin("photon", highFeeAmt)), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: false, -// }, -// "bypass msg type: ibc.core.channel.v1.MsgRecvPacket": { -// minGasPrice: minGasPrice, -// globalFee: globalfeeParamsLow, -// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), -// gasLimit: testGasLimit, -// txMsg: ibcchanneltypes.NewMsgRecvPacket( -// ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), -// txCheck: true, -// expErr: false, -// }, -// "bypass msg type: ibc.core.channel.v1.MsgTimeout": { -// minGasPrice: minGasPrice, -// globalFee: globalfeeParamsLow, -// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), -// gasLimit: testGasLimit, -// txMsg: ibcchanneltypes.NewMsgTimeout( -// // todo check here -// ibcchanneltypes.Packet{}, 1, nil, ibcclienttypes.Height{}, ""), -// txCheck: true, -// expErr: false, -// }, -// "bypass msg type: ibc.core.channel.v1.MsgTimeoutOnClose": { -// minGasPrice: minGasPrice, -// globalFee: globalfeeParamsLow, -// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), -// gasLimit: testGasLimit, -// txMsg: ibcchanneltypes.NewMsgTimeout( -// ibcchanneltypes.Packet{}, 2, nil, ibcclienttypes.Height{}, ""), -// txCheck: true, -// expErr: false, -// }, -// "bypass msg gas usage exceeds maxTotalBypassMinFeeMsgGasUsage": { -// minGasPrice: minGasPrice, -// globalFee: globalfeeParamsLow, -// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), -// gasLimit: 2 * globfeetypes.DefaultmaxTotalBypassMinFeeMsgGasUsage, -// txMsg: ibcchanneltypes.NewMsgTimeout( -// ibcchanneltypes.Packet{}, 2, nil, ibcclienttypes.Height{}, ""), -// txCheck: true, -// expErr: true, -// }, -// "bypass msg gas usage equals to maxTotalBypassMinFeeMsgGasUsage": { -// minGasPrice: minGasPrice, -// globalFee: globalfeeParamsLow, -// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), -// gasLimit: globfeetypes.DefaultmaxTotalBypassMinFeeMsgGasUsage, -// txMsg: ibcchanneltypes.NewMsgTimeout( -// ibcchanneltypes.Packet{}, 3, nil, ibcclienttypes.Height{}, ""), -// txCheck: true, -// expErr: false, -// }, -// "msg type ibc, zero fee not in globalfee denom": { -// minGasPrice: minGasPrice, -// globalFee: globalfeeParamsLow, -// gasPrice: sdk.NewCoins(sdk.NewCoin("photon", sdk.ZeroInt())), -// gasLimit: testGasLimit, -// txMsg: ibcchanneltypes.NewMsgRecvPacket( -// ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), -// txCheck: true, -// expErr: false, -// }, -// "msg type ibc, nonzero fee in globalfee denom": { -// minGasPrice: minGasPrice, -// globalFee: globalfeeParamsLow, -// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", highFeeAmt)), -// gasLimit: testGasLimit, -// txMsg: ibcchanneltypes.NewMsgRecvPacket( -// ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), -// txCheck: true, -// expErr: false, -// }, -// "msg type ibc, nonzero fee not in globalfee denom": { -// minGasPrice: minGasPrice, -// globalFee: globalfeeParamsLow, -// gasPrice: sdk.NewCoins(sdk.NewCoin("photon", highFeeAmt)), -// gasLimit: testGasLimit, -// txMsg: ibcchanneltypes.NewMsgRecvPacket( -// ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), -// txCheck: true, -// expErr: true, -// }, -// "msg type ibc, empty fee": { -// minGasPrice: minGasPrice, -// globalFee: globalfeeParamsLow, -// gasPrice: sdk.Coins{}, -// gasLimit: testGasLimit, -// txMsg: ibcchanneltypes.NewMsgRecvPacket( -// ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), -// txCheck: true, -// expErr: false, -// }, -// "msg type non-ibc, nonzero fee in globalfee denom": { -// minGasPrice: minGasPrice, -// globalFee: globalfeeParamsLow, -// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", highFeeAmt)), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: false, -// }, -// "msg type non-ibc, empty fee": { -// minGasPrice: minGasPrice, -// globalFee: globalfeeParamsLow, -// gasPrice: sdk.Coins{}, -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: true, -// }, -// "msg type non-ibc, nonzero fee not in globalfee denom": { -// minGasPrice: minGasPrice, -// globalFee: globalfeeParamsLow, -// gasPrice: sdk.NewCoins(sdk.NewCoin("photon", highFeeAmt)), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: true, -// expErr: true, -// }, -// "disable checkTx: min_gas_price is medium, global fee is low, tx fee is low": { -// minGasPrice: minGasPrice, -// globalFee: globalfeeParamsLow, -// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: false, -// expErr: false, -// }, -// "disable checkTx: min_gas_price is medium, global fee is low, tx is zero": { -// minGasPrice: minGasPrice, -// globalFee: globalfeeParamsLow, -// gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: false, -// expErr: true, -// }, -// "disable checkTx: min_gas_price is low, global fee is low, tx fee's denom is not in global fees denoms set": { -// minGasPrice: minGasPrice, -// globalFee: globalfeeParamsLow, -// gasPrice: sdk.NewCoins(sdk.NewCoin("quark", sdk.ZeroInt())), -// gasLimit: testGasLimit, -// txMsg: testdata.NewTestMsg(addr1), -// txCheck: false, -// expErr: true, -// }, -// } - -// globalfeeParams := &globfeetypes.Params{ -// BypassMinFeeMsgTypes: globfeetypes.DefaultBypassMinFeeMsgTypes, -// MaxTotalBypassMinFeeMsgGasUsage: globfeetypes.DefaultmaxTotalBypassMinFeeMsgGasUsage, -// } - -// for name, tc := range testCases { -// s.Run(name, func() { -// // set globalfees and min gas price -// globalfeeParams.MinimumGasPrices = tc.globalFee -// _, antehandler := s.SetupTestGlobalFeeStoreAndMinGasPrice(tc.minGasPrice, globalfeeParams) - -// // set fee decorator to ante handler - -// s.Require().NoError(s.txBuilder.SetMsgs(tc.txMsg)) -// s.txBuilder.SetFeeAmount(tc.gasPrice) -// s.txBuilder.SetGasLimit(tc.gasLimit) -// tx, err := s.CreateTestTx(privs, accNums, accSeqs, s.ctx.ChainID()) -// s.Require().NoError(err) - -// s.ctx = s.ctx.WithIsCheckTx(tc.txCheck) -// _, err = antehandler(s.ctx, tx, false) -// if !tc.expErr { -// s.Require().NoError(err) -// } else { -// s.Require().Error(err) -// } -// }) -// } -// } - -// // Test how the operator fees are determined using various min gas prices. -// // -// // Note that in a real Gaia deployment all zero coins can be removed from minGasPrice. -// // This sanitizing happens when the minGasPrice is set into the context. -// // (see baseapp.SetMinGasPrices in gaia/cmd/root.go line 221) -// func (s *IntegrationTestSuite) TestGetMinGasPrice() { -// expCoins := sdk.Coins{ -// sdk.NewCoin("photon", sdk.NewInt(2000)), -// sdk.NewCoin("uatom", sdk.NewInt(3000)), -// } - -// testCases := []struct { -// name string -// minGasPrice []sdk.DecCoin -// feeTxGasLimit uint64 -// expCoins sdk.Coins -// }{ -// { -// "empty min gas price should return empty coins", -// []sdk.DecCoin{}, -// uint64(1000), -// sdk.Coins{}, -// }, -// { -// "zero coins min gas price should return empty coins", -// []sdk.DecCoin{ -// sdk.NewDecCoinFromDec("stake", sdk.NewDec(0)), -// sdk.NewDecCoinFromDec("uatom", sdk.NewDec(0)), -// }, -// uint64(1000), -// sdk.Coins{}, -// }, -// { -// "zero coins, non-zero coins mix should return zero coin and non-zero coins", -// []sdk.DecCoin{ -// sdk.NewDecCoinFromDec("stake", sdk.NewDec(0)), -// sdk.NewDecCoinFromDec("uatom", sdk.NewDec(1)), -// }, -// uint64(1000), -// sdk.Coins{ -// sdk.NewCoin("stake", sdk.NewInt(0)), -// sdk.NewCoin("uatom", sdk.NewInt(1000)), -// }, -// }, - -// { -// "unsorted min gas price should return sorted coins", -// []sdk.DecCoin{ -// sdk.NewDecCoinFromDec("uatom", sdk.NewDec(3)), -// sdk.NewDecCoinFromDec("photon", sdk.NewDec(2)), -// }, -// uint64(1000), -// expCoins, -// }, -// { -// "sorted min gas price should return same conins", -// []sdk.DecCoin{ -// sdk.NewDecCoinFromDec("photon", sdk.NewDec(2)), -// sdk.NewDecCoinFromDec("uatom", sdk.NewDec(3)), -// }, -// uint64(1000), -// expCoins, -// }, -// } - -// for _, tc := range testCases { -// s.Run(tc.name, func() { -// s.SetupTestGlobalFeeStoreAndMinGasPrice(tc.minGasPrice, &globfeetypes.Params{}) - -// fees := gaiafeeante.GetMinGasPrice(s.ctx, int64(tc.feeTxGasLimit)) -// s.Require().True(tc.expCoins.Sort().IsEqual(fees)) -// }) -// } -// } - -// func (s *IntegrationTestSuite) TestContainsOnlyBypassMinFeeMsgs() { -// // set globalfees params and min gas price -// globalfeeParams := &globfeetypes.Params{ -// BypassMinFeeMsgTypes: globfeetypes.DefaultBypassMinFeeMsgTypes, -// MaxTotalBypassMinFeeMsgGasUsage: globfeetypes.DefaultmaxTotalBypassMinFeeMsgGasUsage, -// } -// feeDecorator, _ := s.SetupTestGlobalFeeStoreAndMinGasPrice([]sdk.DecCoin{}, globalfeeParams) -// testCases := []struct { -// name string -// msgs []sdk.Msg -// expPass bool -// }{ -// { -// "expect empty msgs to pass", -// []sdk.Msg{}, -// true, -// }, -// { -// "expect default bypass msg to pass", -// []sdk.Msg{ -// ibcchanneltypes.NewMsgRecvPacket(ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), -// ibcchanneltypes.NewMsgAcknowledgement(ibcchanneltypes.Packet{}, []byte{1}, []byte{1}, ibcclienttypes.Height{}, ""), -// }, -// true, -// }, -// { -// "expect default bypass msgs to pass", -// []sdk.Msg{ -// ibcchanneltypes.NewMsgRecvPacket(ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), -// ibcchanneltypes.NewMsgAcknowledgement(ibcchanneltypes.Packet{}, []byte{1}, []byte{1}, ibcclienttypes.Height{}, ""), -// }, -// true, -// }, -// { -// "msgs contain non-bypass msg - should not pass", -// []sdk.Msg{ -// ibcchanneltypes.NewMsgRecvPacket(ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), -// stakingtypes.NewMsgDelegate(sdk.AccAddress{}, sdk.ValAddress{}, sdk.Coin{}), -// }, -// false, -// }, -// { -// "msgs contain only non-bypass msgs - should not pass", -// []sdk.Msg{ -// stakingtypes.NewMsgDelegate(sdk.AccAddress{}, sdk.ValAddress{}, sdk.Coin{}), -// }, -// false, -// }, -// } - -// for _, tc := range testCases { -// s.Run(tc.name, func() { -// res := feeDecorator.ContainsOnlyBypassMinFeeMsgs(s.ctx, tc.msgs) -// s.Require().True(tc.expPass == res) -// }) -// } -// } - -// func (s *IntegrationTestSuite) TestGetTxFeeRequired() { -// // create global fee params -// globalfeeParamsEmpty := &globfeetypes.Params{MinimumGasPrices: []sdk.DecCoin{}} - -// // setup tests with default global fee i.e. "0uatom" and empty local min gas prices -// feeDecorator, _ := s.SetupTestGlobalFeeStoreAndMinGasPrice([]sdk.DecCoin{}, globalfeeParamsEmpty) - -// // set a subspace that doesn't have the stakingtypes.KeyBondDenom key registred -// feeDecorator.StakingSubspace = s.app.GetSubspace(globfeetypes.ModuleName) - -// // check that an error is returned when staking bond denom is empty -// _, err := feeDecorator.GetTxFeeRequired(s.ctx, nil) -// s.Require().Equal(err.Error(), "empty staking bond denomination") - -// // set non-zero local min gas prices -// localMinGasPrices := sdk.NewCoins(sdk.NewCoin("uatom", sdk.NewInt(1))) - -// // setup tests with non-empty local min gas prices -// feeDecorator, _ = s.SetupTestGlobalFeeStoreAndMinGasPrice( -// sdk.NewDecCoinsFromCoins(localMinGasPrices...), -// globalfeeParamsEmpty, -// ) - -// // mock tx data -// s.txBuilder = s.clientCtx.TxConfig.NewTxBuilder() -// priv1, _, addr1 := testdata.KeyTestPubAddr() -// privs, accNums, accSeqs := []cryptotypes.PrivKey{priv1}, []uint64{0}, []uint64{0} - -// s.Require().NoError(s.txBuilder.SetMsgs(testdata.NewTestMsg(addr1))) -// s.txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt()))) - -// s.txBuilder.SetGasLimit(uint64(1)) -// tx, err := s.CreateTestTx(privs, accNums, accSeqs, s.ctx.ChainID()) -// s.Require().NoError(err) - -// // check that the required fees returned in CheckTx mode are equal to -// // local min gas prices since they're greater than the default global fee values. -// s.Require().True(s.ctx.IsCheckTx()) -// res, err := feeDecorator.GetTxFeeRequired(s.ctx, tx) -// s.Require().True(res.IsEqual(localMinGasPrices)) -// s.Require().NoError(err) - -// // check that the global fee is returned in DeliverTx mode. -// globalFee, err := feeDecorator.GetGlobalFee(s.ctx, tx) -// s.Require().NoError(err) - -// ctx := s.ctx.WithIsCheckTx(false) -// res, err = feeDecorator.GetTxFeeRequired(ctx, tx) -// s.Require().NoError(err) -// s.Require().True(res.IsEqual(globalFee)) -// } +import ( + "testing" + + 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" + "github.com/stretchr/testify/suite" + + gaiafeeante "github.com/cosmos/gaia/v11/x/globalfee/ante" + globfeetypes "github.com/cosmos/gaia/v11/x/globalfee/types" +) + +var testGasLimit uint64 = 200_000 + +func TestIntegrationTestSuite(t *testing.T) { + suite.Run(t, new(IntegrationTestSuite)) +} + +func (s *IntegrationTestSuite) TestGetDefaultGlobalFees() { + // set globalfees and min gas price + feeDecorator, _ := s.SetupTestGlobalFeeStoreAndMinGasPrice([]sdk.DecCoin{}, &globfeetypes.Params{}) + defaultGlobalFees, err := feeDecorator.DefaultZeroGlobalFee(s.ctx) + s.Require().NoError(err) + s.Require().Greater(len(defaultGlobalFees), 0) + + if defaultGlobalFees[0].Denom != testBondDenom { + s.T().Fatalf("bond denom: %s, default global fee denom: %s", testBondDenom, defaultGlobalFees[0].Denom) + } +} + +// Test global fees and min_gas_price with bypass msg types. +// Please note even globalfee=0, min_gas_price=0, we do not let fee=0random_denom pass. +// Paid fees are already sanitized by removing zero coins(through feeFlag parsing), so use sdk.NewCoins() to create it. +func (s *IntegrationTestSuite) TestGlobalFeeMinimumGasFeeAnteHandler() { + s.txBuilder = s.clientCtx.TxConfig.NewTxBuilder() + priv1, _, addr1 := testdata.KeyTestPubAddr() + privs, accNums, accSeqs := []cryptotypes.PrivKey{priv1}, []uint64{0}, []uint64{0} + + denominator := int64(100000) + high := sdk.NewDec(400).Quo(sdk.NewDec(denominator)) // 0.004 + med := sdk.NewDec(200).Quo(sdk.NewDec(denominator)) // 0.002 + low := sdk.NewDec(100).Quo(sdk.NewDec(denominator)) // 0.001 + + highFeeAmt := sdk.NewInt(high.MulInt64(int64(2) * denominator).RoundInt64()) + medFeeAmt := sdk.NewInt(med.MulInt64(int64(2) * denominator).RoundInt64()) + lowFeeAmt := sdk.NewInt(low.MulInt64(int64(2) * denominator).RoundInt64()) + + globalfeeParamsEmpty := []sdk.DecCoin{} + minGasPriceEmpty := []sdk.DecCoin{} + globalfeeParams0 := []sdk.DecCoin{ + sdk.NewDecCoinFromDec("photon", sdk.NewDec(0)), + sdk.NewDecCoinFromDec("uatom", sdk.NewDec(0)), + } + globalfeeParamsContain0 := []sdk.DecCoin{ + sdk.NewDecCoinFromDec("photon", med), + sdk.NewDecCoinFromDec("uatom", sdk.NewDec(0)), + } + minGasPrice0 := []sdk.DecCoin{ + sdk.NewDecCoinFromDec("stake", sdk.NewDec(0)), + sdk.NewDecCoinFromDec("uatom", sdk.NewDec(0)), + } + globalfeeParamsHigh := []sdk.DecCoin{ + sdk.NewDecCoinFromDec("uatom", high), + } + minGasPrice := []sdk.DecCoin{ + sdk.NewDecCoinFromDec("uatom", med), + sdk.NewDecCoinFromDec("stake", med), + } + globalfeeParamsLow := []sdk.DecCoin{ + sdk.NewDecCoinFromDec("uatom", low), + } + // global fee must be sorted in denom + globalfeeParamsNewDenom := []sdk.DecCoin{ + sdk.NewDecCoinFromDec("photon", high), + sdk.NewDecCoinFromDec("quark", high), + } + + testCases := map[string]struct { + minGasPrice []sdk.DecCoin + globalFee []sdk.DecCoin + gasPrice sdk.Coins + gasLimit sdk.Gas + txMsg sdk.Msg + txCheck bool + expErr bool + }{ + // test fees + // empty min_gas_price or empty global fee + "empty min_gas_price, nonempty global fee, fee higher/equal than global_fee": { + minGasPrice: minGasPriceEmpty, + globalFee: globalfeeParamsHigh, + gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", highFeeAmt)), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: false, + }, + "empty min_gas_price, nonempty global fee, fee lower than global_fee": { + minGasPrice: minGasPriceEmpty, + globalFee: globalfeeParamsHigh, + gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: true, + }, + "nonempty min_gas_price with defaultGlobalFee denom, empty global fee, fee higher/equal than min_gas_price": { + minGasPrice: minGasPrice, + globalFee: globalfeeParamsEmpty, // default 0uatom + gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", medFeeAmt)), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: false, + }, + "nonempty min_gas_price with defaultGlobalFee denom, empty global fee, fee lower than min_gas_price": { + minGasPrice: minGasPrice, + globalFee: globalfeeParamsEmpty, + gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: true, + }, + "empty min_gas_price, empty global fee, empty fee": { + minGasPrice: minGasPriceEmpty, + globalFee: globalfeeParamsEmpty, + gasPrice: sdk.Coins{}, + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: false, + }, + // zero min_gas_price or zero global fee + "zero min_gas_price, zero global fee, zero fee in global fee denom": { + minGasPrice: minGasPrice0, + globalFee: globalfeeParams0, + gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt()), sdk.NewCoin("photon", sdk.ZeroInt())), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: false, + }, + "zero min_gas_price, zero global fee, empty fee": { + minGasPrice: minGasPrice0, + globalFee: globalfeeParams0, + gasPrice: sdk.Coins{}, + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: false, + }, + // zero global fee + "zero min_gas_price, zero global fee, zero fee not in globalfee denom": { + minGasPrice: minGasPrice0, + globalFee: globalfeeParams0, + gasPrice: sdk.NewCoins(sdk.NewCoin("stake", sdk.ZeroInt())), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: false, + }, + "zero min_gas_price, zero global fee, zero fees one in, one not in globalfee denom": { + minGasPrice: minGasPrice0, + globalFee: globalfeeParams0, + gasPrice: sdk.NewCoins( + sdk.NewCoin("stake", sdk.ZeroInt()), + sdk.NewCoin("uatom", sdk.ZeroInt())), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: false, + }, + // zero min_gas_price and empty global fee + "zero min_gas_price, empty global fee, zero fee in min_gas_price_denom": { + minGasPrice: minGasPrice0, + globalFee: globalfeeParamsEmpty, + gasPrice: sdk.NewCoins(sdk.NewCoin("stake", sdk.ZeroInt())), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: false, + }, + "zero min_gas_price, empty global fee, zero fee not in min_gas_price denom, not in defaultZeroGlobalFee denom": { + minGasPrice: minGasPrice0, + globalFee: globalfeeParamsEmpty, + gasPrice: sdk.NewCoins(sdk.NewCoin("quark", sdk.ZeroInt())), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: false, + }, + "zero min_gas_price, empty global fee, zero fee in defaultZeroGlobalFee denom": { + minGasPrice: minGasPrice0, + globalFee: globalfeeParamsEmpty, + gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: false, + }, + "zero min_gas_price, empty global fee, nonzero fee in defaultZeroGlobalFee denom": { + minGasPrice: minGasPrice0, + globalFee: globalfeeParamsEmpty, + gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: false, + }, + "zero min_gas_price, empty global fee, nonzero fee not in defaultZeroGlobalFee denom": { + minGasPrice: minGasPrice0, + globalFee: globalfeeParamsEmpty, + gasPrice: sdk.NewCoins(sdk.NewCoin("quark", highFeeAmt)), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: true, + }, + // empty min_gas_price, zero global fee + "empty min_gas_price, zero global fee, zero fee in global fee denom": { + minGasPrice: minGasPriceEmpty, + globalFee: globalfeeParams0, + gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: false, + }, + "empty min_gas_price, zero global fee, zero fee not in global fee denom": { + minGasPrice: minGasPriceEmpty, + globalFee: globalfeeParams0, + gasPrice: sdk.NewCoins(sdk.NewCoin("stake", sdk.ZeroInt())), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: false, + }, + "empty min_gas_price, zero global fee, nonzero fee in global fee denom": { + minGasPrice: minGasPriceEmpty, + globalFee: globalfeeParams0, + gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: false, + }, + "empty min_gas_price, zero global fee, nonzero fee not in global fee denom": { + minGasPrice: minGasPriceEmpty, + globalFee: globalfeeParams0, + gasPrice: sdk.NewCoins(sdk.NewCoin("stake", highFeeAmt)), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: true, + }, + // zero min_gas_price, nonzero global fee + "zero min_gas_price, nonzero global fee, fee is higher than global fee": { + minGasPrice: minGasPrice0, + globalFee: globalfeeParamsLow, + gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: false, + }, + // nonzero min_gas_price, nonzero global fee + "fee higher/equal than globalfee and min_gas_price": { + minGasPrice: minGasPrice, + globalFee: globalfeeParamsHigh, + gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", highFeeAmt)), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: false, + }, + "fee lower than globalfee and min_gas_price": { + minGasPrice: minGasPrice, + globalFee: globalfeeParamsHigh, + gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: true, + }, + "fee with one denom higher/equal, one denom lower than globalfee and min_gas_price": { + minGasPrice: minGasPrice, + globalFee: globalfeeParamsNewDenom, + gasPrice: sdk.NewCoins( + sdk.NewCoin("photon", lowFeeAmt), + sdk.NewCoin("quark", highFeeAmt)), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: false, + }, + "globalfee > min_gas_price, fee higher/equal than min_gas_price, lower than globalfee": { + minGasPrice: minGasPrice, + globalFee: globalfeeParamsHigh, + gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", medFeeAmt)), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: true, + }, + "globalfee < min_gas_price, fee higher/equal than globalfee and lower than min_gas_price": { + minGasPrice: minGasPrice, + globalFee: globalfeeParamsLow, + gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: true, + }, + // nonzero min_gas_price, zero global fee + "nonzero min_gas_price, zero global fee, fee is in global fee denom and lower than min_gas_price": { + minGasPrice: minGasPrice, + globalFee: globalfeeParams0, + gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: true, + }, + "nonzero min_gas_price, zero global fee, fee is in global fee denom and higher/equal than min_gas_price": { + minGasPrice: minGasPrice, + globalFee: globalfeeParams0, + gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", medFeeAmt)), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: false, + }, + "nonzero min_gas_price, zero global fee, fee is in min_gas_price denom which is not in global fee default, but higher/equal than min_gas_price": { + minGasPrice: minGasPrice, + globalFee: globalfeeParams0, + gasPrice: sdk.NewCoins(sdk.NewCoin("stake", highFeeAmt)), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: true, + }, + // fee denom tests + "min_gas_price denom is not subset of global fee denom , fee paying in global fee denom": { + minGasPrice: minGasPrice, + globalFee: globalfeeParamsNewDenom, + gasPrice: sdk.NewCoins(sdk.NewCoin("photon", highFeeAmt)), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: false, + }, + "min_gas_price denom is not subset of global fee denom, fee paying in min_gas_price denom": { + minGasPrice: minGasPrice, + globalFee: globalfeeParamsNewDenom, + gasPrice: sdk.NewCoins(sdk.NewCoin("stake", highFeeAmt)), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: true, + }, + "fees contain denom not in globalfee": { + minGasPrice: minGasPrice, + globalFee: globalfeeParamsLow, + gasPrice: sdk.NewCoins( + sdk.NewCoin("uatom", highFeeAmt), + sdk.NewCoin("quark", highFeeAmt)), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: true, + }, + "fees contain denom not in globalfee with zero amount": { + minGasPrice: minGasPrice, + globalFee: globalfeeParamsLow, + gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", highFeeAmt), + sdk.NewCoin("quark", sdk.ZeroInt())), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: false, + }, + // cases from https://github.com/cosmos/gaia/pull/1570#issuecomment-1190524402 + // note: this is kind of a silly scenario but technically correct + // if there is a zero coin in the globalfee, the user could pay 0fees + // if the user includes any fee at all in the non-zero denom, it must be higher than that non-zero fee + // unlikely we will ever see zero and non-zero together but technically possible + "globalfee contains zero coin and non-zero coin, fee is lower than the nonzero coin": { + minGasPrice: minGasPrice0, + globalFee: globalfeeParamsContain0, + gasPrice: sdk.NewCoins(sdk.NewCoin("photon", lowFeeAmt)), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: true, + }, + "globalfee contains zero coin, fee contains zero coins of the same denom and a lower fee of the other denom in global fee": { + minGasPrice: minGasPrice0, + globalFee: globalfeeParamsContain0, + gasPrice: sdk.NewCoins( + sdk.NewCoin("photon", lowFeeAmt), + sdk.NewCoin("uatom", sdk.ZeroInt())), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: true, + }, + "globalfee contains zero coin, fee is empty": { + minGasPrice: minGasPrice0, + globalFee: globalfeeParamsContain0, + gasPrice: sdk.Coins{}, + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: false, + }, + "globalfee contains zero coin, fee contains lower fee of zero coins's denom, globalfee also contains nonzero coin,fee contains higher fee of nonzero coins's denom, ": { + minGasPrice: minGasPrice0, + globalFee: globalfeeParamsContain0, + gasPrice: sdk.NewCoins( + sdk.NewCoin("photon", lowFeeAmt), + sdk.NewCoin("uatom", highFeeAmt)), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: false, + }, + "globalfee contains zero coin, fee is all zero coins but in global fee's denom": { + minGasPrice: minGasPrice0, + globalFee: globalfeeParamsContain0, + gasPrice: sdk.NewCoins( + sdk.NewCoin("photon", sdk.ZeroInt()), + sdk.NewCoin("uatom", sdk.ZeroInt()), + ), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: false, + }, + "globalfee contains zero coin, fee is higher than the nonzero coin": { + minGasPrice: minGasPrice0, + globalFee: globalfeeParamsContain0, + gasPrice: sdk.NewCoins(sdk.NewCoin("photon", highFeeAmt)), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: false, + }, + "bypass msg type: ibc.core.channel.v1.MsgRecvPacket": { + minGasPrice: minGasPrice, + globalFee: globalfeeParamsLow, + gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), + gasLimit: testGasLimit, + txMsg: ibcchanneltypes.NewMsgRecvPacket( + ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), + txCheck: true, + expErr: false, + }, + "bypass msg type: ibc.core.channel.v1.MsgTimeout": { + minGasPrice: minGasPrice, + globalFee: globalfeeParamsLow, + gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), + gasLimit: testGasLimit, + txMsg: ibcchanneltypes.NewMsgTimeout( + // todo check here + ibcchanneltypes.Packet{}, 1, nil, ibcclienttypes.Height{}, ""), + txCheck: true, + expErr: false, + }, + "bypass msg type: ibc.core.channel.v1.MsgTimeoutOnClose": { + minGasPrice: minGasPrice, + globalFee: globalfeeParamsLow, + gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), + gasLimit: testGasLimit, + txMsg: ibcchanneltypes.NewMsgTimeout( + ibcchanneltypes.Packet{}, 2, nil, ibcclienttypes.Height{}, ""), + txCheck: true, + expErr: false, + }, + "bypass msg gas usage exceeds maxTotalBypassMinFeeMsgGasUsage": { + minGasPrice: minGasPrice, + globalFee: globalfeeParamsLow, + gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), + gasLimit: 2 * globfeetypes.DefaultmaxTotalBypassMinFeeMsgGasUsage, + txMsg: ibcchanneltypes.NewMsgTimeout( + ibcchanneltypes.Packet{}, 2, nil, ibcclienttypes.Height{}, ""), + txCheck: true, + expErr: true, + }, + "bypass msg gas usage equals to maxTotalBypassMinFeeMsgGasUsage": { + minGasPrice: minGasPrice, + globalFee: globalfeeParamsLow, + gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), + gasLimit: globfeetypes.DefaultmaxTotalBypassMinFeeMsgGasUsage, + txMsg: ibcchanneltypes.NewMsgTimeout( + ibcchanneltypes.Packet{}, 3, nil, ibcclienttypes.Height{}, ""), + txCheck: true, + expErr: false, + }, + "msg type ibc, zero fee not in globalfee denom": { + minGasPrice: minGasPrice, + globalFee: globalfeeParamsLow, + gasPrice: sdk.NewCoins(sdk.NewCoin("photon", sdk.ZeroInt())), + gasLimit: testGasLimit, + txMsg: ibcchanneltypes.NewMsgRecvPacket( + ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), + txCheck: true, + expErr: false, + }, + "msg type ibc, nonzero fee in globalfee denom": { + minGasPrice: minGasPrice, + globalFee: globalfeeParamsLow, + gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", highFeeAmt)), + gasLimit: testGasLimit, + txMsg: ibcchanneltypes.NewMsgRecvPacket( + ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), + txCheck: true, + expErr: false, + }, + "msg type ibc, nonzero fee not in globalfee denom": { + minGasPrice: minGasPrice, + globalFee: globalfeeParamsLow, + gasPrice: sdk.NewCoins(sdk.NewCoin("photon", highFeeAmt)), + gasLimit: testGasLimit, + txMsg: ibcchanneltypes.NewMsgRecvPacket( + ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), + txCheck: true, + expErr: true, + }, + "msg type ibc, empty fee": { + minGasPrice: minGasPrice, + globalFee: globalfeeParamsLow, + gasPrice: sdk.Coins{}, + gasLimit: testGasLimit, + txMsg: ibcchanneltypes.NewMsgRecvPacket( + ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), + txCheck: true, + expErr: false, + }, + "msg type non-ibc, nonzero fee in globalfee denom": { + minGasPrice: minGasPrice, + globalFee: globalfeeParamsLow, + gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", highFeeAmt)), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: false, + }, + "msg type non-ibc, empty fee": { + minGasPrice: minGasPrice, + globalFee: globalfeeParamsLow, + gasPrice: sdk.Coins{}, + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: true, + }, + "msg type non-ibc, nonzero fee not in globalfee denom": { + minGasPrice: minGasPrice, + globalFee: globalfeeParamsLow, + gasPrice: sdk.NewCoins(sdk.NewCoin("photon", highFeeAmt)), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: true, + expErr: true, + }, + "disable checkTx: min_gas_price is medium, global fee is low, tx fee is low": { + minGasPrice: minGasPrice, + globalFee: globalfeeParamsLow, + gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", lowFeeAmt)), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: false, + expErr: false, + }, + "disable checkTx: min_gas_price is medium, global fee is low, tx is zero": { + minGasPrice: minGasPrice, + globalFee: globalfeeParamsLow, + gasPrice: sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt())), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: false, + expErr: true, + }, + "disable checkTx: min_gas_price is low, global fee is low, tx fee's denom is not in global fees denoms set": { + minGasPrice: minGasPrice, + globalFee: globalfeeParamsLow, + gasPrice: sdk.NewCoins(sdk.NewCoin("quark", sdk.ZeroInt())), + gasLimit: testGasLimit, + txMsg: testdata.NewTestMsg(addr1), + txCheck: false, + expErr: true, + }, + } + + globalfeeParams := &globfeetypes.Params{ + BypassMinFeeMsgTypes: globfeetypes.DefaultBypassMinFeeMsgTypes, + MaxTotalBypassMinFeeMsgGasUsage: globfeetypes.DefaultmaxTotalBypassMinFeeMsgGasUsage, + } + + for name, tc := range testCases { + s.Run(name, func() { + // set globalfees and min gas price + globalfeeParams.MinimumGasPrices = tc.globalFee + _, antehandler := s.SetupTestGlobalFeeStoreAndMinGasPrice(tc.minGasPrice, globalfeeParams) + + // set fee decorator to ante handler + + s.Require().NoError(s.txBuilder.SetMsgs(tc.txMsg)) + s.txBuilder.SetFeeAmount(tc.gasPrice) + s.txBuilder.SetGasLimit(tc.gasLimit) + tx, err := s.CreateTestTx(privs, accNums, accSeqs, s.ctx.ChainID()) + s.Require().NoError(err) + + s.ctx = s.ctx.WithIsCheckTx(tc.txCheck) + _, err = antehandler(s.ctx, tx, false) + if !tc.expErr { + s.Require().NoError(err) + } else { + s.Require().Error(err) + } + }) + } +} + +// Test how the operator fees are determined using various min gas prices. +// +// Note that in a real Gaia deployment all zero coins can be removed from minGasPrice. +// This sanitizing happens when the minGasPrice is set into the context. +// (see baseapp.SetMinGasPrices in gaia/cmd/root.go line 221) +func (s *IntegrationTestSuite) TestGetMinGasPrice() { + expCoins := sdk.Coins{ + sdk.NewCoin("photon", sdk.NewInt(2000)), + sdk.NewCoin("uatom", sdk.NewInt(3000)), + } + + testCases := []struct { + name string + minGasPrice []sdk.DecCoin + feeTxGasLimit uint64 + expCoins sdk.Coins + }{ + { + "empty min gas price should return empty coins", + []sdk.DecCoin{}, + uint64(1000), + sdk.Coins{}, + }, + { + "zero coins min gas price should return empty coins", + []sdk.DecCoin{ + sdk.NewDecCoinFromDec("stake", sdk.NewDec(0)), + sdk.NewDecCoinFromDec("uatom", sdk.NewDec(0)), + }, + uint64(1000), + sdk.Coins{}, + }, + { + "zero coins, non-zero coins mix should return zero coin and non-zero coins", + []sdk.DecCoin{ + sdk.NewDecCoinFromDec("stake", sdk.NewDec(0)), + sdk.NewDecCoinFromDec("uatom", sdk.NewDec(1)), + }, + uint64(1000), + sdk.Coins{ + sdk.NewCoin("stake", sdk.NewInt(0)), + sdk.NewCoin("uatom", sdk.NewInt(1000)), + }, + }, + + { + "unsorted min gas price should return sorted coins", + []sdk.DecCoin{ + sdk.NewDecCoinFromDec("uatom", sdk.NewDec(3)), + sdk.NewDecCoinFromDec("photon", sdk.NewDec(2)), + }, + uint64(1000), + expCoins, + }, + { + "sorted min gas price should return same conins", + []sdk.DecCoin{ + sdk.NewDecCoinFromDec("photon", sdk.NewDec(2)), + sdk.NewDecCoinFromDec("uatom", sdk.NewDec(3)), + }, + uint64(1000), + expCoins, + }, + } + + for _, tc := range testCases { + s.Run(tc.name, func() { + s.SetupTestGlobalFeeStoreAndMinGasPrice(tc.minGasPrice, &globfeetypes.Params{}) + + fees := gaiafeeante.GetMinGasPrice(s.ctx, int64(tc.feeTxGasLimit)) + s.Require().True(tc.expCoins.Sort().IsEqual(fees)) + }) + } +} + +func (s *IntegrationTestSuite) TestContainsOnlyBypassMinFeeMsgs() { + // set globalfees params and min gas price + globalfeeParams := &globfeetypes.Params{ + BypassMinFeeMsgTypes: globfeetypes.DefaultBypassMinFeeMsgTypes, + MaxTotalBypassMinFeeMsgGasUsage: globfeetypes.DefaultmaxTotalBypassMinFeeMsgGasUsage, + } + feeDecorator, _ := s.SetupTestGlobalFeeStoreAndMinGasPrice([]sdk.DecCoin{}, globalfeeParams) + testCases := []struct { + name string + msgs []sdk.Msg + expPass bool + }{ + { + "expect empty msgs to pass", + []sdk.Msg{}, + true, + }, + { + "expect default bypass msg to pass", + []sdk.Msg{ + ibcchanneltypes.NewMsgRecvPacket(ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), + ibcchanneltypes.NewMsgAcknowledgement(ibcchanneltypes.Packet{}, []byte{1}, []byte{1}, ibcclienttypes.Height{}, ""), + }, + true, + }, + { + "msgs contain not only bypass msg - should not pass", + []sdk.Msg{ + ibcchanneltypes.NewMsgRecvPacket(ibcchanneltypes.Packet{}, nil, ibcclienttypes.Height{}, ""), + stakingtypes.NewMsgDelegate(sdk.AccAddress{}, sdk.ValAddress{}, sdk.Coin{}), + }, + false, + }, + { + "msgs contain only non-bypass msgs - should not pass", + []sdk.Msg{ + stakingtypes.NewMsgDelegate(sdk.AccAddress{}, sdk.ValAddress{}, sdk.Coin{}), + }, + false, + }, + } + + for _, tc := range testCases { + s.Run(tc.name, func() { + res := feeDecorator.ContainsOnlyBypassMinFeeMsgs(s.ctx, tc.msgs) + s.Require().True(tc.expPass == res) + }) + } +} + +func (s *IntegrationTestSuite) TestGetTxFeeRequired() { + // create global fee params + globalfeeParamsEmpty := &globfeetypes.Params{MinimumGasPrices: []sdk.DecCoin{}} + + // set non-zero local min gas prices + localMinGasPrices := sdk.NewCoins(sdk.NewCoin("uatom", sdk.NewInt(1))) + + // setup tests with non-empty local min gas prices + feeDecorator, _ := s.SetupTestGlobalFeeStoreAndMinGasPrice( + sdk.NewDecCoinsFromCoins(localMinGasPrices...), + globalfeeParamsEmpty, + ) + + // mock tx data + s.txBuilder = s.clientCtx.TxConfig.NewTxBuilder() + priv1, _, addr1 := testdata.KeyTestPubAddr() + privs, accNums, accSeqs := []cryptotypes.PrivKey{priv1}, []uint64{0}, []uint64{0} + + s.Require().NoError(s.txBuilder.SetMsgs(testdata.NewTestMsg(addr1))) + s.txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin("uatom", sdk.ZeroInt()))) + + s.txBuilder.SetGasLimit(uint64(1)) + tx, err := s.CreateTestTx(privs, accNums, accSeqs, s.ctx.ChainID()) + s.Require().NoError(err) + + // check that the required fees returned in CheckTx mode are equal to + // local min gas prices since they're greater than the default global fee values. + s.Require().True(s.ctx.IsCheckTx()) + res, err := feeDecorator.GetTxFeeRequired(s.ctx, tx) + s.Require().True(res.IsEqual(localMinGasPrices)) + s.Require().NoError(err) + + // check that the global fee is returned in DeliverTx mode. + globalFee, err := feeDecorator.GetGlobalFee(s.ctx, tx) + s.Require().NoError(err) + + ctx := s.ctx.WithIsCheckTx(false) + res, err = feeDecorator.GetTxFeeRequired(ctx, tx) + s.Require().NoError(err) + s.Require().True(res.IsEqual(globalFee)) +} diff --git a/x/globalfee/ante/antetest/fee_test_setup.go b/x/globalfee/ante/antetest/fee_test_setup.go index f0c8904348..0cc4450796 100644 --- a/x/globalfee/ante/antetest/fee_test_setup.go +++ b/x/globalfee/ante/antetest/fee_test_setup.go @@ -1,125 +1,120 @@ package antetest -// import ( -// "fmt" - -// "github.com/cosmos/cosmos-sdk/client" -// "github.com/cosmos/cosmos-sdk/client/tx" -// cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" -// "github.com/cosmos/cosmos-sdk/testutil/testdata" -// 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/cosmos/cosmos-sdk/x/params/types" -// stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" -// "github.com/stretchr/testify/suite" -// tmrand "github.com/tendermint/tendermint/libs/rand" -// tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - -// gaiahelpers "github.com/cosmos/gaia/v11/app/helpers" -// gaiafeeante "github.com/cosmos/gaia/v11/x/globalfee/ante" - -// gaiaapp "github.com/cosmos/gaia/v11/app" -// "github.com/cosmos/gaia/v11/x/globalfee" -// globfeetypes "github.com/cosmos/gaia/v11/x/globalfee/types" -// ) - -// type IntegrationTestSuite struct { -// suite.Suite - -// app *gaiaapp.GaiaApp -// ctx sdk.Context -// clientCtx client.Context -// txBuilder client.TxBuilder -// } - -// var testBondDenom = "uatom" - -// func (s *IntegrationTestSuite) SetupTest() { -// app := gaiahelpers.Setup(s.T()) -// ctx := app.BaseApp.NewContext(false, tmproto.Header{ -// ChainID: fmt.Sprintf("test-chain-%s", tmrand.Str(4)), -// Height: 1, -// }) - -// encodingConfig := gaiaapp.MakeTestEncodingConfig() -// encodingConfig.Amino.RegisterConcrete(&testdata.TestMsg{}, "testdata.TestMsg", nil) -// testdata.RegisterInterfaces(encodingConfig.InterfaceRegistry) - -// s.app = app -// s.ctx = ctx -// s.clientCtx = client.Context{}.WithTxConfig(encodingConfig.TxConfig) -// } - -// func (s *IntegrationTestSuite) SetupTestGlobalFeeStoreAndMinGasPrice(minGasPrice []sdk.DecCoin, globalFeeParams *globfeetypes.Params) (gaiafeeante.FeeDecorator, sdk.AnteHandler) { -// subspace := s.app.GetSubspace(globalfee.ModuleName) -// subspace.SetParamSet(s.ctx, globalFeeParams) -// s.ctx = s.ctx.WithMinGasPrices(minGasPrice).WithIsCheckTx(true) - -// // set staking params -// stakingParam := stakingtypes.DefaultParams() -// stakingParam.BondDenom = testBondDenom -// stakingSubspace := s.SetupTestStakingSubspace(stakingParam) - -// // build fee decorator -// feeDecorator := gaiafeeante.NewFeeDecorator(subspace, stakingSubspace) - -// // chain fee decorator to antehandler -// antehandler := sdk.ChainAnteDecorators(feeDecorator) - -// return feeDecorator, antehandler -// } - -// // SetupTestStakingSubspace sets uatom as bond denom for the fee tests. -// func (s *IntegrationTestSuite) SetupTestStakingSubspace(params stakingtypes.Params) types.Subspace { -// s.app.GetSubspace(stakingtypes.ModuleName).SetParamSet(s.ctx, ¶ms) -// return s.app.GetSubspace(stakingtypes.ModuleName) -// } - -// func (s *IntegrationTestSuite) CreateTestTx(privs []cryptotypes.PrivKey, accNums []uint64, accSeqs []uint64, chainID string) (xauthsigning.Tx, error) { -// var sigsV2 []signing.SignatureV2 -// for i, priv := range privs { -// sigV2 := signing.SignatureV2{ -// PubKey: priv.PubKey(), -// Data: &signing.SingleSignatureData{ -// SignMode: s.clientCtx.TxConfig.SignModeHandler().DefaultMode(), -// Signature: nil, -// }, -// Sequence: accSeqs[i], -// } - -// sigsV2 = append(sigsV2, sigV2) -// } - -// if err := s.txBuilder.SetSignatures(sigsV2...); err != nil { -// return nil, err -// } - -// sigsV2 = []signing.SignatureV2{} -// for i, priv := range privs { -// signerData := xauthsigning.SignerData{ -// ChainID: chainID, -// AccountNumber: accNums[i], -// Sequence: accSeqs[i], -// } -// sigV2, err := tx.SignWithPrivKey( -// s.clientCtx.TxConfig.SignModeHandler().DefaultMode(), -// signerData, -// s.txBuilder, -// priv, -// s.clientCtx.TxConfig, -// accSeqs[i], -// ) -// if err != nil { -// return nil, err -// } - -// sigsV2 = append(sigsV2, sigV2) -// } - -// if err := s.txBuilder.SetSignatures(sigsV2...); err != nil { -// return nil, err -// } - -// return s.txBuilder.GetTx(), nil -// } +import ( + "fmt" + + 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" + "github.com/cosmos/cosmos-sdk/testutil/testdata" + 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" + + gaiahelpers "github.com/cosmos/gaia/v11/app/helpers" + gaiaparams "github.com/cosmos/gaia/v11/app/params" + gaiafeeante "github.com/cosmos/gaia/v11/x/globalfee/ante" + + gaiaapp "github.com/cosmos/gaia/v11/app" + "github.com/cosmos/gaia/v11/x/globalfee" + globfeetypes "github.com/cosmos/gaia/v11/x/globalfee/types" +) + +type IntegrationTestSuite struct { + suite.Suite + + app *gaiaapp.GaiaApp + ctx sdk.Context + clientCtx client.Context + txBuilder client.TxBuilder +} + +var testBondDenom = "uatom" + +func (s *IntegrationTestSuite) SetupTest() { + app := gaiahelpers.Setup(s.T()) + ctx := app.BaseApp.NewContext(false, tmproto.Header{ + ChainID: fmt.Sprintf("test-chain-%s", tmrand.Str(4)), + Height: 1, + }) + + encodingConfig := gaiaparams.MakeEncodingConfig() + encodingConfig.Amino.RegisterConcrete(&testdata.TestMsg{}, "testdata.TestMsg", nil) + testdata.RegisterInterfaces(encodingConfig.InterfaceRegistry) + + s.app = app + s.ctx = ctx + s.clientCtx = client.Context{}.WithTxConfig(encodingConfig.TxConfig) +} + +func (s *IntegrationTestSuite) SetupTestGlobalFeeStoreAndMinGasPrice(minGasPrice []sdk.DecCoin, globalFeeParams *globfeetypes.Params) (gaiafeeante.FeeDecorator, sdk.AnteHandler) { + subspace := s.app.GetSubspace(globalfee.ModuleName) + subspace.SetParamSet(s.ctx, globalFeeParams) + s.ctx = s.ctx.WithMinGasPrices(minGasPrice).WithIsCheckTx(true) + + // setup staking bond denom to "uatom" + // since it's "stake" per default + params := s.app.StakingKeeper.GetParams(s.ctx) + params.BondDenom = testBondDenom + err := s.app.StakingKeeper.SetParams(s.ctx, params) + s.Require().NoError(err) + + // build fee decorator + feeDecorator := gaiafeeante.NewFeeDecorator(subspace, s.app.StakingKeeper) + + // chain fee decorator to antehandler + antehandler := sdk.ChainAnteDecorators(feeDecorator) + + return feeDecorator, antehandler +} + +func (s *IntegrationTestSuite) CreateTestTx(privs []cryptotypes.PrivKey, accNums []uint64, accSeqs []uint64, chainID string) (xauthsigning.Tx, error) { + var sigsV2 []signing.SignatureV2 + for i, priv := range privs { + sigV2 := signing.SignatureV2{ + PubKey: priv.PubKey(), + Data: &signing.SingleSignatureData{ + SignMode: s.clientCtx.TxConfig.SignModeHandler().DefaultMode(), + Signature: nil, + }, + Sequence: accSeqs[i], + } + + sigsV2 = append(sigsV2, sigV2) + } + + if err := s.txBuilder.SetSignatures(sigsV2...); err != nil { + return nil, err + } + + sigsV2 = []signing.SignatureV2{} + for i, priv := range privs { + signerData := xauthsigning.SignerData{ + ChainID: chainID, + AccountNumber: accNums[i], + Sequence: accSeqs[i], + } + sigV2, err := tx.SignWithPrivKey( + s.clientCtx.TxConfig.SignModeHandler().DefaultMode(), + signerData, + s.txBuilder, + priv, + s.clientCtx.TxConfig, + accSeqs[i], + ) + if err != nil { + return nil, err + } + + sigsV2 = append(sigsV2, sigV2) + } + + if err := s.txBuilder.SetSignatures(sigsV2...); err != nil { + return nil, err + } + + return s.txBuilder.GetTx(), nil +} diff --git a/x/globalfee/ante/fee.go b/x/globalfee/ante/fee.go index 81969e3f85..af09e2a2d8 100644 --- a/x/globalfee/ante/fee.go +++ b/x/globalfee/ante/fee.go @@ -1,278 +1,284 @@ package ante -// import ( -// "errors" -// "fmt" +import ( + "errors" + "fmt" -// errorsmod "cosmossdk.io/errors" -// sdk "github.com/cosmos/cosmos-sdk/types" -// paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" -// stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" -// gaiaerrors "github.com/cosmos/gaia/v11/types/errors" -// tmstrings "github.com/tendermint/tendermint/libs/strings" + errorsmod "cosmossdk.io/errors" + tmstrings "github.com/cometbft/cometbft/libs/strings" + sdk "github.com/cosmos/cosmos-sdk/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" -// "github.com/cosmos/gaia/v11/x/globalfee" -// "github.com/cosmos/gaia/v11/x/globalfee/types" -// ) + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + + gaiaerrors "github.com/cosmos/gaia/v11/types/errors" + + "github.com/cosmos/gaia/v11/x/globalfee" + "github.com/cosmos/gaia/v11/x/globalfee/types" +) // FeeWithBypassDecorator checks if the transaction's fee is at least as large // as the local validator's minimum gasFee (defined in validator config) and global fee, and the fee denom should be in the global fees' denoms. // -// import ( -// "errors" -// "fmt" // // CONTRACT: Tx must implement FeeTx to use FeeDecorator // If the tx msg type is one of the bypass msg types, the tx is valid even if the min fee is lower than normally required. // If the bypass tx still carries fees, the fee denom should be the same as global fee required. -// var _ sdk.AnteDecorator = FeeDecorator{} +var _ sdk.AnteDecorator = FeeDecorator{} -// type FeeDecorator struct { -// GlobalMinFeeParamSource globalfee.ParamSource -// StakingSubspace paramtypes.Subspace -// } +type FeeDecorator struct { + GlobalMinFeeParamSource globalfee.ParamSource + StakingKeeper *stakingkeeper.Keeper +} -// func NewFeeDecorator(globalfeeSubspace, stakingSubspace paramtypes.Subspace) FeeDecorator { -// if !globalfeeSubspace.HasKeyTable() { -// panic("global fee paramspace was not set up via module") -// } +func NewFeeDecorator(globalfeeSubspace paramtypes.Subspace, sk *stakingkeeper.Keeper) FeeDecorator { + if !globalfeeSubspace.HasKeyTable() { + panic("global fee paramspace was not set up via module") + } -// if !stakingSubspace.HasKeyTable() { -// panic("staking paramspace was not set up via module") -// } - -// return FeeDecorator{ -// GlobalMinFeeParamSource: globalfeeSubspace, -// StakingSubspace: stakingSubspace, -// } -// } + return FeeDecorator{ + GlobalMinFeeParamSource: globalfeeSubspace, + StakingKeeper: sk, + } +} // AnteHandle implements the AnteDecorator interface -// func (mfd FeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) { -// feeTx, ok := tx.(sdk.FeeTx) -// if !ok { -// return ctx, errorsmod.Wrap(gaiaerrors.ErrTxDecode, "Tx must implement the sdk.FeeTx interface") -// } - -// // Do not check minimum-gas-prices and global fees during simulations -// if simulate { -// return next(ctx, tx, simulate) -// } - -// // Get the required fees according to the CheckTx or DeliverTx modes -// feeRequired, err := mfd.GetTxFeeRequired(ctx, feeTx) -// if err != nil { -// return ctx, err -// } - -// reject the transaction early if the feeCoins have more denoms than the fee requirement - -// feeRequired cannot be empty -// if feeTx.GetFee().Len() > feeRequired.Len() { -// return ctx, errorsmod.Wrapf(gaiaerrors.ErrInvalidCoins, "fee is not a subset of required fees; got %s, required: %s", feeTx.GetFee().String(), feeRequired.String()) -// } - -// // Sort fee tx's coins, zero coins in feeCoins are already removed -// feeCoins := feeTx.GetFee().Sort() -// gas := feeTx.GetGas() -// msgs := feeTx.GetMsgs() - -// // split feeRequired into zero and non-zero coins(nonZeroCoinFeesReq, zeroCoinFeesDenomReq), split feeCoins according to -// // nonZeroCoinFeesReq, zeroCoinFeesDenomReq, -// // so that feeCoins can be checked separately against them. -// nonZeroCoinFeesReq, zeroCoinFeesDenomReq := getNonZeroFees(feeRequired) - -// // feeCoinsNonZeroDenom contains non-zero denominations from the feeRequired -// // feeCoinsNonZeroDenom is used to check if the fees meets the requirement imposed by nonZeroCoinFeesReq -// // when feeCoins does not contain zero coins' denoms in feeRequired -// feeCoinsNonZeroDenom, feeCoinsZeroDenom := splitCoinsByDenoms(feeCoins, zeroCoinFeesDenomReq) - -// Check that the fees are in expected denominations. -// according to splitCoinsByDenoms(), feeCoinsZeroDenom must be in denom subset of zeroCoinFeesDenomReq. -// check if feeCoinsNonZeroDenom is a subset of nonZeroCoinFeesReq. -// special case: if feeCoinsNonZeroDenom=[], DenomsSubsetOf returns true -// special case: if feeCoinsNonZeroDenom is not empty, but nonZeroCoinFeesReq empty, return false -// if !feeCoinsNonZeroDenom.DenomsSubsetOf(nonZeroCoinFeesReq) { -// return ctx, errorsmod.Wrapf(gaiaerrors.ErrInsufficientFee, "fee is not a subset of required fees; got %s, required: %s", feeCoins.String(), feeRequired.String()) -// } - -// // If the feeCoins pass the denoms check, check they are bypass-msg types. -// // -// // Bypass min fee requires: -// // - the tx contains only message types that can bypass the minimum fee, -// // see BypassMinFeeMsgTypes; -// // - the total gas limit per message does not exceed MaxTotalBypassMinFeeMsgGasUsage, -// // i.e., totalGas <= MaxTotalBypassMinFeeMsgGasUsage -// // Otherwise, minimum fees and global fees are checked to prevent spam. -// maxTotalBypassMinFeeMsgGasUsage := mfd.GetMaxTotalBypassMinFeeMsgGasUsage(ctx) -// doesNotExceedMaxGasUsage := gas <= maxTotalBypassMinFeeMsgGasUsage -// allBypassMsgs := mfd.ContainsOnlyBypassMinFeeMsgs(ctx, msgs) -// allowedToBypassMinFee := allBypassMsgs && doesNotExceedMaxGasUsage - -// if allowedToBypassMinFee { -// return next(ctx, tx, simulate) -// } - -// if the msg does not satisfy bypass condition and the feeCoins denoms are subset of feeRequired, -// check the feeCoins amount against feeRequired -// -// when feeCoins=[] -// special case: and there is zero coin in fee requirement, pass, -// otherwise, err -// if len(feeCoins) == 0 { -// if len(zeroCoinFeesDenomReq) != 0 { -// return next(ctx, tx, simulate) -// } -// return ctx, errorsmod.Wrapf(gaiaerrors.ErrInsufficientFee, "insufficient fees; got: %s required: %s", feeCoins.String(), feeRequired.String()) -// } - -// // when feeCoins != [] -// // special case: if TX has at least one of the zeroCoinFeesDenomReq, then it should pass -// if len(feeCoinsZeroDenom) > 0 { -// return next(ctx, tx, simulate) -// } - -// // After all the checks, the tx is confirmed: -// // feeCoins denoms subset off feeRequired -// // Not bypass -// // feeCoins != [] -// // Not contain zeroCoinFeesDenomReq's denoms -// // -// // check if the feeCoins's feeCoinsNonZeroDenom part has coins' amount higher/equal to nonZeroCoinFeesReq -// if !feeCoinsNonZeroDenom.IsAnyGTE(nonZeroCoinFeesReq) { -// errMsg := fmt.Sprintf("Insufficient fees; got: %s required: %s", feeCoins.String(), feeRequired.String()) -// if allBypassMsgs && !doesNotExceedMaxGasUsage { -// errMsg = fmt.Sprintf("Insufficient fees; bypass-min-fee-msg-types with gas consumption %v exceeds the maximum allowed gas value of %v.", gas, maxTotalBypassMinFeeMsgGasUsage) -// } - -// return ctx, errorsmod.Wrap(gaiaerrors.ErrInsufficientFee, errMsg) -// } - -// return next(ctx, tx, simulate) -// } - -// // GetTxFeeRequired returns the required fees for the given FeeTx. -// // In case the FeeTx's mode is CheckTx, it returns the combined requirements -// // of local min gas prices and global fees. Otherwise, in DeliverTx, it returns the global fee. -// func (mfd FeeDecorator) GetTxFeeRequired(ctx sdk.Context, tx sdk.FeeTx) (sdk.Coins, error) { -// // Get required global fee min gas prices -// // Note that it should never be empty since its default value is set to coin={"StakingBondDenom", 0} -// globalFees, err := mfd.GetGlobalFee(ctx, tx) -// if err != nil { -// return sdk.Coins{}, err -// } - -// // In DeliverTx, the global fee min gas prices are the only tx fee requirements. -// if !ctx.IsCheckTx() { -// return globalFees, nil -// } - -// // In CheckTx mode, the local and global fee min gas prices are combined -// // to form the tx fee requirements - -// // Get local minimum-gas-prices -// localFees := GetMinGasPrice(ctx, int64(tx.GetGas())) - -// // Return combined fee requirements -// return CombinedFeeRequirement(globalFees, localFees) -// } - -// // GetGlobalFee returns the global fees for a given fee tx's gas -// // (might also return 0denom if globalMinGasPrice is 0) -// // sorted in ascending order. -// // Note that ParamStoreKeyMinGasPrices type requires coins sorted. -// func (mfd FeeDecorator) GetGlobalFee(ctx sdk.Context, feeTx sdk.FeeTx) (sdk.Coins, error) { -// var ( -// globalMinGasPrices sdk.DecCoins -// err error -// ) - -// if mfd.GlobalMinFeeParamSource.Has(ctx, types.ParamStoreKeyMinGasPrices) { -// mfd.GlobalMinFeeParamSource.Get(ctx, types.ParamStoreKeyMinGasPrices, &globalMinGasPrices) -// } -// // global fee is empty set, set global fee to 0uatom -// if len(globalMinGasPrices) == 0 { -// globalMinGasPrices, err = mfd.DefaultZeroGlobalFee(ctx) -// if err != nil { -// return sdk.Coins{}, err -// } -// } -// requiredGlobalFees := make(sdk.Coins, len(globalMinGasPrices)) -// // Determine the required fees by multiplying each required minimum gas -// // price by the gas limit, where fee = ceil(minGasPrice * gasLimit). -// glDec := sdk.NewDec(int64(feeTx.GetGas())) -// for i, gp := range globalMinGasPrices { -// fee := gp.Amount.Mul(glDec) -// requiredGlobalFees[i] = sdk.NewCoin(gp.Denom, fee.Ceil().RoundInt()) -// } - -// return requiredGlobalFees.Sort(), nil -// } - -// // DefaultZeroGlobalFee returns a zero coin with the staking module bond denom -// func (mfd FeeDecorator) DefaultZeroGlobalFee(ctx sdk.Context) ([]sdk.DecCoin, error) { -// bondDenom := mfd.getBondDenom(ctx) -// if bondDenom == "" { -// return nil, errors.New("empty staking bond denomination") -// } - -// return []sdk.DecCoin{sdk.NewDecCoinFromDec(bondDenom, sdk.NewDec(0))}, nil -// } - -// func (mfd FeeDecorator) getBondDenom(ctx sdk.Context) (bondDenom string) { -// if mfd.StakingSubspace.Has(ctx, stakingtypes.KeyBondDenom) { -// mfd.StakingSubspace.Get(ctx, stakingtypes.KeyBondDenom, &bondDenom) -// } - -// return -// } - -// func (mfd FeeDecorator) ContainsOnlyBypassMinFeeMsgs(ctx sdk.Context, msgs []sdk.Msg) bool { -// bypassMsgTypes := mfd.GetBypassMsgTypes(ctx) -// for _, msg := range msgs { -// if tmstrings.StringInSlice(sdk.MsgTypeURL(msg), bypassMsgTypes) { -// continue -// } -// return false -// } - -// return true -// } - -// func (mfd FeeDecorator) GetBypassMsgTypes(ctx sdk.Context) (res []string) { -// if mfd.GlobalMinFeeParamSource.Has(ctx, types.ParamStoreKeyBypassMinFeeMsgTypes) { -// mfd.GlobalMinFeeParamSource.Get(ctx, types.ParamStoreKeyBypassMinFeeMsgTypes, &res) -// } - -// return -// } - -// func (mfd FeeDecorator) GetMaxTotalBypassMinFeeMsgGasUsage(ctx sdk.Context) (res uint64) { -// if mfd.GlobalMinFeeParamSource.Has(ctx, types.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage) { -// mfd.GlobalMinFeeParamSource.Get(ctx, types.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage, &res) -// } - -// return -// } - -// // GetMinGasPrice returns a nodes's local minimum gas prices -// // fees given a gas limit -// func GetMinGasPrice(ctx sdk.Context, gasLimit int64) sdk.Coins { -// minGasPrices := ctx.MinGasPrices() -// // special case: if minGasPrices=[], requiredFees=[] -// if minGasPrices.IsZero() { -// return sdk.Coins{} -// } - -// requiredFees := make(sdk.Coins, len(minGasPrices)) -// // Determine the required fees by multiplying each required minimum gas -// // price by the gas limit, where fee = ceil(minGasPrice * gasLimit). -// glDec := sdk.NewDec(gasLimit) -// for i, gp := range minGasPrices { -// fee := gp.Amount.Mul(glDec) -// requiredFees[i] = sdk.NewCoin(gp.Denom, fee.Ceil().RoundInt()) -// } - -// return requiredFees.Sort() -// } +func (mfd FeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) { + feeTx, ok := tx.(sdk.FeeTx) + if !ok { + return ctx, errorsmod.Wrap(gaiaerrors.ErrTxDecode, "Tx must implement the sdk.FeeTx interface") + } + + // Do not check minimum-gas-prices and global fees during simulations + if simulate { + return next(ctx, tx, simulate) + } + + // Get the required fees according to the CheckTx or DeliverTx modes + feeRequired, err := mfd.GetTxFeeRequired(ctx, feeTx) + if err != nil { + return ctx, err + } + + ctx.Logger().Info(fmt.Sprintf("FeeCoins: %v", feeTx.GetFee())) + ctx.Logger().Info(fmt.Sprintf("FeeRequired: %v", feeRequired)) + + // reject the transaction early if the feeCoins have more denoms than the fee requirement + + // feeRequired cannot be empty + if feeTx.GetFee().Len() > feeRequired.Len() { + return ctx, errorsmod.Wrapf(gaiaerrors.ErrInvalidCoins, "fee is not a subset of required fees; got %s, required: %s", feeTx.GetFee().String(), feeRequired.String()) + } + + // Sort fee tx's coins, zero coins in feeCoins are already removed + feeCoins := feeTx.GetFee().Sort() + gas := feeTx.GetGas() + msgs := feeTx.GetMsgs() + + // split feeRequired into zero and non-zero coins(nonZeroCoinFeesReq, zeroCoinFeesDenomReq), split feeCoins according to + // nonZeroCoinFeesReq, zeroCoinFeesDenomReq, + // so that feeCoins can be checked separately against them. + nonZeroCoinFeesReq, zeroCoinFeesDenomReq := getNonZeroFees(feeRequired) + + // feeCoinsNonZeroDenom contains non-zero denominations from the feeRequired + // feeCoinsNonZeroDenom is used to check if the fees meets the requirement imposed by nonZeroCoinFeesReq + // when feeCoins does not contain zero coins' denoms in feeRequired + feeCoinsNonZeroDenom, feeCoinsZeroDenom := splitCoinsByDenoms(feeCoins, zeroCoinFeesDenomReq) + + // Check that the fees are in expected denominations. + // according to splitCoinsByDenoms(), feeCoinsZeroDenom must be in denom subset of zeroCoinFeesDenomReq. + // check if feeCoinsNonZeroDenom is a subset of nonZeroCoinFeesReq. + // special case: if feeCoinsNonZeroDenom=[], DenomsSubsetOf returns true + // special case: if feeCoinsNonZeroDenom is not empty, but nonZeroCoinFeesReq empty, return false + if !feeCoinsNonZeroDenom.DenomsSubsetOf(nonZeroCoinFeesReq) { + return ctx, errorsmod.Wrapf(gaiaerrors.ErrInsufficientFee, "fee is not a subset of required fees; got %s, required: %s", feeCoins.String(), feeRequired.String()) + } + + // If the feeCoins pass the denoms check, check they are bypass-msg types. + // + // Bypass min fee requires: + // - the tx contains only message types that can bypass the minimum fee, + // see BypassMinFeeMsgTypes; + // - the total gas limit per message does not exceed MaxTotalBypassMinFeeMsgGasUsage, + // i.e., totalGas <= MaxTotalBypassMinFeeMsgGasUsage + // Otherwise, minimum fees and global fees are checked to prevent spam. + maxTotalBypassMinFeeMsgGasUsage := mfd.GetMaxTotalBypassMinFeeMsgGasUsage(ctx) + doesNotExceedMaxGasUsage := gas <= maxTotalBypassMinFeeMsgGasUsage + allBypassMsgs := mfd.ContainsOnlyBypassMinFeeMsgs(ctx, msgs) + allowedToBypassMinFee := allBypassMsgs && doesNotExceedMaxGasUsage + ctx.Logger().Info(fmt.Sprintf("gas: %v", gas)) + ctx.Logger().Info(fmt.Sprintf("allBypassMsgs: %v", allBypassMsgs)) + ctx.Logger().Info(fmt.Sprintf("maxTotalBypassMinFeeMsgGasUsage: %v", maxTotalBypassMinFeeMsgGasUsage)) + ctx.Logger().Info(fmt.Sprintf("doesNotExceedMaxGasUsage: %v", doesNotExceedMaxGasUsage)) + ctx.Logger().Info(fmt.Sprintf("allowedToBypassMinFee: %v", allowedToBypassMinFee)) + + if allowedToBypassMinFee { + ctx.Logger().Info("Pass allowedToBypassMinFee check") + return next(ctx, tx, simulate) + } + + // if the msg does not satisfy bypass condition and the feeCoins denoms are subset of feeRequired, + // check the feeCoins amount against feeRequired + + // when feeCoins=[] + // special case: and there is zero coin in fee requirement, pass, + // otherwise, err + if len(feeCoins) == 0 { + if len(zeroCoinFeesDenomReq) != 0 { + return next(ctx, tx, simulate) + } + return ctx, errorsmod.Wrapf(gaiaerrors.ErrInsufficientFee, "insufficient fees; got: %s required: %s", feeCoins.String(), feeRequired.String()) + } + + // when feeCoins != [] + // special case: if TX has at least one of the zeroCoinFeesDenomReq, then it should pass + if len(feeCoinsZeroDenom) > 0 { + return next(ctx, tx, simulate) + } + + // After all the checks, the tx is confirmed: + // feeCoins denoms subset off feeRequired + // Not bypass + // feeCoins != [] + // Not contain zeroCoinFeesDenomReq's denoms + // + // check if the feeCoins's feeCoinsNonZeroDenom part has coins' amount higher/equal to nonZeroCoinFeesReq + if !feeCoinsNonZeroDenom.IsAnyGTE(nonZeroCoinFeesReq) { + errMsg := fmt.Sprintf("Insufficient fees; got: %s required: %s", feeCoins.String(), feeRequired.String()) + if allBypassMsgs && !doesNotExceedMaxGasUsage { + errMsg = fmt.Sprintf("Insufficient fees; bypass-min-fee-msg-types with gas consumption %v exceeds the maximum allowed gas value of %v.", gas, maxTotalBypassMinFeeMsgGasUsage) + } + + return ctx, errorsmod.Wrap(gaiaerrors.ErrInsufficientFee, errMsg) + } + + return next(ctx, tx, simulate) +} + +// GetTxFeeRequired returns the required fees for the given FeeTx. +// In case the FeeTx's mode is CheckTx, it returns the combined requirements +// of local min gas prices and global fees. Otherwise, in DeliverTx, it returns the global fee. +func (mfd FeeDecorator) GetTxFeeRequired(ctx sdk.Context, tx sdk.FeeTx) (sdk.Coins, error) { + // Get required global fee min gas prices + // Note that it should never be empty since its default value is set to coin={"StakingBondDenom", 0} + globalFees, err := mfd.GetGlobalFee(ctx, tx) + if err != nil { + return sdk.Coins{}, err + } + + ctx.Logger().Info(fmt.Sprintf("GlobalFees: %v, IsCheckTx: %v", globalFees, ctx.IsCheckTx())) + + // In DeliverTx, the global fee min gas prices are the only tx fee requirements. + if !ctx.IsCheckTx() { + return globalFees, nil + } + + // In CheckTx mode, the local and global fee min gas prices are combined + // to form the tx fee requirements + + // Get local minimum-gas-prices + localFees := GetMinGasPrice(ctx, int64(tx.GetGas())) + ctx.Logger().Info(fmt.Sprintf("localFees: %v, IsCheckTx: %v", localFees, ctx.IsCheckTx())) + + c, err := CombinedFeeRequirement(globalFees, localFees) + ctx.Logger().Info(fmt.Sprintf("CombinedFeeRequirement: %v, IsCheckTx: %v", c, ctx.IsCheckTx())) + + // Return combined fee requirements + return c, err +} + +// GetGlobalFee returns the global fees for a given fee tx's gas +// (might also return 0denom if globalMinGasPrice is 0) +// sorted in ascending order. +// Note that ParamStoreKeyMinGasPrices type requires coins sorted. +func (mfd FeeDecorator) GetGlobalFee(ctx sdk.Context, feeTx sdk.FeeTx) (sdk.Coins, error) { + var ( + globalMinGasPrices sdk.DecCoins + err error + ) + + if mfd.GlobalMinFeeParamSource.Has(ctx, types.ParamStoreKeyMinGasPrices) { + mfd.GlobalMinFeeParamSource.Get(ctx, types.ParamStoreKeyMinGasPrices, &globalMinGasPrices) + } + // global fee is empty set, set global fee to 0uatom + if len(globalMinGasPrices) == 0 { + globalMinGasPrices, err = mfd.DefaultZeroGlobalFee(ctx) + if err != nil { + return sdk.Coins{}, err + } + } + requiredGlobalFees := make(sdk.Coins, len(globalMinGasPrices)) + // Determine the required fees by multiplying each required minimum gas + // price by the gas limit, where fee = ceil(minGasPrice * gasLimit). + glDec := sdk.NewDec(int64(feeTx.GetGas())) + for i, gp := range globalMinGasPrices { + fee := gp.Amount.Mul(glDec) + requiredGlobalFees[i] = sdk.NewCoin(gp.Denom, fee.Ceil().RoundInt()) + } + + return requiredGlobalFees.Sort(), nil +} + +// DefaultZeroGlobalFee returns a zero coin with the staking module bond denom +func (mfd FeeDecorator) DefaultZeroGlobalFee(ctx sdk.Context) ([]sdk.DecCoin, error) { + bondDenom := mfd.StakingKeeper.BondDenom(ctx) + if bondDenom == "" { + return nil, errors.New("empty staking bond denomination") + } + + return []sdk.DecCoin{sdk.NewDecCoinFromDec(bondDenom, sdk.NewDec(0))}, nil +} + +func (mfd FeeDecorator) ContainsOnlyBypassMinFeeMsgs(ctx sdk.Context, msgs []sdk.Msg) bool { + bypassMsgTypes := mfd.GetBypassMsgTypes(ctx) + ctx.Logger().Info(fmt.Sprintf("BypassMsgs: %v", bypassMsgTypes)) + + for _, msg := range msgs { + ctx.Logger().Info(fmt.Sprintf("TxBypassMsg: %v", sdk.MsgTypeURL(msg))) + + if tmstrings.StringInSlice(sdk.MsgTypeURL(msg), bypassMsgTypes) { + continue + } + return false + } + + return true +} + +func (mfd FeeDecorator) GetBypassMsgTypes(ctx sdk.Context) (res []string) { + if mfd.GlobalMinFeeParamSource.Has(ctx, types.ParamStoreKeyBypassMinFeeMsgTypes) { + mfd.GlobalMinFeeParamSource.Get(ctx, types.ParamStoreKeyBypassMinFeeMsgTypes, &res) + } + + return +} + +func (mfd FeeDecorator) GetMaxTotalBypassMinFeeMsgGasUsage(ctx sdk.Context) (res uint64) { + if mfd.GlobalMinFeeParamSource.Has(ctx, types.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage) { + mfd.GlobalMinFeeParamSource.Get(ctx, types.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage, &res) + } + + return +} + +// GetMinGasPrice returns a nodes's local minimum gas prices +// fees given a gas limit +func GetMinGasPrice(ctx sdk.Context, gasLimit int64) sdk.Coins { + minGasPrices := ctx.MinGasPrices() + // special case: if minGasPrices=[], requiredFees=[] + if minGasPrices.IsZero() { + return sdk.Coins{} + } + + requiredFees := make(sdk.Coins, len(minGasPrices)) + // Determine the required fees by multiplying each required minimum gas + // price by the gas limit, where fee = ceil(minGasPrice * gasLimit). + glDec := sdk.NewDec(gasLimit) + for i, gp := range minGasPrices { + fee := gp.Amount.Mul(glDec) + requiredFees[i] = sdk.NewCoin(gp.Denom, fee.Ceil().RoundInt()) + } + + return requiredFees.Sort() +} diff --git a/x/globalfee/ante/fee_utils.go b/x/globalfee/ante/fee_utils.go index 27c5fb3899..fa132e1d8b 100644 --- a/x/globalfee/ante/fee_utils.go +++ b/x/globalfee/ante/fee_utils.go @@ -1,114 +1,115 @@ package ante -// import ( -// errorsmod "cosmossdk.io/errors" -// sdk "github.com/cosmos/cosmos-sdk/types" -// gaiaerrors "github.com/cosmos/gaia/v11/types/errors" -// ) +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + + gaiaerrors "github.com/cosmos/gaia/v11/types/errors" +) // ContainZeroCoins returns true if the given coins are empty or contain zero coins, // Note that the coins denoms must be validated, see sdk.ValidateDenom -// func ContainZeroCoins(coins sdk.Coins) bool { -// if len(coins) == 0 { -// return true -// } -// for _, coin := range coins { -// if coin.IsZero() { -// return true -// } -// } - -// return false -// } +func ContainZeroCoins(coins sdk.Coins) bool { + if len(coins) == 0 { + return true + } + for _, coin := range coins { + if coin.IsZero() { + return true + } + } + + return false +} // CombinedFeeRequirement returns the global fee and min_gas_price combined and sorted. // Both globalFees and minGasPrices must be valid, but CombinedFeeRequirement // does not validate them, so it may return 0denom. // if globalfee is empty, CombinedFeeRequirement return sdk.Coins{} -// func CombinedFeeRequirement(globalFees, minGasPrices sdk.Coins) (sdk.Coins, error) { -// // global fees should never be empty -// // since it has a default value using the staking module's bond denom -// if len(globalFees) == 0 { -// return sdk.Coins{}, errorsmod.Wrapf(gaiaerrors.ErrNotFound, "global fee cannot be empty") -// } - -// // empty min_gas_price -// if len(minGasPrices) == 0 { -// return globalFees, nil -// } - -// // if min_gas_price denom is in globalfee, and the amount is higher than globalfee, add min_gas_price to allFees -// var allFees sdk.Coins -// for _, fee := range globalFees { -// // min_gas_price denom in global fee -// ok, c := Find(minGasPrices, fee.Denom) -// if ok && c.Amount.GT(fee.Amount) { -// allFees = append(allFees, c) -// } else { -// allFees = append(allFees, fee) -// } -// } - -// return allFees.Sort(), nil -// } - -// // Find replaces the functionality of Coins.Find from SDK v0.46.x -// func Find(coins sdk.Coins, denom string) (bool, sdk.Coin) { -// switch len(coins) { -// case 0: -// return false, sdk.Coin{} - -// case 1: -// coin := coins[0] -// if coin.Denom == denom { -// return true, coin -// } -// return false, sdk.Coin{} - -// default: -// midIdx := len(coins) / 2 // 2:1, 3:1, 4:2 -// coin := coins[midIdx] -// switch { -// case denom < coin.Denom: -// return Find(coins[:midIdx], denom) -// case denom == coin.Denom: -// return true, coin -// default: -// return Find(coins[midIdx+1:], denom) -// } -// } -// } - -// // splitCoinsByDenoms returns the given coins split in two whether -// // their demon is or isn't found in the given denom map. -// func splitCoinsByDenoms(feeCoins sdk.Coins, denomMap map[string]struct{}) (sdk.Coins, sdk.Coins) { -// feeCoinsNonZeroDenom, feeCoinsZeroDenom := sdk.Coins{}, sdk.Coins{} - -// for _, fc := range feeCoins { -// _, found := denomMap[fc.Denom] -// if found { -// feeCoinsZeroDenom = append(feeCoinsZeroDenom, fc) -// } else { -// feeCoinsNonZeroDenom = append(feeCoinsNonZeroDenom, fc) -// } -// } - -// return feeCoinsNonZeroDenom.Sort(), feeCoinsZeroDenom.Sort() -// } - -// // getNonZeroFees returns the given fees nonzero coins -// // and a map storing the zero coins's denoms -// func getNonZeroFees(fees sdk.Coins) (sdk.Coins, map[string]struct{}) { -// requiredFeesNonZero := sdk.Coins{} -// requiredFeesZeroDenom := map[string]struct{}{} - -// for _, gf := range fees { -// if gf.IsZero() { -// requiredFeesZeroDenom[gf.Denom] = struct{}{} -// } else { -// requiredFeesNonZero = append(requiredFeesNonZero, gf) -// } -// } - -// return requiredFeesNonZero.Sort(), requiredFeesZeroDenom -// } +func CombinedFeeRequirement(globalFees, minGasPrices sdk.Coins) (sdk.Coins, error) { + // global fees should never be empty + // since it has a default value using the staking module's bond denom + if len(globalFees) == 0 { + return sdk.Coins{}, errorsmod.Wrapf(gaiaerrors.ErrNotFound, "global fee cannot be empty") + } + + // empty min_gas_price + if len(minGasPrices) == 0 { + return globalFees, nil + } + + // if min_gas_price denom is in globalfee, and the amount is higher than globalfee, add min_gas_price to allFees + var allFees sdk.Coins + for _, fee := range globalFees { + // min_gas_price denom in global fee + ok, c := Find(minGasPrices, fee.Denom) + if ok && c.Amount.GT(fee.Amount) { + allFees = append(allFees, c) + } else { + allFees = append(allFees, fee) + } + } + + return allFees.Sort(), nil +} + +// Find replaces the functionality of Coins.Find from SDK v0.46.x +func Find(coins sdk.Coins, denom string) (bool, sdk.Coin) { + switch len(coins) { + case 0: + return false, sdk.Coin{} + + case 1: + coin := coins[0] + if coin.Denom == denom { + return true, coin + } + return false, sdk.Coin{} + + default: + midIdx := len(coins) / 2 // 2:1, 3:1, 4:2 + coin := coins[midIdx] + switch { + case denom < coin.Denom: + return Find(coins[:midIdx], denom) + case denom == coin.Denom: + return true, coin + default: + return Find(coins[midIdx+1:], denom) + } + } +} + +// splitCoinsByDenoms returns the given coins split in two whether +// their demon is or isn't found in the given denom map. +func splitCoinsByDenoms(feeCoins sdk.Coins, denomMap map[string]struct{}) (sdk.Coins, sdk.Coins) { + feeCoinsNonZeroDenom, feeCoinsZeroDenom := sdk.Coins{}, sdk.Coins{} + + for _, fc := range feeCoins { + _, found := denomMap[fc.Denom] + if found { + feeCoinsZeroDenom = append(feeCoinsZeroDenom, fc) + } else { + feeCoinsNonZeroDenom = append(feeCoinsNonZeroDenom, fc) + } + } + + return feeCoinsNonZeroDenom.Sort(), feeCoinsZeroDenom.Sort() +} + +// getNonZeroFees returns the given fees nonzero coins +// and a map storing the zero coins's denoms +func getNonZeroFees(fees sdk.Coins) (sdk.Coins, map[string]struct{}) { + requiredFeesNonZero := sdk.Coins{} + requiredFeesZeroDenom := map[string]struct{}{} + + for _, gf := range fees { + if gf.IsZero() { + requiredFeesZeroDenom[gf.Denom] = struct{}{} + } else { + requiredFeesNonZero = append(requiredFeesNonZero, gf) + } + } + + return requiredFeesNonZero.Sort(), requiredFeesZeroDenom +} diff --git a/x/globalfee/ante/fee_utils_test.go b/x/globalfee/ante/fee_utils_test.go index 3b887003cb..8378e46713 100644 --- a/x/globalfee/ante/fee_utils_test.go +++ b/x/globalfee/ante/fee_utils_test.go @@ -1,299 +1,298 @@ package ante -// -// import ( -// "testing" -// -// sdk "github.com/cosmos/cosmos-sdk/types" -// "github.com/stretchr/testify/require" -//) -// -// func TestContainZeroCoins(t *testing.T) { -// zeroCoin1 := sdk.NewCoin("photon", sdk.ZeroInt()) -// zeroCoin2 := sdk.NewCoin("stake", sdk.ZeroInt()) -// coin1 := sdk.NewCoin("photon", sdk.NewInt(1)) -// coin2 := sdk.NewCoin("stake", sdk.NewInt(2)) -// coin3 := sdk.NewCoin("quark", sdk.NewInt(3)) -// // coins must be valid !!! -// coinsEmpty := sdk.Coins{} -// coinsNonEmpty := sdk.Coins{coin1, coin2} -// coinsCointainZero := sdk.Coins{coin1, zeroCoin2} -// coinsCointainTwoZero := sdk.Coins{zeroCoin1, zeroCoin2, coin3} -// coinsAllZero := sdk.Coins{zeroCoin1, zeroCoin2} -// -// tests := []struct { -// c sdk.Coins -// ok bool -// }{ -// { -// coinsEmpty, -// true, -// }, -// { -// coinsNonEmpty, -// false, -// }, -// { -// coinsCointainZero, -// true, -// }, -// { -// coinsCointainTwoZero, -// true, -// }, -// { -// coinsAllZero, -// true, -// }, -// } -// -// for _, test := range tests { -// ok := ContainZeroCoins(test.c) -// require.Equal(t, test.ok, ok) -// } -//} -// -//// Note that in a real Gaia deployment all zero coins can be removed from minGasPrice. -//// This sanitizing happens when the minGasPrice is set into the context. -//// (see baseapp.SetMinGasPrices in gaia/cmd/root.go line 221) -// func TestCombinedFeeRequirement(t *testing.T) { -// zeroCoin1 := sdk.NewCoin("photon", sdk.ZeroInt()) -// zeroCoin2 := sdk.NewCoin("stake", sdk.ZeroInt()) -// zeroCoin3 := sdk.NewCoin("quark", sdk.ZeroInt()) -// coin1 := sdk.NewCoin("photon", sdk.NewInt(1)) -// coin2 := sdk.NewCoin("stake", sdk.NewInt(2)) -// coin1High := sdk.NewCoin("photon", sdk.NewInt(10)) -// coin2High := sdk.NewCoin("stake", sdk.NewInt(20)) -// coinNewDenom1 := sdk.NewCoin("Newphoton", sdk.NewInt(1)) -// coinNewDenom2 := sdk.NewCoin("Newstake", sdk.NewInt(1)) -// // coins must be valid !!! and sorted!!! -// coinsEmpty := sdk.Coins{} -// coinsNonEmpty := sdk.Coins{coin1, coin2}.Sort() -// coinsNonEmptyHigh := sdk.Coins{coin1High, coin2High}.Sort() -// coinsNonEmptyOneHigh := sdk.Coins{coin1High, coin2}.Sort() -// coinsNewDenom := sdk.Coins{coinNewDenom1, coinNewDenom2}.Sort() -// coinsNewOldDenom := sdk.Coins{coin1, coinNewDenom1}.Sort() -// coinsNewOldDenomHigh := sdk.Coins{coin1High, coinNewDenom1}.Sort() -// coinsCointainZero := sdk.Coins{coin1, zeroCoin2}.Sort() -// coinsCointainZeroNewDenom := sdk.Coins{coin1, zeroCoin3}.Sort() -// coinsAllZero := sdk.Coins{zeroCoin1, zeroCoin2}.Sort() -// tests := map[string]struct { -// cGlobal sdk.Coins -// c sdk.Coins -// combined sdk.Coins -// }{ -// "global fee invalid, return combined fee empty and non-nil error": { -// cGlobal: coinsEmpty, -// c: coinsEmpty, -// combined: coinsEmpty, -// }, -// "global fee nonempty, min fee empty, combined fee = global fee": { -// cGlobal: coinsNonEmpty, -// c: coinsNonEmpty, -// combined: coinsNonEmpty, -// }, -// "global fee and min fee have overlapping denom, min fees amounts are all higher": { -// cGlobal: coinsNonEmpty, -// c: coinsNonEmptyHigh, -// combined: coinsNonEmptyHigh, -// }, -// "global fee and min fee have overlapping denom, one of min fees amounts is higher": { -// cGlobal: coinsNonEmpty, -// c: coinsNonEmptyOneHigh, -// combined: coinsNonEmptyOneHigh, -// }, -// "global fee and min fee have no overlapping denom, combined fee = global fee": { -// cGlobal: coinsNonEmpty, -// c: coinsNewDenom, -// combined: coinsNonEmpty, -// }, -// "global fees and min fees have partial overlapping denom, min fee amount <= global fee amount, combined fees = global fees": { -// cGlobal: coinsNonEmpty, -// c: coinsNewOldDenom, -// combined: coinsNonEmpty, -// }, -// "global fees and min fees have partial overlapping denom, one min fee amount > global fee amount, combined fee = overlapping highest": { -// cGlobal: coinsNonEmpty, -// c: coinsNewOldDenomHigh, -// combined: sdk.Coins{coin1High, coin2}, -// }, -// "global fees have zero fees, min fees have overlapping non-zero fees, combined fees = overlapping highest": { -// cGlobal: coinsCointainZero, -// c: coinsNonEmpty, -// combined: sdk.Coins{coin1, coin2}, -// }, -// "global fees have zero fees, min fees have overlapping zero fees": { -// cGlobal: coinsCointainZero, -// c: coinsCointainZero, -// combined: coinsCointainZero, -// }, -// "global fees have zero fees, min fees have non-overlapping zero fees": { -// cGlobal: coinsCointainZero, -// c: coinsCointainZeroNewDenom, -// combined: coinsCointainZero, -// }, -// "global fees are all zero fees, min fees have overlapping zero fees": { -// cGlobal: coinsAllZero, -// c: coinsAllZero, -// combined: coinsAllZero, -// }, -// "global fees are all zero fees, min fees have overlapping non-zero fees, combined fee = overlapping highest": { -// cGlobal: coinsAllZero, -// c: coinsCointainZeroNewDenom, -// combined: sdk.Coins{coin1, zeroCoin2}, -// }, -// "global fees are all zero fees, fees have one overlapping non-zero fee": { -// cGlobal: coinsAllZero, -// c: coinsCointainZero, -// combined: coinsCointainZero, -// }, -// } -// -// for name, test := range tests { -// t.Run(name, func(t *testing.T) { -// allFees, err := CombinedFeeRequirement(test.cGlobal, test.c) -// if len(test.cGlobal) == 0 { -// require.Error(t, err) -// } else { -// require.NoError(t, err) -// } -// require.Equal(t, test.combined, allFees) -// }) -// } -//} -// -// func TestSplitCoinsByDenoms(t *testing.T) { -// zeroGlobalFeesDenom0 := map[string]struct{}{} -// zeroGlobalFeesDenom1 := map[string]struct{}{ -// "uatom": {}, -// "photon": {}, -// } -// zeroGlobalFeesDenom2 := map[string]struct{}{ -// "uatom": {}, -// } -// zeroGlobalFeesDenom3 := map[string]struct{}{ -// "stake": {}, -// } -// -// photon := sdk.NewCoin("photon", sdk.OneInt()) -// uatom := sdk.NewCoin("uatom", sdk.OneInt()) -// feeCoins := sdk.NewCoins(photon, uatom) -// -// tests := map[string]struct { -// feeCoins sdk.Coins -// zeroGlobalFeesDenom map[string]struct{} -// expectedNonZeroCoins sdk.Coins -// expectedZeroCoins sdk.Coins -// }{ -// "no zero coins in global fees": { -// feeCoins: feeCoins, -// zeroGlobalFeesDenom: zeroGlobalFeesDenom0, -// expectedNonZeroCoins: feeCoins, -// expectedZeroCoins: sdk.Coins{}, -// }, -// "no split of fee coins": { -// feeCoins: feeCoins, -// zeroGlobalFeesDenom: zeroGlobalFeesDenom3, -// expectedNonZeroCoins: feeCoins, -// expectedZeroCoins: sdk.Coins{}, -// }, -// "split the fee coins": { -// feeCoins: feeCoins, -// zeroGlobalFeesDenom: zeroGlobalFeesDenom2, -// expectedNonZeroCoins: sdk.NewCoins(photon), -// expectedZeroCoins: sdk.NewCoins(uatom), -// }, -// "remove all of the fee coins": { -// feeCoins: feeCoins, -// zeroGlobalFeesDenom: zeroGlobalFeesDenom1, -// expectedNonZeroCoins: sdk.Coins{}, -// expectedZeroCoins: feeCoins, -// }, -// "fee coins are empty": { -// feeCoins: sdk.Coins{}, -// zeroGlobalFeesDenom: zeroGlobalFeesDenom1, -// expectedNonZeroCoins: sdk.Coins{}, -// expectedZeroCoins: sdk.Coins{}, -// }, -// } -// -// for name, test := range tests { -// t.Run(name, func(t *testing.T) { -// feeCoinsNoZeroDenoms, feeCoinsZeroDenoms := splitCoinsByDenoms(test.feeCoins, test.zeroGlobalFeesDenom) -// require.Equal(t, test.expectedNonZeroCoins, feeCoinsNoZeroDenoms) -// require.Equal(t, test.expectedZeroCoins, feeCoinsZeroDenoms) -// }) -// } -//} -// -// func TestSplitGlobalFees(t *testing.T) { -// photon0 := sdk.NewCoin("photon", sdk.ZeroInt()) -// uatom0 := sdk.NewCoin("uatom", sdk.ZeroInt()) -// photon1 := sdk.NewCoin("photon", sdk.OneInt()) -// uatom1 := sdk.NewCoin("uatom", sdk.OneInt()) -// -// globalFeesEmpty := sdk.Coins{} -// globalFees := sdk.Coins{photon1, uatom1}.Sort() -// globalFeesZeroCoins := sdk.Coins{photon0, uatom0}.Sort() -// globalFeesMix := sdk.Coins{photon0, uatom1}.Sort() -// -// tests := map[string]struct { -// globalfees sdk.Coins -// zeroGlobalFeesDenom map[string]struct{} -// globalfeesNonZero sdk.Coins -// }{ -// "empty global fees": { -// globalfees: globalFeesEmpty, -// zeroGlobalFeesDenom: map[string]struct{}{}, -// globalfeesNonZero: sdk.Coins{}, -// }, -// "nonzero coins global fees": { -// globalfees: globalFees, -// zeroGlobalFeesDenom: map[string]struct{}{}, -// globalfeesNonZero: globalFees, -// }, -// "zero coins global fees": { -// globalfees: globalFeesZeroCoins, -// zeroGlobalFeesDenom: map[string]struct{}{ -// "photon": {}, -// "uatom": {}, -// }, -// globalfeesNonZero: sdk.Coins{}, -// }, -// "mix zero, nonzero coins global fees": { -// globalfees: globalFeesMix, -// zeroGlobalFeesDenom: map[string]struct{}{ -// "photon": {}, -// }, -// globalfeesNonZero: sdk.NewCoins(uatom1), -// }, -// } -// -// for name, test := range tests { -// t.Run(name, func(t *testing.T) { -// nonZeroCoins, zeroCoinsMap := getNonZeroFees(test.globalfees) -// require.True(t, nonZeroCoins.IsEqual(test.globalfeesNonZero)) -// require.True(t, equalMap(zeroCoinsMap, test.zeroGlobalFeesDenom)) -// }) -// } -//} -// -// func equalMap(a, b map[string]struct{}) bool { -// if len(a) != len(b) { -// return false -// } -// if len(a) == 0 && len(b) == 0 { -// return true -// } -// if len(a) == 0 { -// return false -// } -// -// for k := range a { -// if _, ok := b[k]; !ok { -// return false -// } -// } -// -// return true -//} +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" +) + +func TestContainZeroCoins(t *testing.T) { + zeroCoin1 := sdk.NewCoin("photon", sdk.ZeroInt()) + zeroCoin2 := sdk.NewCoin("stake", sdk.ZeroInt()) + coin1 := sdk.NewCoin("photon", sdk.NewInt(1)) + coin2 := sdk.NewCoin("stake", sdk.NewInt(2)) + coin3 := sdk.NewCoin("quark", sdk.NewInt(3)) + // coins must be valid !!! + coinsEmpty := sdk.Coins{} + coinsNonEmpty := sdk.Coins{coin1, coin2} + coinsCointainZero := sdk.Coins{coin1, zeroCoin2} + coinsCointainTwoZero := sdk.Coins{zeroCoin1, zeroCoin2, coin3} + coinsAllZero := sdk.Coins{zeroCoin1, zeroCoin2} + + tests := []struct { + c sdk.Coins + ok bool + }{ + { + coinsEmpty, + true, + }, + { + coinsNonEmpty, + false, + }, + { + coinsCointainZero, + true, + }, + { + coinsCointainTwoZero, + true, + }, + { + coinsAllZero, + true, + }, + } + + for _, test := range tests { + ok := ContainZeroCoins(test.c) + require.Equal(t, test.ok, ok) + } +} + +// Note that in a real Gaia deployment all zero coins can be removed from minGasPrice. +// This sanitizing happens when the minGasPrice is set into the context. +// (see baseapp.SetMinGasPrices in gaia/cmd/root.go line 221) +func TestCombinedFeeRequirement(t *testing.T) { + zeroCoin1 := sdk.NewCoin("photon", sdk.ZeroInt()) + zeroCoin2 := sdk.NewCoin("stake", sdk.ZeroInt()) + zeroCoin3 := sdk.NewCoin("quark", sdk.ZeroInt()) + coin1 := sdk.NewCoin("photon", sdk.NewInt(1)) + coin2 := sdk.NewCoin("stake", sdk.NewInt(2)) + coin1High := sdk.NewCoin("photon", sdk.NewInt(10)) + coin2High := sdk.NewCoin("stake", sdk.NewInt(20)) + coinNewDenom1 := sdk.NewCoin("Newphoton", sdk.NewInt(1)) + coinNewDenom2 := sdk.NewCoin("Newstake", sdk.NewInt(1)) + // coins must be valid !!! and sorted!!! + coinsEmpty := sdk.Coins{} + coinsNonEmpty := sdk.Coins{coin1, coin2}.Sort() + coinsNonEmptyHigh := sdk.Coins{coin1High, coin2High}.Sort() + coinsNonEmptyOneHigh := sdk.Coins{coin1High, coin2}.Sort() + coinsNewDenom := sdk.Coins{coinNewDenom1, coinNewDenom2}.Sort() + coinsNewOldDenom := sdk.Coins{coin1, coinNewDenom1}.Sort() + coinsNewOldDenomHigh := sdk.Coins{coin1High, coinNewDenom1}.Sort() + coinsCointainZero := sdk.Coins{coin1, zeroCoin2}.Sort() + coinsCointainZeroNewDenom := sdk.Coins{coin1, zeroCoin3}.Sort() + coinsAllZero := sdk.Coins{zeroCoin1, zeroCoin2}.Sort() + tests := map[string]struct { + cGlobal sdk.Coins + c sdk.Coins + combined sdk.Coins + }{ + "global fee invalid, return combined fee empty and non-nil error": { + cGlobal: coinsEmpty, + c: coinsEmpty, + combined: coinsEmpty, + }, + "global fee nonempty, min fee empty, combined fee = global fee": { + cGlobal: coinsNonEmpty, + c: coinsNonEmpty, + combined: coinsNonEmpty, + }, + "global fee and min fee have overlapping denom, min fees amounts are all higher": { + cGlobal: coinsNonEmpty, + c: coinsNonEmptyHigh, + combined: coinsNonEmptyHigh, + }, + "global fee and min fee have overlapping denom, one of min fees amounts is higher": { + cGlobal: coinsNonEmpty, + c: coinsNonEmptyOneHigh, + combined: coinsNonEmptyOneHigh, + }, + "global fee and min fee have no overlapping denom, combined fee = global fee": { + cGlobal: coinsNonEmpty, + c: coinsNewDenom, + combined: coinsNonEmpty, + }, + "global fees and min fees have partial overlapping denom, min fee amount <= global fee amount, combined fees = global fees": { + cGlobal: coinsNonEmpty, + c: coinsNewOldDenom, + combined: coinsNonEmpty, + }, + "global fees and min fees have partial overlapping denom, one min fee amount > global fee amount, combined fee = overlapping highest": { + cGlobal: coinsNonEmpty, + c: coinsNewOldDenomHigh, + combined: sdk.Coins{coin1High, coin2}, + }, + "global fees have zero fees, min fees have overlapping non-zero fees, combined fees = overlapping highest": { + cGlobal: coinsCointainZero, + c: coinsNonEmpty, + combined: sdk.Coins{coin1, coin2}, + }, + "global fees have zero fees, min fees have overlapping zero fees": { + cGlobal: coinsCointainZero, + c: coinsCointainZero, + combined: coinsCointainZero, + }, + "global fees have zero fees, min fees have non-overlapping zero fees": { + cGlobal: coinsCointainZero, + c: coinsCointainZeroNewDenom, + combined: coinsCointainZero, + }, + "global fees are all zero fees, min fees have overlapping zero fees": { + cGlobal: coinsAllZero, + c: coinsAllZero, + combined: coinsAllZero, + }, + "global fees are all zero fees, min fees have overlapping non-zero fees, combined fee = overlapping highest": { + cGlobal: coinsAllZero, + c: coinsCointainZeroNewDenom, + combined: sdk.Coins{coin1, zeroCoin2}, + }, + "global fees are all zero fees, fees have one overlapping non-zero fee": { + cGlobal: coinsAllZero, + c: coinsCointainZero, + combined: coinsCointainZero, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + allFees, err := CombinedFeeRequirement(test.cGlobal, test.c) + if len(test.cGlobal) == 0 { + require.Error(t, err) + } else { + require.NoError(t, err) + } + require.Equal(t, test.combined, allFees) + }) + } +} + +func TestSplitCoinsByDenoms(t *testing.T) { + zeroGlobalFeesDenom0 := map[string]struct{}{} + zeroGlobalFeesDenom1 := map[string]struct{}{ + "uatom": {}, + "photon": {}, + } + zeroGlobalFeesDenom2 := map[string]struct{}{ + "uatom": {}, + } + zeroGlobalFeesDenom3 := map[string]struct{}{ + "stake": {}, + } + + photon := sdk.NewCoin("photon", sdk.OneInt()) + uatom := sdk.NewCoin("uatom", sdk.OneInt()) + feeCoins := sdk.NewCoins(photon, uatom) + + tests := map[string]struct { + feeCoins sdk.Coins + zeroGlobalFeesDenom map[string]struct{} + expectedNonZeroCoins sdk.Coins + expectedZeroCoins sdk.Coins + }{ + "no zero coins in global fees": { + feeCoins: feeCoins, + zeroGlobalFeesDenom: zeroGlobalFeesDenom0, + expectedNonZeroCoins: feeCoins, + expectedZeroCoins: sdk.Coins{}, + }, + "no split of fee coins": { + feeCoins: feeCoins, + zeroGlobalFeesDenom: zeroGlobalFeesDenom3, + expectedNonZeroCoins: feeCoins, + expectedZeroCoins: sdk.Coins{}, + }, + "split the fee coins": { + feeCoins: feeCoins, + zeroGlobalFeesDenom: zeroGlobalFeesDenom2, + expectedNonZeroCoins: sdk.NewCoins(photon), + expectedZeroCoins: sdk.NewCoins(uatom), + }, + "remove all of the fee coins": { + feeCoins: feeCoins, + zeroGlobalFeesDenom: zeroGlobalFeesDenom1, + expectedNonZeroCoins: sdk.Coins{}, + expectedZeroCoins: feeCoins, + }, + "fee coins are empty": { + feeCoins: sdk.Coins{}, + zeroGlobalFeesDenom: zeroGlobalFeesDenom1, + expectedNonZeroCoins: sdk.Coins{}, + expectedZeroCoins: sdk.Coins{}, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + feeCoinsNoZeroDenoms, feeCoinsZeroDenoms := splitCoinsByDenoms(test.feeCoins, test.zeroGlobalFeesDenom) + require.Equal(t, test.expectedNonZeroCoins, feeCoinsNoZeroDenoms) + require.Equal(t, test.expectedZeroCoins, feeCoinsZeroDenoms) + }) + } +} + +func TestSplitGlobalFees(t *testing.T) { + photon0 := sdk.NewCoin("photon", sdk.ZeroInt()) + uatom0 := sdk.NewCoin("uatom", sdk.ZeroInt()) + photon1 := sdk.NewCoin("photon", sdk.OneInt()) + uatom1 := sdk.NewCoin("uatom", sdk.OneInt()) + + globalFeesEmpty := sdk.Coins{} + globalFees := sdk.Coins{photon1, uatom1}.Sort() + globalFeesZeroCoins := sdk.Coins{photon0, uatom0}.Sort() + globalFeesMix := sdk.Coins{photon0, uatom1}.Sort() + + tests := map[string]struct { + globalfees sdk.Coins + zeroGlobalFeesDenom map[string]struct{} + globalfeesNonZero sdk.Coins + }{ + "empty global fees": { + globalfees: globalFeesEmpty, + zeroGlobalFeesDenom: map[string]struct{}{}, + globalfeesNonZero: sdk.Coins{}, + }, + "nonzero coins global fees": { + globalfees: globalFees, + zeroGlobalFeesDenom: map[string]struct{}{}, + globalfeesNonZero: globalFees, + }, + "zero coins global fees": { + globalfees: globalFeesZeroCoins, + zeroGlobalFeesDenom: map[string]struct{}{ + "photon": {}, + "uatom": {}, + }, + globalfeesNonZero: sdk.Coins{}, + }, + "mix zero, nonzero coins global fees": { + globalfees: globalFeesMix, + zeroGlobalFeesDenom: map[string]struct{}{ + "photon": {}, + }, + globalfeesNonZero: sdk.NewCoins(uatom1), + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + nonZeroCoins, zeroCoinsMap := getNonZeroFees(test.globalfees) + require.True(t, nonZeroCoins.IsEqual(test.globalfeesNonZero)) + require.True(t, equalMap(zeroCoinsMap, test.zeroGlobalFeesDenom)) + }) + } +} + +func equalMap(a, b map[string]struct{}) bool { + if len(a) != len(b) { + return false + } + if len(a) == 0 && len(b) == 0 { + return true + } + if len(a) == 0 { + return false + } + + for k := range a { + if _, ok := b[k]; !ok { + return false + } + } + + return true +} diff --git a/x/globalfee/client/cli/query.go b/x/globalfee/client/cli/query.go index ebce304ad0..b3b2056fc3 100644 --- a/x/globalfee/client/cli/query.go +++ b/x/globalfee/client/cli/query.go @@ -1,47 +1,47 @@ package cli -// import ( -// "github.com/cosmos/cosmos-sdk/client" -// "github.com/cosmos/cosmos-sdk/client/flags" -// "github.com/spf13/cobra" +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" -// "github.com/cosmos/gaia/v11/x/globalfee/types" -// ) + "github.com/cosmos/gaia/v11/x/globalfee/types" +) -// func GetQueryCmd() *cobra.Command { -// queryCmd := &cobra.Command{ -// Use: types.ModuleName, -// Short: "Querying commands for the global fee module", -// DisableFlagParsing: true, -// SuggestionsMinimumDistance: 2, -// RunE: client.ValidateCmd, -// } -// queryCmd.AddCommand( -// GetCmdShowGlobalFeeParams(), -// ) -// return queryCmd -// } +func GetQueryCmd() *cobra.Command { + queryCmd := &cobra.Command{ + Use: types.ModuleName, + Short: "Querying commands for the global fee module", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + queryCmd.AddCommand( + GetCmdShowGlobalFeeParams(), + ) + return queryCmd +} -// func GetCmdShowGlobalFeeParams() *cobra.Command { -// cmd := &cobra.Command{ -// Use: "params", -// Short: "Show globalfee params", -// Long: "Show globalfee requirement: minimum_gas_prices, bypass_min_fee_msg_types, max_total_bypass_minFee_msg_gas_usage", -// Args: cobra.ExactArgs(0), -// RunE: func(cmd *cobra.Command, args []string) error { -// clientCtx, err := client.GetClientQueryContext(cmd) -// if err != nil { -// return err -// } +func GetCmdShowGlobalFeeParams() *cobra.Command { + cmd := &cobra.Command{ + Use: "params", + Short: "Show globalfee params", + Long: "Show globalfee requirement: minimum_gas_prices, bypass_min_fee_msg_types, max_total_bypass_minFee_msg_gas_usage", + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } -// queryClient := types.NewQueryClient(clientCtx) -// res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{}) -// if err != nil { -// return err -// } -// return clientCtx.PrintProto(&res.Params) -// }, -// } -// flags.AddQueryFlagsToCmd(cmd) -// return cmd -// } + queryClient := types.NewQueryClient(clientCtx) + res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{}) + if err != nil { + return err + } + return clientCtx.PrintProto(&res.Params) + }, + } + flags.AddQueryFlagsToCmd(cmd) + return cmd +} diff --git a/x/globalfee/keeper/migrations.go b/x/globalfee/keeper/migrations.go index 3f2e40e12d..64f08edd3b 100644 --- a/x/globalfee/keeper/migrations.go +++ b/x/globalfee/keeper/migrations.go @@ -1,23 +1,23 @@ package keeper -// import ( -// sdk "github.com/cosmos/cosmos-sdk/types" -// paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" -// v2 "github.com/cosmos/gaia/v11/x/globalfee/migrations/v2" -// ) + v2 "github.com/cosmos/gaia/v11/x/globalfee/migrations/v2" +) -// // Migrator is a struct for handling in-place store migrations. -// type Migrator struct { -// globalfeeSubspace paramtypes.Subspace -// } +// Migrator is a struct for handling in-place store migrations. +type Migrator struct { + globalfeeSubspace paramtypes.Subspace +} -// // NewMigrator returns a new Migrator. -// func NewMigrator(globalfeeSubspace paramtypes.Subspace) Migrator { -// return Migrator{globalfeeSubspace: globalfeeSubspace} -// } +// NewMigrator returns a new Migrator. +func NewMigrator(globalfeeSubspace paramtypes.Subspace) Migrator { + return Migrator{globalfeeSubspace: globalfeeSubspace} +} -// // Migrate1to2 migrates from version 1 to 2. -// func (m Migrator) Migrate1to2(ctx sdk.Context) error { -// return v2.MigrateStore(ctx, m.globalfeeSubspace) -// } +// Migrate1to2 migrates from version 1 to 2. +func (m Migrator) Migrate1to2(ctx sdk.Context) error { + return v2.MigrateStore(ctx, m.globalfeeSubspace) +} diff --git a/x/globalfee/migrations/v2/migration.go b/x/globalfee/migrations/v2/migration.go index a49cbe5b63..176ff59d6f 100644 --- a/x/globalfee/migrations/v2/migration.go +++ b/x/globalfee/migrations/v2/migration.go @@ -1,5 +1,12 @@ package v2 +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + + "github.com/cosmos/gaia/v11/x/globalfee/types" +) + // MigrateStore performs in-place params migrations of // BypassMinFeeMsgTypes and MaxTotalBypassMinFeeMsgGasUsage // from app.toml to globalfee params. @@ -11,21 +18,21 @@ package v2 // "/ibc.core.channel.v1.MsgTimeout", // "/ibc.core.channel.v1.MsgTimeoutOnClose"] as default and // add MaxTotalBypassMinFeeMsgGasUsage that is set 1_000_000 as default. -// func MigrateStore(ctx sdk.Context, globalfeeSubspace paramtypes.Subspace) error { -// var oldGlobalMinGasPrices sdk.DecCoins -// globalfeeSubspace.Get(ctx, types.ParamStoreKeyMinGasPrices, &oldGlobalMinGasPrices) -// defaultParams := types.DefaultParams() -// params := types.Params{ -// MinimumGasPrices: oldGlobalMinGasPrices, -// BypassMinFeeMsgTypes: defaultParams.BypassMinFeeMsgTypes, -// MaxTotalBypassMinFeeMsgGasUsage: defaultParams.MaxTotalBypassMinFeeMsgGasUsage, -// } +func MigrateStore(ctx sdk.Context, globalfeeSubspace paramtypes.Subspace) error { + var oldGlobalMinGasPrices sdk.DecCoins + globalfeeSubspace.Get(ctx, types.ParamStoreKeyMinGasPrices, &oldGlobalMinGasPrices) + defaultParams := types.DefaultParams() + params := types.Params{ + MinimumGasPrices: oldGlobalMinGasPrices, + BypassMinFeeMsgTypes: defaultParams.BypassMinFeeMsgTypes, + MaxTotalBypassMinFeeMsgGasUsage: defaultParams.MaxTotalBypassMinFeeMsgGasUsage, + } -// if !globalfeeSubspace.HasKeyTable() { -// globalfeeSubspace = globalfeeSubspace.WithKeyTable(types.ParamKeyTable()) -// } + if !globalfeeSubspace.HasKeyTable() { + globalfeeSubspace = globalfeeSubspace.WithKeyTable(types.ParamKeyTable()) + } -// globalfeeSubspace.SetParamSet(ctx, ¶ms) + globalfeeSubspace.SetParamSet(ctx, ¶ms) -// return nil -// } + return nil +} diff --git a/x/globalfee/migrations/v2/v2_test/migration_test.go b/x/globalfee/migrations/v2/v2_test/migration_test.go index b8f257906c..7b6e5a2425 100644 --- a/x/globalfee/migrations/v2/v2_test/migration_test.go +++ b/x/globalfee/migrations/v2/v2_test/migration_test.go @@ -1,107 +1,108 @@ package v2_test -// import ( -// "testing" - -// "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" -// v2 "github.com/cosmos/gaia/v11/x/globalfee/migrations/v2" -// globalfeetypes "github.com/cosmos/gaia/v11/x/globalfee/types" -// "github.com/stretchr/testify/require" -// "github.com/tendermint/tendermint/libs/log" -// tmproto "github.com/tendermint/tendermint/proto/tendermint/types" -// tmdb "github.com/tendermint/tm-db" -// ) - -// func TestMigrateStore(t *testing.T) { -// db := tmdb.NewMemDB() -// stateStore := store.NewCommitMultiStore(db) - -// storeKey := sdk.NewKVStoreKey(paramtypes.StoreKey) -// memStoreKey := storetypes.NewMemoryStoreKey("mem_key") - -// stateStore.MountStoreWithDB(storeKey, sdk.StoreTypeIAVL, db) -// stateStore.MountStoreWithDB(memStoreKey, sdk.StoreTypeMemory, nil) -// require.NoError(t, stateStore.LoadLatestVersion()) - -// registry := codectypes.NewInterfaceRegistry() -// cdc := codec.NewProtoCodec(registry) -// ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) - -// require.NoError(t, stateStore.LoadLatestVersion()) - -// // Create new empty subspace -// newSubspace := paramtypes.NewSubspace(cdc, -// codec.NewLegacyAmino(), -// storeKey, -// memStoreKey, -// paramtypes.ModuleName, -// ) - -// // register the subspace with the v11 paramKeyTable -// newSubspace = newSubspace.WithKeyTable(globalfeetypes.ParamKeyTable()) - -// // check MinGasPrices isn't set -// _, ok := getMinGasPrice(newSubspace, ctx) -// require.Equal(t, ok, false) - -// // set a minGasPrice different that default value -// minGasPrices := sdk.NewDecCoins(sdk.NewDecCoin("uatom", sdk.OneInt())) -// newSubspace.Set(ctx, globalfeetypes.ParamStoreKeyMinGasPrices, minGasPrices) -// require.False(t, minGasPrices.IsEqual(globalfeetypes.DefaultMinGasPrices)) - -// // check that the new parameters aren't set -// _, ok = getBypassMsgTypes(newSubspace, ctx) -// require.Equal(t, ok, false) -// _, ok = getMaxTotalBypassMinFeeMsgGasUsage(newSubspace, ctx) -// require.Equal(t, ok, false) - -// // run global fee migration -// err := v2.MigrateStore(ctx, newSubspace) -// require.NoError(t, err) - -// newMinGasPrices, _ := getMinGasPrice(newSubspace, ctx) -// bypassMsgTypes, _ := getBypassMsgTypes(newSubspace, ctx) -// maxGas, _ := getMaxTotalBypassMinFeeMsgGasUsage(newSubspace, ctx) - -// require.Equal(t, bypassMsgTypes, globalfeetypes.DefaultBypassMinFeeMsgTypes) -// require.Equal(t, maxGas, globalfeetypes.DefaultmaxTotalBypassMinFeeMsgGasUsage) -// require.Equal(t, minGasPrices, newMinGasPrices) -// } - -// func getBypassMsgTypes(globalfeeSubspace paramtypes.Subspace, ctx sdk.Context) ([]string, bool) { -// bypassMsgs := []string{} -// if globalfeeSubspace.Has(ctx, globalfeetypes.ParamStoreKeyBypassMinFeeMsgTypes) { -// globalfeeSubspace.Get(ctx, globalfeetypes.ParamStoreKeyBypassMinFeeMsgTypes, &bypassMsgs) -// } else { -// return bypassMsgs, false -// } - -// return bypassMsgs, true -// } - -// func getMaxTotalBypassMinFeeMsgGasUsage(globalfeeSubspace paramtypes.Subspace, ctx sdk.Context) (uint64, bool) { -// var maxTotalBypassMinFeeMsgGasUsage uint64 -// if globalfeeSubspace.Has(ctx, globalfeetypes.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage) { -// globalfeeSubspace.Get(ctx, globalfeetypes.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage, &maxTotalBypassMinFeeMsgGasUsage) -// } else { -// return maxTotalBypassMinFeeMsgGasUsage, false -// } - -// return maxTotalBypassMinFeeMsgGasUsage, true -// } - -// func getMinGasPrice(globalfeeSubspace paramtypes.Subspace, ctx sdk.Context) (sdk.DecCoins, bool) { -// var globalMinGasPrices sdk.DecCoins -// if globalfeeSubspace.Has(ctx, globalfeetypes.ParamStoreKeyMinGasPrices) { -// globalfeeSubspace.Get(ctx, globalfeetypes.ParamStoreKeyMinGasPrices, &globalMinGasPrices) -// } else { -// return globalMinGasPrices, false -// } - -// return globalMinGasPrices, true -// } +import ( + "testing" + + 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/v11/x/globalfee/migrations/v2" + globalfeetypes "github.com/cosmos/gaia/v11/x/globalfee/types" +) + +func TestMigrateStore(t *testing.T) { + db := cmdb.NewMemDB() + stateStore := store.NewCommitMultiStore(db) + + storeKey := sdk.NewKVStoreKey(paramtypes.StoreKey) + memStoreKey := storetypes.NewMemoryStoreKey("mem_key") + + stateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, db) + stateStore.MountStoreWithDB(memStoreKey, storetypes.StoreTypeMemory, nil) + require.NoError(t, stateStore.LoadLatestVersion()) + + registry := codectypes.NewInterfaceRegistry() + cdc := codec.NewProtoCodec(registry) + ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) + + require.NoError(t, stateStore.LoadLatestVersion()) + + // Create new empty subspace + newSubspace := paramtypes.NewSubspace(cdc, + codec.NewLegacyAmino(), + storeKey, + memStoreKey, + paramtypes.ModuleName, + ) + + // register the subspace with the v11 paramKeyTable + newSubspace = newSubspace.WithKeyTable(globalfeetypes.ParamKeyTable()) + + // check MinGasPrices isn't set + _, ok := getMinGasPrice(newSubspace, ctx) + require.Equal(t, ok, false) + + // set a minGasPrice different that default value + minGasPrices := sdk.NewDecCoins(sdk.NewDecCoin("uatom", sdk.OneInt())) + newSubspace.Set(ctx, globalfeetypes.ParamStoreKeyMinGasPrices, minGasPrices) + require.False(t, minGasPrices.IsEqual(globalfeetypes.DefaultMinGasPrices)) + + // check that the new parameters aren't set + _, ok = getBypassMsgTypes(newSubspace, ctx) + require.Equal(t, ok, false) + _, ok = getMaxTotalBypassMinFeeMsgGasUsage(newSubspace, ctx) + require.Equal(t, ok, false) + + // run global fee migration + err := v2.MigrateStore(ctx, newSubspace) + require.NoError(t, err) + + newMinGasPrices, _ := getMinGasPrice(newSubspace, ctx) + bypassMsgTypes, _ := getBypassMsgTypes(newSubspace, ctx) + maxGas, _ := getMaxTotalBypassMinFeeMsgGasUsage(newSubspace, ctx) + + require.Equal(t, bypassMsgTypes, globalfeetypes.DefaultBypassMinFeeMsgTypes) + require.Equal(t, maxGas, globalfeetypes.DefaultmaxTotalBypassMinFeeMsgGasUsage) + require.Equal(t, minGasPrices, newMinGasPrices) +} + +func getBypassMsgTypes(globalfeeSubspace paramtypes.Subspace, ctx sdk.Context) ([]string, bool) { + bypassMsgs := []string{} + if globalfeeSubspace.Has(ctx, globalfeetypes.ParamStoreKeyBypassMinFeeMsgTypes) { + globalfeeSubspace.Get(ctx, globalfeetypes.ParamStoreKeyBypassMinFeeMsgTypes, &bypassMsgs) + } else { + return bypassMsgs, false + } + + return bypassMsgs, true +} + +func getMaxTotalBypassMinFeeMsgGasUsage(globalfeeSubspace paramtypes.Subspace, ctx sdk.Context) (uint64, bool) { + var maxTotalBypassMinFeeMsgGasUsage uint64 + if globalfeeSubspace.Has(ctx, globalfeetypes.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage) { + globalfeeSubspace.Get(ctx, globalfeetypes.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage, &maxTotalBypassMinFeeMsgGasUsage) + } else { + return maxTotalBypassMinFeeMsgGasUsage, false + } + + return maxTotalBypassMinFeeMsgGasUsage, true +} + +func getMinGasPrice(globalfeeSubspace paramtypes.Subspace, ctx sdk.Context) (sdk.DecCoins, bool) { + var globalMinGasPrices sdk.DecCoins + if globalfeeSubspace.Has(ctx, globalfeetypes.ParamStoreKeyMinGasPrices) { + globalfeeSubspace.Get(ctx, globalfeetypes.ParamStoreKeyMinGasPrices, &globalMinGasPrices) + } else { + return globalMinGasPrices, false + } + + return globalMinGasPrices, true +} diff --git a/x/globalfee/module.go b/x/globalfee/module.go index e1e367455f..d6add4249f 100644 --- a/x/globalfee/module.go +++ b/x/globalfee/module.go @@ -1,146 +1,134 @@ package globalfee -// import ( -// "context" -// "encoding/json" -// "fmt" - -// errorsmod "cosmossdk.io/errors" -// "github.com/cosmos/cosmos-sdk/client" -// "github.com/cosmos/cosmos-sdk/codec" -// codectypes "github.com/cosmos/cosmos-sdk/codec/types" -// sdk "github.com/cosmos/cosmos-sdk/types" -// "github.com/cosmos/cosmos-sdk/types/module" -// paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" -// "github.com/gorilla/mux" -// "github.com/grpc-ecosystem/grpc-gateway/runtime" -// "github.com/spf13/cobra" -// abci "github.com/tendermint/tendermint/abci/types" - -// "github.com/cosmos/gaia/v11/x/globalfee/client/cli" -// "github.com/cosmos/gaia/v11/x/globalfee/keeper" -// "github.com/cosmos/gaia/v11/x/globalfee/types" -// ) - -// var ( -// _ module.AppModuleBasic = AppModuleBasic{} -// _ module.AppModuleGenesis = AppModule{} -// _ module.AppModule = AppModule{} -// ) - -// // AppModuleBasic defines the basic application module used by the wasm module. -// type AppModuleBasic struct{} - -// func (a AppModuleBasic) Name() string { -// return types.ModuleName -// } - -// func (a AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { -// return cdc.MustMarshalJSON(&types.GenesisState{ -// Params: types.DefaultParams(), -// }) -// } - -// func (a AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, _ client.TxEncodingConfig, message json.RawMessage) error { -// var data types.GenesisState -// err := marshaler.UnmarshalJSON(message, &data) -// if err != nil { -// return err -// } -// if err := data.Params.ValidateBasic(); err != nil { -// return errorsmod.Wrap(err, "params") -// } -// return nil -// } - -// func (a AppModuleBasic) RegisterInterfaces(_ codectypes.InterfaceRegistry) { -// } - -// func (a AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) { -// } - -// func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { -// err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) -// if err != nil { -// // same behavior as in cosmos-sdk -// panic(err) -// } -// } - -// func (a AppModuleBasic) GetTxCmd() *cobra.Command { -// return nil -// } - -// func (a AppModuleBasic) GetQueryCmd() *cobra.Command { -// return cli.GetQueryCmd() -// } - -// func (a AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino) { -// } - -// type AppModule struct { -// AppModuleBasic -// paramSpace paramstypes.Subspace -// } - -// // NewAppModule constructor -// func NewAppModule(paramSpace paramstypes.Subspace) *AppModule { -// if !paramSpace.HasKeyTable() { -// paramSpace = paramSpace.WithKeyTable(types.ParamKeyTable()) -// } - -// return &AppModule{paramSpace: paramSpace} -// } - -// func (a AppModule) InitGenesis(ctx sdk.Context, marshaler codec.JSONCodec, message json.RawMessage) []abci.ValidatorUpdate { -// var genesisState types.GenesisState -// marshaler.MustUnmarshalJSON(message, &genesisState) - -// a.paramSpace.SetParamSet(ctx, &genesisState.Params) -// return nil -// } - -// func (a AppModule) ExportGenesis(ctx sdk.Context, marshaler codec.JSONCodec) json.RawMessage { -// var genState types.GenesisState -// a.paramSpace.GetParamSet(ctx, &genState.Params) -// return marshaler.MustMarshalJSON(&genState) -// } - -// func (a AppModule) RegisterInvariants(_ sdk.InvariantRegistry) { -// } - -// func (a AppModule) Route() sdk.Route { -// return sdk.Route{} -// } - -// func (a AppModule) QuerierRoute() string { -// return types.QuerierRoute -// } - -// func (a AppModule) LegacyQuerierHandler(_ *codec.LegacyAmino) sdk.Querier { -// return nil -// } - -// func (a AppModule) RegisterServices(cfg module.Configurator) { -// types.RegisterQueryServer(cfg.QueryServer(), NewGrpcQuerier(a.paramSpace)) - -// m := keeper.NewMigrator(a.paramSpace) -// if err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2); err != nil { -// panic(fmt.Sprintf("failed to migrate x/globalfee from version 1 to 2: %v", err)) -// } -// } - -// func (a AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) { -// } - -// func (a AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { -// return nil -// } - -// // ConsensusVersion is a sequence number for state-breaking change of the -// // module. It should be incremented on each consensus-breaking change -// // introduced by the module. To avoid wrong/empty versions, the initial version -// // should be set to 1. -// func (a AppModule) ConsensusVersion() uint64 { -// return 2 -// } +import ( + "context" + "encoding/json" + "fmt" + + errorsmod "cosmossdk.io/errors" + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + + "github.com/cosmos/gaia/v11/x/globalfee/client/cli" + "github.com/cosmos/gaia/v11/x/globalfee/keeper" + "github.com/cosmos/gaia/v11/x/globalfee/types" +) + +var ( + _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleGenesis = AppModule{} + _ module.AppModule = AppModule{} +) + +// AppModuleBasic defines the basic application module used by the wasm module. +type AppModuleBasic struct{} + +func (a AppModuleBasic) Name() string { + return types.ModuleName +} + +func (a AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(&types.GenesisState{ + Params: types.DefaultParams(), + }) +} + +func (a AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, _ client.TxEncodingConfig, message json.RawMessage) error { + var data types.GenesisState + err := marshaler.UnmarshalJSON(message, &data) + if err != nil { + return err + } + if err := data.Params.ValidateBasic(); err != nil { + return errorsmod.Wrap(err, "params") + } + return nil +} + +func (a AppModuleBasic) RegisterInterfaces(_ codectypes.InterfaceRegistry) { +} + +func (a AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) { +} + +func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) + if err != nil { + // same behavior as in cosmos-sdk + panic(err) + } +} + +func (a AppModuleBasic) GetTxCmd() *cobra.Command { + return nil +} + +func (a AppModuleBasic) GetQueryCmd() *cobra.Command { + return cli.GetQueryCmd() +} + +func (a AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino) { +} + +type AppModule struct { + AppModuleBasic + paramSpace paramstypes.Subspace +} + +// NewAppModule constructor +func NewAppModule(paramSpace paramstypes.Subspace) *AppModule { + if !paramSpace.HasKeyTable() { + paramSpace = paramSpace.WithKeyTable(types.ParamKeyTable()) + } + + return &AppModule{paramSpace: paramSpace} +} + +func (a AppModule) InitGenesis(ctx sdk.Context, marshaler codec.JSONCodec, message json.RawMessage) []abci.ValidatorUpdate { + var genesisState types.GenesisState + marshaler.MustUnmarshalJSON(message, &genesisState) + + a.paramSpace.SetParamSet(ctx, &genesisState.Params) + return nil +} + +func (a AppModule) ExportGenesis(ctx sdk.Context, marshaler codec.JSONCodec) json.RawMessage { + var genState types.GenesisState + a.paramSpace.GetParamSet(ctx, &genState.Params) + return marshaler.MustMarshalJSON(&genState) +} + +func (a AppModule) RegisterInvariants(_ sdk.InvariantRegistry) { +} + +func (a AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryServer(cfg.QueryServer(), NewGrpcQuerier(a.paramSpace)) + + m := keeper.NewMigrator(a.paramSpace) + if err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2); err != nil { + panic(fmt.Sprintf("failed to migrate x/globalfee from version 1 to 2: %v", err)) + } +} + +func (a AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) { +} + +func (a AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { + return nil +} + +// ConsensusVersion is a sequence number for state-breaking change of the +// module. It should be incremented on each consensus-breaking change +// introduced by the module. To avoid wrong/empty versions, the initial version +// should be set to 1. +func (a AppModule) ConsensusVersion() uint64 { + return 2 +} diff --git a/x/globalfee/querier.go b/x/globalfee/querier.go index 93d30999d7..4ddd5ac28f 100644 --- a/x/globalfee/querier.go +++ b/x/globalfee/querier.go @@ -1,52 +1,52 @@ package globalfee -// import ( -// "context" - -// sdk "github.com/cosmos/cosmos-sdk/types" - -// "github.com/cosmos/gaia/v11/x/globalfee/types" -// ) - -// var _ types.QueryServer = &GrpcQuerier{} - -// // ParamSource is a read only subset of paramtypes.Subspace -// type ParamSource interface { -// Get(ctx sdk.Context, key []byte, ptr interface{}) -// Has(ctx sdk.Context, key []byte) bool -// } - -// type GrpcQuerier struct { -// paramSource ParamSource -// } - -// func NewGrpcQuerier(paramSource ParamSource) GrpcQuerier { -// return GrpcQuerier{paramSource: paramSource} -// } - -// // MinimumGasPrices return minimum gas prices -// func (g GrpcQuerier) Params(stdCtx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { -// var minGasPrices sdk.DecCoins -// var bypassMinFeeMsgTypes []string -// var maxTotalBypassMinFeeMsgGasUsage uint64 -// ctx := sdk.UnwrapSDKContext(stdCtx) - -// // todo: if return err if not exist? -// if g.paramSource.Has(ctx, types.ParamStoreKeyMinGasPrices) { -// g.paramSource.Get(ctx, types.ParamStoreKeyMinGasPrices, &minGasPrices) -// } -// if g.paramSource.Has(ctx, types.ParamStoreKeyBypassMinFeeMsgTypes) { -// g.paramSource.Get(ctx, types.ParamStoreKeyBypassMinFeeMsgTypes, &bypassMinFeeMsgTypes) -// } -// if g.paramSource.Has(ctx, types.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage) { -// g.paramSource.Get(ctx, types.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage, &maxTotalBypassMinFeeMsgGasUsage) -// } - -// return &types.QueryParamsResponse{ -// Params: types.Params{ -// MinimumGasPrices: minGasPrices, -// BypassMinFeeMsgTypes: bypassMinFeeMsgTypes, -// MaxTotalBypassMinFeeMsgGasUsage: maxTotalBypassMinFeeMsgGasUsage, -// }, -// }, nil -// } +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/cosmos/gaia/v11/x/globalfee/types" +) + +var _ types.QueryServer = &GrpcQuerier{} + +// ParamSource is a read only subset of paramtypes.Subspace +type ParamSource interface { + Get(ctx sdk.Context, key []byte, ptr interface{}) + Has(ctx sdk.Context, key []byte) bool +} + +type GrpcQuerier struct { + paramSource ParamSource +} + +func NewGrpcQuerier(paramSource ParamSource) GrpcQuerier { + return GrpcQuerier{paramSource: paramSource} +} + +// MinimumGasPrices return minimum gas prices +func (g GrpcQuerier) Params(stdCtx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + var minGasPrices sdk.DecCoins + var bypassMinFeeMsgTypes []string + var maxTotalBypassMinFeeMsgGasUsage uint64 + ctx := sdk.UnwrapSDKContext(stdCtx) + + // todo: if return err if not exist? + if g.paramSource.Has(ctx, types.ParamStoreKeyMinGasPrices) { + g.paramSource.Get(ctx, types.ParamStoreKeyMinGasPrices, &minGasPrices) + } + if g.paramSource.Has(ctx, types.ParamStoreKeyBypassMinFeeMsgTypes) { + g.paramSource.Get(ctx, types.ParamStoreKeyBypassMinFeeMsgTypes, &bypassMinFeeMsgTypes) + } + if g.paramSource.Has(ctx, types.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage) { + g.paramSource.Get(ctx, types.ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage, &maxTotalBypassMinFeeMsgGasUsage) + } + + return &types.QueryParamsResponse{ + Params: types.Params{ + MinimumGasPrices: minGasPrices, + BypassMinFeeMsgTypes: bypassMinFeeMsgTypes, + MaxTotalBypassMinFeeMsgGasUsage: maxTotalBypassMinFeeMsgGasUsage, + }, + }, nil +} diff --git a/x/globalfee/types/genesis.go b/x/globalfee/types/genesis.go index 5d045dd9b5..253df889c6 100644 --- a/x/globalfee/types/genesis.go +++ b/x/globalfee/types/genesis.go @@ -1,40 +1,40 @@ package types -// import ( -// "encoding/json" - -// errorsmod "cosmossdk.io/errors" -// "github.com/cosmos/cosmos-sdk/codec" -// ) - -// // NewGenesisState - Create a new genesis state -// func NewGenesisState(params Params) *GenesisState { -// return &GenesisState{ -// Params: params, -// } -// } - -// // DefaultGenesisState - Return a default genesis state -// func DefaultGenesisState() *GenesisState { -// return NewGenesisState(DefaultParams()) -// } - -// // GetGenesisStateFromAppState returns x/auth GenesisState given raw application -// // genesis state. -// func GetGenesisStateFromAppState(cdc codec.Codec, appState map[string]json.RawMessage) *GenesisState { -// var genesisState GenesisState - -// if appState[ModuleName] != nil { -// cdc.MustUnmarshalJSON(appState[ModuleName], &genesisState) -// } - -// return &genesisState -// } - -// func ValidateGenesis(data GenesisState) error { -// if err := data.Params.ValidateBasic(); err != nil { -// return errorsmod.Wrap(err, "globalfee params") -// } - -// return nil -// } +import ( + "encoding/json" + + errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/codec" +) + +// NewGenesisState - Create a new genesis state +func NewGenesisState(params Params) *GenesisState { + return &GenesisState{ + Params: params, + } +} + +// DefaultGenesisState - Return a default genesis state +func DefaultGenesisState() *GenesisState { + return NewGenesisState(DefaultParams()) +} + +// GetGenesisStateFromAppState returns x/auth GenesisState given raw application +// genesis state. +func GetGenesisStateFromAppState(cdc codec.Codec, appState map[string]json.RawMessage) *GenesisState { + var genesisState GenesisState + + if appState[ModuleName] != nil { + cdc.MustUnmarshalJSON(appState[ModuleName], &genesisState) + } + + return &genesisState +} + +func ValidateGenesis(data GenesisState) error { + if err := data.Params.ValidateBasic(); err != nil { + return errorsmod.Wrap(err, "globalfee params") + } + + return nil +} diff --git a/x/globalfee/types/genesis.pb.go b/x/globalfee/types/genesis.pb.go index f42a1699b2..a5f48d0767 100644 --- a/x/globalfee/types/genesis.pb.go +++ b/x/globalfee/types/genesis.pb.go @@ -1,12 +1,17 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: gaia/globalfee/v1/genesis.proto +// source: gaia/globalfee/v1beta1/genesis.proto package types import ( fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" + io "io" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -20,14 +25,598 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -func init() { proto.RegisterFile("gaia/globalfee/v1/genesis.proto", fileDescriptor_adcbe28f22ae5b0a) } +// GenesisState - initial state of module +type GenesisState struct { + // Params of this module + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_015b3e8b7a7c65c5, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// Params defines the set of module parameters. +type Params struct { + // minimum_gas_prices stores the minimum gas price(s) for all TX on the chain. + // When multiple coins are defined then they are accepted alternatively. + // The list must be sorted by denoms asc. No duplicate denoms or zero amount + // values allowed. For more information see + // https://docs.cosmos.network/main/modules/auth#concepts + MinimumGasPrices github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,1,rep,name=minimum_gas_prices,json=minimumGasPrices,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"minimum_gas_prices,omitempty" yaml:"minimum_gas_prices"` + // bypass_min_fee_msg_types defines a list of message type urls + // that are free of fee charge. + BypassMinFeeMsgTypes []string `protobuf:"bytes,2,rep,name=bypass_min_fee_msg_types,json=bypassMinFeeMsgTypes,proto3" json:"bypass_min_fee_msg_types,omitempty" yaml:"bypass_min_fee_msg_types"` + // max_total_bypass_min_fee_msg_gas_usage defines the total maximum gas usage + // allowed for a transaction containing only messages of types in bypass_min_fee_msg_types + // to bypass fee charge. + MaxTotalBypassMinFeeMsgGasUsage uint64 `protobuf:"varint,3,opt,name=max_total_bypass_min_fee_msg_gas_usage,json=maxTotalBypassMinFeeMsgGasUsage,proto3" json:"max_total_bypass_min_fee_msg_gas_usage,omitempty"` +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_015b3e8b7a7c65c5, []int{1} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func (m *Params) GetMinimumGasPrices() github_com_cosmos_cosmos_sdk_types.DecCoins { + if m != nil { + return m.MinimumGasPrices + } + return nil +} + +func (m *Params) GetBypassMinFeeMsgTypes() []string { + if m != nil { + return m.BypassMinFeeMsgTypes + } + return nil +} + +func (m *Params) GetMaxTotalBypassMinFeeMsgGasUsage() uint64 { + if m != nil { + return m.MaxTotalBypassMinFeeMsgGasUsage + } + return 0 +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "gaia.globalfee.v1beta1.GenesisState") + proto.RegisterType((*Params)(nil), "gaia.globalfee.v1beta1.Params") +} -var fileDescriptor_adcbe28f22ae5b0a = []byte{ - // 90 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0x4f, 0xcc, 0x4c, - 0xd4, 0x4f, 0xcf, 0xc9, 0x4f, 0x4a, 0xcc, 0x49, 0x4b, 0x4d, 0xd5, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, - 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x77, 0x92, 0x38, 0xf1, 0x48, - 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, - 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x24, 0x36, 0xb0, 0x02, 0x63, 0x40, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xd4, 0x1e, 0x8a, 0x2e, 0x43, 0x00, 0x00, 0x00, +func init() { + proto.RegisterFile("gaia/globalfee/v1beta1/genesis.proto", fileDescriptor_015b3e8b7a7c65c5) } + +var fileDescriptor_015b3e8b7a7c65c5 = []byte{ + // 428 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x4d, 0x6e, 0xd3, 0x40, + 0x14, 0xc7, 0x33, 0x04, 0x45, 0xc2, 0x65, 0x51, 0x59, 0x15, 0x32, 0x55, 0x35, 0x8e, 0x2c, 0x84, + 0x2c, 0x01, 0x63, 0xb5, 0xec, 0x58, 0x1a, 0x44, 0xc4, 0xa2, 0x22, 0x0a, 0x65, 0xc3, 0x66, 0x78, + 0x36, 0xd3, 0x61, 0x44, 0xc6, 0x63, 0xe5, 0x4d, 0x50, 0xb2, 0xe4, 0x06, 0x1c, 0x80, 0x13, 0x70, + 0x06, 0x0e, 0xd0, 0x65, 0x97, 0xac, 0x0c, 0x4a, 0x76, 0x5d, 0x72, 0x02, 0x34, 0x1e, 0xd3, 0x52, + 0xa5, 0x59, 0xd9, 0xf2, 0xfb, 0xfd, 0x3f, 0xfc, 0xf4, 0x82, 0x07, 0x12, 0x14, 0x64, 0x72, 0x6a, + 0x0a, 0x98, 0x9e, 0x0a, 0x91, 0x7d, 0x3e, 0x2c, 0x84, 0x85, 0xc3, 0x4c, 0x8a, 0x4a, 0xa0, 0x42, + 0x56, 0xcf, 0x8c, 0x35, 0xe1, 0x3d, 0x47, 0xb1, 0x4b, 0x8a, 0x75, 0xd4, 0xfe, 0x9e, 0x34, 0xd2, + 0xb4, 0x48, 0xe6, 0xde, 0x3c, 0xbd, 0x4f, 0x4b, 0x83, 0xda, 0x60, 0x56, 0x00, 0x5e, 0x19, 0x96, + 0x46, 0x55, 0x7e, 0x9e, 0xbc, 0x0f, 0xee, 0x8e, 0xbc, 0xfd, 0x1b, 0x0b, 0x56, 0x84, 0xe3, 0x60, + 0x50, 0xc3, 0x0c, 0x34, 0x46, 0x64, 0x48, 0xd2, 0x9d, 0x23, 0xca, 0x6e, 0x8e, 0x63, 0xe3, 0x96, + 0xca, 0xa3, 0xb3, 0x26, 0xee, 0x5d, 0x34, 0xf1, 0xae, 0x57, 0x3d, 0x36, 0x5a, 0x59, 0xa1, 0x6b, + 0xbb, 0x9c, 0x74, 0x3e, 0xc9, 0xb7, 0x7e, 0x30, 0xf0, 0x70, 0xf8, 0x83, 0x04, 0xa1, 0x56, 0x95, + 0xd2, 0x73, 0xcd, 0x25, 0x20, 0xaf, 0x67, 0xaa, 0x14, 0x2e, 0xa9, 0x9f, 0xee, 0x1c, 0x1d, 0x30, + 0x5f, 0x95, 0xb9, 0xaa, 0x97, 0x31, 0x2f, 0x44, 0xf9, 0xdc, 0xa8, 0x2a, 0xaf, 0xbb, 0x9c, 0x83, + 0x4d, 0xfd, 0x55, 0xe6, 0x9f, 0x26, 0xbe, 0xbf, 0x04, 0x3d, 0x7d, 0x96, 0x6c, 0x52, 0xc9, 0xf7, + 0x5f, 0xf1, 0x23, 0xa9, 0xec, 0xc7, 0x79, 0xc1, 0x4a, 0xa3, 0xb3, 0x6e, 0x2f, 0xfe, 0xf1, 0x04, + 0x3f, 0x7c, 0xca, 0xec, 0xb2, 0x16, 0xf8, 0x2f, 0x10, 0x27, 0xbb, 0x9d, 0xc7, 0x08, 0x70, 0xdc, + 0x3a, 0x84, 0x5f, 0x48, 0x10, 0x15, 0xcb, 0x1a, 0x10, 0xb9, 0x56, 0x15, 0x3f, 0x15, 0x82, 0x6b, + 0x94, 0xbc, 0xd5, 0x45, 0xb7, 0x86, 0xfd, 0xf4, 0x4e, 0xfe, 0xea, 0xa2, 0x89, 0x93, 0x6d, 0xcc, + 0xb5, 0xa2, 0xb1, 0x2f, 0xba, 0x8d, 0x4d, 0x26, 0x7b, 0x7e, 0x74, 0xac, 0xaa, 0x97, 0x42, 0x1c, + 0xa3, 0x3c, 0x71, 0x9f, 0xc3, 0xd7, 0xc1, 0x43, 0x0d, 0x0b, 0x6e, 0x8d, 0x85, 0x29, 0xbf, 0x41, + 0xec, 0x7e, 0x78, 0x8e, 0x20, 0x45, 0xd4, 0x1f, 0x92, 0xf4, 0xf6, 0x24, 0xd6, 0xb0, 0x38, 0x71, + 0x70, 0x7e, 0xdd, 0x6d, 0x04, 0xf8, 0xd6, 0x61, 0x79, 0x7e, 0xb6, 0xa2, 0xe4, 0x7c, 0x45, 0xc9, + 0xef, 0x15, 0x25, 0x5f, 0xd7, 0xb4, 0x77, 0xbe, 0xa6, 0xbd, 0x9f, 0x6b, 0xda, 0x7b, 0x97, 0x6e, + 0x6e, 0xab, 0x3d, 0xd0, 0xc5, 0x7f, 0x27, 0xda, 0x76, 0x2d, 0x06, 0xed, 0x2d, 0x3d, 0xfd, 0x1b, + 0x00, 0x00, 0xff, 0xff, 0x90, 0xb9, 0xb2, 0x8a, 0xc1, 0x02, 0x00, 0x00, +} + +func (m *GenesisState) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Params) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MaxTotalBypassMinFeeMsgGasUsage != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.MaxTotalBypassMinFeeMsgGasUsage)) + i-- + dAtA[i] = 0x18 + } + if len(m.BypassMinFeeMsgTypes) > 0 { + for iNdEx := len(m.BypassMinFeeMsgTypes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.BypassMinFeeMsgTypes[iNdEx]) + copy(dAtA[i:], m.BypassMinFeeMsgTypes[iNdEx]) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.BypassMinFeeMsgTypes[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.MinimumGasPrices) > 0 { + for iNdEx := len(m.MinimumGasPrices) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.MinimumGasPrices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.MinimumGasPrices) > 0 { + for _, e := range m.MinimumGasPrices { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.BypassMinFeeMsgTypes) > 0 { + for _, s := range m.BypassMinFeeMsgTypes { + l = len(s) + n += 1 + l + sovGenesis(uint64(l)) + } + } + if m.MaxTotalBypassMinFeeMsgGasUsage != 0 { + n += 1 + sovGenesis(uint64(m.MaxTotalBypassMinFeeMsgGasUsage)) + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Params) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinimumGasPrices", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MinimumGasPrices = append(m.MinimumGasPrices, types.DecCoin{}) + if err := m.MinimumGasPrices[len(m.MinimumGasPrices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BypassMinFeeMsgTypes", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BypassMinFeeMsgTypes = append(m.BypassMinFeeMsgTypes, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxTotalBypassMinFeeMsgGasUsage", wireType) + } + m.MaxTotalBypassMinFeeMsgGasUsage = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxTotalBypassMinFeeMsgGasUsage |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/globalfee/types/keys.go b/x/globalfee/types/keys.go index 13d6c31ad0..71b43267dd 100644 --- a/x/globalfee/types/keys.go +++ b/x/globalfee/types/keys.go @@ -1,9 +1,8 @@ package types -// -// const ( -// // ModuleName is the name of the this module -// ModuleName = "globalfee" -// -// QuerierRoute = ModuleName -//) +const ( + // ModuleName is the name of the this module + ModuleName = "globalfee" + + QuerierRoute = ModuleName +) diff --git a/x/globalfee/types/params.go b/x/globalfee/types/params.go index 0e61a2ae41..dc21409304 100644 --- a/x/globalfee/types/params.go +++ b/x/globalfee/types/params.go @@ -1,155 +1,156 @@ package types -// import ( -// "fmt" -// "strings" - -// errorsmod "cosmossdk.io/errors" -// sdk "github.com/cosmos/cosmos-sdk/types" -// paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" -// gaiaerrors "github.com/cosmos/gaia/v11/types/errors" -// ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" -// ibcchanneltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" -// ) - -// var ( -// // ParamStoreKeyMinGasPrices store key -// ParamStoreKeyMinGasPrices = []byte("MinimumGasPricesParam") -// ParamStoreKeyBypassMinFeeMsgTypes = []byte("BypassMinFeeMsgTypes") -// ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage = []byte("MaxTotalBypassMinFeeMsgGasUsage") - -// // DefaultMinGasPrices is set at runtime to the staking token with zero amount i.e. "0uatom" -// // see DefaultZeroGlobalFee method in gaia/x/globalfee/ante/fee.go. -// DefaultMinGasPrices = sdk.DecCoins{} -// DefaultBypassMinFeeMsgTypes = []string{ -// sdk.MsgTypeURL(&ibcchanneltypes.MsgRecvPacket{}), -// sdk.MsgTypeURL(&ibcchanneltypes.MsgAcknowledgement{}), -// sdk.MsgTypeURL(&ibcclienttypes.MsgUpdateClient{}), -// sdk.MsgTypeURL(&ibcchanneltypes.MsgTimeout{}), -// sdk.MsgTypeURL(&ibcchanneltypes.MsgTimeoutOnClose{}), -// } - -// // maxTotalBypassMinFeeMsgGasUsage is the allowed maximum gas usage -// // for all the bypass msgs in a transactions. -// // A transaction that contains only bypass message types and the gas usage does not -// // exceed maxTotalBypassMinFeeMsgGasUsage can be accepted with a zero fee. -// // For details, see gaiafeeante.NewFeeDecorator() -// DefaultmaxTotalBypassMinFeeMsgGasUsage uint64 = 1_000_000 -// ) - -// // DefaultParams returns default parameters -// func DefaultParams() Params { -// return Params{ -// MinimumGasPrices: DefaultMinGasPrices, -// BypassMinFeeMsgTypes: DefaultBypassMinFeeMsgTypes, -// MaxTotalBypassMinFeeMsgGasUsage: DefaultmaxTotalBypassMinFeeMsgGasUsage, -// } -// } - -// func ParamKeyTable() paramtypes.KeyTable { -// return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) -// } - -// // ValidateBasic performs basic validation. -// func (p Params) ValidateBasic() error { -// if err := validateMinimumGasPrices(p.MinimumGasPrices); err != nil { -// return err -// } - -// if err := validateBypassMinFeeMsgTypes(p.BypassMinFeeMsgTypes); err != nil { -// return err -// } - -// return validateMaxTotalBypassMinFeeMsgGasUsage(p.MaxTotalBypassMinFeeMsgGasUsage) -// } - -// // ParamSetPairs returns the parameter set pairs. -// func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { -// return paramtypes.ParamSetPairs{ -// paramtypes.NewParamSetPair( -// ParamStoreKeyMinGasPrices, &p.MinimumGasPrices, validateMinimumGasPrices, -// ), -// paramtypes.NewParamSetPair( -// ParamStoreKeyBypassMinFeeMsgTypes, &p.BypassMinFeeMsgTypes, validateBypassMinFeeMsgTypes, -// ), -// paramtypes.NewParamSetPair( -// ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage, &p.MaxTotalBypassMinFeeMsgGasUsage, validateMaxTotalBypassMinFeeMsgGasUsage, -// ), -// } -// } - -// func validateMinimumGasPrices(i interface{}) error { -// v, ok := i.(sdk.DecCoins) -// if !ok { -// return errorsmod.Wrapf(gaiaerrors.ErrInvalidType, "type: %T, expected sdk.DecCoins", i) -// } - -// dec := DecCoins(v) -// return dec.Validate() -// } - -// type BypassMinFeeMsgTypes []string +import ( + "fmt" + "strings" + + 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/v11/types/errors" +) + +var ( + // ParamStoreKeyMinGasPrices store key + ParamStoreKeyMinGasPrices = []byte("MinimumGasPricesParam") + ParamStoreKeyBypassMinFeeMsgTypes = []byte("BypassMinFeeMsgTypes") + ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage = []byte("MaxTotalBypassMinFeeMsgGasUsage") + + // DefaultMinGasPrices is set at runtime to the staking token with zero amount i.e. "0uatom" + // see DefaultZeroGlobalFee method in gaia/x/globalfee/ante/fee.go. + DefaultMinGasPrices = sdk.DecCoins{} + DefaultBypassMinFeeMsgTypes = []string{ + sdk.MsgTypeURL(&ibcchanneltypes.MsgRecvPacket{}), + sdk.MsgTypeURL(&ibcchanneltypes.MsgAcknowledgement{}), + sdk.MsgTypeURL(&ibcclienttypes.MsgUpdateClient{}), + sdk.MsgTypeURL(&ibcchanneltypes.MsgTimeout{}), + sdk.MsgTypeURL(&ibcchanneltypes.MsgTimeoutOnClose{}), + } + + // maxTotalBypassMinFeeMsgGasUsage is the allowed maximum gas usage + // for all the bypass msgs in a transactions. + // A transaction that contains only bypass message types and the gas usage does not + // exceed maxTotalBypassMinFeeMsgGasUsage can be accepted with a zero fee. + // For details, see gaiafeeante.NewFeeDecorator() + DefaultmaxTotalBypassMinFeeMsgGasUsage uint64 = 1_000_000 +) + +// DefaultParams returns default parameters +func DefaultParams() Params { + return Params{ + MinimumGasPrices: DefaultMinGasPrices, + BypassMinFeeMsgTypes: DefaultBypassMinFeeMsgTypes, + MaxTotalBypassMinFeeMsgGasUsage: DefaultmaxTotalBypassMinFeeMsgGasUsage, + } +} + +func ParamKeyTable() paramtypes.KeyTable { + return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) +} + +// ValidateBasic performs basic validation. +func (p Params) ValidateBasic() error { + if err := validateMinimumGasPrices(p.MinimumGasPrices); err != nil { + return err + } + + if err := validateBypassMinFeeMsgTypes(p.BypassMinFeeMsgTypes); err != nil { + return err + } + + return validateMaxTotalBypassMinFeeMsgGasUsage(p.MaxTotalBypassMinFeeMsgGasUsage) +} + +// ParamSetPairs returns the parameter set pairs. +func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { + return paramtypes.ParamSetPairs{ + paramtypes.NewParamSetPair( + ParamStoreKeyMinGasPrices, &p.MinimumGasPrices, validateMinimumGasPrices, + ), + paramtypes.NewParamSetPair( + ParamStoreKeyBypassMinFeeMsgTypes, &p.BypassMinFeeMsgTypes, validateBypassMinFeeMsgTypes, + ), + paramtypes.NewParamSetPair( + ParamStoreKeyMaxTotalBypassMinFeeMsgGasUsage, &p.MaxTotalBypassMinFeeMsgGasUsage, validateMaxTotalBypassMinFeeMsgGasUsage, + ), + } +} + +func validateMinimumGasPrices(i interface{}) error { + v, ok := i.(sdk.DecCoins) + if !ok { + return errorsmod.Wrapf(gaiaerrors.ErrInvalidType, "type: %T, expected sdk.DecCoins", i) + } + + dec := DecCoins(v) + return dec.Validate() +} + +type BypassMinFeeMsgTypes []string // validateBypassMinFeeMsgTypes checks that bypass msg types aren't empty -// func validateBypassMinFeeMsgTypes(i interface{}) error { -// bypassMinFeeMsgTypes, ok := i.([]string) -// if !ok { -// return errorsmod.Wrapf(gaiaerrors.ErrInvalidType, "type: %T, expected []sdk.Msg", i) -// } - -// for _, msgType := range bypassMinFeeMsgTypes { -// if msgType == "" { -// return fmt.Errorf("invalid empty bypass msg type") -// } - -// if !strings.HasPrefix(msgType, sdk.MsgTypeURL(nil)) { -// return fmt.Errorf("invalid bypass msg type name %s", msgType) -// } -// } - -// return nil -// } - -// func validateMaxTotalBypassMinFeeMsgGasUsage(i interface{}) error { -// _, ok := i.(uint64) -// if !ok { -// return errorsmod.Wrapf(gaiaerrors.ErrInvalidType, "type: %T, expected uint64", i) -// } - -// return nil -// } - -// type DecCoins sdk.DecCoins - -// // Validate checks that the DecCoins are sorted, have nonnegtive amount, with a valid and unique -// // denomination (i.e no duplicates). Otherwise, it returns an error. -// func (coins DecCoins) Validate() error { -// if len(coins) == 0 { -// return nil -// } - -// lowDenom := "" -// seenDenoms := make(map[string]bool) - -// for i, coin := range coins { -// if seenDenoms[coin.Denom] { -// return fmt.Errorf("duplicate denomination %s", coin.Denom) -// } -// if err := sdk.ValidateDenom(coin.Denom); err != nil { -// return err -// } -// // skip the denom order check for the first denom in the coins list -// if i != 0 && coin.Denom <= lowDenom { -// return fmt.Errorf("denomination %s is not sorted", coin.Denom) -// } -// if coin.IsNegative() { -// return fmt.Errorf("coin %s amount is negative", coin.Amount) -// } - -// // we compare each coin against the last denom -// lowDenom = coin.Denom -// seenDenoms[coin.Denom] = true -// } - -// return nil -// } +func validateBypassMinFeeMsgTypes(i interface{}) error { + bypassMinFeeMsgTypes, ok := i.([]string) + if !ok { + return errorsmod.Wrapf(gaiaerrors.ErrInvalidType, "type: %T, expected []sdk.Msg", i) + } + + for _, msgType := range bypassMinFeeMsgTypes { + if msgType == "" { + return fmt.Errorf("invalid empty bypass msg type") + } + + if !strings.HasPrefix(msgType, sdk.MsgTypeURL(nil)) { + return fmt.Errorf("invalid bypass msg type name %s", msgType) + } + } + + return nil +} + +func validateMaxTotalBypassMinFeeMsgGasUsage(i interface{}) error { + _, ok := i.(uint64) + if !ok { + return errorsmod.Wrapf(gaiaerrors.ErrInvalidType, "type: %T, expected uint64", i) + } + + return nil +} + +type DecCoins sdk.DecCoins + +// Validate checks that the DecCoins are sorted, have nonnegtive amount, with a valid and unique +// denomination (i.e no duplicates). Otherwise, it returns an error. +func (coins DecCoins) Validate() error { + if len(coins) == 0 { + return nil + } + + lowDenom := "" + seenDenoms := make(map[string]bool) + + for i, coin := range coins { + if seenDenoms[coin.Denom] { + return fmt.Errorf("duplicate denomination %s", coin.Denom) + } + if err := sdk.ValidateDenom(coin.Denom); err != nil { + return err + } + // skip the denom order check for the first denom in the coins list + if i != 0 && coin.Denom <= lowDenom { + return fmt.Errorf("denomination %s is not sorted", coin.Denom) + } + if coin.IsNegative() { + return fmt.Errorf("coin %s amount is negative", coin.Amount) + } + + // we compare each coin against the last denom + lowDenom = coin.Denom + seenDenoms[coin.Denom] = true + } + + return nil +} diff --git a/x/globalfee/types/params_test.go b/x/globalfee/types/params_test.go index 1f31fe9fd6..b2c2931674 100644 --- a/x/globalfee/types/params_test.go +++ b/x/globalfee/types/params_test.go @@ -1,157 +1,156 @@ package types -// -// import ( -// "testing" -// -// sdk "github.com/cosmos/cosmos-sdk/types" -// "github.com/stretchr/testify/require" -//) -// -// func TestDefaultParams(t *testing.T) { -// p := DefaultParams() -// require.EqualValues(t, p.MinimumGasPrices, sdk.DecCoins{}) -// require.EqualValues(t, p.BypassMinFeeMsgTypes, DefaultBypassMinFeeMsgTypes) -// require.EqualValues(t, p.MaxTotalBypassMinFeeMsgGasUsage, DefaultmaxTotalBypassMinFeeMsgGasUsage) -//} -// -// func Test_validateMinGasPrices(t *testing.T) { -// tests := map[string]struct { -// coins interface{} -// expectErr bool -// }{ -// "DefaultParams, pass": { -// DefaultParams().MinimumGasPrices, -// false, -// }, -// "DecCoins conversion fails, fail": { -// sdk.Coins{sdk.NewCoin("photon", sdk.OneInt())}, -// true, -// }, -// "coins amounts are zero, pass": { -// sdk.DecCoins{ -// sdk.NewDecCoin("atom", sdk.ZeroInt()), -// sdk.NewDecCoin("photon", sdk.ZeroInt()), -// }, -// false, -// }, -// "duplicate coins denoms, fail": { -// sdk.DecCoins{ -// sdk.NewDecCoin("photon", sdk.OneInt()), -// sdk.NewDecCoin("photon", sdk.OneInt()), -// }, -// true, -// }, -// "coins are not sorted by denom alphabetically, fail": { -// sdk.DecCoins{ -// sdk.NewDecCoin("photon", sdk.OneInt()), -// sdk.NewDecCoin("atom", sdk.OneInt()), -// }, -// true, -// }, -// "negative amount, fail": { -// sdk.DecCoins{ -// sdk.DecCoin{Denom: "photon", Amount: sdk.OneDec().Neg()}, -// }, -// true, -// }, -// "invalid denom, fail": { -// sdk.DecCoins{ -// sdk.DecCoin{Denom: "photon!", Amount: sdk.OneDec().Neg()}, -// }, -// true, -// }, -// } -// -// for name, test := range tests { -// t.Run(name, func(t *testing.T) { -// err := validateMinimumGasPrices(test.coins) -// if test.expectErr { -// require.Error(t, err) -// return -// } -// require.NoError(t, err) -// }) -// } -//} -// -// func Test_validateBypassMinFeeMsgTypes(t *testing.T) { -// tests := map[string]struct { -// msgTypes interface{} -// expectErr bool -// }{ -// "DefaultParams, pass": { -// DefaultParams().BypassMinFeeMsgTypes, -// false, -// }, -// "wrong msg type should make conversion fail, fail": { -// []int{0, 1, 2, 3}, -// true, -// }, -// "empty msg types, pass": { -// []string{}, -// false, -// }, -// "empty msg type, fail": { -// []string{""}, -// true, -// }, -// "invalid msg type name, fail": { -// []string{"ibc.core.channel.v1.MsgRecvPacket"}, -// true, -// }, -// "mixed valid and invalid msgs, fail": { -// []string{ -// "/ibc.core.channel.v1.MsgRecvPacket", -// "", -// }, -// true, -// }, -// } -// -// for name, test := range tests { -// t.Run(name, func(t *testing.T) { -// err := validateBypassMinFeeMsgTypes(test.msgTypes) -// if test.expectErr { -// require.Error(t, err) -// return -// } -// require.NoError(t, err) -// }) -// } -//} -// -// func Test_validateMaxTotalBypassMinFeeMsgGasUsage(t *testing.T) { -// tests := map[string]struct { -// msgTypes interface{} -// expectErr bool -// }{ -// "DefaultParams, pass": { -// DefaultParams().MaxTotalBypassMinFeeMsgGasUsage, -// false, -// }, -// "zero value, pass": { -// uint64(0), -// false, -// }, -// "negative value, fail": { -// -1, -// true, -// }, -// "invalid type, fail": { -// "5", -// true, -// }, -// } -// -// for name, test := range tests { -// t.Run(name, func(t *testing.T) { -// err := validateMaxTotalBypassMinFeeMsgGasUsage(test.msgTypes) -// if test.expectErr { -// require.Error(t, err) -// return -// } -// require.NoError(t, err) -// }) -// } -//} +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" +) + +func TestDefaultParams(t *testing.T) { + p := DefaultParams() + require.EqualValues(t, p.MinimumGasPrices, sdk.DecCoins{}) + require.EqualValues(t, p.BypassMinFeeMsgTypes, DefaultBypassMinFeeMsgTypes) + require.EqualValues(t, p.MaxTotalBypassMinFeeMsgGasUsage, DefaultmaxTotalBypassMinFeeMsgGasUsage) +} + +func Test_validateMinGasPrices(t *testing.T) { + tests := map[string]struct { + coins interface{} + expectErr bool + }{ + "DefaultParams, pass": { + DefaultParams().MinimumGasPrices, + false, + }, + "DecCoins conversion fails, fail": { + sdk.Coins{sdk.NewCoin("photon", sdk.OneInt())}, + true, + }, + "coins amounts are zero, pass": { + sdk.DecCoins{ + sdk.NewDecCoin("atom", sdk.ZeroInt()), + sdk.NewDecCoin("photon", sdk.ZeroInt()), + }, + false, + }, + "duplicate coins denoms, fail": { + sdk.DecCoins{ + sdk.NewDecCoin("photon", sdk.OneInt()), + sdk.NewDecCoin("photon", sdk.OneInt()), + }, + true, + }, + "coins are not sorted by denom alphabetically, fail": { + sdk.DecCoins{ + sdk.NewDecCoin("photon", sdk.OneInt()), + sdk.NewDecCoin("atom", sdk.OneInt()), + }, + true, + }, + "negative amount, fail": { + sdk.DecCoins{ + sdk.DecCoin{Denom: "photon", Amount: sdk.OneDec().Neg()}, + }, + true, + }, + "invalid denom, fail": { + sdk.DecCoins{ + sdk.DecCoin{Denom: "photon!", Amount: sdk.OneDec().Neg()}, + }, + true, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + err := validateMinimumGasPrices(test.coins) + if test.expectErr { + require.Error(t, err) + return + } + require.NoError(t, err) + }) + } +} + +func Test_validateBypassMinFeeMsgTypes(t *testing.T) { + tests := map[string]struct { + msgTypes interface{} + expectErr bool + }{ + "DefaultParams, pass": { + DefaultParams().BypassMinFeeMsgTypes, + false, + }, + "wrong msg type should make conversion fail, fail": { + []int{0, 1, 2, 3}, + true, + }, + "empty msg types, pass": { + []string{}, + false, + }, + "empty msg type, fail": { + []string{""}, + true, + }, + "invalid msg type name, fail": { + []string{"ibc.core.channel.v1.MsgRecvPacket"}, + true, + }, + "mixed valid and invalid msgs, fail": { + []string{ + "/ibc.core.channel.v1.MsgRecvPacket", + "", + }, + true, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + err := validateBypassMinFeeMsgTypes(test.msgTypes) + if test.expectErr { + require.Error(t, err) + return + } + require.NoError(t, err) + }) + } +} + +func Test_validateMaxTotalBypassMinFeeMsgGasUsage(t *testing.T) { + tests := map[string]struct { + msgTypes interface{} + expectErr bool + }{ + "DefaultParams, pass": { + DefaultParams().MaxTotalBypassMinFeeMsgGasUsage, + false, + }, + "zero value, pass": { + uint64(0), + false, + }, + "negative value, fail": { + -1, + true, + }, + "invalid type, fail": { + "5", + true, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + err := validateMaxTotalBypassMinFeeMsgGasUsage(test.msgTypes) + if test.expectErr { + require.Error(t, err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/globalfee/types/query.pb.go b/x/globalfee/types/query.pb.go index cb690734b0..fbf9ed4514 100644 --- a/x/globalfee/types/query.pb.go +++ b/x/globalfee/types/query.pb.go @@ -1,12 +1,21 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: gaia/globalfee/v1/query.proto +// source: gaia/globalfee/v1beta1/query.proto package types import ( + context "context" fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -20,14 +29,508 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -func init() { proto.RegisterFile("gaia/globalfee/v1/query.proto", fileDescriptor_9d905334454049fe) } +// QueryMinimumGasPricesRequest is the request type for the +// Query/MinimumGasPrices RPC method. +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_12a736cede25d10a, []int{0} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryMinimumGasPricesResponse is the response type for the +// Query/MinimumGasPrices RPC method. +type QueryParamsResponse struct { + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_12a736cede25d10a, []int{1} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "gaia.globalfee.v1beta1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "gaia.globalfee.v1beta1.QueryParamsResponse") +} + +func init() { + proto.RegisterFile("gaia/globalfee/v1beta1/query.proto", fileDescriptor_12a736cede25d10a) +} + +var fileDescriptor_12a736cede25d10a = []byte{ + // 286 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0x31, 0x4b, 0xc3, 0x40, + 0x14, 0xc7, 0x73, 0xa2, 0x1d, 0xce, 0xed, 0x2c, 0x22, 0x41, 0xce, 0x12, 0x44, 0x8a, 0xc2, 0x1d, + 0xad, 0xab, 0x53, 0x3e, 0x81, 0xd6, 0xcd, 0xed, 0x52, 0x9e, 0x67, 0x20, 0xc9, 0x4b, 0x73, 0x17, + 0xb1, 0xab, 0x9b, 0x9b, 0xd0, 0x2f, 0xd5, 0xb1, 0xe0, 0xe2, 0x24, 0x92, 0xf8, 0x41, 0x24, 0xb9, + 0x20, 0x8a, 0x06, 0xdc, 0x8e, 0x77, 0xbf, 0xf7, 0x7f, 0x3f, 0xfe, 0x34, 0xd0, 0x2a, 0x56, 0x52, + 0x27, 0x18, 0xa9, 0xe4, 0x16, 0x40, 0xde, 0x4f, 0x22, 0xb0, 0x6a, 0x22, 0x17, 0x25, 0x14, 0x4b, + 0x91, 0x17, 0x68, 0x91, 0xed, 0x37, 0x8c, 0xf8, 0x62, 0x44, 0xc7, 0xf8, 0x43, 0x8d, 0x1a, 0x5b, + 0x44, 0x36, 0x2f, 0x47, 0xfb, 0x87, 0x1a, 0x51, 0x27, 0x20, 0x55, 0x1e, 0x4b, 0x95, 0x65, 0x68, + 0x95, 0x8d, 0x31, 0x33, 0xdd, 0xef, 0x71, 0xcf, 0x3d, 0x0d, 0x19, 0x98, 0xb8, 0xa3, 0x82, 0x21, + 0x65, 0x57, 0x8d, 0xc0, 0xa5, 0x2a, 0x54, 0x6a, 0x66, 0xb0, 0x28, 0xc1, 0xd8, 0xe0, 0x9a, 0xee, + 0xfd, 0x98, 0x9a, 0x1c, 0x33, 0x03, 0xec, 0x82, 0x0e, 0xf2, 0x76, 0x72, 0x40, 0x46, 0x64, 0xbc, + 0x3b, 0xe5, 0xe2, 0x6f, 0x5f, 0xe1, 0xf6, 0xc2, 0xed, 0xf5, 0xdb, 0x91, 0x37, 0xeb, 0x76, 0xa6, + 0x2b, 0x42, 0x77, 0xda, 0x54, 0xf6, 0x44, 0xe8, 0xc0, 0x21, 0xec, 0xb4, 0x2f, 0xe2, 0xb7, 0x95, + 0x7f, 0xf6, 0x2f, 0xd6, 0xb9, 0x06, 0x27, 0x8f, 0x2f, 0x1f, 0xab, 0xad, 0x11, 0xe3, 0xb2, 0xa7, + 0x07, 0x67, 0x15, 0x86, 0xeb, 0x8a, 0x93, 0x4d, 0xc5, 0xc9, 0x7b, 0xc5, 0xc9, 0x73, 0xcd, 0xbd, + 0x4d, 0xcd, 0xbd, 0xd7, 0x9a, 0x7b, 0x37, 0x63, 0x1d, 0xdb, 0xbb, 0x32, 0x12, 0x73, 0x4c, 0xe5, + 0x1c, 0x4d, 0x8a, 0xc6, 0x45, 0x3d, 0x7c, 0x0b, 0xb3, 0xcb, 0x1c, 0x4c, 0x34, 0x68, 0xbb, 0x3c, + 0xff, 0x0c, 0x00, 0x00, 0xff, 0xff, 0x01, 0xc5, 0x11, 0x71, 0xe3, 0x01, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/gaia.globalfee.v1beta1.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gaia.globalfee.v1beta1.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "gaia.globalfee.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "gaia/globalfee/v1beta1/query.proto", +} + +func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} -var fileDescriptor_9d905334454049fe = []byte{ - // 88 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4d, 0x4f, 0xcc, 0x4c, - 0xd4, 0x4f, 0xcf, 0xc9, 0x4f, 0x4a, 0xcc, 0x49, 0x4b, 0x4d, 0xd5, 0x2f, 0x33, 0xd4, 0x2f, 0x2c, - 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x77, 0x92, 0x38, 0xf1, 0x48, 0x8e, 0xf1, - 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, - 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x24, 0x36, 0xb0, 0x02, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x8e, 0xf4, 0x45, 0x9d, 0x41, 0x00, 0x00, 0x00, +func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil } + +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/globalfee/types/query.pb.gw.go b/x/globalfee/types/query.pb.gw.go new file mode 100644 index 0000000000..71ec5cbab4 --- /dev/null +++ b/x/globalfee/types/query.pb.gw.go @@ -0,0 +1,153 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: gaia/globalfee/v1beta1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"gaia", "globalfee", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage +) From 861ba391c3b49c36c29619a1b1c1c43568f79f69 Mon Sep 17 00:00:00 2001 From: MSalopek Date: Mon, 24 Jul 2023 17:28:30 +0200 Subject: [PATCH 05/43] deps: bump ics to v3.1; chore: update e2e (#2663) * deps: bump ics to v3.1; chore: update e2e * fix: update hermes.Dockerfile --- app/keepers/keepers.go | 1 + app/modules.go | 12 +-- go.mod | 4 +- go.sum | 8 +- proto/buf.lock | 5 ++ proto/buf.yaml | 1 + tests/e2e/chain.go | 2 + tests/e2e/docker/hermes.Dockerfile | 2 +- tests/e2e/e2e_exec_test.go | 1 - tests/e2e/e2e_gov_test.go | 63 +------------ tests/e2e/e2e_ics_test.go | 139 +++++++++++++++++++++++++++++ tests/e2e/e2e_query_exec_test.go | 78 ++++++++-------- tests/e2e/e2e_setup_test.go | 59 ------------ tests/e2e/e2e_test.go | 2 +- 14 files changed, 205 insertions(+), 172 deletions(-) create mode 100644 tests/e2e/e2e_ics_test.go diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index fa38439529..4370d5924d 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -349,6 +349,7 @@ func NewAppKeeper( // Set legacy router for backwards compatibility with gov v1beta1 govKeeper.SetLegacyRouter(govRouter) + // appKeepers.GovKeeper = *govKeeper appKeepers.GovKeeper = *govKeeper.SetHooks( govtypes.NewMultiGovHooks( // register the governance hooks diff --git a/app/modules.go b/app/modules.go index c4ea6437ad..b9d4435e02 100644 --- a/app/modules.go +++ b/app/modules.go @@ -48,8 +48,8 @@ import ( 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" - ibcprovider "github.com/cosmos/interchain-security/v3/x/ccv/provider" - ibcproviderclient "github.com/cosmos/interchain-security/v3/x/ccv/provider/client" + 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/strangelove-ventures/packet-forward-middleware/v7/router" @@ -90,9 +90,9 @@ var ModuleBasics = module.NewBasicManager( upgradeclient.LegacyCancelProposalHandler, ibcclientclient.UpdateClientProposalHandler, ibcclientclient.UpgradeProposalHandler, - ibcproviderclient.ConsumerAdditionProposalHandler, - ibcproviderclient.ConsumerRemovalProposalHandler, - ibcproviderclient.EquivocationProposalHandler, + icsproviderclient.ConsumerAdditionProposalHandler, + icsproviderclient.ConsumerRemovalProposalHandler, + icsproviderclient.EquivocationProposalHandler, }, ), sdkparams.AppModuleBasic{}, @@ -109,7 +109,7 @@ var ModuleBasics = module.NewBasicManager( router.AppModuleBasic{}, ica.AppModuleBasic{}, globalfee.AppModule{}, - ibcprovider.AppModuleBasic{}, + icsprovider.AppModuleBasic{}, consensus.AppModuleBasic{}, ) diff --git a/go.mod b/go.mod index 2e25abfaaf..ea03416f00 100644 --- a/go.mod +++ b/go.mod @@ -7,13 +7,13 @@ require ( cosmossdk.io/math v1.0.1 cosmossdk.io/simapp v0.0.0-20230602123434-616841b9704d cosmossdk.io/tools/rosetta v0.2.1 - github.com/cometbft/cometbft v0.37.1 + github.com/cometbft/cometbft v0.37.2 github.com/cometbft/cometbft-db v0.8.0 github.com/cosmos/cosmos-sdk v0.47.3 github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/gogoproto v1.4.10 github.com/cosmos/ibc-go/v7 v7.1.0 - github.com/cosmos/interchain-security/v3 v3.0.0-rc0 + github.com/cosmos/interchain-security/v3 v3.1.0 github.com/gorilla/mux v1.8.0 github.com/rakyll/statik v0.1.7 github.com/spf13/cast v1.5.1 diff --git a/go.sum b/go.sum index d323d9de5d..0cc85bd6eb 100644 --- a/go.sum +++ b/go.sum @@ -569,8 +569,8 @@ github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE github.com/coinbase/kryptology v1.8.0/go.mod h1:RYXOAPdzOGUe3qlSFkMGn58i3xUA8hmxYHksuq+8ciI= github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZr9ZvoCcA= github.com/coinbase/rosetta-sdk-go v0.7.9/go.mod h1:0/knutI7XGVqXmmH4OQD8OckFrbQ8yMsUZTG7FXCR2M= -github.com/cometbft/cometbft v0.37.1 h1:KLxkQTK2hICXYq21U2hn1W5hOVYUdQgDQ1uB+90xPIg= -github.com/cometbft/cometbft v0.37.1/go.mod h1:Y2MMMN//O5K4YKd8ze4r9jmk4Y7h0ajqILXbH5JQFVs= +github.com/cometbft/cometbft v0.37.2 h1:XB0yyHGT0lwmJlFmM4+rsRnczPlHoAKFX6K8Zgc2/Jc= +github.com/cometbft/cometbft v0.37.2/go.mod h1:Y2MMMN//O5K4YKd8ze4r9jmk4Y7h0ajqILXbH5JQFVs= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= @@ -609,8 +609,8 @@ github.com/cosmos/ibc-go/v7 v7.1.0 h1:SCLgs7tqVnzdIDO5MRLgovAnc696vTTKl+8qsTu8IM github.com/cosmos/ibc-go/v7 v7.1.0/go.mod h1:7MptlWeIyqmDiuJeRAFqBvXKY8Hybd+rF8vMSmGd2zg= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= -github.com/cosmos/interchain-security/v3 v3.0.0-rc0 h1:Rm2oMSCod27YkEHFZu5BqjkN3HYtxOrcuHDKMYJBDtw= -github.com/cosmos/interchain-security/v3 v3.0.0-rc0/go.mod h1:HKHw9u4xMm5QJV76A03ORAXB2zisgpcunXZSca8TBdg= +github.com/cosmos/interchain-security/v3 v3.1.0 h1:EKDJCIKIDLG45tvKwfoANrRPgqvqfUt/f1TNKx3b7Uo= +github.com/cosmos/interchain-security/v3 v3.1.0/go.mod h1:2fILBgypEZcwR3BSzKDw+EsYtMKv9Z6cYXfouh4xTYU= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= github.com/cosmos/ledger-cosmos-go v0.12.2 h1:/XYaBlE2BJxtvpkHiBm97gFGSGmYGKunKyF3nNqAXZA= diff --git a/proto/buf.lock b/proto/buf.lock index 92d4c31f60..9266086911 100644 --- a/proto/buf.lock +++ b/proto/buf.lock @@ -26,6 +26,11 @@ deps: repository: ics23 commit: 55085f7c710a45f58fa09947208eb70b digest: shake256:9bf0bc495b5a11c88d163d39ef521bc4b00bc1374a05758c91d82821bdc61f09e8c2c51dda8452529bf80137f34d852561eacbe9550a59015d51cecb0dacb628 + - remote: buf.build + owner: cosmos + repository: interchain-security + commit: 4fcaba68958648a180fdc72c487018b5 + digest: shake256:a699ee174513d757cbd2f7a5827f9622b15c0204fe850bdeedbeb4e141f6c33a0e3e341e7aaf6cdd2e05f3deaf6932282805a090b0624759a2418ed7aceb3bc7 - remote: buf.build owner: googleapis repository: googleapis diff --git a/proto/buf.yaml b/proto/buf.yaml index d8b1f9ce8e..0be5bfc26d 100644 --- a/proto/buf.yaml +++ b/proto/buf.yaml @@ -11,6 +11,7 @@ deps: - buf.build/cosmos/ibc:fbb44f5ad3194450af479a615fa715d9 - buf.build/googleapis/googleapis - buf.build/cosmos/ics23:b1abd8678aab07165efd453c96796a179eb3131f + - buf.build/cosmos/interchain-security:064c601231b85066bfaf734efec2751a672528a7 breaking: use: diff --git a/tests/e2e/chain.go b/tests/e2e/chain.go index c8a8eb4346..22339a351a 100644 --- a/tests/e2e/chain.go +++ b/tests/e2e/chain.go @@ -19,6 +19,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" gaiaparams "github.com/cosmos/gaia/v11/app/params" ) @@ -48,6 +49,7 @@ func init() { upgradetypes.RegisterInterfaces(encodingConfig.InterfaceRegistry) distribtypes.RegisterInterfaces(encodingConfig.InterfaceRegistry) + providertypes.RegisterInterfaces(encodingConfig.InterfaceRegistry) cdc = encodingConfig.Marshaler txConfig = encodingConfig.TxConfig diff --git a/tests/e2e/docker/hermes.Dockerfile b/tests/e2e/docker/hermes.Dockerfile index 8230f1f22b..81d675079f 100644 --- a/tests/e2e/docker/hermes.Dockerfile +++ b/tests/e2e/docker/hermes.Dockerfile @@ -1,4 +1,4 @@ -FROM informalsystems/hermes:1.4.1 AS hermes-builder +FROM --platform=linux/amd64 informalsystems/hermes:1.4.1 AS hermes-builder FROM debian:buster-slim USER root diff --git a/tests/e2e/e2e_exec_test.go b/tests/e2e/e2e_exec_test.go index 7d6ecb8fc6..2ba718b430 100644 --- a/tests/e2e/e2e_exec_test.go +++ b/tests/e2e/e2e_exec_test.go @@ -380,7 +380,6 @@ func (s *IntegrationTestSuite) runGovExec(c *chain, valIdx int, submitterAddr, g } gaiaCommand = concatFlags(gaiaCommand, proposalFlags, generalFlags) - s.T().Logf("Executing gaiad tx gov %s on chain %s", govCommand, c.id) s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) s.T().Logf("Successfully executed %s", govCommand) diff --git a/tests/e2e/e2e_gov_test.go b/tests/e2e/e2e_gov_test.go index 2e7a668481..0756f8277f 100644 --- a/tests/e2e/e2e_gov_test.go +++ b/tests/e2e/e2e_gov_test.go @@ -147,64 +147,8 @@ func (s *IntegrationTestSuite) GovCommunityPoolSpend() { ) } -/* -AddRemoveConsumerChain tests adding and subsequently removing a new consumer chain to Gaia. -Test Benchmarks: -1. Submit and pass proposal to add consumer chain -2. Validation that consumer chain was added -3. Submit and pass proposal to remove consumer chain -4. Validation that consumer chain was removed -*/ -// func (s *IntegrationTestSuite) AddRemoveConsumerChain() { -// s.fundCommunityPool() -// chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) -// proposerAddress, _ := s.chainA.validators[0].keyInfo.GetAddress() -// sender := proposerAddress.String() -// consumerChainID := "consumer" -// s.writeAddRemoveConsumerProposals(s.chainA, consumerChainID) - -// // Gov tests may be run in arbitrary order, each test must increment proposalCounter to have the correct proposal id to submit and query -// // Add Consumer Chain -// proposalCounter++ -// submitGovFlags := []string{"consumer-addition", configFile(proposalAddConsumerChainFilename)} -// depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} -// voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} -// s.runGovProcess(chainAAPIEndpoint, sender, proposalCounter, ccvtypes.ProposalTypeConsumerAddition, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false) - -// // Query and assert consumer has been added -// s.execQueryConsumerChains(s.chainA, 0, gaiaHomePath, validateConsumerAddition, consumerChainID) - -// // Remove Consumer Chain -// proposalCounter++ -// submitGovFlags = []string{"consumer-removal", configFile(proposalRemoveConsumerChainFilename)} -// depositGovFlags = []string{strconv.Itoa(proposalCounter), depositAmount.String()} -// voteGovFlags = []string{strconv.Itoa(proposalCounter), "yes"} -// s.runGovProcess(chainAAPIEndpoint, sender, proposalCounter, ccvtypes.ProposalTypeConsumerRemoval, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false) -// // Query and assert consumer has been removed -// s.execQueryConsumerChains(s.chainA, 0, gaiaHomePath, validateConsumerRemoval, consumerChainID) -// } - -// func validateConsumerAddition(res ccvtypes.QueryConsumerChainsResponse, consumerChainID string) bool { -// if res.Size() == 0 { -// return false -// } -// for _, chain := range res.GetChains() { -// return strings.Compare(chain.ChainId, consumerChainID) == 0 -// } -// return false -// } - -// func validateConsumerRemoval(res ccvtypes.QueryConsumerChainsResponse, consumerChainID string) bool { -// if res.Size() > 0 { -// for _, chain := range res.GetChains() { -// if strings.Compare(chain.ChainId, consumerChainID) == 0 { -// return false -// } -// } -// } -// return true -// } - +// NOTE: @MSalopek +// rename to runGovLegacyProcess or submitLegacyGovProposal func (s *IntegrationTestSuite) runGovProcess(chainAAPIEndpoint, sender string, proposalID int, proposalType string, submitFlags []string, depositFlags []string, voteFlags []string, voteCommand string, withDeposit bool) { s.T().Logf("Submitting Gov Proposal: %s", proposalType) // min deposit of 1000uatom is required in e2e tests, otherwise the gov antehandler causes the proposal to be dropped @@ -219,6 +163,8 @@ func (s *IntegrationTestSuite) runGovProcess(chainAAPIEndpoint, sender string, p s.submitGovCommand(chainAAPIEndpoint, sender, proposalID, voteCommand, voteFlags, govtypesv1beta1.StatusPassed) } +// NOTE: @MSalopek +// rename to runGovProcess or submitGovProposal func (s *IntegrationTestSuite) runGovProcessV1(chainAAPIEndpoint, sender string, proposalID int, proposalType string, submitFlags []string, depositFlags []string, voteFlags []string, voteCommand string, withDeposit bool) { s.T().Logf("Submitting Gov Proposal: %s", proposalType) // min deposit of 1000uatom is required in e2e tests, otherwise the gov antehandler causes the proposal to be dropped @@ -282,7 +228,6 @@ func (s *IntegrationTestSuite) submitGovCommand(chainAAPIEndpoint, sender string func() bool { proposal, err := queryGovProposal(chainAAPIEndpoint, proposalID) s.Require().NoError(err) - return proposal.GetProposal().Status == expectedSuccessStatus }, 15*time.Second, diff --git a/tests/e2e/e2e_ics_test.go b/tests/e2e/e2e_ics_test.go new file mode 100644 index 0000000000..b30ac32311 --- /dev/null +++ b/tests/e2e/e2e_ics_test.go @@ -0,0 +1,139 @@ +package e2e + +import ( + "encoding/json" + "fmt" + "path/filepath" + "strconv" + "strings" + "time" + + ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" +) + +const ( + proposalAddConsumerChainFilename = "proposal_add_consumer.json" + proposalRemoveConsumerChainFilename = "proposal_remove_consumer.json" +) + +type ConsumerAdditionProposalWithDeposit struct { + providertypes.ConsumerAdditionProposal + Deposit string `json:"deposit"` + Summary string `json:"summary"` // required on legacy proposals +} + +type ConsumerRemovalProposalWithDeposit struct { + providertypes.ConsumerRemovalProposal + Deposit string `json:"deposit"` + Summary string `json:"summary"` // required on legacy proposals +} + +func (s *IntegrationTestSuite) writeAddRemoveConsumerProposals(c *chain, consumerChainID string) { + hash, _ := json.Marshal("Z2VuX2hhc2g=") + addProp := &providertypes.ConsumerAdditionProposal{ + Title: "Create consumer chain", + Description: "First consumer chain", + ChainId: consumerChainID, + InitialHeight: ibcclienttypes.Height{ + RevisionHeight: 1, + }, + GenesisHash: hash, + BinaryHash: hash, + SpawnTime: time.Now(), + UnbondingPeriod: time.Duration(100000000000), + CcvTimeoutPeriod: time.Duration(100000000000), + TransferTimeoutPeriod: time.Duration(100000000000), + ConsumerRedistributionFraction: "0.75", + BlocksPerDistributionTransmission: 10, + HistoricalEntries: 10000, + } + addPropWithDeposit := ConsumerAdditionProposalWithDeposit{ + ConsumerAdditionProposal: *addProp, + Deposit: "1000uatom", + // Summary is + Summary: "Summary for the First consumer chain addition proposal", + } + + removeProp := &providertypes.ConsumerRemovalProposal{ + Title: "Remove consumer chain", + Description: "Removing consumer chain", + ChainId: consumerChainID, + StopTime: time.Now(), + } + + removePropWithDeposit := ConsumerRemovalProposalWithDeposit{ + ConsumerRemovalProposal: *removeProp, + Summary: "Summary for the First consumer chain removal proposal", + Deposit: "1000uatom", + } + + consumerAddBody, err := json.MarshalIndent(addPropWithDeposit, "", " ") + s.Require().NoError(err) + + consumerRemoveBody, err := json.MarshalIndent(removePropWithDeposit, "", " ") + s.Require().NoError(err) + + err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalAddConsumerChainFilename), consumerAddBody) + s.Require().NoError(err) + err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalRemoveConsumerChainFilename), consumerRemoveBody) + s.Require().NoError(err) +} + +/* +AddRemoveConsumerChain tests adding and subsequently removing a new consumer chain to Gaia. +Test Benchmarks: +1. Submit and pass proposal to add consumer chain +2. Validation that consumer chain was added +3. Submit and pass proposal to remove consumer chain +4. Validation that consumer chain was removed +*/ +func (s *IntegrationTestSuite) AddRemoveConsumerChain() { + s.fundCommunityPool() + chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) + proposerAddress, _ := s.chainA.validators[0].keyInfo.GetAddress() + sender := proposerAddress.String() + consumerChainID := "consumer" + s.writeAddRemoveConsumerProposals(s.chainA, consumerChainID) + + // Gov tests may be run in arbitrary order, each test must increment proposalCounter to have the correct proposal id to submit and query + // Add Consumer Chain + proposalCounter++ + submitGovFlags := []string{"consumer-addition", configFile(proposalAddConsumerChainFilename)} + depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} + voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} + s.runGovProcess(chainAAPIEndpoint, sender, proposalCounter, providertypes.ProposalTypeConsumerAddition, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false) + + // Query and assert consumer has been added + s.execQueryConsumerChains(s.chainA, 0, gaiaHomePath, validateConsumerAddition, consumerChainID) + + // Remove Consumer Chain + proposalCounter++ + submitGovFlags = []string{"consumer-removal", configFile(proposalRemoveConsumerChainFilename)} + depositGovFlags = []string{strconv.Itoa(proposalCounter), depositAmount.String()} + voteGovFlags = []string{strconv.Itoa(proposalCounter), "yes"} + s.runGovProcess(chainAAPIEndpoint, sender, proposalCounter, providertypes.ProposalTypeConsumerRemoval, submitGovFlags, depositGovFlags, voteGovFlags, "vote", false) + // Query and assert consumer has been removed + s.execQueryConsumerChains(s.chainA, 0, gaiaHomePath, validateConsumerRemoval, consumerChainID) +} + +func validateConsumerAddition(res providertypes.QueryConsumerChainsResponse, consumerChainID string) bool { + if res.Size() == 0 { + return false + } + for _, chain := range res.GetChains() { + return strings.Compare(chain.ChainId, consumerChainID) == 0 + } + return false +} + +func validateConsumerRemoval(res providertypes.QueryConsumerChainsResponse, consumerChainID string) bool { + if res.Size() > 0 { + for _, chain := range res.GetChains() { + if strings.Compare(chain.ChainId, consumerChainID) == 0 { + return false + } + } + } + return true +} diff --git a/tests/e2e/e2e_query_exec_test.go b/tests/e2e/e2e_query_exec_test.go index 184732a6a1..666af3ec1c 100644 --- a/tests/e2e/e2e_query_exec_test.go +++ b/tests/e2e/e2e_query_exec_test.go @@ -1,47 +1,47 @@ package e2e -// import ( -// "context" -// "fmt" -// "time" +import ( + "context" + "fmt" + "time" -// ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" + ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" -// "github.com/cosmos/cosmos-sdk/client/flags" -// ) + "github.com/cosmos/cosmos-sdk/client/flags" +) -// func (s *IntegrationTestSuite) execQueryConsumerChains( -// c *chain, -// valIdx int, -// homePath string, -// queryValidation func(res ccvtypes.QueryConsumerChainsResponse, consumerChainId string) bool, -// consumerChainID string, -// ) { -// ctx, cancel := context.WithTimeout(context.Background(), time.Minute) -// defer cancel() +func (s *IntegrationTestSuite) execQueryConsumerChains( + c *chain, + valIdx int, + homePath string, + queryValidation func(res ccvtypes.QueryConsumerChainsResponse, consumerChainId string) bool, + consumerChainID string, +) { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() -// s.T().Logf("Querying consumer chains for chain: %s", c.id) -// gaiaCommand := []string{ -// gaiadBinary, -// "query", -// "provider", -// "list-consumer-chains", -// fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), -// fmt.Sprintf("--%s=%s", flags.FlagHome, homePath), -// "--output=json", -// } + s.T().Logf("Querying consumer chains for chain: %s", c.id) + gaiaCommand := []string{ + gaiadBinary, + "query", + "provider", + "list-consumer-chains", + fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), + fmt.Sprintf("--%s=%s", flags.FlagHome, homePath), + "--output=json", + } -// s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.validateQueryConsumers(queryValidation, consumerChainID)) -// s.T().Logf("Successfully queried consumer chains for chain %s", c.id) -// } + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.validateQueryConsumers(queryValidation, consumerChainID)) + s.T().Logf("Successfully queried consumer chains for chain %s", c.id) +} -// func (s *IntegrationTestSuite) validateQueryConsumers(queryValidation func(ccvtypes.QueryConsumerChainsResponse, string) bool, consumerChainID string) func([]byte, []byte) bool { -// return func(stdOut []byte, stdErr []byte) bool { -// var queryConsumersRes ccvtypes.QueryConsumerChainsResponse -// if err := cdc.UnmarshalJSON(stdOut, &queryConsumersRes); err != nil { -// s.T().Logf("Error unmarshalling query consumer chains: %s", err.Error()) -// return false -// } -// return queryValidation(queryConsumersRes, consumerChainID) -// } -// } +func (s *IntegrationTestSuite) validateQueryConsumers(queryValidation func(ccvtypes.QueryConsumerChainsResponse, string) bool, consumerChainID string) func([]byte, []byte) bool { + return func(stdOut []byte, stdErr []byte) bool { + var queryConsumersRes ccvtypes.QueryConsumerChainsResponse + if err := cdc.UnmarshalJSON(stdOut, &queryConsumersRes); err != nil { + s.T().Logf("Error unmarshalling query consumer chains: %s", err.Error()) + return false + } + return queryValidation(queryConsumersRes, consumerChainID) + } +} diff --git a/tests/e2e/e2e_setup_test.go b/tests/e2e/e2e_setup_test.go index 84bdf6499e..9aa1ef43de 100644 --- a/tests/e2e/e2e_setup_test.go +++ b/tests/e2e/e2e_setup_test.go @@ -38,7 +38,6 @@ import ( "github.com/ory/dockertest/v3" "github.com/stretchr/testify/suite" - // // ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" // "github.com/cosmos/cosmos-sdk/crypto/hd" // "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/ory/dockertest/v3/docker" @@ -600,7 +599,6 @@ func (s *IntegrationTestSuite) runValidators(c *chain, portOffset int) { if status.SyncInfo.CatchingUp || status.SyncInfo.LatestBlockHeight < 3 { return false } - return true }, 5*time.Minute, @@ -910,63 +908,6 @@ func (s *IntegrationTestSuite) writeGovLegProposal(c *chain, height int64, name s.Require().NoError(err) } -// type ConsumerAdditionProposalWithDeposit struct { -// ccvprovider.ConsumerAdditionProposal -// Deposit string `json:"deposit"` -// } -// -// type ConsumerRemovalProposalWithDeposit struct { -// ccvprovider.ConsumerRemovalProposal -// Deposit string `json:"deposit"` -// } -// -// func (s *IntegrationTestSuite) writeAddRemoveConsumerProposals(c *chain, consumerChainID string) { -// hash, _ := json.Marshal("Z2VuX2hhc2g=") -// addProp := &ccvprovider.ConsumerAdditionProposal{ -// Title: "Create consumer chain", -// Description: "First consumer chain", -// ChainId: consumerChainID, -// InitialHeight: ibcclienttypes.Height{ -// RevisionHeight: 1, -// }, -// GenesisHash: hash, -// BinaryHash: hash, -// SpawnTime: time.Now(), -// UnbondingPeriod: time.Duration(100000000000), -// CcvTimeoutPeriod: time.Duration(100000000000), -// TransferTimeoutPeriod: time.Duration(100000000000), -// ConsumerRedistributionFraction: "0.75", -// BlocksPerDistributionTransmission: 10, -// HistoricalEntries: 10000, -// } -// addPropWithDeposit := ConsumerAdditionProposalWithDeposit{ -// ConsumerAdditionProposal: *addProp, -// Deposit: "1000uatom", -// } -// -// removeProp := &ccvprovider.ConsumerRemovalProposal{ -// Title: "Remove consumer chain", -// Description: "Removing consumer chain", -// ChainId: consumerChainID, -// StopTime: time.Now(), -// } -// -// removePropWithDeposit := ConsumerRemovalProposalWithDeposit{ -// ConsumerRemovalProposal: *removeProp, -// Deposit: "1000uatom", -// } -// -// consumerAddBody, err := json.MarshalIndent(addPropWithDeposit, "", " ") -// s.Require().NoError(err) -// -// consumerRemoveBody, err := json.MarshalIndent(removePropWithDeposit, "", " ") -// s.Require().NoError(err) -// -// err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalAddConsumerChainFilename), consumerAddBody) -// s.Require().NoError(err) -// err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalRemoveConsumerChainFilename), consumerRemoveBody) -// s.Require().NoError(err) -// } func configFile(filename string) string { filepath := filepath.Join(gaiaConfigPath, filename) return filepath diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go index daf20a21a8..6f5d231b2e 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/e2e/e2e_test.go @@ -76,7 +76,7 @@ func (s *IntegrationTestSuite) TestGov() { s.GovSoftwareUpgrade() s.GovCancelSoftwareUpgrade() s.GovCommunityPoolSpend() - // s.AddRemoveConsumerChain() + s.AddRemoveConsumerChain() } func (s *IntegrationTestSuite) TestIBC() { From 2e4d98d95a2048f1289bd4d55a3ac09d3231cf06 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Tue, 26 Sep 2023 14:48:41 +0200 Subject: [PATCH 06/43] chore: refactor remaining E2E tests for SDK v47 (#2744) * add bank multi-send api test * add cancel-unbond ET * nits * nits * nits * reformat * fix * reformat * lint * remove simapp from genesis test * nit --- tests/e2e/e2e_bank_test.go | 75 +++++++-- tests/e2e/e2e_exec_test.go | 94 ++++++++++- tests/e2e/e2e_staking_test.go | 85 +++++++++- tests/e2e/e2e_vesting_test.go | 6 +- tests/e2e/query.go | 15 +- x/globalfee/genesis_test.go | 304 +++++++++++++++++----------------- 6 files changed, 401 insertions(+), 178 deletions(-) diff --git a/tests/e2e/e2e_bank_test.go b/tests/e2e/e2e_bank_test.go index bb9e7ffbc2..2abae83599 100644 --- a/tests/e2e/e2e_bank_test.go +++ b/tests/e2e/e2e_bank_test.go @@ -9,50 +9,89 @@ import ( func (s *IntegrationTestSuite) testBankTokenTransfer() { s.Run("send_photon_between_accounts", func() { - var err error - senderAddress, _ := s.chainA.validators[0].keyInfo.GetAddress() - sender := senderAddress.String() + var ( + err error + valIdx = 0 + c = s.chainA + chainEndpoint = fmt.Sprintf("http://%s", s.valResources[c.id][valIdx].GetHostPort("1317/tcp")) + ) - recipientAddress, _ := s.chainA.validators[1].keyInfo.GetAddress() - recipient := recipientAddress.String() + // define one sender and two recipient accounts + alice, _ := c.genesisAccounts[1].keyInfo.GetAddress() + bob, _ := c.genesisAccounts[2].keyInfo.GetAddress() + charlie, _ := c.genesisAccounts[3].keyInfo.GetAddress() - chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) + var beforeAliceUAtomBalance, + beforeBobUAtomBalance, + beforeCharlieUAtomBalance, + afterAliceUAtomBalance, + afterBobUAtomBalance, + afterCharlieUAtomBalance sdk.Coin - var ( - beforeSenderUAtomBalance sdk.Coin - beforeRecipientUAtomBalance sdk.Coin + // get balances of sender and recipient accounts + s.Require().Eventually( + func() bool { + beforeAliceUAtomBalance, err = getSpecificBalance(chainEndpoint, alice.String(), uatomDenom) + s.Require().NoError(err) + + beforeBobUAtomBalance, err = getSpecificBalance(chainEndpoint, bob.String(), uatomDenom) + s.Require().NoError(err) + + beforeCharlieUAtomBalance, err = getSpecificBalance(chainEndpoint, charlie.String(), uatomDenom) + s.Require().NoError(err) + + return beforeAliceUAtomBalance.IsValid() && beforeBobUAtomBalance.IsValid() && beforeCharlieUAtomBalance.IsValid() + }, + 10*time.Second, + 5*time.Second, ) + // alice sends tokens to bob + s.execBankSend(s.chainA, valIdx, alice.String(), bob.String(), tokenAmount.String(), standardFees.String(), false) + + // check that the transfer was successful s.Require().Eventually( func() bool { - beforeSenderUAtomBalance, err = getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) + afterAliceUAtomBalance, err = getSpecificBalance(chainEndpoint, alice.String(), uatomDenom) s.Require().NoError(err) - beforeRecipientUAtomBalance, err = getSpecificBalance(chainAAPIEndpoint, recipient, uatomDenom) + afterBobUAtomBalance, err = getSpecificBalance(chainEndpoint, bob.String(), uatomDenom) s.Require().NoError(err) - return beforeSenderUAtomBalance.IsValid() && beforeRecipientUAtomBalance.IsValid() + decremented := beforeAliceUAtomBalance.Sub(tokenAmount).Sub(standardFees).IsEqual(afterAliceUAtomBalance) + incremented := beforeBobUAtomBalance.Add(tokenAmount).IsEqual(afterBobUAtomBalance) + + return decremented && incremented }, 10*time.Second, 5*time.Second, ) - s.execBankSend(s.chainA, 0, sender, recipient, tokenAmount.String(), standardFees.String(), false) + // save the updated account balances of alice and bob + beforeAliceUAtomBalance, beforeBobUAtomBalance = afterAliceUAtomBalance, afterBobUAtomBalance + + // alice sends tokens to bob and charlie, at once + s.execBankMultiSend(s.chainA, valIdx, alice.String(), []string{bob.String(), charlie.String()}, tokenAmount.String(), standardFees.String(), false) s.Require().Eventually( func() bool { - afterSenderUAtomBalance, err := getSpecificBalance(chainAAPIEndpoint, sender, uatomDenom) + afterAliceUAtomBalance, err = getSpecificBalance(chainEndpoint, alice.String(), uatomDenom) s.Require().NoError(err) - afterRecipientUAtomBalance, err := getSpecificBalance(chainAAPIEndpoint, recipient, uatomDenom) + afterBobUAtomBalance, err = getSpecificBalance(chainEndpoint, bob.String(), uatomDenom) s.Require().NoError(err) - decremented := beforeSenderUAtomBalance.Sub(tokenAmount).Sub(standardFees).IsEqual(afterSenderUAtomBalance) - incremented := beforeRecipientUAtomBalance.Add(tokenAmount).IsEqual(afterRecipientUAtomBalance) + afterCharlieUAtomBalance, err = getSpecificBalance(chainEndpoint, charlie.String(), uatomDenom) + s.Require().NoError(err) + + // assert alice's account gets decremented the amount of tokens twice + decremented := beforeAliceUAtomBalance.Sub(tokenAmount).Sub(tokenAmount).Sub(standardFees).IsEqual(afterAliceUAtomBalance) + incremented := beforeBobUAtomBalance.Add(tokenAmount).IsEqual(afterBobUAtomBalance) && + beforeCharlieUAtomBalance.Add(tokenAmount).IsEqual(afterCharlieUAtomBalance) return decremented && incremented }, - time.Minute, + 10*time.Second, 5*time.Second, ) }) diff --git a/tests/e2e/e2e_exec_test.go b/tests/e2e/e2e_exec_test.go index 2ba718b430..134dfdb909 100644 --- a/tests/e2e/e2e_exec_test.go +++ b/tests/e2e/e2e_exec_test.go @@ -284,6 +284,44 @@ func (s *IntegrationTestSuite) execBankSend( s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.expectErrExecValidation(c, valIdx, expectErr)) } +func (s *IntegrationTestSuite) execBankMultiSend( + c *chain, + valIdx int, + from string, + to []string, + amt string, + fees string, + expectErr bool, + opt ...flagOption, +) { + // TODO remove the hardcode opt after refactor, all methods should accept custom flags + opt = append(opt, withKeyValue(flagFees, fees)) + opt = append(opt, withKeyValue(flagFrom, from)) + opts := applyOptions(c.id, opt) + + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("sending %s tokens from %s to %s on chain %s", amt, from, to, c.id) + + gaiaCommand := []string{ + gaiadBinary, + txCommand, + banktypes.ModuleName, + "multi-send", + from, + } + + gaiaCommand = append(gaiaCommand, to...) + gaiaCommand = append(gaiaCommand, amt, "-y") + + for flag, value := range opts { + gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.expectErrExecValidation(c, valIdx, expectErr)) +} + type txBankSend struct { from string to string @@ -428,7 +466,7 @@ func (s *IntegrationTestSuite) runGovExec(c *chain, valIdx int, submitterAddr, g // }) // } -func (s *IntegrationTestSuite) executeDelegate(c *chain, valIdx int, amount, valOperAddress, delegatorAddr, home, delegateFees string) { //nolint:unparam +func (s *IntegrationTestSuite) execDelegate(c *chain, valIdx int, amount, valOperAddress, delegatorAddr, home, delegateFees string) { //nolint:unparam ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() @@ -455,8 +493,60 @@ func (s *IntegrationTestSuite) executeDelegate(c *chain, valIdx int, amount, val s.T().Logf("%s successfully delegated %s to %s", delegatorAddr, amount, valOperAddress) } -func (s *IntegrationTestSuite) executeRedelegate(c *chain, valIdx int, amount, originalValOperAddress, +func (s *IntegrationTestSuite) execUnbondDelegation(c *chain, valIdx int, amount, valOperAddress, delegatorAddr, home, delegateFees string) { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("Executing gaiad tx staking unbond %s", c.id) + + gaiaCommand := []string{ + gaiadBinary, + txCommand, + stakingtypes.ModuleName, + "unbond", + valOperAddress, + amount, + fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddr), + fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), + fmt.Sprintf("--%s=%s", flags.FlagGasPrices, delegateFees), + "--keyring-backend=test", + fmt.Sprintf("--%s=%s", flags.FlagHome, home), + "--output=json", + "-y", + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) + s.T().Logf("%s successfully undelegated %s to %s", delegatorAddr, amount, valOperAddress) +} + +func (s *IntegrationTestSuite) execCancelUnbondingDelegation(c *chain, valIdx int, amount, valOperAddress, creationHeight, delegatorAddr, home, delegateFees string) { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("Executing gaiad tx staking cancel-unbond %s", c.id) + + gaiaCommand := []string{ + gaiadBinary, + txCommand, + stakingtypes.ModuleName, + "cancel-unbond", + valOperAddress, + amount, + creationHeight, + fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddr), + fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), + fmt.Sprintf("--%s=%s", flags.FlagGasPrices, delegateFees), + "--keyring-backend=test", + fmt.Sprintf("--%s=%s", flags.FlagHome, home), + "--output=json", + "-y", + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) + s.T().Logf("%s successfully canceled unbonding %s to %s", delegatorAddr, amount, valOperAddress) +} +func (s *IntegrationTestSuite) execRedelegate(c *chain, valIdx int, amount, originalValOperAddress, newValOperAddress, delegatorAddr, home, delegateFees string, ) { ctx, cancel := context.WithTimeout(context.Background(), time.Minute) diff --git a/tests/e2e/e2e_staking_test.go b/tests/e2e/e2e_staking_test.go index e9ab52ab9e..0a616530d2 100644 --- a/tests/e2e/e2e_staking_test.go +++ b/tests/e2e/e2e_staking_test.go @@ -2,9 +2,12 @@ package e2e import ( "fmt" + "strconv" "time" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/staking/types" ) func (s *IntegrationTestSuite) testStaking() { @@ -26,7 +29,7 @@ func (s *IntegrationTestSuite) testStaking() { delegation := sdk.NewCoin(uatomDenom, delegationAmount) // 500 atom // Alice delegate uatom to Validator A - s.executeDelegate(s.chainA, 0, delegation.String(), validatorAddressA, delegatorAddress.String(), gaiaHomePath, fees.String()) + s.execDelegate(s.chainA, 0, delegation.String(), validatorAddressA, delegatorAddress.String(), gaiaHomePath, fees.String()) // Validate delegation successful s.Require().Eventually( @@ -41,8 +44,11 @@ func (s *IntegrationTestSuite) testStaking() { 5*time.Second, ) - // Alice re-delegate uatom from Validator A to Validator B - s.executeRedelegate(s.chainA, 0, delegation.String(), validatorAddressA, validatorAddressB, delegatorAddress.String(), gaiaHomePath, fees.String()) + redelegationAmount := delegationAmount.Quo(sdk.NewInt(2)) + redelegation := sdk.NewCoin(uatomDenom, redelegationAmount) // 250 atom + + // Alice re-delegate half of her uatom delegation from Validator A to Validator B + s.execRedelegate(s.chainA, 0, redelegation.String(), validatorAddressA, validatorAddressB, delegatorAddress.String(), gaiaHomePath, fees.String()) // Validate re-delegation successful s.Require().Eventually( @@ -51,7 +57,78 @@ func (s *IntegrationTestSuite) testStaking() { amt := res.GetDelegationResponse().GetDelegation().GetShares() s.Require().NoError(err) - return amt.Equal(sdk.NewDecFromInt(delegationAmount)) + return amt.Equal(sdk.NewDecFromInt(redelegationAmount)) + }, + 20*time.Second, + 5*time.Second, + ) + + var ( + currDelegation sdk.Coin + currDelegationAmount math.Int + ) + + // query alice's current delegation from validator A + s.Require().Eventually( + func() bool { + res, err := queryDelegation(chainEndpoint, validatorAddressA, delegatorAddress.String()) + amt := res.GetDelegationResponse().GetDelegation().GetShares() + s.Require().NoError(err) + + currDelegationAmount = amt.TruncateInt() + currDelegation = sdk.NewCoin(uatomDenom, currDelegationAmount) + + return currDelegation.IsValid() + }, + 20*time.Second, + 5*time.Second, + ) + + // Alice unbonds all her uatom delegation from Validator A + s.execUnbondDelegation(s.chainA, 0, currDelegation.String(), validatorAddressA, delegatorAddress.String(), gaiaHomePath, fees.String()) + + var ubdDelegationEntry types.UnbondingDelegationEntry + + // validate unbonding delegations + s.Require().Eventually( + func() bool { + res, err := queryUnbondingDelegation(chainEndpoint, validatorAddressA, delegatorAddress.String()) + s.Require().NoError(err) + + s.Require().Len(res.GetUnbond().Entries, 1) + ubdDelegationEntry = res.GetUnbond().Entries[0] + + return ubdDelegationEntry.Balance.Equal(currDelegationAmount) + }, + 20*time.Second, + 5*time.Second, + ) + + // cancel the full amount of unbonding delegations from Validator A + s.execCancelUnbondingDelegation( + s.chainA, + 0, + currDelegation.String(), + validatorAddressA, + strconv.Itoa(int(ubdDelegationEntry.CreationHeight)), + delegatorAddress.String(), + gaiaHomePath, + fees.String(), + ) + + // validate that unbonding delegation was successfully canceled + s.Require().Eventually( + func() bool { + resDel, err := queryDelegation(chainEndpoint, validatorAddressA, delegatorAddress.String()) + amt := resDel.GetDelegationResponse().GetDelegation().GetShares() + s.Require().NoError(err) + + // expect that no unbonding delegations are found for validator A + _, err = queryUnbondingDelegation(chainEndpoint, validatorAddressA, delegatorAddress.String()) + s.Require().Error(err) + + // expect to get the delegation back + return amt.Equal(sdk.NewDecFromInt(currDelegationAmount)) }, 20*time.Second, 5*time.Second, diff --git a/tests/e2e/e2e_vesting_test.go b/tests/e2e/e2e_vesting_test.go index 0483cb8343..6d652a1d8b 100644 --- a/tests/e2e/e2e_vesting_test.go +++ b/tests/e2e/e2e_vesting_test.go @@ -59,7 +59,7 @@ func (s *IntegrationTestSuite) testDelayedVestingAccount(api string) { s.Require().Equal(vestingBalance.AmountOf(uatomDenom), balance.Amount) // Delegate coins should succeed - s.executeDelegate(chain, valIdx, vestingDelegationAmount.String(), valOpAddr, + s.execDelegate(chain, valIdx, vestingDelegationAmount.String(), valOpAddr, vestingDelayedAcc.String(), gaiaHomePath, vestingDelegationFees.String()) // Validate delegation successful @@ -128,7 +128,7 @@ func (s *IntegrationTestSuite) testContinuousVestingAccount(api string) { s.Require().Equal(vestingBalance.AmountOf(uatomDenom), balance.Amount) // Delegate coins should succeed - s.executeDelegate(chain, valIdx, vestingDelegationAmount.String(), + s.execDelegate(chain, valIdx, vestingDelegationAmount.String(), valOpAddr, continuousVestingAcc.String(), gaiaHomePath, vestingDelegationFees.String()) // Validate delegation successful @@ -267,7 +267,7 @@ func (s *IntegrationTestSuite) testPeriodicVestingAccount(api string) { //nolint } // Delegate coins should succeed - s.executeDelegate(chain, valIdx, vestingDelegationAmount.String(), valOpAddr, + s.execDelegate(chain, valIdx, vestingDelegationAmount.String(), valOpAddr, periodicVestingAddr, gaiaHomePath, vestingDelegationFees.String()) // Validate delegation successful diff --git a/tests/e2e/query.go b/tests/e2e/query.go index 15d4e10aa4..44d12bb303 100644 --- a/tests/e2e/query.go +++ b/tests/e2e/query.go @@ -33,12 +33,12 @@ func queryGaiaTx(endpoint, txHash string) error { } var result map[string]interface{} + if err := json.NewDecoder(resp.Body).Decode(&result); err != nil { return fmt.Errorf("failed to read response body: %w", err) } txResp := result["tx_response"].(map[string]interface{}) - if v := txResp["code"]; v.(float64) != 0 { return fmt.Errorf("tx %s failed with status code %v", txHash, v) } @@ -121,6 +121,19 @@ func queryDelegation(endpoint string, validatorAddr string, delegatorAddr string return res, nil } +func queryUnbondingDelegation(endpoint string, validatorAddr string, delegatorAddr string) (stakingtypes.QueryUnbondingDelegationResponse, error) { + var res stakingtypes.QueryUnbondingDelegationResponse + body, err := httpGet(fmt.Sprintf("%s/cosmos/staking/v1beta1/validators/%s/delegations/%s/unbonding_delegation", endpoint, validatorAddr, delegatorAddr)) + if err != nil { + return res, err + } + + if err = cdc.UnmarshalJSON(body, &res); err != nil { + return res, err + } + return res, nil +} + func queryDelegatorWithdrawalAddress(endpoint string, delegatorAddr string) (disttypes.QueryDelegatorWithdrawAddressResponse, error) { var res disttypes.QueryDelegatorWithdrawAddressResponse diff --git a/x/globalfee/genesis_test.go b/x/globalfee/genesis_test.go index e073054020..073e355ae2 100644 --- a/x/globalfee/genesis_test.go +++ b/x/globalfee/genesis_test.go @@ -1,161 +1,165 @@ package globalfee -// import ( -// "testing" -// "time" +import ( + "testing" + "time" -// "github.com/cosmos/cosmos-sdk/simapp" -// simappparams "github.com/cosmos/cosmos-sdk/simapp/params" -// "github.com/cosmos/cosmos-sdk/store" -// storetypes "github.com/cosmos/cosmos-sdk/store/types" -// sdk "github.com/cosmos/cosmos-sdk/types" -// paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" -// paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" -// "github.com/stretchr/testify/assert" -// "github.com/stretchr/testify/require" -// "github.com/tendermint/tendermint/libs/log" -// tmproto "github.com/tendermint/tendermint/proto/tendermint/types" -// dbm "github.com/tendermint/tm-db" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" -// "github.com/cosmos/gaia/v11/x/globalfee/types" -// ) + dbm "github.com/cometbft/cometbft-db" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" -// func TestDefaultGenesis(t *testing.T) { -// encCfg := simapp.MakeTestEncodingConfig() -// gotJSON := AppModuleBasic{}.DefaultGenesis(encCfg.Marshaler) -// assert.JSONEq(t, -// `{"params":{"minimum_gas_prices":[],"bypass_min_fee_msg_types":["/ibc.core.channel.v1.MsgRecvPacket","/ibc.core.channel.v1.MsgAcknowledgement","/ibc.core.client.v1.MsgUpdateClient","/ibc.core.channel.v1.MsgTimeout","/ibc.core.channel.v1.MsgTimeoutOnClose"], "max_total_bypass_min_fee_msg_gas_usage":"1000000"}}`, -// string(gotJSON), string(gotJSON)) -// } + "github.com/cometbft/cometbft/libs/log" + "github.com/cosmos/cosmos-sdk/store" + sdk "github.com/cosmos/cosmos-sdk/types" -// func TestValidateGenesis(t *testing.T) { -// encCfg := simapp.MakeTestEncodingConfig() -// specs := map[string]struct { -// src string -// expErr bool -// }{ -// "all good": { -// src: `{"params":{"minimum_gas_prices":[{"denom":"ALX", "amount":"1"}], "bypass_min_fee_msg_types":["/ibc.core.channel.v1.MsgRecvPacket"]}}`, -// expErr: false, -// }, -// "empty minimum": { -// src: `{"params":{"minimum_gas_prices":[], "bypass_min_fee_msg_types":[]}}`, -// expErr: false, -// }, -// "minimum and bypass not set": { -// src: `{"params":{}}`, -// expErr: false, -// }, -// "minimum not set": { -// src: `{"params":{"bypass_min_fee_msg_types":[]}}`, -// expErr: false, -// }, -// "bypass not set": { -// src: `{"params":{"minimum_gas_prices":[]}}`, -// expErr: false, -// }, -// "zero amount allowed": { -// src: `{"params":{"minimum_gas_prices":[{"denom":"ALX", "amount":"0"}]}}`, -// expErr: false, -// }, -// "duplicate denoms not allowed": { -// src: `{"params":{"minimum_gas_prices":[{"denom":"ALX", "amount":"1"},{"denom":"ALX", "amount":"2"}]}}`, -// expErr: true, -// }, -// "negative amounts not allowed": { -// src: `{"params":{"minimum_gas_prices":[{"denom":"ALX", "amount":"-1"}]}}`, -// expErr: true, -// }, -// "denom must be sorted": { -// src: `{"params":{"minimum_gas_prices":[{"denom":"ZLX", "amount":"1"},{"denom":"ALX", "amount":"2"}]}}`, -// expErr: true, -// }, -// "empty bypass msg types not allowed": { -// src: `{"params":{"bypass_min_fee_msg_types":[""]}}`, -// expErr: true, -// }, -// "sorted denoms is allowed": { -// src: `{"params":{"minimum_gas_prices":[{"denom":"ALX", "amount":"1"},{"denom":"ZLX", "amount":"2"}]}}`, -// expErr: false, -// }, -// } -// for name, spec := range specs { -// t.Run(name, func(t *testing.T) { -// gotErr := AppModuleBasic{}.ValidateGenesis(encCfg.Marshaler, nil, []byte(spec.src)) -// if spec.expErr { -// require.Error(t, gotErr) -// return -// } -// require.NoError(t, gotErr) -// }) -// } -// } + gaiaparams "github.com/cosmos/gaia/v11/app/params" + "github.com/cosmos/gaia/v11/x/globalfee/types" -// func TestInitExportGenesis(t *testing.T) { -// specs := map[string]struct { -// src string -// exp types.GenesisState -// }{ -// "single fee": { -// src: `{"params":{"minimum_gas_prices":[{"denom":"ALX", "amount":"1"}], "bypass_min_fee_msg_types":["/ibc.core.channel.v1.MsgRecvPacket"]}}`, -// exp: types.GenesisState{ -// Params: types.Params{ -// MinimumGasPrices: sdk.NewDecCoins(sdk.NewDecCoin("ALX", sdk.NewInt(1))), -// BypassMinFeeMsgTypes: []string{"/ibc.core.channel.v1.MsgRecvPacket"}, -// }, -// }, -// }, -// "multiple fee options": { -// src: `{"params":{"minimum_gas_prices":[{"denom":"ALX", "amount":"1"}, {"denom":"BLX", "amount":"0.001"}], "bypass_min_fee_msg_types":["/ibc.core.channel.v1.MsgRecvPacket","/ibc.core.channel.v1.MsgTimeoutOnClose"]}}`, -// exp: types.GenesisState{ -// Params: types.Params{ -// MinimumGasPrices: sdk.NewDecCoins(sdk.NewDecCoin("ALX", sdk.NewInt(1)), -// sdk.NewDecCoinFromDec("BLX", sdk.NewDecWithPrec(1, 3))), -// BypassMinFeeMsgTypes: []string{"/ibc.core.channel.v1.MsgRecvPacket", "/ibc.core.channel.v1.MsgTimeoutOnClose"}, -// }, -// }, -// }, -// "no fee set": { -// src: `{"params":{}}`, -// exp: types.GenesisState{ -// Params: types.Params{ -// MinimumGasPrices: sdk.DecCoins{}, -// BypassMinFeeMsgTypes: []string{}, -// }, -// }, -// }, -// } -// for name, spec := range specs { -// t.Run(name, func(t *testing.T) { -// ctx, encCfg, subspace := setupTestStore(t) -// m := NewAppModule(subspace) -// m.InitGenesis(ctx, encCfg.Marshaler, []byte(spec.src)) -// gotJSON := m.ExportGenesis(ctx, encCfg.Marshaler) -// var got types.GenesisState -// require.NoError(t, encCfg.Marshaler.UnmarshalJSON(gotJSON, &got)) -// assert.Equal(t, spec.exp, got, string(gotJSON)) -// }) -// } -// } + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) -// func setupTestStore(t *testing.T) (sdk.Context, simappparams.EncodingConfig, paramstypes.Subspace) { -// t.Helper() -// db := dbm.NewMemDB() -// ms := store.NewCommitMultiStore(db) -// encCfg := simapp.MakeTestEncodingConfig() -// keyParams := sdk.NewKVStoreKey(paramstypes.StoreKey) -// tkeyParams := sdk.NewTransientStoreKey(paramstypes.TStoreKey) -// ms.MountStoreWithDB(keyParams, storetypes.StoreTypeIAVL, db) -// ms.MountStoreWithDB(tkeyParams, storetypes.StoreTypeTransient, db) -// require.NoError(t, ms.LoadLatestVersion()) +func TestDefaultGenesis(t *testing.T) { + encCfg := gaiaparams.MakeEncodingConfig() + gotJSON := AppModuleBasic{}.DefaultGenesis(encCfg.Marshaler) + assert.JSONEq(t, + `{"params":{"minimum_gas_prices":[],"bypass_min_fee_msg_types":["/ibc.core.channel.v1.MsgRecvPacket","/ibc.core.channel.v1.MsgAcknowledgement","/ibc.core.client.v1.MsgUpdateClient","/ibc.core.channel.v1.MsgTimeout","/ibc.core.channel.v1.MsgTimeoutOnClose"], "max_total_bypass_min_fee_msg_gas_usage":"1000000"}}`, + string(gotJSON), string(gotJSON)) +} -// paramsKeeper := paramskeeper.NewKeeper(encCfg.Marshaler, encCfg.Amino, keyParams, tkeyParams) +func TestValidateGenesis(t *testing.T) { + encCfg := gaiaparams.MakeEncodingConfig() + specs := map[string]struct { + src string + expErr bool + }{ + "all good": { + src: `{"params":{"minimum_gas_prices":[{"denom":"ALX", "amount":"1"}], "bypass_min_fee_msg_types":["/ibc.core.channel.v1.MsgRecvPacket"]}}`, + expErr: false, + }, + "empty minimum": { + src: `{"params":{"minimum_gas_prices":[], "bypass_min_fee_msg_types":[]}}`, + expErr: false, + }, + "minimum and bypass not set": { + src: `{"params":{}}`, + expErr: false, + }, + "minimum not set": { + src: `{"params":{"bypass_min_fee_msg_types":[]}}`, + expErr: false, + }, + "bypass not set": { + src: `{"params":{"minimum_gas_prices":[]}}`, + expErr: false, + }, + "zero amount allowed": { + src: `{"params":{"minimum_gas_prices":[{"denom":"ALX", "amount":"0"}]}}`, + expErr: false, + }, + "duplicate denoms not allowed": { + src: `{"params":{"minimum_gas_prices":[{"denom":"ALX", "amount":"1"},{"denom":"ALX", "amount":"2"}]}}`, + expErr: true, + }, + "negative amounts not allowed": { + src: `{"params":{"minimum_gas_prices":[{"denom":"ALX", "amount":"-1"}]}}`, + expErr: true, + }, + "denom must be sorted": { + src: `{"params":{"minimum_gas_prices":[{"denom":"ZLX", "amount":"1"},{"denom":"ALX", "amount":"2"}]}}`, + expErr: true, + }, + "empty bypass msg types not allowed": { + src: `{"params":{"bypass_min_fee_msg_types":[""]}}`, + expErr: true, + }, + "sorted denoms is allowed": { + src: `{"params":{"minimum_gas_prices":[{"denom":"ALX", "amount":"1"},{"denom":"ZLX", "amount":"2"}]}}`, + expErr: false, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + gotErr := AppModuleBasic{}.ValidateGenesis(encCfg.Marshaler, nil, []byte(spec.src)) + if spec.expErr { + require.Error(t, gotErr) + return + } + require.NoError(t, gotErr) + }) + } +} -// ctx := sdk.NewContext(ms, tmproto.Header{ -// Height: 1234567, -// Time: time.Date(2020, time.April, 22, 12, 0, 0, 0, time.UTC), -// }, false, log.NewNopLogger()) +func TestInitExportGenesis(t *testing.T) { + specs := map[string]struct { + src string + exp types.GenesisState + }{ + "single fee": { + src: `{"params":{"minimum_gas_prices":[{"denom":"ALX", "amount":"1"}], "bypass_min_fee_msg_types":["/ibc.core.channel.v1.MsgRecvPacket"]}}`, + exp: types.GenesisState{ + Params: types.Params{ + MinimumGasPrices: sdk.NewDecCoins(sdk.NewDecCoin("ALX", sdk.NewInt(1))), + BypassMinFeeMsgTypes: []string{"/ibc.core.channel.v1.MsgRecvPacket"}, + }, + }, + }, + "multiple fee options": { + src: `{"params":{"minimum_gas_prices":[{"denom":"ALX", "amount":"1"}, {"denom":"BLX", "amount":"0.001"}], "bypass_min_fee_msg_types":["/ibc.core.channel.v1.MsgRecvPacket","/ibc.core.channel.v1.MsgTimeoutOnClose"]}}`, + exp: types.GenesisState{ + Params: types.Params{ + MinimumGasPrices: sdk.NewDecCoins(sdk.NewDecCoin("ALX", sdk.NewInt(1)), + sdk.NewDecCoinFromDec("BLX", sdk.NewDecWithPrec(1, 3))), + BypassMinFeeMsgTypes: []string{"/ibc.core.channel.v1.MsgRecvPacket", "/ibc.core.channel.v1.MsgTimeoutOnClose"}, + }, + }, + }, + "no fee set": { + src: `{"params":{}}`, + exp: types.GenesisState{ + Params: types.Params{ + MinimumGasPrices: sdk.DecCoins{}, + BypassMinFeeMsgTypes: []string{}, + }, + }, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + ctx, encCfg, subspace := setupTestStore(t) + m := NewAppModule(subspace) + m.InitGenesis(ctx, encCfg.Marshaler, []byte(spec.src)) + gotJSON := m.ExportGenesis(ctx, encCfg.Marshaler) + var got types.GenesisState + require.NoError(t, encCfg.Marshaler.UnmarshalJSON(gotJSON, &got)) + assert.Equal(t, spec.exp, got, string(gotJSON)) + }) + } +} -// subspace := paramsKeeper.Subspace(ModuleName).WithKeyTable(types.ParamKeyTable()) -// return ctx, encCfg, subspace -// } +func setupTestStore(t *testing.T) (sdk.Context, gaiaparams.EncodingConfig, paramstypes.Subspace) { + t.Helper() + db := dbm.NewMemDB() + ms := store.NewCommitMultiStore(db) + encCfg := gaiaparams.MakeEncodingConfig() + keyParams := sdk.NewKVStoreKey(paramstypes.StoreKey) + tkeyParams := sdk.NewTransientStoreKey(paramstypes.TStoreKey) + ms.MountStoreWithDB(keyParams, storetypes.StoreTypeIAVL, db) + ms.MountStoreWithDB(tkeyParams, storetypes.StoreTypeTransient, db) + require.NoError(t, ms.LoadLatestVersion()) + + ctx := sdk.NewContext(ms, tmproto.Header{ + Height: 1234567, + Time: time.Date(2020, time.April, 22, 12, 0, 0, 0, time.UTC), + }, false, log.NewNopLogger()) + + subspace := paramstypes.NewSubspace(encCfg.Marshaler, + encCfg.Amino, + keyParams, + tkeyParams, + paramstypes.ModuleName, + ) + return ctx, encCfg, subspace +} From ff8acabb1a551082fc31f836040f9993ccb23e86 Mon Sep 17 00:00:00 2001 From: MSalopek Date: Fri, 8 Dec 2023 10:58:17 +0100 Subject: [PATCH 07/43] deps: bump go version to 1.21 --- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/nightly-tests.yml | 2 +- .github/workflows/release-sims.yml | 4 ++-- .github/workflows/release.yml | 2 +- .github/workflows/sim-label.yml | 4 ++-- .github/workflows/sims.yml | 10 +++++----- .github/workflows/test.yml | 8 ++++---- Dockerfile | 2 +- Makefile | 4 ++-- contrib/Dockerfile.test | 2 +- e2e.Dockerfile | 2 +- go.mod | 2 +- go.sum | 23 +++++++++++++++++++++++ 14 files changed, 46 insertions(+), 23 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 6037a95102..3f9656eee3 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -26,7 +26,7 @@ jobs: uses: actions/checkout@v3.5.2 - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.21" check-latest: true # Initializes the CodeQL tools for scanning. diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 97543a0ddc..ecac002828 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v3.5.2 - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.21" check-latest: true - uses: technote-space/get-diff-action@v6.1.2 id: git_diff diff --git a/.github/workflows/nightly-tests.yml b/.github/workflows/nightly-tests.yml index 572ee87d80..23de2453c6 100644 --- a/.github/workflows/nightly-tests.yml +++ b/.github/workflows/nightly-tests.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@v3.5.2 - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.21" check-latest: true - name: run-vulncheck id: vulncheck diff --git a/.github/workflows/release-sims.yml b/.github/workflows/release-sims.yml index 6ea0f02ca4..f37525e3ab 100644 --- a/.github/workflows/release-sims.yml +++ b/.github/workflows/release-sims.yml @@ -26,7 +26,7 @@ jobs: steps: - uses: actions/setup-go@v4 with: - go-version: 1.20.x + go-version: 1.21.x - name: Install runsim run: go install github.com/cosmos/tools/cmd/runsim@v1.0.0 - uses: actions/cache@v3.3.1 @@ -65,7 +65,7 @@ jobs: - uses: actions/checkout@v3.5.2 - uses: actions/setup-go@v4 with: - go-version: 1.20.x + go-version: 1.21.x - uses: technote-space/get-diff-action@v6.0.1 with: PATTERNS: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9361d207cc..6afb60fbaa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.21" - name: Set Env run: echo "TM_VERSION=$(go list -m github.com/tendermint/tendermint | sed 's:.* ::')" >> $GITHUB_ENV diff --git a/.github/workflows/sim-label.yml b/.github/workflows/sim-label.yml index f427fb08b2..ce6dd57dab 100644 --- a/.github/workflows/sim-label.yml +++ b/.github/workflows/sim-label.yml @@ -17,7 +17,7 @@ jobs: steps: - uses: actions/setup-go@v4 with: - go-version: 1.20.x + go-version: 1.21.x - name: Install runsim run: go install github.com/cosmos/tools/cmd/runsim@v1.0.0 - uses: actions/cache@v3.3.1 @@ -33,7 +33,7 @@ jobs: - uses: actions/checkout@v3.5.2 - uses: actions/setup-go@v4 with: - go-version: 1.20.x + go-version: 1.21.x - uses: actions/cache@v3.3.1 with: path: ~/go/bin diff --git a/.github/workflows/sims.yml b/.github/workflows/sims.yml index 41a3d3357e..ac08bddd5d 100644 --- a/.github/workflows/sims.yml +++ b/.github/workflows/sims.yml @@ -21,7 +21,7 @@ jobs: steps: - uses: actions/setup-go@v4 with: - go-version: 1.20.x + go-version: 1.21.x - name: Install runsim run: go install github.com/cosmos/tools/cmd/runsim@v1.0.0 - uses: actions/cache@v3.3.1 @@ -36,7 +36,7 @@ jobs: - uses: actions/checkout@v3.5.2 - uses: actions/setup-go@v4 with: - go-version: 1.20.x + go-version: 1.21.x - uses: technote-space/get-diff-action@v6.0.1 with: PATTERNS: | @@ -60,7 +60,7 @@ jobs: - uses: actions/checkout@v3.5.2 - uses: actions/setup-go@v4 with: - go-version: 1.20.x + go-version: 1.21.x - uses: technote-space/get-diff-action@v6 with: PATTERNS: | @@ -82,7 +82,7 @@ jobs: steps: - uses: actions/setup-go@v4 with: - go-version: 1.20.x + go-version: 1.21.x - name: Install runsim run: go install github.com/cosmos/tools/cmd/runsim@v1.0.0 - uses: actions/cache@v3.3.1 @@ -107,7 +107,7 @@ jobs: steps: - uses: actions/setup-go@v4 with: - go-version: 1.20.x + go-version: 1.21.x - uses: actions/checkout@v3.5.2 - uses: actions/cache@v3.3.1 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 93a4300717..f42ebf99ea 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,7 +26,7 @@ jobs: - uses: actions/checkout@v3.5.2 - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.21" check-latest: true cache: true cache-dependency-path: go.sum @@ -65,7 +65,7 @@ jobs: steps: - uses: actions/setup-go@v4 with: - go-version: 1.20.x + go-version: 1.21.x - uses: actions/checkout@v3.5.2 - uses: technote-space/get-diff-action@v6.0.1 with: @@ -112,7 +112,7 @@ jobs: - uses: actions/checkout@v3.5.2 - uses: actions/setup-go@v4 with: - go-version: 1.20.x + go-version: 1.21.x - uses: technote-space/get-diff-action@v6.0.1 with: PATTERNS: | @@ -147,7 +147,7 @@ jobs: go.sum - uses: actions/setup-go@v4 with: - go-version: 1.20.x + go-version: 1.21.x - name: Install GaiaV10 run: | git checkout v10.0.0 diff --git a/Dockerfile b/Dockerfile index 01937d6117..b27042c088 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ ARG IMG_TAG=latest # Compile the gaiad binary -FROM golang:1.20-alpine AS gaiad-builder +FROM golang:1.21-alpine AS gaiad-builder WORKDIR /src/app/ COPY go.mod go.sum* ./ RUN go mod download diff --git a/Makefile b/Makefile index ae9f349444..a85756b2e7 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.20 +REQUIRE_GO_VERSION = 1.21 export GO111MODULE = on @@ -97,7 +97,7 @@ include contrib/devtools/Makefile check_version: ifneq ($(GO_SYSTEM_VERSION), $(REQUIRE_GO_VERSION)) - @echo "ERROR: Go version 1.20 is required for $(VERSION) of Gaia." + @echo "ERROR: Go version 1.21 is required for $(VERSION) of Gaia." exit 1 endif diff --git a/contrib/Dockerfile.test b/contrib/Dockerfile.test index df49e63fb9..569fa14a70 100644 --- a/contrib/Dockerfile.test +++ b/contrib/Dockerfile.test @@ -2,7 +2,7 @@ # > docker build -t gaia . # > docker run -it -p 46657:46657 -p 46656:46656 -v ~/.gaia:/root/.gaia gaia gaiad init # > docker run -it -p 46657:46657 -p 46656:46656 -v ~/.gaia:/root/.gaia gaia gaiad start -FROM golang:1.20-alpine AS build-env +FROM golang:1.21-alpine AS build-env # Set up dependencies ENV PACKAGES curl make git libc-dev bash gcc linux-headers eudev-dev python3 diff --git a/e2e.Dockerfile b/e2e.Dockerfile index 2c7eb0e112..f0be17c733 100644 --- a/e2e.Dockerfile +++ b/e2e.Dockerfile @@ -1,7 +1,7 @@ ARG IMG_TAG=latest # Compile the gaiad binary -FROM golang:1.20-alpine AS gaiad-builder +FROM golang:1.21-alpine AS gaiad-builder WORKDIR /src/app/ COPY go.mod go.sum* ./ RUN go mod download diff --git a/go.mod b/go.mod index ea03416f00..598c0d9c32 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/cosmos/gaia/v11 -go 1.20 +go 1.21 require ( cosmossdk.io/api v0.3.1 diff --git a/go.sum b/go.sum index 0cc85bd6eb..b11735568f 100644 --- a/go.sum +++ b/go.sum @@ -232,6 +232,7 @@ cloud.google.com/go/logging v1.6.1/go.mod h1:5ZO0mHHbvm8gEmeEUHrmDlTDSu5imF6MUP9 cloud.google.com/go/longrunning v0.1.1/go.mod h1:UUFxuDWkv22EuY93jjmDMFT5GPQKeFVJBIF6QlTqdsE= cloud.google.com/go/longrunning v0.3.0/go.mod h1:qth9Y41RRSUE69rDcOn6DdK3HfQfsUI0YSmW3iIlLJc= cloud.google.com/go/longrunning v0.4.1 h1:v+yFJOfKC3yZdY6ZUI933pIYdhyhV8S3NpWrXWmg7jM= +cloud.google.com/go/longrunning v0.4.1/go.mod h1:4iWDqhBZ70CvZ6BfETbvam3T8FMvLK+eFj0E6AaRQTo= cloud.google.com/go/managedidentities v1.3.0/go.mod h1:UzlW3cBOiPrzucO5qWkNkh0w33KFtBJU281hacNvsdE= cloud.google.com/go/managedidentities v1.4.0/go.mod h1:NWSBYbEMgqmbZsLIyKvxrYbtqOsxY1ZrGM+9RgDqInM= cloud.google.com/go/maps v0.1.0/go.mod h1:BQM97WGyfw9FWEmQMpZ5T6cpovXXSd1cGmFma94eubI= @@ -448,10 +449,12 @@ github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrd github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/Zilliqa/gozilliqa-sdk v1.2.1-0.20201201074141-dd0ecada1be6/go.mod h1:eSYp2T6f0apnuW8TzhV3f6Aff2SE8Dwio++U4ha4yEM= github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= +github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= +github.com/alecthomas/participle/v2 v2.0.0-alpha7/go.mod h1:NumScqsC42o9x+dGj8/YqsIfhrIQjFEOFovxotbBirA= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -505,6 +508,7 @@ github.com/btcsuite/btcd/btcec/v2 v2.1.2/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJ github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= github.com/btcsuite/btcd/btcutil v1.1.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ= +github.com/btcsuite/btcd/btcutil v1.1.2/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= @@ -521,6 +525,7 @@ github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= +github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= @@ -564,6 +569,7 @@ github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWH github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= +github.com/cockroachdb/apd/v3 v3.1.0/go.mod h1:6qgPBMXjATAdD/VefbRP9NoSLKjbB4LCoA7gN4LpHs4= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/coinbase/kryptology v1.8.0/go.mod h1:RYXOAPdzOGUe3qlSFkMGn58i3xUA8hmxYHksuq+8ciI= @@ -627,7 +633,9 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= +github.com/cucumber/common/gherkin/go/v22 v22.0.0/go.mod h1:3mJT10B2GGn3MvVPd3FwR7m2u4tLhSRhWUqJU4KN4Fg= github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= +github.com/cucumber/common/messages/go/v17 v17.1.1/go.mod h1:bpGxb57tDE385Rb2EohgUadLkAbhoC4IyCFi89u/JQI= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= @@ -699,10 +707,12 @@ github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSw github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= @@ -748,6 +758,7 @@ github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5Nq github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= +github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= @@ -767,6 +778,7 @@ github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v4.3.0+incompatible h1:CaSVZxm5B+7o45rtab4jC2G37WGYX1zQfuU2i6DSvnc= +github.com/gofrs/uuid v4.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= @@ -849,12 +861,14 @@ github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= +github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -957,6 +971,7 @@ github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdv github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= +github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= @@ -1012,6 +1027,7 @@ github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1C github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= @@ -1061,6 +1077,7 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -1171,6 +1188,7 @@ github.com/neilotoole/errgroup v0.1.6/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= @@ -1181,6 +1199,7 @@ github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= @@ -1206,6 +1225,7 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= +github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/ory/dockertest/v3 v3.10.0 h1:4K3z2VMe8Woe++invjaTB7VRyQXQy5UY+loujO4aNE4= github.com/ory/dockertest/v3 v3.10.0/go.mod h1:nr57ZbRWMqfsdGdFNLHz5jjNdDb7VVFnzAeW1n5N1Lg= github.com/oxyno-zeta/gomock-extra-matcher v1.1.0 h1:Yyk5ov0ZPKBXtVEeIWtc4J2XVrHuNoIK+0F2BUJgtsc= @@ -1282,6 +1302,7 @@ github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqn github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGnWA97M= +github.com/regen-network/gocuke v0.6.2/go.mod h1:zYaqIHZobHyd0xOrHGPQjbhGJsuZ1oElx150u2o1xuk= github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= @@ -1290,6 +1311,7 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -2132,6 +2154,7 @@ gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= +gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From d0a672ae7d9e492084c71b8f8086eefed67e4767 Mon Sep 17 00:00:00 2001 From: MSalopek Date: Fri, 8 Dec 2023 15:40:40 +0100 Subject: [PATCH 08/43] tests: update hermes images and setup (#2841) * tests: update hermes images and setup * fix makefile hermes build * scripts: update hermes bootstrap scripts --- Makefile | 2 +- tests/e2e/docker/hermes.Dockerfile | 4 +- tests/e2e/e2e_setup_test.go | 65 +++++++++++++------------- tests/e2e/scripts/hermes1_bootstrap.sh | 8 ++-- tests/e2e/scripts/hermes_bootstrap.sh | 4 +- 5 files changed, 42 insertions(+), 41 deletions(-) diff --git a/Makefile b/Makefile index a85756b2e7..b77454f060 100644 --- a/Makefile +++ b/Makefile @@ -234,7 +234,7 @@ docker-build-debug: # TODO: Push this to the Cosmos Dockerhub so we don't have to keep building it # in CI. docker-build-hermes: - @cd tests/e2e/docker; docker build -t ghcr.io/cosmos/hermes-e2e:1.4.1 -f hermes.Dockerfile . + @cd tests/e2e/docker; docker build -t ghcr.io/cosmos/hermes-e2e:1.0.0 -f hermes.Dockerfile . docker-build-all: docker-build-debug docker-build-hermes diff --git a/tests/e2e/docker/hermes.Dockerfile b/tests/e2e/docker/hermes.Dockerfile index 81d675079f..97176a7d37 100644 --- a/tests/e2e/docker/hermes.Dockerfile +++ b/tests/e2e/docker/hermes.Dockerfile @@ -1,6 +1,6 @@ -FROM --platform=linux/amd64 informalsystems/hermes:1.4.1 AS hermes-builder +FROM --platform=linux/amd64 informalsystems/hermes:v1.7.3 AS hermes-builder -FROM debian:buster-slim +FROM --platform=linux/amd64 debian:buster-slim USER root COPY --from=hermes-builder /usr/bin/hermes /usr/local/bin/ diff --git a/tests/e2e/e2e_setup_test.go b/tests/e2e/e2e_setup_test.go index 9aa1ef43de..992526387f 100644 --- a/tests/e2e/e2e_setup_test.go +++ b/tests/e2e/e2e_setup_test.go @@ -4,7 +4,9 @@ import ( "context" "encoding/json" "fmt" + "io" "math/rand" + "net/http" "os" "os/exec" "path" @@ -641,7 +643,7 @@ func (s *IntegrationTestSuite) runIBCRelayer0() { &dockertest.RunOptions{ Name: fmt.Sprintf("%s-%s-relayer-0", s.chainA.id, s.chainB.id), Repository: "ghcr.io/cosmos/hermes-e2e", - Tag: "1.4.1", + Tag: "1.0.0", NetworkID: s.dkrNet.Network.ID, Mounts: []string{ fmt.Sprintf("%s/:/root/hermes", hermesCfgPath), @@ -669,36 +671,35 @@ func (s *IntegrationTestSuite) runIBCRelayer0() { noRestart, ) s.Require().NoError(err) - // TODO: fix Hermes container REST endpoint - // endpoint := fmt.Sprintf("http://%s/state", s.hermesResource0.GetHostPort("3031/tcp")) - // s.Require().Eventually( - // func() bool { - // resp, err := http.Get(endpoint) //nolint:gosec // this is a test - // if err != nil { - // return false - // } - - // defer resp.Body.Close() - - // bz, err := io.ReadAll(resp.Body) - // if err != nil { - // return false - // } - - // var respBody map[string]interface{} - // if err := json.Unmarshal(bz, &respBody); err != nil { - // return false - // } - - // status := respBody["status"].(string) - // result := respBody["result"].(map[string]interface{}) - - // return status == "success" && len(result["chains"].([]interface{})) == 2 - // }, - // 5*time.Minute, - // time.Second, - // "hermes relayer not healthy", - // ) + endpoint := fmt.Sprintf("http://%s/state", s.hermesResource0.GetHostPort("3031/tcp")) + s.Require().Eventually( + func() bool { + resp, err := http.Get(endpoint) //nolint:gosec // this is a test + if err != nil { + return false + } + + defer resp.Body.Close() + + bz, err := io.ReadAll(resp.Body) + if err != nil { + return false + } + + var respBody map[string]interface{} + if err := json.Unmarshal(bz, &respBody); err != nil { + return false + } + + status := respBody["status"].(string) + result := respBody["result"].(map[string]interface{}) + + return status == "success" && len(result["chains"].([]interface{})) == 2 + }, + 5*time.Minute, + time.Second, + "hermes relayer not healthy", + ) s.T().Logf("started Hermes relayer 0 container: %s", s.hermesResource0.Container.ID) @@ -741,7 +742,7 @@ func (s *IntegrationTestSuite) runIBCRelayer1() { &dockertest.RunOptions{ Name: fmt.Sprintf("%s-%s-relayer-1", s.chainA.id, s.chainB.id), Repository: "ghcr.io/cosmos/hermes-e2e", - Tag: "1.4.1", + Tag: "1.0.0", NetworkID: s.dkrNet.Network.ID, Mounts: []string{ fmt.Sprintf("%s/:/root/hermes", hermesCfgPath), diff --git a/tests/e2e/scripts/hermes1_bootstrap.sh b/tests/e2e/scripts/hermes1_bootstrap.sh index 049c61b8ad..8d572e0a2d 100755 --- a/tests/e2e/scripts/hermes1_bootstrap.sh +++ b/tests/e2e/scripts/hermes1_bootstrap.sh @@ -47,7 +47,7 @@ port = 3002 id = '$GAIA_A_E2E_CHAIN_ID' rpc_addr = 'http://$GAIA_A_E2E_VAL_HOST:26657' grpc_addr = 'http://$GAIA_A_E2E_VAL_HOST:9090' -websocket_addr = 'ws://$GAIA_A_E2E_VAL_HOST:26657/websocket' +event_source = { mode = "push", url = "ws://$GAIA_A_E2E_VAL_HOST:26657/websocket", batch_delay = "50ms" } rpc_timeout = '10s' account_prefix = 'cosmos' key_name = 'rly01-gaia-a' @@ -63,7 +63,7 @@ trust_threshold = { numerator = '1', denominator = '3' } id = '$GAIA_B_E2E_CHAIN_ID' rpc_addr = 'http://$GAIA_B_E2E_VAL_HOST:26657' grpc_addr = 'http://$GAIA_B_E2E_VAL_HOST:9090' -websocket_addr = 'ws://$GAIA_B_E2E_VAL_HOST:26657/websocket' +event_source = { mode = "push", url = "ws://$GAIA_B_E2E_VAL_HOST:26657/websocket", batch_delay = "50ms" } rpc_timeout = '10s' account_prefix = 'cosmos' key_name = 'rly01-gaia-b' @@ -114,7 +114,7 @@ port = 3002 id = '$GAIA_A_E2E_CHAIN_ID' rpc_addr = 'http://$GAIA_A_E2E_VAL_HOST:26657' grpc_addr = 'http://$GAIA_A_E2E_VAL_HOST:9090' -websocket_addr = 'ws://$GAIA_A_E2E_VAL_HOST:26657/websocket' +event_source = { mode = "push", url = "ws://$GAIA_A_E2E_VAL_HOST:26657/websocket", batch_delay = "50ms" } rpc_timeout = '10s' account_prefix = 'cosmos' key_name = 'rly01-gaia-a' @@ -130,7 +130,7 @@ trust_threshold = { numerator = '1', denominator = '3' } id = '$GAIA_B_E2E_CHAIN_ID' rpc_addr = 'http://$GAIA_B_E2E_VAL_HOST:26657' grpc_addr = 'http://$GAIA_B_E2E_VAL_HOST:9090' -websocket_addr = 'ws://$GAIA_B_E2E_VAL_HOST:26657/websocket' +event_source = { mode = "push", url = "ws://$GAIA_B_E2E_VAL_HOST:26657/websocket", batch_delay = "50ms" } rpc_timeout = '10s' account_prefix = 'cosmos' key_name = 'rly01-gaia-b' diff --git a/tests/e2e/scripts/hermes_bootstrap.sh b/tests/e2e/scripts/hermes_bootstrap.sh index cc360b759b..8c0db49862 100755 --- a/tests/e2e/scripts/hermes_bootstrap.sh +++ b/tests/e2e/scripts/hermes_bootstrap.sh @@ -47,7 +47,7 @@ port = 3001 id = '$GAIA_A_E2E_CHAIN_ID' rpc_addr = 'http://$GAIA_A_E2E_VAL_HOST:26657' grpc_addr = 'http://$GAIA_A_E2E_VAL_HOST:9090' -websocket_addr = 'ws://$GAIA_A_E2E_VAL_HOST:26657/websocket' +event_source = { mode = "push", url = "ws://$GAIA_A_E2E_VAL_HOST:26657/websocket", batch_delay = "50ms" } rpc_timeout = '10s' account_prefix = 'cosmos' key_name = 'rly01-gaia-a' @@ -63,7 +63,7 @@ trust_threshold = { numerator = '1', denominator = '3' } id = '$GAIA_B_E2E_CHAIN_ID' rpc_addr = 'http://$GAIA_B_E2E_VAL_HOST:26657' grpc_addr = 'http://$GAIA_B_E2E_VAL_HOST:9090' -websocket_addr = 'ws://$GAIA_B_E2E_VAL_HOST:26657/websocket' +event_source = { mode = "push", url = "ws://$GAIA_B_E2E_VAL_HOST:26657/websocket", batch_delay = "50ms" } rpc_timeout = '10s' account_prefix = 'cosmos' key_name = 'rly01-gaia-b' From 21a192ae57c6a7af7ec81a4b200c5505bd246022 Mon Sep 17 00:00:00 2001 From: MSalopek Date: Fri, 8 Dec 2023 15:48:57 +0100 Subject: [PATCH 09/43] deps: use lsm cosmos-sdk fork and ics 3.3.0-rc0-lsm (#2842) * tests: update hermes images and setup * fix makefile hermes build * deps: use lsm cosmos-sdk fork and ics 3.3.0-rc0-lsm * deps: post rebase go mod tidy * update hermes scripts --- ante/gov_ante_test.go | 2 +- app/app.go | 4 +- app/app_helpers.go | 4 +- app/keepers/keepers.go | 57 +++----- app/modules.go | 5 +- cmd/gaiad/cmd/testnet.go | 1 - go.mod | 93 ++++++------ go.sum | 200 ++++++++++++++------------ tests/e2e/validator.go | 4 - tests/ics/interchain_security_test.go | 2 +- 10 files changed, 188 insertions(+), 184 deletions(-) diff --git a/ante/gov_ante_test.go b/ante/gov_ante_test.go index 9f3b0ceb9d..79a147f200 100644 --- a/ante/gov_ante_test.go +++ b/ante/gov_ante_test.go @@ -70,7 +70,7 @@ func (s *GovAnteHandlerTestSuite) TestGlobalFeeMinimumGasFeeAnteHandler() { {"Failing proposal", "the purpose of this proposal is to fail", govv1beta1.ProposalTypeText, testAddr, insufficientCoins, false}, } - decorator := ante.NewGovPreventSpamDecorator(s.app.AppCodec(), &s.app.GovKeeper) + decorator := ante.NewGovPreventSpamDecorator(s.app.AppCodec(), s.app.GovKeeper) for _, tc := range tests { content, _ := govv1beta1.ContentFromProposalType(tc.title, tc.description, tc.proposalType) diff --git a/app/app.go b/app/app.go index aaedd09e7c..6f1831cdeb 100644 --- a/app/app.go +++ b/app/app.go @@ -42,7 +42,7 @@ 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/interchain-security/v3/legacy_ibc_testing/testing" + 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" @@ -225,7 +225,7 @@ func NewGaiaApp( }, Codec: appCodec, IBCkeeper: app.IBCKeeper, - GovKeeper: &app.GovKeeper, + GovKeeper: app.GovKeeper, GlobalFeeSubspace: app.GetSubspace(globalfee.ModuleName), StakingKeeper: app.StakingKeeper, // If TxFeeChecker is nil the default ante TxFeeChecker is used diff --git a/app/app_helpers.go b/app/app_helpers.go index be979819fc..6948db79fa 100644 --- a/app/app_helpers.go +++ b/app/app_helpers.go @@ -4,7 +4,7 @@ package gaia import ( capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" - ibcstakinginterface "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/core" + 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" ) @@ -17,7 +17,7 @@ func (app *GaiaApp) GetProviderKeeper() ibcproviderkeeper.Keeper { //nolint:noli } // GetStakingKeeper implements the TestingApp interface. Needed for ICS. -func (app *GaiaApp) GetStakingKeeper() ibcstakinginterface.StakingKeeper { //nolint:nolintlint +func (app *GaiaApp) GetStakingKeeper() ibctestingtypes.StakingKeeper { //nolint:nolintlint return app.StakingKeeper } diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index 4370d5924d..ad1aa9a94d 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -68,9 +68,6 @@ import ( pfmrouterkeeper "github.com/strangelove-ventures/packet-forward-middleware/v7/router/keeper" pfmroutertypes "github.com/strangelove-ventures/packet-forward-middleware/v7/router/types" - // liquiditykeeper "github.com/gravity-devs/liquidity/x/liquidity/keeper" - // liquiditytypes "github.com/gravity-devs/liquidity/x/liquidity/types" - // unnamed import of statik for swagger UI support _ "github.com/cosmos/cosmos-sdk/client/docs/statik" ) @@ -89,7 +86,7 @@ type AppKeepers struct { SlashingKeeper slashingkeeper.Keeper MintKeeper mintkeeper.Keeper DistrKeeper distrkeeper.Keeper - GovKeeper govkeeper.Keeper + GovKeeper *govkeeper.Keeper CrisisKeeper *crisiskeeper.Keeper UpgradeKeeper *upgradekeeper.Keeper ParamsKeeper paramskeeper.Keeper @@ -286,17 +283,19 @@ func NewAppKeeper( appKeepers.ScopedIBCKeeper, ) - // EvidenceKeeper must be created before ProviderKeeper - evidenceKeeper := evidencekeeper.NewKeeper( + // provider depends on gov, so gov must be registered first + govConfig := govtypes.DefaultConfig() + appKeepers.GovKeeper = govkeeper.NewKeeper( appCodec, - appKeepers.keys[evidencetypes.StoreKey], + appKeepers.keys[govtypes.StoreKey], + appKeepers.AccountKeeper, + appKeepers.BankKeeper, appKeepers.StakingKeeper, - appKeepers.SlashingKeeper, + bApp.MsgServiceRouter(), + govConfig, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) - // If evidence needs to be handled for the app, set routes in router here and seal - appKeepers.EvidenceKeeper = *evidenceKeeper - // TODO: Enable with ICS appKeepers.ProviderKeeper = ibcproviderkeeper.NewKeeper( appCodec, appKeepers.keys[providertypes.StoreKey], @@ -309,9 +308,9 @@ func NewAppKeeper( appKeepers.StakingKeeper, appKeepers.SlashingKeeper, appKeepers.AccountKeeper, - appKeepers.EvidenceKeeper, appKeepers.DistrKeeper, appKeepers.BankKeeper, + appKeepers.GovKeeper, authtypes.FeeCollectorName, ) @@ -329,33 +328,23 @@ func NewAppKeeper( AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(appKeepers.IBCKeeper.ClientKeeper)). AddRoute(providertypes.RouterKey, ibcprovider.NewProviderProposalHandler(appKeepers.ProviderKeeper)) - govConfig := govtypes.DefaultConfig() - /* - Example of setting gov params: - govConfig.MaxMetadataLen = 10000 - */ - - govKeeper := govkeeper.NewKeeper( - appCodec, - appKeepers.keys[govtypes.StoreKey], - appKeepers.AccountKeeper, - appKeepers.BankKeeper, - appKeepers.StakingKeeper, - bApp.MsgServiceRouter(), - govConfig, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) - // Set legacy router for backwards compatibility with gov v1beta1 - govKeeper.SetLegacyRouter(govRouter) + appKeepers.GovKeeper.SetLegacyRouter(govRouter) // appKeepers.GovKeeper = *govKeeper - appKeepers.GovKeeper = *govKeeper.SetHooks( - govtypes.NewMultiGovHooks( - // register the governance hooks - ), + appKeepers.GovKeeper = appKeepers.GovKeeper.SetHooks( + appKeepers.ProviderKeeper.Hooks(), ) + evidenceKeeper := evidencekeeper.NewKeeper( + appCodec, + appKeepers.keys[evidencetypes.StoreKey], + appKeepers.StakingKeeper, + appKeepers.SlashingKeeper, + ) + // If evidence needs to be handled for the app, set routes in router here and seal + appKeepers.EvidenceKeeper = *evidenceKeeper + // ICA Host keeper appKeepers.ICAHostKeeper = icahostkeeper.NewKeeper( appCodec, diff --git a/app/modules.go b/app/modules.go index b9d4435e02..ba3be8ab08 100644 --- a/app/modules.go +++ b/app/modules.go @@ -92,7 +92,6 @@ var ModuleBasics = module.NewBasicManager( ibcclientclient.UpgradeProposalHandler, icsproviderclient.ConsumerAdditionProposalHandler, icsproviderclient.ConsumerRemovalProposalHandler, - icsproviderclient.EquivocationProposalHandler, }, ), sdkparams.AppModuleBasic{}, @@ -132,7 +131,7 @@ func appModules( bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)), capability.NewAppModule(appCodec, *app.CapabilityKeeper, false), crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), - gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)), + gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)), mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil, app.GetSubspace(minttypes.ModuleName)), slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName)), distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)), @@ -165,7 +164,7 @@ func simulationModules( bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)), capability.NewAppModule(appCodec, *app.CapabilityKeeper, false), feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), - gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)), + gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)), mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil, app.GetSubspace(minttypes.ModuleName)), staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)), distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)), diff --git a/cmd/gaiad/cmd/testnet.go b/cmd/gaiad/cmd/testnet.go index c6ee650c00..bfa6112500 100644 --- a/cmd/gaiad/cmd/testnet.go +++ b/cmd/gaiad/cmd/testnet.go @@ -304,7 +304,6 @@ func initTestnetFiles( sdk.NewCoin(sdk.DefaultBondDenom, valTokens), stakingtypes.NewDescription(nodeDirName, "", "", "", ""), stakingtypes.NewCommissionRates(math.LegacyOneDec(), math.LegacyOneDec(), math.LegacyOneDec()), - math.OneInt(), ) if err != nil { return err diff --git a/go.mod b/go.mod index 598c0d9c32..194278c6b3 100644 --- a/go.mod +++ b/go.mod @@ -4,20 +4,20 @@ go 1.21 require ( cosmossdk.io/api v0.3.1 - cosmossdk.io/math v1.0.1 + cosmossdk.io/math v1.2.0 cosmossdk.io/simapp v0.0.0-20230602123434-616841b9704d cosmossdk.io/tools/rosetta v0.2.1 github.com/cometbft/cometbft v0.37.2 github.com/cometbft/cometbft-db v0.8.0 - github.com/cosmos/cosmos-sdk v0.47.3 + github.com/cosmos/cosmos-sdk v0.47.5 github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/gogoproto v1.4.10 - github.com/cosmos/ibc-go/v7 v7.1.0 + github.com/cosmos/ibc-go/v7 v7.3.1 github.com/cosmos/interchain-security/v3 v3.1.0 github.com/gorilla/mux v1.8.0 github.com/rakyll/statik v0.1.7 github.com/spf13/cast v1.5.1 - github.com/spf13/cobra v1.7.0 + github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.16.0 github.com/strangelove-ventures/packet-forward-middleware/v7 v7.0.0-20230412224111-136e94e98861 @@ -25,27 +25,28 @@ require ( ) require ( - cosmossdk.io/errors v1.0.0-beta.7 + cosmossdk.io/errors v1.0.0 github.com/ory/dockertest/v3 v3.10.0 + google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 ) require ( - cloud.google.com/go v0.110.0 // indirect - cloud.google.com/go/compute v1.19.0 // indirect + cloud.google.com/go v0.110.8 // indirect + cloud.google.com/go/compute v1.23.0 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v0.13.0 // indirect - cloud.google.com/go/storage v1.29.0 // indirect + cloud.google.com/go/iam v1.1.2 // indirect + cloud.google.com/go/storage v1.30.1 // indirect github.com/golang/protobuf v1.5.3 // github.com/gravity-devs/liquidity v1.6.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 - google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 - google.golang.org/grpc v1.55.0 + google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a // indirect + google.golang.org/grpc v1.59.0 ) require ( cosmossdk.io/core v0.5.1 // indirect - cosmossdk.io/depinject v1.0.0-alpha.3 // indirect - cosmossdk.io/log v1.1.0 // indirect + cosmossdk.io/depinject v1.0.0-alpha.4 // indirect + cosmossdk.io/log v1.2.1 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect @@ -64,15 +65,18 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/chzyer/readline v1.5.1 // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect + github.com/cockroachdb/errors v1.10.0 // indirect + github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect + github.com/cockroachdb/redact v1.1.5 // indirect github.com/coinbase/rosetta-sdk-go v0.7.9 // indirect github.com/confio/ics23/go v0.9.0 // indirect github.com/containerd/continuity v0.3.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.2 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v0.20.0 // indirect + github.com/cosmos/iavl v0.20.1 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.12.2 // indirect + github.com/cosmos/ledger-cosmos-go v0.12.4 // indirect github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect github.com/creachadair/taskgroup v0.4.2 // indirect github.com/danieljoos/wincred v1.1.2 // indirect @@ -90,28 +94,26 @@ require ( github.com/dvsekhvalnov/jose2go v1.5.0 // indirect github.com/felixge/httpsnoop v1.0.2 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/gin-gonic/gin v1.8.1 // indirect + github.com/getsentry/sentry-go v0.23.0 // indirect github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect - github.com/go-playground/validator/v10 v10.11.1 // indirect github.com/gobwas/ws v1.1.0 // indirect - github.com/goccy/go-json v0.9.11 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/glog v1.1.0 // indirect + github.com/golang/glog v1.1.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/mock v1.6.0 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.1.2 // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/orderedcode v0.0.1 // indirect - github.com/google/s2a-go v0.1.3 // indirect + github.com/google/s2a-go v0.1.4 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect - github.com/googleapis/gax-go/v2 v2.8.0 // indirect + github.com/google/uuid v1.3.1 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.2.4 // indirect + github.com/googleapis/gax-go/v2 v2.12.0 // indirect github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect @@ -133,14 +135,16 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.16.3 // indirect + github.com/klauspost/compress v1.16.7 // indirect + github.com/kr/pretty v0.3.1 // indirect + github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/linxGnu/grocksdb v1.7.16 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.18 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/minio/highwayhash v1.0.2 // indirect @@ -153,7 +157,7 @@ require ( github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0-rc2 // indirect github.com/opencontainers/runc v1.1.5 // indirect - github.com/oxyno-zeta/gomock-extra-matcher v1.1.0 // indirect + github.com/oxyno-zeta/gomock-extra-matcher v1.2.0 // indirect github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect github.com/pkg/errors v0.9.1 // indirect @@ -163,8 +167,9 @@ require ( github.com/prometheus/common v0.42.0 // indirect github.com/prometheus/procfs v0.9.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect + github.com/rogpeppe/go-internal v1.11.0 // indirect github.com/rs/cors v1.8.3 // indirect - github.com/rs/zerolog v1.29.1 // indirect + github.com/rs/zerolog v1.30.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/sirupsen/logrus v1.9.0 // indirect github.com/spf13/afero v1.9.5 // indirect @@ -177,28 +182,30 @@ require ( github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xeipuuv/gojsonschema v1.2.0 // indirect - github.com/zondax/hid v0.9.1 // indirect - github.com/zondax/ledger-go v0.14.1 // indirect + github.com/zondax/hid v0.9.2 // indirect + github.com/zondax/ledger-go v0.14.3 // indirect go.etcd.io/bbolt v1.3.7 // indirect go.opencensus.io v0.24.0 // indirect - golang.org/x/crypto v0.9.0 // indirect - golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc // indirect - golang.org/x/mod v0.9.0 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/oauth2 v0.7.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/term v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect + go.uber.org/mock v0.2.0 // indirect + golang.org/x/crypto v0.14.0 // indirect + golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb // indirect + golang.org/x/mod v0.11.0 // indirect + golang.org/x/net v0.17.0 // indirect + golang.org/x/oauth2 v0.11.0 // indirect + golang.org/x/sys v0.13.0 // indirect + golang.org/x/term v0.13.0 // indirect + golang.org/x/text v0.13.0 // indirect golang.org/x/tools v0.7.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect - google.golang.org/api v0.122.0 // indirect + google.golang.org/api v0.128.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/protobuf v1.30.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect + google.golang.org/protobuf v1.31.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect - pgregory.net/rapid v0.5.5 // indirect + pgregory.net/rapid v1.1.0 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) @@ -218,3 +225,7 @@ replace ( // the following version across all dependencies. google.golang.org/grpc => google.golang.org/grpc v1.54.0 ) + +replace github.com/cosmos/cosmos-sdk => github.com/informalsystems/cosmos-sdk v0.46.0-alpha2.0.20231206144452-5b8e28f3247b + +replace github.com/cosmos/interchain-security/v3 => github.com/cosmos/interchain-security/v3 v3.3.0-rc0.0.20231207121941-02bc47252590 diff --git a/go.sum b/go.sum index b11735568f..59d100914c 100644 --- a/go.sum +++ b/go.sum @@ -36,8 +36,8 @@ cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34h cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= cloud.google.com/go v0.107.0/go.mod h1:wpc2eNrD7hXUTy8EKS10jkxpZBjASrORK7goS+3YX2I= -cloud.google.com/go v0.110.0 h1:Zc8gqp3+a9/Eyph2KDmcGaPtbKRIoqq4YTlL4NMD0Ys= -cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY= +cloud.google.com/go v0.110.8 h1:tyNdfIxjzaWctIiLYOTalaLKZ17SI44SKFW26QbOhME= +cloud.google.com/go v0.110.8/go.mod h1:Iz8AkXJf1qmxC3Oxoep8R1T36w8B92yU29PcBhHO5fk= cloud.google.com/go/accessapproval v1.4.0/go.mod h1:zybIuC3KpDOvotz59lFe5qxRZx6C75OtwbisN56xYB4= cloud.google.com/go/accessapproval v1.5.0/go.mod h1:HFy3tuiGvMdcd/u+Cu5b9NkO1pEICJ46IR82PoUdplw= cloud.google.com/go/accesscontextmanager v1.3.0/go.mod h1:TgCBehyr5gNMz7ZaH9xubp+CE8dkrszb4oK9CWyvD4o= @@ -121,8 +121,8 @@ cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x cloud.google.com/go/compute v1.13.0/go.mod h1:5aPTS0cUNMIc1CE546K+Th6weJUNQErARyZtRXDJ8GE= cloud.google.com/go/compute v1.14.0/go.mod h1:YfLtxrj9sU4Yxv+sXzZkyPjEyPBZfXHUvjxega5vAdo= cloud.google.com/go/compute v1.15.1/go.mod h1:bjjoF/NtFUrkD/urWfdHaKuOPDR5nWIs63rR+SXhcpA= -cloud.google.com/go/compute v1.19.0 h1:+9zda3WGgW1ZSTlVppLCYFIr48Pa35q1uG2N1itbCEQ= -cloud.google.com/go/compute v1.19.0/go.mod h1:rikpw2y+UMidAe9tISo04EHNOIf42RLYF/q8Bs93scU= +cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY= +cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZEXYonfTBHHFPO/4UU= cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= @@ -211,8 +211,8 @@ cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3Q cloud.google.com/go/iam v0.6.0/go.mod h1:+1AH33ueBne5MzYccyMHtEKqLE4/kJOibtffMHDMFMc= cloud.google.com/go/iam v0.7.0/go.mod h1:H5Br8wRaDGNc8XP3keLc4unfUUZeyH3Sfl9XpQEYOeg= cloud.google.com/go/iam v0.8.0/go.mod h1:lga0/y3iH6CX7sYqypWJ33hf7kkfXJag67naqGESjkE= -cloud.google.com/go/iam v0.13.0 h1:+CmB+K0J/33d0zSQ9SlFWUeCCEn5XJA0ZMZ3pHE9u8k= -cloud.google.com/go/iam v0.13.0/go.mod h1:ljOg+rcNfzZ5d6f1nAUJ8ZIxOaZUVoS14bKCtaLZ/D0= +cloud.google.com/go/iam v1.1.2 h1:gacbrBdWcoVmGLozRuStX45YKvJtzIjJdAolzUs1sm4= +cloud.google.com/go/iam v1.1.2/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU= cloud.google.com/go/iap v1.4.0/go.mod h1:RGFwRJdihTINIe4wZ2iCP0zF/qu18ZwyKxrhMhygBEc= cloud.google.com/go/iap v1.5.0/go.mod h1:UH/CGgKd4KyohZL5Pt0jSKE4m3FR51qg6FKQ/z/Ix9A= cloud.google.com/go/ids v1.1.0/go.mod h1:WIuwCaYVOzHIj2OhN9HAwvW+DBdmUAdcWlFxRl+KubM= @@ -231,8 +231,6 @@ cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6 cloud.google.com/go/logging v1.6.1/go.mod h1:5ZO0mHHbvm8gEmeEUHrmDlTDSu5imF6MUP9OfilNXBw= cloud.google.com/go/longrunning v0.1.1/go.mod h1:UUFxuDWkv22EuY93jjmDMFT5GPQKeFVJBIF6QlTqdsE= cloud.google.com/go/longrunning v0.3.0/go.mod h1:qth9Y41RRSUE69rDcOn6DdK3HfQfsUI0YSmW3iIlLJc= -cloud.google.com/go/longrunning v0.4.1 h1:v+yFJOfKC3yZdY6ZUI933pIYdhyhV8S3NpWrXWmg7jM= -cloud.google.com/go/longrunning v0.4.1/go.mod h1:4iWDqhBZ70CvZ6BfETbvam3T8FMvLK+eFj0E6AaRQTo= cloud.google.com/go/managedidentities v1.3.0/go.mod h1:UzlW3cBOiPrzucO5qWkNkh0w33KFtBJU281hacNvsdE= cloud.google.com/go/managedidentities v1.4.0/go.mod h1:NWSBYbEMgqmbZsLIyKvxrYbtqOsxY1ZrGM+9RgDqInM= cloud.google.com/go/maps v0.1.0/go.mod h1:BQM97WGyfw9FWEmQMpZ5T6cpovXXSd1cGmFma94eubI= @@ -355,8 +353,8 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storage v1.29.0 h1:6weCgzRvMg7lzuUurI4697AqIRPU1SvzHhynwpW31jI= -cloud.google.com/go/storage v1.29.0/go.mod h1:4puEjyTKnku6gfKoTfNOU/W+a9JyuVNxjpS5GBrB8h4= +cloud.google.com/go/storage v1.30.1 h1:uOdMxAs8HExqBlnLtnQyP0YkvbiDpdGShGKtx6U/oNM= +cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7BiccwkR7+P7gN8E= cloud.google.com/go/storagetransfer v1.5.0/go.mod h1:dxNzUopWy7RQevYFHewchb29POFv3/AaBgnhqzqiK0w= cloud.google.com/go/storagetransfer v1.6.0/go.mod h1:y77xm4CQV/ZhFZH75PLEXY0ROiS7Gh6pSKrM8dJyg6I= cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= @@ -402,14 +400,14 @@ cosmossdk.io/api v0.3.1 h1:NNiOclKRR0AOlO4KIqeaG6PS6kswOMhHD0ir0SscNXE= cosmossdk.io/api v0.3.1/go.mod h1:DfHfMkiNA2Uhy8fj0JJlOCYOBp4eWUUJ1te5zBGNyIw= cosmossdk.io/core v0.5.1 h1:vQVtFrIYOQJDV3f7rw4pjjVqc1id4+mE0L9hHP66pyI= cosmossdk.io/core v0.5.1/go.mod h1:KZtwHCLjcFuo0nmDc24Xy6CRNEL9Vl/MeimQ2aC7NLE= -cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= -cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= -cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= -cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= -cosmossdk.io/log v1.1.0 h1:v0ogPHYeTzPcBTcPR1A3j1hkei4pZama8kz8LKlCMv0= -cosmossdk.io/log v1.1.0/go.mod h1:6zjroETlcDs+mm62gd8Ig7mZ+N+fVOZS91V17H+M4N4= -cosmossdk.io/math v1.0.1 h1:Qx3ifyOPaMLNH/89WeZFH268yCvU4xEcnPLu3sJqPPg= -cosmossdk.io/math v1.0.1/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= +cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= +cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= +cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04= +cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0= +cosmossdk.io/log v1.2.1 h1:Xc1GgTCicniwmMiKwDxUjO4eLhPxoVdI9vtMW8Ti/uk= +cosmossdk.io/log v1.2.1/go.mod h1:GNSCc/6+DhFIj1aLn/j7Id7PaO8DzNylUZoOYBL9+I4= +cosmossdk.io/math v1.2.0 h1:8gudhTkkD3NxOP2YyyJIYYmt6dQ55ZfJkDOaxXpy7Ig= +cosmossdk.io/math v1.2.0/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= cosmossdk.io/simapp v0.0.0-20230602123434-616841b9704d h1:G24nV8KQ5tcSLJEYPUEpKxuX4usvpQg5r7LhCLYPs1o= cosmossdk.io/simapp v0.0.0-20230602123434-616841b9704d/go.mod h1:xbjky3L3DJEylaho6gXplkrMvJ5sFgv+qNX+Nn47bzY= cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= @@ -453,8 +451,6 @@ github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= -github.com/alecthomas/participle/v2 v2.0.0-alpha7/go.mod h1:NumScqsC42o9x+dGj8/YqsIfhrIQjFEOFovxotbBirA= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -568,9 +564,13 @@ github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= -github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= -github.com/cockroachdb/apd/v3 v3.1.0/go.mod h1:6qgPBMXjATAdD/VefbRP9NoSLKjbB4LCoA7gN4LpHs4= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/cockroachdb/errors v1.10.0 h1:lfxS8zZz1+OjtV4MtNWgboi/W5tyLEB6VQZBXN+0VUU= +github.com/cockroachdb/errors v1.10.0/go.mod h1:lknhIsEVQ9Ss/qKDBQS/UqFSvPQjOwNq2qyKAxtHRqE= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/coinbase/kryptology v1.8.0/go.mod h1:RYXOAPdzOGUe3qlSFkMGn58i3xUA8hmxYHksuq+8ciI= github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZr9ZvoCcA= @@ -599,8 +599,6 @@ github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-proto v1.0.0-beta.2 h1:X3OKvWgK9Gsejo0F1qs5l8Qn6xJV/AzgIWR2wZ8Nua8= github.com/cosmos/cosmos-proto v1.0.0-beta.2/go.mod h1:+XRCLJ14pr5HFEHIUcn51IKXD1Fy3rkEQqt4WqmN4V0= -github.com/cosmos/cosmos-sdk v0.47.3 h1:r0hGmZoAzP2D+MaPaFGHwAaTdFQq3pNpHaUp1BsffbM= -github.com/cosmos/cosmos-sdk v0.47.3/go.mod h1:c4OfLdAykA9zsj1CqrxBRqXzVz48I++JSvIMPSPcEmk= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -609,33 +607,29 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= -github.com/cosmos/iavl v0.20.0 h1:fTVznVlepH0KK8NyKq8w+U7c2L6jofa27aFX6YGlm38= -github.com/cosmos/iavl v0.20.0/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= -github.com/cosmos/ibc-go/v7 v7.1.0 h1:SCLgs7tqVnzdIDO5MRLgovAnc696vTTKl+8qsTu8IMM= -github.com/cosmos/ibc-go/v7 v7.1.0/go.mod h1:7MptlWeIyqmDiuJeRAFqBvXKY8Hybd+rF8vMSmGd2zg= +github.com/cosmos/iavl v0.20.1 h1:rM1kqeG3/HBT85vsZdoSNsehciqUQPWrR4BYmqE2+zg= +github.com/cosmos/iavl v0.20.1/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= +github.com/cosmos/ibc-go/v7 v7.3.1 h1:bil1IjnHdyWDASFYKfwdRiNtFP6WK3osW7QFEAgU4I8= +github.com/cosmos/ibc-go/v7 v7.3.1/go.mod h1:wvx4pPBofe5ZdMNV3OFRxSI4auEP5Qfqf8JXLLNV04g= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= -github.com/cosmos/interchain-security/v3 v3.1.0 h1:EKDJCIKIDLG45tvKwfoANrRPgqvqfUt/f1TNKx3b7Uo= -github.com/cosmos/interchain-security/v3 v3.1.0/go.mod h1:2fILBgypEZcwR3BSzKDw+EsYtMKv9Z6cYXfouh4xTYU= +github.com/cosmos/interchain-security/v3 v3.3.0-rc0.0.20231207121941-02bc47252590 h1:acEi6tT5Dlnblu6e+2aUuKIsrgtp07lvOPkeZhscWSs= +github.com/cosmos/interchain-security/v3 v3.3.0-rc0.0.20231207121941-02bc47252590/go.mod h1:IB5qv5+siEWIrSWEjtwhzLt3ZPSoZfaXVWWMGQteKp0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/cosmos/ledger-cosmos-go v0.12.2 h1:/XYaBlE2BJxtvpkHiBm97gFGSGmYGKunKyF3nNqAXZA= -github.com/cosmos/ledger-cosmos-go v0.12.2/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI= +github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw= +github.com/cosmos/ledger-cosmos-go v0.12.4/go.mod h1:fjfVWRf++Xkygt9wzCsjEBdjcf7wiiY35fv3ctT+k4M= github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM= github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJFxv2Li8= github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= -github.com/cucumber/common/gherkin/go/v22 v22.0.0/go.mod h1:3mJT10B2GGn3MvVPd3FwR7m2u4tLhSRhWUqJU4KN4Fg= -github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= -github.com/cucumber/common/messages/go/v17 v17.1.1/go.mod h1:bpGxb57tDE385Rb2EohgUadLkAbhoC4IyCFi89u/JQI= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= @@ -720,6 +714,8 @@ github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbS github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= +github.com/getsentry/sentry-go v0.23.0 h1:dn+QRCeJv4pPt9OjVXiMcGIBIefaTJPw/h0bZWO05nE= +github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= @@ -728,6 +724,8 @@ github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= +github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -777,8 +775,6 @@ github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6 github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gofrs/uuid v4.3.0+incompatible h1:CaSVZxm5B+7o45rtab4jC2G37WGYX1zQfuU2i6DSvnc= -github.com/gofrs/uuid v4.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= @@ -794,8 +790,8 @@ github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGw github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= -github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= -github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= +github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo= +github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -855,8 +851,9 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -887,21 +884,22 @@ github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/s2a-go v0.1.3 h1:FAgZmpLl/SXurPEZyCMPBIiiYeTbqfjlbdnCNTAkbGE= -github.com/google/s2a-go v0.1.3/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= +github.com/google/s2a-go v0.1.4 h1:1kZ/sQM3srePvKs3tXAvQzo66XfcReoqFpIpIccE7Oc= +github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= -github.com/googleapis/enterprise-certificate-proxy v0.2.3 h1:yk9/cqRKtT9wXZSsRH9aurXEpJX+U6FLtpYTdC3R06k= -github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= +github.com/googleapis/enterprise-certificate-proxy v0.2.4 h1:uGy6JWR/uMIILU8wbf+OkstIrNiMjGpEIyhx8f6W7s4= +github.com/googleapis/enterprise-certificate-proxy v0.2.4/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= @@ -912,8 +910,8 @@ github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= -github.com/googleapis/gax-go/v2 v2.8.0 h1:UBtEZqx1bjXtOQ5BVTkuYghXrr3N4V123VKJK67vJZc= -github.com/googleapis/gax-go/v2 v2.8.0/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= +github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= +github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -1022,6 +1020,8 @@ github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19y github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= +github.com/informalsystems/cosmos-sdk v0.46.0-alpha2.0.20231206144452-5b8e28f3247b h1:30cT7RklLxEObRhrPNWfxmzpwA7L9wlOZtEQGqwUvkU= +github.com/informalsystems/cosmos-sdk v0.46.0-alpha2.0.20231206144452-5b8e28f3247b/go.mod h1:5XeJ1MRNGiKgoCj/1nWQm0xadHcOP8wqpeCUihzead4= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= @@ -1064,8 +1064,8 @@ github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.16.3 h1:XuJt9zzcnaz6a16/OU53ZjWp/v7/42WcR5t2a0PcNQY= -github.com/klauspost/compress v1.16.3/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= +github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= @@ -1123,8 +1123,8 @@ github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2y github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= -github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= @@ -1228,8 +1228,8 @@ github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4 github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/ory/dockertest/v3 v3.10.0 h1:4K3z2VMe8Woe++invjaTB7VRyQXQy5UY+loujO4aNE4= github.com/ory/dockertest/v3 v3.10.0/go.mod h1:nr57ZbRWMqfsdGdFNLHz5jjNdDb7VVFnzAeW1n5N1Lg= -github.com/oxyno-zeta/gomock-extra-matcher v1.1.0 h1:Yyk5ov0ZPKBXtVEeIWtc4J2XVrHuNoIK+0F2BUJgtsc= -github.com/oxyno-zeta/gomock-extra-matcher v1.1.0/go.mod h1:UMGTHYEmJ1dRq8LDZ7VTAYO4nqM3GD1UGC3RJEUxEz0= +github.com/oxyno-zeta/gomock-extra-matcher v1.2.0 h1:WPEclU0y0PMwUzdDcaKZvld4aXpa3fkzjiUMQdcBEHg= +github.com/oxyno-zeta/gomock-extra-matcher v1.2.0/go.mod h1:S0r7HmKeCGsHmvIVFMjKWwswb4+30nCNWbXRMBVPkaU= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= @@ -1249,6 +1249,8 @@ github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08/go.mod h1:pxMtw7c github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= +github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -1301,8 +1303,6 @@ github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Ung github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGnWA97M= -github.com/regen-network/gocuke v0.6.2/go.mod h1:zYaqIHZobHyd0xOrHGPQjbhGJsuZ1oElx150u2o1xuk= github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= @@ -1310,14 +1310,15 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc= -github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.30.0 h1:SymVODrcRsaRaSInD9yQtKbtWqwsfoPcRff/oRXLj4c= +github.com/rs/zerolog v1.30.0/go.mod h1:/tk+P47gFdPXq4QYjvCmT5/Gsug2nagsFWBWhAiSi1w= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -1358,8 +1359,8 @@ github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= @@ -1449,11 +1450,12 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= -github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= -github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= +github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= +github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= +github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= @@ -1474,6 +1476,8 @@ go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/mock v0.2.0 h1:TaP3xedm7JaAgScZO7tlvlKrqT0p7I6OsdGB5YNSMDU= +go.uber.org/mock v0.2.0/go.mod h1:J0y0rp9L3xiff1+ZBfKxlC1fz2+aO16tw0tsDOixfuM= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= @@ -1504,11 +1508,10 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1523,8 +1526,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc h1:mCRnTeVUjcrhlRmO0VK8a6k6Rrf6TF9htwo2pJVSjIU= -golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb h1:xIApU0ow1zwMa2uL1VDNeQlNVFTWMQxZUZCMDy0Q4Us= +golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1551,11 +1554,12 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= -golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= +golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1627,8 +1631,8 @@ golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1656,8 +1660,8 @@ golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= -golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= -golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= +golang.org/x/oauth2 v0.11.0 h1:vPL4xzxBM4niKCW6g9whtaWVXTJf1U5e4aZxxFx/gbU= +golang.org/x/oauth2 v0.11.0/go.mod h1:LdF7O/8bLR/qWK9DrpXmbHLTouvRHK0SgJl0GmDBchk= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1672,8 +1676,9 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1791,8 +1796,8 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1801,8 +1806,8 @@ golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1817,8 +1822,8 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1890,6 +1895,7 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= @@ -1962,8 +1968,8 @@ google.golang.org/api v0.99.0/go.mod h1:1YOf74vkVndF7pG6hIHuINsM7eWwpVTAfNMNiL91 google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= google.golang.org/api v0.102.0/go.mod h1:3VFl6/fzoA+qNuS1N1/VfXY4LjoXN/wzeIp7TweWwGo= google.golang.org/api v0.103.0/go.mod h1:hGtW6nK1AC+d9si/UBhw8Xli+QMOf6xyNAyJw4qU9w0= -google.golang.org/api v0.122.0 h1:zDobeejm3E7pEG1mNHvdxvjs5XJoCMzyNH+CmwL94Es= -google.golang.org/api v0.122.0/go.mod h1:gcitW0lvnyWjSp9nKxAbdHKIZ6vF4aajGueeslZOyms= +google.golang.org/api v0.128.0 h1:RjPESny5CnQRn9V6siglged+DZCgfu9l6mO9dkX9VOg= +google.golang.org/api v0.128.0/go.mod h1:Y611qgqaE92On/7g65MQgxYul3c0rEB894kniWLY750= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -2092,8 +2098,12 @@ google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZV google.golang.org/genproto v0.0.0-20221201164419-0e50fba7f41c/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd/go.mod h1:cTsE614GARnxrLsqKREzmNYJACSWWpAWdNMwnD7c2BE= google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= +google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a h1:fwgW9j3vHirt4ObdHoYNwuO24BEZjSzbh+zPaNWoiY8= +google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:EMfReVxb80Dq1hhioy0sOsY9jCE46YDgHlJ7fWVUWRE= +google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 h1:W18sezcAYs+3tDZX4F80yctqa12jcP1PUS2gQu1zTPU= +google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97/go.mod h1:iargEX0SFPm3xcfMI0d1domjg0ZF4Aa0p2awqyxhvF0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b h1:ZlWIi1wSK56/8hn4QcBp/j9M7Gt3U/3hZw3mC7vDICo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:swOH3j0KzcDDgGUWr+SNpyTen5YrXjS3eyPzFYKc6lc= google.golang.org/grpc v1.54.0 h1:EhTqbhiYeixwWQtAEZAxmV9MGqcjEU2mFx52xCzNyag= google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= @@ -2112,8 +2122,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -2153,8 +2163,8 @@ gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= -gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= +gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= +gotest.tools/v3 v3.5.0/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -2165,8 +2175,8 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -pgregory.net/rapid v0.5.5 h1:jkgx1TjbQPD/feRoK+S/mXw9e1uj6WilpHrXJowi6oA= -pgregory.net/rapid v0.5.5/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= diff --git a/tests/e2e/validator.go b/tests/e2e/validator.go index c9583bf425..ac804aa5dc 100644 --- a/tests/e2e/validator.go +++ b/tests/e2e/validator.go @@ -231,9 +231,6 @@ func (v *validator) buildCreateValidatorMsg(amount sdk.Coin) (sdk.Msg, error) { MaxChangeRate: sdk.MustNewDecFromStr("0.01"), } - // get the initial validator min self delegation - minSelfDelegation := sdk.OneInt() - valPubKey, err := cryptocodec.FromTmPubKeyInterface(v.consensusKey.PubKey) if err != nil { return nil, err @@ -250,7 +247,6 @@ func (v *validator) buildCreateValidatorMsg(amount sdk.Coin) (sdk.Msg, error) { amount, description, commissionRates, - minSelfDelegation, ) } diff --git a/tests/ics/interchain_security_test.go b/tests/ics/interchain_security_test.go index cf6679f505..a2235a2b1c 100644 --- a/tests/ics/interchain_security_test.go +++ b/tests/ics/interchain_security_test.go @@ -11,7 +11,7 @@ import ( tmdb "github.com/cometbft/cometbft-db" "github.com/cometbft/cometbft/libs/log" - ibctesting "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/testing" + ibctesting "github.com/cosmos/ibc-go/v7/testing" gaiaApp "github.com/cosmos/gaia/v11/app" ) From b4730f530cb6ec8e1d57ea8b596e431aa5e2e7f5 Mon Sep 17 00:00:00 2001 From: MSalopek Date: Tue, 12 Dec 2023 10:45:07 +0100 Subject: [PATCH 10/43] chore!: merge main into feat/sdk-47-ibc7 (#2851) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Removed outdated ICS docs (#2634) * feat: add query local min-gas-price (#2627) * feat: add query local min-gas-price * docs: add changelog * test: add test for query local min-gas-prices * test: add test for local min-gas-price query * fix: test query min-gas-price * bring v10.0.2 changelog to main (#2648) * add missing changelog for PFM bump * fix typo in PFM changelog * Merge pull request from GHSA-354m-4qv6-x846 * refactor: use gci linter to sort imports (#2608) * use the gci linter to sort imports * enable custom ordering in gci * chore: remove depguard and bump golangci-lint (#2596) * remove depguard from gaia, bump golangci-lint * use the actual latest version of golangci-lint * update state sync script to use sg1 cached endpoint * use 1.53.3 * revert changes to statesync script * fix: use the latest release of hermes for e2e (#2644) * use the latest release of hermes for e2e * make hermes.Dockerfile work in multiplatform environments. * deps!: bump liquidity to v1.6.0-forced-withdrawal (#2652) * bump liquidity to v1.6.0-forced-withdrawal * add entries to .changelog * fix filenames to contain PR number * add changelog entry for gov bug fix (#2653) * upgrade release testnet to v11 (#2665) * docs: refactor gaia ADRs (#2628) * refactor gaia ADRs * apply review suggestions * add mermaid graph * add ADR-001 back as rejected * fix typo * mergify and dependabot for v11 (#2654) * fix: fix tag sorting in goreleaser (#2666) * chore: update Cosmos Hub Upgrade Epic (#2661) * update upgrade checklist * Update .github/ISSUE_TEMPLATE/upgrade-checklist.md Co-authored-by: Dante Sanchez --------- Co-authored-by: Dante Sanchez * fix: add "v" prefix to release binary version (#2671) * feat: update module name to v12 (#2672) * bump to v12 * feat: add upgrade handler for v12 * feat: add upgrade test for v12 (#2678) * test: fix upgrade test (#2680) * fix: upgrade test * chore: write to log file * fix: update upgrade handler to v12 (#2681) * docs: global fee adr (#2603) * docs: add adr template * tmp * docs: add globalfee ADR * docs: update globalfee adr * docs: minor change of globalfee adr * Apply suggestions from code review Co-authored-by: Simon Noetzlin * Apply suggestions from code review Co-authored-by: Simon Noetzlin * docs: update according to comment * docs: formatting * docs: add fee check details * renaming as ADR 002 * Apply suggestions from code review Co-authored-by: Marius Poke * chore: cosmos-sdk -> Cosmos SDK * chore: typo correction * docs: restructure * docs: add BypassMinFeeMsgTypes intro * docs: clean * docs * docs update * docs formatting * docs: add defination of CombinedFeeRequirement * feat: update chart * Update docs/architecture/adr-002-globalfee.md Co-authored-by: Simon Noetzlin * Update docs/architecture/adr-002-globalfee.md Co-authored-by: Simon Noetzlin --------- Co-authored-by: Simon Noetzlin Co-authored-by: mpoke * Fix pointer to store upgrades inside loop (#2675) Co-authored-by: MSalopek * docs: bring v11.0.0 changelog to main (#2676) * bring v11.0.0 changelog to main * rename 10.0.2 to v10.0.2 * remove duplicates from unreleased * unclog build * chore(deps): bump JamesIves/github-pages-deploy-action from 4.4.2 to 4.4.3 (#2651) Bumps [JamesIves/github-pages-deploy-action](https://github.com/jamesives/github-pages-deploy-action) from 4.4.2 to 4.4.3.
Release notes

Sourced from JamesIves/github-pages-deploy-action's releases.

v4.4.3

What's Changed

Full Changelog: https://github.com/JamesIves/github-pages-deploy-action/compare/v4...v4.4.3

Commits
  • a1ea191 Deploy Production Code for Commit a8bd9aef1855024c235ad911985c97e153ddc9c4 🚀
  • a8bd9ae Merge branch 'dev' into releases/v4
  • 7e13873 Bump @​types/node from 20.3.3 to 20.4.1 (#1395)
  • da98691 Bump tough-cookie from 4.0.0 to 4.1.3 (#1394)
  • 4a6bcf1 Bump semver from 5.7.1 to 5.7.2 (#1396)
  • 426d422 Bump @​types/node from 20.3.2 to 20.3.3 (#1389)
  • 6c78091 Bump @​types/node from 20.3.1 to 20.3.2 (#1387)
  • dbbf76c Deploying to dev from @ JamesIves/github-pages-deploy-action@ce9d786e639c4709...
  • ce9d786 Bump eslint-plugin-jest from 27.2.1 to 27.2.2 (#1386)
  • e33c1e2 Bump @​types/node from 20.2.5 to 20.3.1 (#1385)
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=JamesIves/github-pages-deploy-action&package-manager=github_actions&previous-version=4.4.2&new-version=4.4.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* deps!: bump PFM to v4.1.0 (#2677) * bump PFM to 4.0.6 * add entries to .changelog * bump PFM to 4.0.6 * add entries to .changelog * bump PFM to 4.1.0 * make lint-fix * chore(deps): bump cosmossdk.io/errors from 1.0.0-beta.7 to 1.0.0 (#2650) Bumps [cosmossdk.io/errors](https://github.com/cosmos/cosmos-sdk) from 1.0.0-beta.7 to 1.0.0. - [Release notes](https://github.com/cosmos/cosmos-sdk/releases) - [Changelog](https://github.com/cosmos/cosmos-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/cosmos/cosmos-sdk/compare/errors/v1.0.0-beta.7...log/v1.0.0) --- updated-dependencies: - dependency-name: cosmossdk.io/errors dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * update swagger (#2590) Co-authored-by: Milan Mulji <98309852+mmulji-ic@users.noreply.github.com> * Fix: sim genesis account validation (#2690) * fix: app: make SimGenesisAccount.Validate error if .BaseAccount is nil This change ensures that an error is returned, instead of panicking, when SimGenesisAccount.BaseAccount is nil, after invoking .Validate. Found by fuzzing and added the tests in here to catch future regressions. Fixes #2586 * merge fix FuzzGenesisAccountValidate test * fix: lint --------- Co-authored-by: Emmanuel T Odeke Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * docs: release testnet upgraded to v11 (#2668) * testnet upgraded to v11 * replace v11.0.0-rc0 with v11.0.0 * docs: Updating the quickstart, joining mainnet & upgrade docs for v11 (#2670) * add upgrade instructions for v11 * update docs for v11 * update proposal number and link * Updated cosmovisor version and a typo --------- Co-authored-by: Milan Mulji <98309852+mmulji-ic@users.noreply.github.com> * deps!: use cosmos-sdk v0.45.16-lsm-ics (#2643) * deps: use cosmos-sdk v0.45.16-lsm-ics * deps&rebase: use cosmos-sdk v0.45.16-lsm-ics * add local testing script * fix: update test_helpers; use latest lsm/ics versions * chore: bump iqlusion:cosmos-sdk to latest * Jstr/lsm e2e tests (#2679) * lsm e2e test work - wip * Add validator bond functionality on lsm happy path * add tokenize share check on lsm test & redeemShare utility function * add bank send lsm tokens test * Add test for transfer reward ownership, and redeem shares * Add staking param query utility & LSM params update process on LSM e2e test * Add IBC transfer test on LSM share tokens & Resolve e2e tests by updating gas configs and result checker * resolve github action bot comments * bring all e2e test items back to enabled * Update tests/e2e/e2e_lsm_test.go Co-authored-by: sampocs * resolve comments * reenable tokenize share record module account balance check --------- Co-authored-by: jstr1121 Co-authored-by: jstr1121 <118450565+jstr1121@users.noreply.github.com> Co-authored-by: sampocs * Add lsm params to upgrade handler (#2686) * set LSM params in upgrade handler * added comments around constants * test: add migrateUBDEntries to upgrade handler — required adding exported.go to sdk * Revert "test: add migrateUBDEntries to upgrade handler — required adding exported.go to sdk" This reverts commit 7bd9727ce734e829ef54538485c3bbf327009345. --------- Co-authored-by: Riley Edmunds * chore: bump cosmos-sdk and ics to latest * Fix staking & distribution e2e test with LSM (#2687) * lsm e2e test work - wip * Add validator bond functionality on lsm happy path * add tokenize share check on lsm test & redeemShare utility function * add bank send lsm tokens test * Add test for transfer reward ownership, and redeem shares * Add staking param query utility & LSM params update process on LSM e2e test * Add IBC transfer test on LSM share tokens & Resolve e2e tests by updating gas configs and result checker * resolve github action bot comments * bring all e2e test items back to enabled * Update tests/e2e/e2e_lsm_test.go Co-authored-by: sampocs * resolve comments * reenable tokenize share record module account balance check * fix staking test affected by other test --------- Co-authored-by: jstr1121 Co-authored-by: jstr1121 <118450565+jstr1121@users.noreply.github.com> * chore: appease lint rules * docs: Add LSM docs (#2683) * docs: validator FAQ updated with LSM docs * docs: validator faq - remove min self delegation references * docs: delegator faq - add lsm docs * docs: address Marius review comments on docs * bump SDK to 0.45.16-ics-lsm-rc0 and ICS to 2.0.0-lsm-rc0 * add .changelog entries * use sdk.Dec * Update constants.go --------- Co-authored-by: riley-stride <104941670+riley-stride@users.noreply.github.com> Co-authored-by: jstr1121 Co-authored-by: jstr1121 <118450565+jstr1121@users.noreply.github.com> Co-authored-by: sampocs Co-authored-by: Riley Edmunds Co-authored-by: Marius Poke Co-authored-by: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> * deps: bump SDK to v0.45.16-ics-lsm and ICS to v2.0.0-lsm (#2695) * bump SDK to v0.45.16-ics-lsm and ICS to v2.0.0-lsm * fix link in .changelog entry * chore(deps): bump cosmossdk.io/math from 1.0.1 to 1.1.0 (#2698) Bumps [cosmossdk.io/math](https://github.com/cosmos/cosmos-sdk) from 1.0.1 to 1.1.0.
Release notes

Sourced from cosmossdk.io/math's releases.

Cosmovisor v1.1.0

Release Notes

New execution model

With this release we are shifting to a new CLI design:

  • in the past, Cosmovisor was designed to act as a wrapper for a Cosmos App. An admin could link it and use it instead of the Cosmos App. When running it will pass all options and configuration parameters to the app. Hence the only way to configure the Cosmovisor was through environment variables.
  • now, we are moving to a more traditional model, where Cosmovisor has it's own command set and is a true supervisor.

New commands have been added:

  • run will start the Cosmos App and pass remaining arguments to the app (similar to npm run)
  • help will display Cosmovisor help
  • version will display both Cosmovisor and the associated app version.

The existing way of starting an app with Cosmovisor has been deprecated (cosmovisor [app params]) and will be removed in the future version. Please use cosmovisor run [app pararms] instead.

New Features

We added a new configuration option: DAEMON_BACKUP_DIR (as env variable). When set, Cosmovisor will create backup the app data backup in that directory (instead of using the app home directory) before running the update. See the README file for more details.

Bug Fixes

  • Fixed cosmovisor version output when installed using 'go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@v1.0.0'.

Changelog

For more details, please see the CHANGELOG.

Commits
  • be5e3aa feat(log): extend logger options (#15956)
  • 851e9e8 docs: update roadmap for q2 (#15952)
  • 91278f6 refactor(x/authz)!: Use KVStoreService, context.Context and return errors ins...
  • 26faee9 refactor: bcrypt key derivation to aead (#509) (#15817)
  • 428e19f refactor(x/distribution)!: Use KVStoreService, context.Context and return err...
  • a6ea094 ci: skip fix registration for linting (#15965)
  • 00b78fa refactor(x/auth): v2 adaptable tx instead of double decode (#15910)
  • 1179285 feat(hubl): cache bech32 prefix (#15954)
  • 6a8251a build(deps): bump cometbft to v0.37.1 (#15955)
  • 6dfe735 refactor!: use KVStoreService and context.Context in x/bank (#15891)
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cosmossdk.io/math&package-manager=go_modules&previous-version=1.0.1&new-version=1.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* chore: mergify and dependabot for v12 (#2701) * update mergify * update dependabot * chore(deps): Bump cosmossdk.io/math from 1.1.0 to 1.1.2 (#2705) Bumps [cosmossdk.io/math](https://github.com/cosmos/cosmos-sdk) from 1.1.0 to 1.1.2.
Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cosmossdk.io/math&package-manager=go_modules&previous-version=1.1.0&new-version=1.1.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* Test: automate upgrade test in ci (#2692) * feat: automate upgrade test * test: update upgrade workflow * test: update upgrade workflow again * test: update update upgrade scripts * test: update binary copying * test: update upgrade dir * test: update upgrade dir path * fix: binary copying * fix: update dir path * debug * fix: upgrade version number * fix: version comparision * fix: version comparision in run_upgrade_commands.sh * fix: use pre-release tag first, then use latest release tag for old binary version * fix: continue-on-error * checkout current pr branch * remove checkout - * release checkout * typo * move gaiad binary to GITHUB_WORKSPACE * debug * debug: update checkout verison * fix test.yml * debug: binary share between steps * debug: checkout present pr branch before run scripts * query proposals * fix cosmovisor dir * fix the upgrade version * formatting * formatting * formatting * debug yml format * typo correction * make old gaiad version hardcoded * chore: add comments * fix typos in release notes template (#2708) * chore: update to v13 (#2707) * update to v13 * update upgrade script * update test upgrade script * update sed command * update app.go * update upgradeFrom version * ci: update goreleaser tag sort options (#2710) * ci: update goreleaser tag sort options * ci: add prerelease suffix * ci: add force tag fetch just in case * ci: use refname with suffix instead of creatordate * ci: use refname with suffix instead of creatordate * docs: schedule testnet upgrade to v12 (#2704) * v12 upgrade height, cosmovisor 1.5.0 * testnet upgraded to v12 * fix: Removal of liquidity module (#2716) * Remove liquidity module * Fix issue found by linter * Update docs * Correction to coding guidlines * docs: Updated docs for v12 release (#2718) * updated docs for v12 release * Review comments regarding installation instructions of cosmovisor * bring v12 changelog from release branch (#2715) * chore(deps): Bump actions/checkout from 3 to 4 (#2721) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
Release notes

Sourced from actions/checkout's releases.

v4.0.0

What's Changed

New Contributors

Full Changelog: https://github.com/actions/checkout/compare/v3...v4.0.0

v3.6.0

What's Changed

New Contributors

Full Changelog: https://github.com/actions/checkout/compare/v3.5.3...v3.6.0

v3.5.3

What's Changed

New Contributors

Full Changelog: https://github.com/actions/checkout/compare/v3...v3.5.3

v3.5.2

What's Changed

Full Changelog: https://github.com/actions/checkout/compare/v3.5.1...v3.5.2

v3.5.1

What's Changed

New Contributors

... (truncated)

Changelog

Sourced from actions/checkout's changelog.

Changelog

v4.0.0

v3.6.0

v3.5.3

v3.5.2

v3.5.1

v3.5.0

v3.4.0

v3.3.0

v3.2.0

v3.1.0

v3.0.2

v3.0.1

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/checkout&package-manager=github_actions&previous-version=3&new-version=4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* chore(deps): Bump actions/cache from 3.3.1 to 3.3.2 (#2719) Bumps [actions/cache](https://github.com/actions/cache) from 3.3.1 to 3.3.2.
Release notes

Sourced from actions/cache's releases.

v3.3.2

What's Changed

New Contributors

Full Changelog: https://github.com/actions/cache/compare/v3...v3.3.2

Changelog

Sourced from actions/cache's changelog.

3.3.1

  • Reduced segment size to 128MB and segment timeout to 10 minutes to fail fast in case the cache download is stuck.

3.3.2

  • Fixes bug with Azure SDK causing blob downloads to get stuck.
Commits
  • 704facf Merge pull request #1236 from actions/bethanyj28/bump-version
  • 17e2888 Add to RELEASES.md
  • 667d8fd bump action version to 3.3.2
  • f7ebb81 Consume latest toolkit and fix dangling promise bug (#1217)
  • 67b839e Merge pull request #1187 from jorendorff/jorendorff/rm-add-to-project
  • 57f0e3f Remove actions to add new PRs and issues to a project board
  • 04f198b Merge pull request #1132 from vorburger/bazel-example
  • bd9b49b Merge branch 'main' into bazel-example
  • ea05037 Merge pull request #1122 from actions/pdotl-patch-1
  • 6a1a45d Merge branch 'main' into pdotl-patch-1
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/cache&package-manager=github_actions&previous-version=3.3.1&new-version=3.3.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* chore(deps): Bump docker/build-push-action from 4.1.1 to 4.2.1 (#2720) Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4.1.1 to 4.2.1.
Release notes

Sourced from docker/build-push-action's releases.

v4.2.1

Note

Buildx v0.10 enables support for a minimal SLSA Provenance attestation, which requires support for OCI-compliant multi-platform images. This may introduce issues with registry and runtime support (e.g. Google Cloud Run and AWS Lambda). You can optionally disable the default provenance attestation functionality using provenance: false.

Full Changelog: https://github.com/docker/build-push-action/compare/v4.2.0...v4.2.1

v4.2.0

Note

Buildx v0.10 enables support for a minimal SLSA Provenance attestation, which requires support for OCI-compliant multi-platform images. This may introduce issues with registry and runtime support (e.g. Google Cloud Run and AWS Lambda). You can optionally disable the default provenance attestation functionality using provenance: false.

Full Changelog: https://github.com/docker/build-push-action/compare/v4.1.1...v4.2.0

Commits
  • 0a97817 Merge pull request #957 from crazy-max/warn-docker-config
  • ec39ef3 chore: update generated content
  • f46044b warn if docker config can't be parsed
  • 4e4ee68 Merge pull request #951 from crazy-max/ci-concurrency
  • e86cf55 ci: missing concurrency checks
  • daa0106 Merge pull request #949 from docker/dependabot/github_actions/actions/checkout-4
  • ce51e90 chore(deps): Bump actions/checkout from 3 to 4
  • 1fde163 Merge pull request #950 from crazy-max/fix-ci
  • ae311c5 ci: fix workflow
  • 9311bf5 Merge pull request #932 from crazy-max/form-templates
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=docker/build-push-action&package-manager=github_actions&previous-version=4.1.1&new-version=4.2.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* docs: fix .md links (#2722) * fix md links * remove proto docs and Makefile target * fix md links * fix ledger-live link (#2724) * fix md links (#2725) * bump ICS to v2.1.0-provider-lsm-rc0 (#2727) * bump ICS to v2.1.0-provider-lsm-rc1 (#2728) * add prop handler to app (#2731) * deps!: bump ICS to v2.1.0-provider-lsm (#2732) * bump ICS to v2.1.0-provider-lsm * add changelog entries * chore(deps): Bump docker/build-push-action from 4.2.1 to 5.0.0 (#2736) Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4.2.1 to 5.0.0.
Release notes

Sourced from docker/build-push-action's releases.

v5.0.0

Full Changelog: https://github.com/docker/build-push-action/compare/v4.2.1...v5.0.0

Commits
  • 0565240 Merge pull request #959 from docker/dependabot/npm_and_yarn/actions/core-1.10.1
  • 3ab07f8 chore: update generated content
  • b9e7e4d chore(deps): Bump @​actions/core from 1.10.0 to 1.10.1
  • 04d1a3b Merge pull request #954 from crazy-max/update-node20
  • 1a4d1a1 chore: node 20 as default runtime
  • 675965c chore: update generated content
  • 58ee34c chore: fix author in package.json
  • c97c406 fix ProxyConfig type when checking length
  • 47d5369 vendor: bump @​docker/actions-toolkit from 0.8.0 to 0.12.0
  • 8895c74 chore: update dev dependencies
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=docker/build-push-action&package-manager=github_actions&previous-version=4.2.1&new-version=5.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* chore(deps): Bump docker/login-action from 2.2.0 to 3.0.0 (#2738) Bumps [docker/login-action](https://github.com/docker/login-action) from 2.2.0 to 3.0.0.
Release notes

Sourced from docker/login-action's releases.

v3.0.0

Full Changelog: https://github.com/docker/login-action/compare/v2.2.0...v3.0.0

Commits
  • 343f7c4 Merge pull request #599 from docker/dependabot/npm_and_yarn/aws-sdk-dependenc...
  • aad0f97 chore: update generated content
  • 2e0cd39 build(deps): bump the aws-sdk-dependencies group with 2 updates
  • 203bc9c Merge pull request #588 from docker/dependabot/npm_and_yarn/proxy-agent-depen...
  • 2199648 chore: update generated content
  • b489376 build(deps): bump the proxy-agent-dependencies group with 1 update
  • 7c309e7 Merge pull request #598 from docker/dependabot/npm_and_yarn/actions/core-1.10.1
  • 0ccf222 chore: update generated content
  • 56d703e Merge pull request #597 from docker/dependabot/github_actions/aws-actions/con...
  • 24d3b35 build(deps): bump @​actions/core from 1.10.0 to 1.10.1
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=docker/login-action&package-manager=github_actions&previous-version=2.2.0&new-version=3.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* chore(deps): Bump docker/metadata-action from 4.6.0 to 5.0.0 (#2737) Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 4.6.0 to 5.0.0.
Release notes

Sourced from docker/metadata-action's releases.

v5.0.0

Full Changelog: https://github.com/docker/metadata-action/compare/v4.6.0...v5.0.0

Upgrade guide

Sourced from docker/metadata-action's upgrade guide.

Upgrade notes

v2 to v3

  • Repository has been moved to docker org. Replace crazy-max/ghaction-docker-meta@v2 with docker/metadata-action@v5
  • The default bake target has been changed: ghaction-docker-meta > docker-metadata-action

v1 to v2

inputs

New Unchanged Removed
tags images tag-sha
flavor sep-tags tag-edge
labels sep-labels tag-edge-branch
tag-semver
tag-match
tag-match-group
tag-latest
tag-schedule
tag-custom
tag-custom-only
label-custom

tag-sha

tags: |
  type=sha

tag-edge / tag-edge-branch

tags: |
  # default branch
</tr></table>

... (truncated)

Commits
  • 96383f4 Merge pull request #320 from docker/dependabot/npm_and_yarn/csv-parse-5.5.0
  • f138b96 chore: update generated content
  • 9cf7015 Bump csv-parse from 5.4.0 to 5.5.0
  • 5a8a5ff Merge pull request #315 from docker/dependabot/npm_and_yarn/handlebars-4.7.8
  • 2279d9a chore: update generated content
  • c659933 Bump handlebars from 4.7.7 to 4.7.8
  • 48d23cc Merge pull request #333 from docker/dependabot/npm_and_yarn/actions/core-1.10.1
  • b83ffb4 chore: update generated content
  • 3207f24 Bump @​actions/core from 1.10.0 to 1.10.1
  • 63f4a26 Merge pull request #328 from crazy-max/update-node20
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=docker/metadata-action&package-manager=github_actions&previous-version=4.6.0&new-version=5.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* chore(deps): Bump goreleaser/goreleaser-action from 4 to 5 (#2739) Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 4 to 5.
Release notes

Sourced from goreleaser/goreleaser-action's releases.

v5.0.0

What's Changed

Full Changelog: https://github.com/goreleaser/goreleaser-action/compare/v4.6.0...v5.0.0

v4.6.0

Reverts the change to node20 runtime.

Full Changelog: https://github.com/goreleaser/goreleaser-action/compare/v4.5.0...v4.6.0

v4.5.0

What's Changed

New Contributors

Full Changelog: https://github.com/goreleaser/goreleaser-action/compare/v4.4.0...v4.5.0

v4.4.0

What's Changed

Full Changelog: https://github.com/goreleaser/goreleaser-action/compare/v4.3.0...v4.4.0

v4.3.0

What's Changed

New Contributors

Full Changelog: https://github.com/goreleaser/goreleaser-action/compare/v4.2.0...v4.3.0

... (truncated)

Commits
  • 7ec5c2b chore(deps): bump @​actions/core from 1.10.0 to 1.10.1 (#434)
  • 3529a65 chore: node 20 as default runtime (#432)
  • d2f6e33 chore(deps): bump crazy-max/ghaction-import-gpg from 5 to 6 (#433)
  • See full diff in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=goreleaser/goreleaser-action&package-manager=github_actions&previous-version=4&new-version=5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* set testnet v13 upgrade height (#2743) * add v13.0.0 changelog section (#2748) * update mergify and dependabot (#2750) * chore: update main to v14 (#2749) * replace v13 with v14 * update test.yml * add v14 upgrade handler * docs: updating release procedure (#2751) * updating release procedure * Update RELEASE_PROCESS.md Co-authored-by: bernd-m <43466467+bermuell@users.noreply.github.com> --------- Co-authored-by: bernd-m <43466467+bermuell@users.noreply.github.com> * fix uninitiated bank keeper passed in crisis keeper (#2753) Co-authored-by: Marius Poke * docs: Added maintainability section, to include vulnerability checking (#2755) * Added maintainability section, to include vulnerability checking * Updated with review comments * testnet upgraded to v13 (#2747) * docs: Updated migration docs for v13 release (#2754) * Migration instructions for v13 * Migration instructions for v13 * Updated with review comments * Added upgrade banner + timeline * docs: Post v13 docs update (#2757) * Added post upgrade docs * Update docs/roadmap/README.md Co-authored-by: Simon Noetzlin * Update docs/roadmap/README.md Co-authored-by: Simon Noetzlin --------- Co-authored-by: Simon Noetzlin * chore(deps): Bump golang.org/x/net from 0.12.0 to 0.17.0 (#2760) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.12.0 to 0.17.0. - [Commits](https://github.com/golang/net/compare/v0.12.0...v0.17.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): Bump github.com/spf13/viper from 1.16.0 to 1.17.0 (#2759) Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.16.0 to 1.17.0. - [Release notes](https://github.com/spf13/viper/releases) - [Commits](https://github.com/spf13/viper/compare/v1.16.0...v1.17.0) --- updated-dependencies: - dependency-name: github.com/spf13/viper dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Updates wallets and explorers (#2770) * chore(deps): Bump github.com/docker/docker from 20.10.24+incompatible to 24.0.7+incompatible (#2777) Bumps [github.com/docker/docker](https://github.com/docker/docker) from 20.10.24+incompatible to 24.0.7+incompatible.
Release notes

Sourced from github.com/docker/docker's releases.

v24.0.7

24.0.7

For a full list of pull requests and changes in this release, refer to the relevant GitHub milestones:

Bug fixes and enhancements

  • Write overlay2 layer metadata atomically. moby/moby#46703
  • Fix "Rootful-in-Rootless" Docker-in-Docker on systemd version 250 and later. moby/moby#46626
  • Fix dockerd-rootless-setuptools.sh when username contains a backslash. moby/moby#46407
  • Fix a bug that would prevent network sandboxes to be fully deleted when stopping containers with no network attachments and when dockerd --bridge=none is used. moby/moby#46702
  • Fix a bug where cancelling an API request could interrupt container restart. moby/moby#46697
  • Fix an issue where containers would fail to start when providing --ip-range with a range larger than the subnet. docker/for-mac#6870
  • Fix data corruption with zstd output. moby/moby#46709
  • Fix the conditions under which the container's MAC address is applied. moby/moby#46478
  • Improve the performance of the stats collector. moby/moby#46448
  • Fix an issue with source policy rules ending up in the wrong order. moby/moby#46441

Packaging updates

Security

v24.0.6

24.0.6

For a full list of pull requests and changes in this release, refer to the relevant GitHub milestones:

Bug fixes and enhancements

  • containerd storage backend: Fix docker ps failing when a container image is no longer present in the content store. moby/moby#46095
  • containerd storage backend: Fix docker ps -s -a and docker container prune failing when a container image config is no longer present in the content store. moby/moby#46097
  • containerd storage backend: Fix docker inspect failing when a container image config is no longer (or was never) present in the content store. moby/moby#46244
  • containerd storage backend: Fix diff and export with the overlayfs snapshotter by using reference-counted rootfs mounts. moby/moby#46266
  • containerd storage backend: Fix a misleading error message when the image platforms available locally do not match the desired platform. moby/moby#46300
  • containerd storage backend: Fix the FROM scratch Dockerfile instruction with the classic builder. moby/moby#46302
  • containerd storage backend: Fix mismatched image rootfs and manifest layers errors with the classic builder. moby/moby#46310

... (truncated)

Commits
  • 311b9ff Merge pull request #46697 from thaJeztah/24.0_backport_restart_nocancel
  • af60804 Merge pull request from GHSA-jq35-85cj-fj4p
  • 3cf363e Merge pull request #46709 from thaJeztah/24.0_backport_bump_compress
  • 05d7386 daemon: daemon.containerRestart: don't cancel restart on context cancel
  • 649c944 Merge pull request #46703 from thaJeztah/24.0_backport_atomic-layer-data-write
  • 9b20b1a Merge pull request #46702 from thaJeztah/24.0_backport_releaseNetwork_Network...
  • dd37b0b vendor: github.com/klauspost/compress v1.17.2
  • 7058c0d vendor: github.com/klauspost/compress v1.16.5
  • 57bd388 daemon: overlay2: Write layer metadata atomically
  • 05d95fd daemon: release sandbox even when NetworkDisabled
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/docker/docker&package-manager=go_modules&previous-version=20.10.24+incompatible&new-version=24.0.7+incompatible)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/cosmos/gaia/network/alerts).
* bump hid and ledger-cosmos deps (#2763) * deps: bump pfm to v4.1.1 (#2779) * bump pfm to 4.1.1 * add changelog entries * bump ics (#2781) * fix "follwing" typo (#2782) Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * deps: bump ICS (#2789) * bump ics * bump ics to new RC * nit * chore(deps): Bump github.com/spf13/cobra from 1.7.0 to 1.8.0 (#2788) Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.7.0 to 1.8.0.
Release notes

Sourced from github.com/spf13/cobra's releases.

v1.8.0

✨ Features

🐛 Bug fixes

🔧 Maintenance

🧪 Testing & CI/CD

✏️ Documentation


Thank you everyone who contributed to this release and all your hard work! Cobra and this community would never be possible without all of you!!!! 🐍

Full Changelog: https://github.com/spf13/cobra/compare/v1.7.0...v1.8.0

Commits
  • a0a6ae0 Improve API to get flag completion function (#2063)
  • 890302a Support usage as plugin for tools like kubectl (#2018)
  • 48cea5c build(deps): bump actions/checkout from 3 to 4 (#2028)
  • 22953d8 Replace all non-alphanumerics in active help env var program prefix (#1940)
  • 00b68a1 Add tests for flag completion registration (#2053)
  • b711e87 Don't complete --help flag when flag parsing disabled (#2061)
  • 8b1eba4 Fix linter errors (#2052)
  • 4cafa37 Allow running persistent run hooks of all parents (#2044)
  • 5c962a2 build(deps): bump github.com/cpuguy83/go-md2man/v2 from 2.0.2 to 2.0.3 (#2047)
  • efe8fa3 build(deps): bump actions/setup-go from 3 to 4 (#1934)
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/spf13/cobra&package-manager=go_modules&previous-version=1.7.0&new-version=1.8.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* chore(deps): Bump github.com/gorilla/mux from 1.8.0 to 1.8.1 (#2787) Bumps [github.com/gorilla/mux](https://github.com/gorilla/mux) from 1.8.0 to 1.8.1.
Release notes

Sourced from github.com/gorilla/mux's releases.

Release v1.8.1

What's Changed

New Contributors

Full Changelog: https://github.com/gorilla/mux/compare/v1.8.0...v1.8.1

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/gorilla/mux&package-manager=go_modules&previous-version=1.8.0&new-version=1.8.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* backport v13.0.1 changelog entries to main (#2791) * add changelog entry for ledger fix (#2792) * dep: bump ics to v2.2.0-provider-lsm (#2795) * bump ics to v2.2.0-provider-lsm * add ICS bump to changelog * Update .changelog/unreleased/features/2781-bump-ics.md Co-authored-by: Marius Poke * Update .changelog/unreleased/api-breaking/2781-bump-ics.md Co-authored-by: Marius Poke --------- Co-authored-by: Marius Poke * cleanup changelog (#2796) * backport v13.0.2 changelog section to main (#2802) * update mergify and dependabot for v14 (#2798) * docs: fix .md links (#2804) * fix .md links * remove false positives * (deps!): bump ICS to v2.3.0-provider-lsm (#2808) (#2809) * bump ics * update changelog entries * bump ics (#2811) * deps: bump ICS to v2.3.0-provider-lsm (#2814) * bump ICS to v2.3.0-provider-lsm * update changelog entries * chore(deps): Bump cosmossdk.io/math from 1.1.2 to 1.2.0 (#2806) Bumps [cosmossdk.io/math](https://github.com/cosmos/cosmos-sdk) from 1.1.2 to 1.2.0.
Release notes

Sourced from cosmossdk.io/math's releases.

Cosmovisor v1.2.0

Release Notes

New Features

With the cosmovisor init command, all the necessary folders for using cosmovisor are automatically created. You do not need to manually symlink the chain binary anymore.

We've added a new configuration option: DAEMON_RESTART_DELAY (as env variable). When set, Cosmovisor will wait that delay between the node halt and backup. See the README file for more details.

Bug Fixes

  • Fix Cosmovisor binary usage for pre-upgrade. Cosmovisor was using the wrong binary when running a pre-upgrade command.

Changelog

For more details, please see the CHANGELOG.

Commits
  • c33b4db chore: prepare log 1.2.0 (#17214)
  • c36c860 refactor(cli): remove duplicate --home flag (#17215)
  • 31f7247 feat(cli): status cmd cli support output text (#17184)
  • 095a641 feat(docker): Add debuging dependencies directly into the dockerfile (#17228)
  • f47749b fix: text output format of block-results cmd cli (#17183)
  • 236fe4c docs: additional fields in context.go to be added to context.md (#17199)
  • 382de33 feat(testutil): adding DefaultContextWithKeys test helper (#17216)
  • 0b7d2d3 fix(log): add fallback to Stringer when type do not implement `json.Marshal...
  • 60ead8d ci: skip fix_registration.go when using LINT_DIFF=1 (#17185)
  • edba186 refactor(keys): remove duplicate --home flag (#17197)
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cosmossdk.io/math&package-manager=go_modules&previous-version=1.1.2&new-version=1.2.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* bring v14.0.0 changelog entries to main (#2817) * bump ICS to v2.4.0-lsm-rc0 (#2819) * update security policy (#2820) * set the min evidence height for neutron-1 and stride-1 (#2821) * chore(deps): Bump docker/build-push-action from 5.0.0 to 5.1.0 (#2822) Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5.0.0 to 5.1.0.
Release notes

Sourced from docker/build-push-action's releases.

v5.1.0

Full Changelog: https://github.com/docker/build-push-action/compare/v5.0.0...v5.1.0

Commits
  • 4a13e50 Merge pull request #1006 from docker/dependabot/npm_and_yarn/docker/actions-t...
  • 7416668 chore: update generated content
  • b4f76a5 chore(deps): Bump @​docker/actions-toolkit from 0.13.0 to 0.14.0
  • b7feb76 Merge pull request #1005 from crazy-max/ci-inspect
  • fae8018 ci: inspect sbom and provenance
  • b625868 Merge pull request #1004 from crazy-max/ci-update-buildx
  • 5193ef1 ci: update buildx to latest
  • d3afd77 Merge pull request #991 from docker/dependabot/npm_and_yarn/babel/traverse-7....
  • 7a786bb Merge pull request #992 from crazy-max/annotations
  • c66ae3a chore: update generated content
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=docker/build-push-action&package-manager=github_actions&previous-version=5.0.0&new-version=5.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* bump ICS to v2.4.0-lsm-rc1 (#2823) * update bots for v14.1.x (#2824) * deps!: bump ICS to v2.4.0-lsm (#2825) * bump ICS to v2.4.0-lsm * add changelog entries and update v14.0.0 section * add changelog entry for #2821 * deprecate v14.0.0 changelog section (#2827) * docs: update Gaia processes (#2818) * update Gaia processes * Update STATE-COMPATIBILITY.md Co-authored-by: Simon Noetzlin * update cosmos sdk link --------- Co-authored-by: Simon Noetzlin * bring changelog 14.1.0 section to main (#2831) * chore(deps): Bump github.com/spf13/cast from 1.5.1 to 1.6.0 (#2835) Bumps [github.com/spf13/cast](https://github.com/spf13/cast) from 1.5.1 to 1.6.0. - [Release notes](https://github.com/spf13/cast/releases) - [Commits](https://github.com/spf13/cast/compare/v1.5.1...v1.6.0) --- updated-dependencies: - dependency-name: github.com/spf13/cast dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): Bump JamesIves/github-pages-deploy-action from 4.4.3 to 4.5.0 (#2836) Bumps [JamesIves/github-pages-deploy-action](https://github.com/jamesives/github-pages-deploy-action) from 4.4.3 to 4.5.0.
Release notes

Sourced from JamesIves/github-pages-deploy-action's releases.

v4.5.0

What's Changed

New Contributors

Full Changelog: https://github.com/JamesIves/github-pages-deploy-action/compare/v4.4.3...v4.5.0

Commits
  • 65b5dfd Deploy Production Code for Commit 32bb2a8d7bda92f28b1fd223fc5793ab27f725eb 🚀
  • 32bb2a8 Merge branch 'dev' into releases/v4
  • 7879c16 feat: update to Node 20
  • 1c34508 build(deps-dev): bump @​types/node from 20.9.0 to 20.10.0 (#1479)
  • b957d05 Bump actions/checkout from 3 to 4 (#1429)
  • 3a4632d build(deps-dev): bump @​types/node from 20.4.9 to 20.9.0 (#1474)
  • 9de0269 build(deps): bump actions/setup-node from 3 to 4 (#1467)
  • 810af53 Update README.md
  • 24c1e2a doc: .gitignore matches not being deployed (#1459)
  • 0769273 fix: remove base.Dockerfile as it's not needed
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=JamesIves/github-pages-deploy-action&package-manager=github_actions&previous-version=4.4.3&new-version=4.5.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* chore(deps): Bump docker/metadata-action from 5.0.0 to 5.2.0 (#2837) Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 5.0.0 to 5.2.0.
Release notes

Sourced from docker/metadata-action's releases.

v5.2.0

Full Changelog: https://github.com/docker/metadata-action/compare/v5.1.0...v5.2.0

v5.1.0

Full Changelog: https://github.com/docker/metadata-action/compare/v5.0.0...v5.1.0

Commits
  • e6428a5 Merge pull request #361 from crazy-max/custom-annotations
  • 26b4721 Merge pull request #359 from favonia/document-annotations
  • 352ce8b chore: update generated content
  • cb0becc custom annotations support
  • 91224bc docs(README): add a hint about multi-arch builds
  • f19c369 Merge pull request #358 from crazy-max/empty-images
  • 4066f0c chore: update generated content
  • d6a296c chore: use anonymous func to generate tags and add tests
  • aacea38 feat: allow the images input to be empty, to output just tags
  • 051f7ea Merge pull request #357 from docker/dependabot/npm_and_yarn/docker/actions-to...
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=docker/metadata-action&package-manager=github_actions&previous-version=5.0.0&new-version=5.2.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* docs: Updates for Gaia v14 (aka v14.1.0) (#2839) * Updates for Gaia v14 (aka v14.1.0) * Some minor updates * prepare main for v15 (#2807) * merge: post merge fixes and updates * post-merge: update majority of bugs * tests: port lsm e2e, fix testing issues * tests: update e2e_staking tests to reflect LSM changes --------- Signed-off-by: dependabot[bot] Co-authored-by: Milan Mulji <98309852+mmulji-ic@users.noreply.github.com> Co-authored-by: yaruwangway <69694322+yaruwangway@users.noreply.github.com> Co-authored-by: Marius Poke Co-authored-by: dongsam Co-authored-by: Jacob Gadikian Co-authored-by: Dante Sanchez Co-authored-by: Simon Noetzlin Co-authored-by: Wojciech Małota-Wójcik <59281144+outofforest@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Emmanuel T Odeke Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> Co-authored-by: riley-stride <104941670+riley-stride@users.noreply.github.com> Co-authored-by: jstr1121 Co-authored-by: jstr1121 <118450565+jstr1121@users.noreply.github.com> Co-authored-by: sampocs Co-authored-by: Riley Edmunds Co-authored-by: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Co-authored-by: bernd-m <43466467+bermuell@users.noreply.github.com> Co-authored-by: Puneet <59960662+puneet2019@users.noreply.github.com> Co-authored-by: Jorge Hernandez <3452489+jhernandezb@users.noreply.github.com> Co-authored-by: Kevin Heavey <24635973+kevinheavey@users.noreply.github.com> --- .../dependencies/2554-bump-ibc.md | 0 .../dependencies/2594-bump-cometbft.md | 0 .../2629-add-query-local-min-gas-prices.md | 3 + .changelog/v10.0.2/summary.md | 3 + .../api-breaking/globalfee/2424-params.md | 0 .../bug-fixes/0-GHSA-354m-4qv6-x846.md | 3 + .../v11.0.0/dependencies/2185-bump-pfm.md | 3 + .../dependencies/2616-bump-ics.md | 0 .../dependencies/2652-liquidity-removal.md | 3 + .../state-breaking/0-GHSA-354m-4qv6-x846.md | 3 + .../v11.0.0/state-breaking/2616-bump-ics.md | 3 + .../state-breaking/2652-liquidity-removal.md | 3 + .../globalfee/2352-migration.md | 0 .../state-breaking/globalfee/2424-params.md | 0 .../globalfee/2447-delivertx.md | 0 .changelog/v11.0.0/summary.md | 1 + .changelog/v12.0.0/api-breaking/2643-lsm.md | 3 + .changelog/v12.0.0/bug-fixes/2677-bump-pfm.md | 3 + .../v12.0.0/dependencies/2643-bump-ics.md | 3 + .../v12.0.0/dependencies/2643-bump-sdk.md | 3 + .../v12.0.0/dependencies/2677-bump-pfm.md | 3 + .changelog/v12.0.0/features/2643-lsm.md | 3 + .changelog/v12.0.0/state-breaking/2643-lsm.md | 3 + .../v12.0.0/state-breaking/2677-bump-pfm.md | 3 + .changelog/v12.0.0/summary.md | 1 + .../dependencies/2714-remove-liquidity.md | 2 + .../v13.0.0/dependencies/2732-bump-ics.md | 3 + .../v13.0.0/state-breaking/2732-bump-ics.md | 3 + .changelog/v13.0.0/summary.md | 1 + .changelog/v13.0.1/bug-fixes/2771-bump-pfm.md | 3 + .../v13.0.1/dependencies/2771-bump-pfm.md | 3 + .changelog/v13.0.1/summary.md | 1 + .../v13.0.2/bug-fixes/2763-ledger-fix.md | 4 + .changelog/v13.0.2/summary.md | 1 + .../v14.0.0/api-breaking/2814-bump-ics.md | 1 + .../v14.0.0/dependencies/2814-bump-ics.md | 1 + .changelog/v14.0.0/features/2814-bump-ics.md | 1 + .../v14.0.0/state-breaking/2814-bump-ics.md | 1 + .changelog/v14.0.0/summary.md | 3 + .../v14.1.0/api-breaking/2825-bump-ics.md | 1 + .../v14.1.0/dependencies/2825-bump-ics.md | 1 + .../v14.1.0/features/2821-evidence-height.md | 3 + .changelog/v14.1.0/features/2825-bump-ics.md | 1 + .../v14.1.0/state-breaking/2825-bump-ics.md | 1 + .changelog/v14.1.0/summary.md | 2 + .github/ISSUE_TEMPLATE/upgrade-checklist.md | 84 +++--- .github/dependabot.yml | 14 +- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/docker-push.yml | 10 +- .github/workflows/docs.yml | 4 +- .github/workflows/lint.yml | 2 +- .github/workflows/md-link-checker.yml | 3 +- .github/workflows/nightly-tests.yml | 2 +- .github/workflows/release-sims.yml | 14 +- .github/workflows/release.yml | 5 +- .github/workflows/sim-label.yml | 6 +- .github/workflows/sims.yml | 18 +- .github/workflows/test.yml | 37 +-- .golangci.yml | 28 +- .goreleaser.yml | 10 +- .mergify.yml | 21 +- CHANGELOG.md | 204 +++++++++++++ CONTRIBUTING.md | 22 +- Makefile | 2 +- RELEASE_NOTES.md | 4 +- RELEASE_PROCESS.md | 114 +++++-- RELEASING.md | 182 ----------- SECURITY.md | 93 ++---- STATE-COMPATIBILITY.md | 211 +++++++++++++ ante/ante.go | 5 +- ante/gov_ante.go | 6 +- ante/gov_ante_test.go | 25 +- app/app.go | 29 +- app/app_test.go | 7 +- app/encoding.go | 2 +- app/genesis.go | 2 +- app/genesis_account.go | 9 + app/genesis_account_fuzz_test.go | 35 +++ app/helpers/test_helpers.go | 23 +- app/keepers/keepers.go | 17 +- app/keepers/keys.go | 4 +- app/modules.go | 23 +- app/sim/sim_state.go | 6 +- app/sim/sim_utils.go | 4 +- app/sim_bench_test.go | 4 +- app/sim_test.go | 4 +- app/upgrades/types.go | 2 +- app/upgrades/v10/constants.go | 2 +- app/upgrades/v10/upgrades.go | 2 +- app/upgrades/v11/constants.go | 2 +- app/upgrades/v11/upgrades.go | 2 +- app/upgrades/v12/constants.go | 30 ++ app/upgrades/v12/upgrades.go | 35 +++ app/upgrades/v13/constants.go | 15 + app/upgrades/v13/upgrades.go | 27 ++ app/upgrades/v14/constants.go | 15 + app/upgrades/v14/upgrades.go | 32 ++ app/upgrades/v15/constants.go | 15 + app/upgrades/v15/upgrades.go | 27 ++ app/upgrades/v7/constants.go | 4 +- app/upgrades/v7/upgrades.go | 6 +- app/upgrades/v8/constants.go | 4 +- app/upgrades/v8/upgrades.go | 2 +- app/upgrades/v9/constants.go | 4 +- app/upgrades/v9/upgrades.go | 2 +- cmd/gaiad/cmd/bech32_convert.go | 4 +- cmd/gaiad/cmd/genaccounts.go | 194 ------------ cmd/gaiad/cmd/root.go | 4 +- cmd/gaiad/cmd/root_test.go | 7 +- cmd/gaiad/main.go | 4 +- contrib/scripts/local-gaia.sh | 65 ++++ .../scripts/upgrade_test_scripts/run_gaia.sh | 93 ++++++ .../run_upgrade_commands.sh | 96 ++++++ .../upgrade_test_scripts/v12/run_gaia_v11.sh | 73 +++++ .../v12/run_upgrade_commands_v12.sh | 73 +++++ docs/architecture/PROCESS.md | 57 ++++ docs/architecture/README.md | 64 ++++ .../adr-001-interchain-accounts.md | 23 +- docs/architecture/adr-002-globalfee.md | 165 ++++++++++ docs/architecture/adr-template.md | 58 ++++ .../gaia/globalfee/v1beta1/query.swagger.json | 32 +- docs/delegators/delegator-faq.md | 29 +- docs/delegators/delegator-guide-cli.md | 2 +- docs/delegators/delegator-security.md | 2 +- docs/getting-started/quickstart.md | 2 +- docs/getting-started/system-requirements.md | 14 + .../governance/proposal-types/param-change.md | 2 +- .../params-change/Distribution.md | 2 +- .../params-change/Governance.md | 2 +- .../proposal-types/params-change/Mint.md | 12 +- .../proposal-types/params-change/Slashing.md | 18 +- .../proposal-types/params-change/Staking.md | 6 +- docs/gtm-interchain.md | 2 +- docs/guidelines/code-guidelines.md | 65 ++-- docs/hub-overview/overview.md | 28 +- docs/hub-tutorials/gaiad.md | 2 +- docs/hub-tutorials/join-mainnet.md | 48 +-- docs/hub-tutorials/join-testnet.md | 94 +++--- docs/hub-tutorials/upgrade-node.md | 8 - docs/interchain-security.md | 161 ---------- docs/ko/delegators/delegator-guide-cli.md | 2 +- docs/migration/README.md | 4 +- .../{ => cosmoshub-2}/cosmoshub-2.md | 0 .../{ => cosmoshub-3}/cosmoshub-3.md | 0 .../{ => cosmoshub-3}/cosmoshub-3[ES_es].md | 0 .../{ => cosmoshub-3}/cosmoshub-3[KR_kr].md | 0 docs/migration/cosmoshub-4-delta-upgrade.md | 2 +- docs/migration/cosmoshub-4-v10-upgrade.md | 2 +- docs/migration/cosmoshub-4-v11-upgrade.md | 277 +++++++++++++++++ docs/migration/cosmoshub-4-v12-upgrade.md | 284 ++++++++++++++++++ docs/migration/cosmoshub-4-v13-upgrade.md | 277 +++++++++++++++++ docs/migration/cosmoshub-4-v14-upgrade.md | 210 +++++++++++++ .../migration/cosmoshub-4-v7-Theta-upgrade.md | 2 +- docs/migration/cosmoshub-4-v8-Rho-upgrade.md | 2 +- .../cosmoshub-4-v9-Lambda-upgrade.md | 2 +- docs/migration/cosmoshub-4-vega-upgrade.md | 2 +- docs/modules/globalfee.md | 2 +- docs/proto/proto-docs.md | 141 --------- docs/proto/protodoc-markdown.tmpl | 105 ------- docs/readiness/README.md | 112 ------- docs/readiness/template.md | 95 ------ docs/resources/genesis.md | 4 +- docs/resources/ledger.md | 4 +- docs/resources/service-providers.md | 27 +- docs/roadmap/README.md | 90 +----- docs/validators/validator-faq.md | 62 +++- docs/validators/validator-setup.md | 4 - docs/zh/delegator/delegator-guide-cli.md | 2 +- go.mod | 19 +- go.sum | 7 +- mlc_config.json | 2 +- tests/e2e/chain.go | 2 +- tests/e2e/e2e_exec_test.go | 110 ++++++- tests/e2e/e2e_globalfee_test.go | 1 + tests/e2e/e2e_ibc_test.go | 4 +- tests/e2e/e2e_lsm_test.go | 221 ++++++++++++++ tests/e2e/e2e_setup_test.go | 42 +++ tests/e2e/e2e_staking_test.go | 8 +- tests/e2e/e2e_test.go | 8 + tests/e2e/genesis.go | 26 +- tests/e2e/query.go | 30 +- tests/e2e/validator.go | 2 +- tests/ics/interchain_security_test.go | 2 +- x/globalfee/alias.go | 2 +- x/globalfee/ante/antetest/fee_test.go | 7 +- x/globalfee/ante/antetest/fee_test_setup.go | 12 +- x/globalfee/ante/fee.go | 7 +- x/globalfee/ante/fee_utils.go | 3 +- x/globalfee/ante/fee_utils_test.go | 3 +- x/globalfee/client/cli/query.go | 5 +- x/globalfee/genesis_test.go | 4 +- x/globalfee/keeper/migrations.go | 2 +- x/globalfee/migrations/v2/migration.go | 2 +- .../migrations/v2/v2_test/migration_test.go | 4 +- x/globalfee/module.go | 13 +- x/globalfee/querier.go | 2 +- x/globalfee/types/genesis.go | 1 + x/globalfee/types/params.go | 2 +- x/globalfee/types/params_test.go | 3 +- 199 files changed, 3755 insertions(+), 1638 deletions(-) rename .changelog/{unreleased => v10.0.2}/dependencies/2554-bump-ibc.md (100%) rename .changelog/{unreleased => v10.0.2}/dependencies/2594-bump-cometbft.md (100%) create mode 100644 .changelog/v10.0.2/features/2629-add-query-local-min-gas-prices.md create mode 100644 .changelog/v10.0.2/summary.md rename .changelog/{unreleased => v11.0.0}/api-breaking/globalfee/2424-params.md (100%) create mode 100644 .changelog/v11.0.0/bug-fixes/0-GHSA-354m-4qv6-x846.md create mode 100644 .changelog/v11.0.0/dependencies/2185-bump-pfm.md rename .changelog/{unreleased => v11.0.0}/dependencies/2616-bump-ics.md (100%) create mode 100644 .changelog/v11.0.0/dependencies/2652-liquidity-removal.md create mode 100644 .changelog/v11.0.0/state-breaking/0-GHSA-354m-4qv6-x846.md create mode 100644 .changelog/v11.0.0/state-breaking/2616-bump-ics.md create mode 100644 .changelog/v11.0.0/state-breaking/2652-liquidity-removal.md rename .changelog/{unreleased => v11.0.0}/state-breaking/globalfee/2352-migration.md (100%) rename .changelog/{unreleased => v11.0.0}/state-breaking/globalfee/2424-params.md (100%) rename .changelog/{unreleased => v11.0.0}/state-breaking/globalfee/2447-delivertx.md (100%) create mode 100644 .changelog/v11.0.0/summary.md create mode 100644 .changelog/v12.0.0/api-breaking/2643-lsm.md create mode 100644 .changelog/v12.0.0/bug-fixes/2677-bump-pfm.md create mode 100644 .changelog/v12.0.0/dependencies/2643-bump-ics.md create mode 100644 .changelog/v12.0.0/dependencies/2643-bump-sdk.md create mode 100644 .changelog/v12.0.0/dependencies/2677-bump-pfm.md create mode 100644 .changelog/v12.0.0/features/2643-lsm.md create mode 100644 .changelog/v12.0.0/state-breaking/2643-lsm.md create mode 100644 .changelog/v12.0.0/state-breaking/2677-bump-pfm.md create mode 100644 .changelog/v12.0.0/summary.md create mode 100644 .changelog/v13.0.0/dependencies/2714-remove-liquidity.md create mode 100644 .changelog/v13.0.0/dependencies/2732-bump-ics.md create mode 100644 .changelog/v13.0.0/state-breaking/2732-bump-ics.md create mode 100644 .changelog/v13.0.0/summary.md create mode 100644 .changelog/v13.0.1/bug-fixes/2771-bump-pfm.md create mode 100644 .changelog/v13.0.1/dependencies/2771-bump-pfm.md create mode 100644 .changelog/v13.0.1/summary.md create mode 100644 .changelog/v13.0.2/bug-fixes/2763-ledger-fix.md create mode 100644 .changelog/v13.0.2/summary.md create mode 100644 .changelog/v14.0.0/api-breaking/2814-bump-ics.md create mode 100644 .changelog/v14.0.0/dependencies/2814-bump-ics.md create mode 100644 .changelog/v14.0.0/features/2814-bump-ics.md create mode 100644 .changelog/v14.0.0/state-breaking/2814-bump-ics.md create mode 100644 .changelog/v14.0.0/summary.md create mode 100644 .changelog/v14.1.0/api-breaking/2825-bump-ics.md create mode 100644 .changelog/v14.1.0/dependencies/2825-bump-ics.md create mode 100644 .changelog/v14.1.0/features/2821-evidence-height.md create mode 100644 .changelog/v14.1.0/features/2825-bump-ics.md create mode 100644 .changelog/v14.1.0/state-breaking/2825-bump-ics.md create mode 100644 .changelog/v14.1.0/summary.md delete mode 100644 RELEASING.md create mode 100644 STATE-COMPATIBILITY.md create mode 100644 app/genesis_account_fuzz_test.go create mode 100644 app/upgrades/v12/constants.go create mode 100644 app/upgrades/v12/upgrades.go create mode 100644 app/upgrades/v13/constants.go create mode 100644 app/upgrades/v13/upgrades.go create mode 100644 app/upgrades/v14/constants.go create mode 100644 app/upgrades/v14/upgrades.go create mode 100644 app/upgrades/v15/constants.go create mode 100644 app/upgrades/v15/upgrades.go delete mode 100644 cmd/gaiad/cmd/genaccounts.go create mode 100755 contrib/scripts/local-gaia.sh create mode 100755 contrib/scripts/upgrade_test_scripts/run_gaia.sh create mode 100755 contrib/scripts/upgrade_test_scripts/run_upgrade_commands.sh create mode 100755 contrib/scripts/upgrade_test_scripts/v12/run_gaia_v11.sh create mode 100755 contrib/scripts/upgrade_test_scripts/v12/run_upgrade_commands_v12.sh create mode 100644 docs/architecture/PROCESS.md create mode 100644 docs/architecture/README.md rename docs/{readiness => architecture}/adr-001-interchain-accounts.md (92%) create mode 100644 docs/architecture/adr-002-globalfee.md create mode 100644 docs/architecture/adr-template.md create mode 100644 docs/getting-started/system-requirements.md delete mode 100644 docs/interchain-security.md rename docs/migration/{ => cosmoshub-2}/cosmoshub-2.md (100%) rename docs/migration/{ => cosmoshub-3}/cosmoshub-3.md (100%) rename docs/migration/{ => cosmoshub-3}/cosmoshub-3[ES_es].md (100%) rename docs/migration/{ => cosmoshub-3}/cosmoshub-3[KR_kr].md (100%) create mode 100644 docs/migration/cosmoshub-4-v11-upgrade.md create mode 100644 docs/migration/cosmoshub-4-v12-upgrade.md create mode 100644 docs/migration/cosmoshub-4-v13-upgrade.md create mode 100644 docs/migration/cosmoshub-4-v14-upgrade.md delete mode 100644 docs/proto/proto-docs.md delete mode 100644 docs/proto/protodoc-markdown.tmpl delete mode 100644 docs/readiness/README.md delete mode 100644 docs/readiness/template.md create mode 100644 tests/e2e/e2e_lsm_test.go diff --git a/.changelog/unreleased/dependencies/2554-bump-ibc.md b/.changelog/v10.0.2/dependencies/2554-bump-ibc.md similarity index 100% rename from .changelog/unreleased/dependencies/2554-bump-ibc.md rename to .changelog/v10.0.2/dependencies/2554-bump-ibc.md diff --git a/.changelog/unreleased/dependencies/2594-bump-cometbft.md b/.changelog/v10.0.2/dependencies/2594-bump-cometbft.md similarity index 100% rename from .changelog/unreleased/dependencies/2594-bump-cometbft.md rename to .changelog/v10.0.2/dependencies/2594-bump-cometbft.md diff --git a/.changelog/v10.0.2/features/2629-add-query-local-min-gas-prices.md b/.changelog/v10.0.2/features/2629-add-query-local-min-gas-prices.md new file mode 100644 index 0000000000..0288fc0775 --- /dev/null +++ b/.changelog/v10.0.2/features/2629-add-query-local-min-gas-prices.md @@ -0,0 +1,3 @@ +- Register NodeService to enable query `/cosmos/base/node/v1beta1/config` + gRPC query to disclose node operator's configured minimum-gas-price. + ([\#2629](https://github.com/cosmos/gaia/issues/2629)) diff --git a/.changelog/v10.0.2/summary.md b/.changelog/v10.0.2/summary.md new file mode 100644 index 0000000000..7271151c27 --- /dev/null +++ b/.changelog/v10.0.2/summary.md @@ -0,0 +1,3 @@ +*July 03, 2023* + +This release bumps several dependencies and enables extra queries. diff --git a/.changelog/unreleased/api-breaking/globalfee/2424-params.md b/.changelog/v11.0.0/api-breaking/globalfee/2424-params.md similarity index 100% rename from .changelog/unreleased/api-breaking/globalfee/2424-params.md rename to .changelog/v11.0.0/api-breaking/globalfee/2424-params.md diff --git a/.changelog/v11.0.0/bug-fixes/0-GHSA-354m-4qv6-x846.md b/.changelog/v11.0.0/bug-fixes/0-GHSA-354m-4qv6-x846.md new file mode 100644 index 0000000000..06b902a1f8 --- /dev/null +++ b/.changelog/v11.0.0/bug-fixes/0-GHSA-354m-4qv6-x846.md @@ -0,0 +1,3 @@ +- Fix logic bug in `GovPreventSpamDecorator` that allows bypassing the + `MinInitialDeposit` requirement + ([a759409](https://github.com/cosmos/gaia/commit/a759409c9da2780663244308b430a7847b95139b)) \ No newline at end of file diff --git a/.changelog/v11.0.0/dependencies/2185-bump-pfm.md b/.changelog/v11.0.0/dependencies/2185-bump-pfm.md new file mode 100644 index 0000000000..c4c7acac6b --- /dev/null +++ b/.changelog/v11.0.0/dependencies/2185-bump-pfm.md @@ -0,0 +1,3 @@ +- Bump [PFM](https://github.com/strangelove-ventures/packet-forward-middleware) to + [v4.0.5](https://github.com/strangelove-ventures/packet-forward-middleware/releases/tag/v4.0.5) + ([\#2185](https://github.com/cosmos/gaia/issues/2185)) \ No newline at end of file diff --git a/.changelog/unreleased/dependencies/2616-bump-ics.md b/.changelog/v11.0.0/dependencies/2616-bump-ics.md similarity index 100% rename from .changelog/unreleased/dependencies/2616-bump-ics.md rename to .changelog/v11.0.0/dependencies/2616-bump-ics.md diff --git a/.changelog/v11.0.0/dependencies/2652-liquidity-removal.md b/.changelog/v11.0.0/dependencies/2652-liquidity-removal.md new file mode 100644 index 0000000000..53bc7b4087 --- /dev/null +++ b/.changelog/v11.0.0/dependencies/2652-liquidity-removal.md @@ -0,0 +1,3 @@ +- Bump [Liquidity](https://github.com/Gravity-Devs/liquidity) to + [v1.6.0-forced-withdrawal](https://github.com/Gravity-Devs/liquidity/releases/tag/v1.6.0-forced-withdrawal) + ([\#2652](https://github.com/cosmos/gaia/pull/2652)) \ No newline at end of file diff --git a/.changelog/v11.0.0/state-breaking/0-GHSA-354m-4qv6-x846.md b/.changelog/v11.0.0/state-breaking/0-GHSA-354m-4qv6-x846.md new file mode 100644 index 0000000000..06b902a1f8 --- /dev/null +++ b/.changelog/v11.0.0/state-breaking/0-GHSA-354m-4qv6-x846.md @@ -0,0 +1,3 @@ +- Fix logic bug in `GovPreventSpamDecorator` that allows bypassing the + `MinInitialDeposit` requirement + ([a759409](https://github.com/cosmos/gaia/commit/a759409c9da2780663244308b430a7847b95139b)) \ No newline at end of file diff --git a/.changelog/v11.0.0/state-breaking/2616-bump-ics.md b/.changelog/v11.0.0/state-breaking/2616-bump-ics.md new file mode 100644 index 0000000000..e3f6707628 --- /dev/null +++ b/.changelog/v11.0.0/state-breaking/2616-bump-ics.md @@ -0,0 +1,3 @@ +- Bump [Interchain-Security](https://github.com/cosmos/interchain-security) to + [v2.0.0](https://github.com/cosmos/interchain-security/releases/tag/v2.0.0) + ([\#2616](https://github.com/cosmos/gaia/pull/2616)) \ No newline at end of file diff --git a/.changelog/v11.0.0/state-breaking/2652-liquidity-removal.md b/.changelog/v11.0.0/state-breaking/2652-liquidity-removal.md new file mode 100644 index 0000000000..53bc7b4087 --- /dev/null +++ b/.changelog/v11.0.0/state-breaking/2652-liquidity-removal.md @@ -0,0 +1,3 @@ +- Bump [Liquidity](https://github.com/Gravity-Devs/liquidity) to + [v1.6.0-forced-withdrawal](https://github.com/Gravity-Devs/liquidity/releases/tag/v1.6.0-forced-withdrawal) + ([\#2652](https://github.com/cosmos/gaia/pull/2652)) \ No newline at end of file diff --git a/.changelog/unreleased/state-breaking/globalfee/2352-migration.md b/.changelog/v11.0.0/state-breaking/globalfee/2352-migration.md similarity index 100% rename from .changelog/unreleased/state-breaking/globalfee/2352-migration.md rename to .changelog/v11.0.0/state-breaking/globalfee/2352-migration.md diff --git a/.changelog/unreleased/state-breaking/globalfee/2424-params.md b/.changelog/v11.0.0/state-breaking/globalfee/2424-params.md similarity index 100% rename from .changelog/unreleased/state-breaking/globalfee/2424-params.md rename to .changelog/v11.0.0/state-breaking/globalfee/2424-params.md diff --git a/.changelog/unreleased/state-breaking/globalfee/2447-delivertx.md b/.changelog/v11.0.0/state-breaking/globalfee/2447-delivertx.md similarity index 100% rename from .changelog/unreleased/state-breaking/globalfee/2447-delivertx.md rename to .changelog/v11.0.0/state-breaking/globalfee/2447-delivertx.md diff --git a/.changelog/v11.0.0/summary.md b/.changelog/v11.0.0/summary.md new file mode 100644 index 0000000000..114d570d46 --- /dev/null +++ b/.changelog/v11.0.0/summary.md @@ -0,0 +1 @@ +*July 18, 2023* \ No newline at end of file diff --git a/.changelog/v12.0.0/api-breaking/2643-lsm.md b/.changelog/v12.0.0/api-breaking/2643-lsm.md new file mode 100644 index 0000000000..b0ce066b4f --- /dev/null +++ b/.changelog/v12.0.0/api-breaking/2643-lsm.md @@ -0,0 +1,3 @@ +- Add Liquid Staking Module (LSM) and initialize the LSM params: + ValidatorBondFactor, ValidatorLiquidStakingCap, GlobalLiquidStakingCap + ([\#2643](https://github.com/cosmos/gaia/pull/2643)) \ No newline at end of file diff --git a/.changelog/v12.0.0/bug-fixes/2677-bump-pfm.md b/.changelog/v12.0.0/bug-fixes/2677-bump-pfm.md new file mode 100644 index 0000000000..803634e744 --- /dev/null +++ b/.changelog/v12.0.0/bug-fixes/2677-bump-pfm.md @@ -0,0 +1,3 @@ +- Bump [PFM](https://github.com/cosmos/ibc-apps/tree/main/middleware) + to [v4.1.0](https://github.com/cosmos/ibc-apps/releases/tag/middleware%2Fpacket-forward-middleware%2Fv4.1.0) + ([\#2677](https://github.com/cosmos/gaia/pull/2677)) \ No newline at end of file diff --git a/.changelog/v12.0.0/dependencies/2643-bump-ics.md b/.changelog/v12.0.0/dependencies/2643-bump-ics.md new file mode 100644 index 0000000000..1bfca86072 --- /dev/null +++ b/.changelog/v12.0.0/dependencies/2643-bump-ics.md @@ -0,0 +1,3 @@ +- Bump [interchain-security](https://github.com/cosmos/interchain-security) to + [v2.0.0-lsm](https://github.com/cosmos/interchain-security/releases/tag/v2.0.0-lsm) + ([\#2643](https://github.com/cosmos/gaia/pull/2643)) \ No newline at end of file diff --git a/.changelog/v12.0.0/dependencies/2643-bump-sdk.md b/.changelog/v12.0.0/dependencies/2643-bump-sdk.md new file mode 100644 index 0000000000..093e5b3bf5 --- /dev/null +++ b/.changelog/v12.0.0/dependencies/2643-bump-sdk.md @@ -0,0 +1,3 @@ +- Bump [cosmos-sdk](https://github.com/cosmos/cosmos-sdk) to + [v0.45.16-ics-lsm](https://github.com/cosmos/cosmos-sdk/tree/v0.45.16-ics-lsm) + ([\#2643](https://github.com/cosmos/gaia/pull/2643)) \ No newline at end of file diff --git a/.changelog/v12.0.0/dependencies/2677-bump-pfm.md b/.changelog/v12.0.0/dependencies/2677-bump-pfm.md new file mode 100644 index 0000000000..803634e744 --- /dev/null +++ b/.changelog/v12.0.0/dependencies/2677-bump-pfm.md @@ -0,0 +1,3 @@ +- Bump [PFM](https://github.com/cosmos/ibc-apps/tree/main/middleware) + to [v4.1.0](https://github.com/cosmos/ibc-apps/releases/tag/middleware%2Fpacket-forward-middleware%2Fv4.1.0) + ([\#2677](https://github.com/cosmos/gaia/pull/2677)) \ No newline at end of file diff --git a/.changelog/v12.0.0/features/2643-lsm.md b/.changelog/v12.0.0/features/2643-lsm.md new file mode 100644 index 0000000000..b0ce066b4f --- /dev/null +++ b/.changelog/v12.0.0/features/2643-lsm.md @@ -0,0 +1,3 @@ +- Add Liquid Staking Module (LSM) and initialize the LSM params: + ValidatorBondFactor, ValidatorLiquidStakingCap, GlobalLiquidStakingCap + ([\#2643](https://github.com/cosmos/gaia/pull/2643)) \ No newline at end of file diff --git a/.changelog/v12.0.0/state-breaking/2643-lsm.md b/.changelog/v12.0.0/state-breaking/2643-lsm.md new file mode 100644 index 0000000000..b0ce066b4f --- /dev/null +++ b/.changelog/v12.0.0/state-breaking/2643-lsm.md @@ -0,0 +1,3 @@ +- Add Liquid Staking Module (LSM) and initialize the LSM params: + ValidatorBondFactor, ValidatorLiquidStakingCap, GlobalLiquidStakingCap + ([\#2643](https://github.com/cosmos/gaia/pull/2643)) \ No newline at end of file diff --git a/.changelog/v12.0.0/state-breaking/2677-bump-pfm.md b/.changelog/v12.0.0/state-breaking/2677-bump-pfm.md new file mode 100644 index 0000000000..803634e744 --- /dev/null +++ b/.changelog/v12.0.0/state-breaking/2677-bump-pfm.md @@ -0,0 +1,3 @@ +- Bump [PFM](https://github.com/cosmos/ibc-apps/tree/main/middleware) + to [v4.1.0](https://github.com/cosmos/ibc-apps/releases/tag/middleware%2Fpacket-forward-middleware%2Fv4.1.0) + ([\#2677](https://github.com/cosmos/gaia/pull/2677)) \ No newline at end of file diff --git a/.changelog/v12.0.0/summary.md b/.changelog/v12.0.0/summary.md new file mode 100644 index 0000000000..957dea6d0d --- /dev/null +++ b/.changelog/v12.0.0/summary.md @@ -0,0 +1 @@ +*August 18, 2023* diff --git a/.changelog/v13.0.0/dependencies/2714-remove-liquidity.md b/.changelog/v13.0.0/dependencies/2714-remove-liquidity.md new file mode 100644 index 0000000000..80d24c0506 --- /dev/null +++ b/.changelog/v13.0.0/dependencies/2714-remove-liquidity.md @@ -0,0 +1,2 @@ +- Remove [Liquidity](https://github.com/Gravity-Devs/liquidity) + ([\#2716](https://github.com/cosmos/gaia/pull/2716)) diff --git a/.changelog/v13.0.0/dependencies/2732-bump-ics.md b/.changelog/v13.0.0/dependencies/2732-bump-ics.md new file mode 100644 index 0000000000..4c861ee7ab --- /dev/null +++ b/.changelog/v13.0.0/dependencies/2732-bump-ics.md @@ -0,0 +1,3 @@ +- Bump [interchain-security](https://github.com/cosmos/interchain-security) to + [v2.1.0-provider-lsm](https://github.com/cosmos/interchain-security/releases/tag/v2.1.0-provider-lsm) + ([\#2732](https://github.com/cosmos/gaia/pull/2732)) \ No newline at end of file diff --git a/.changelog/v13.0.0/state-breaking/2732-bump-ics.md b/.changelog/v13.0.0/state-breaking/2732-bump-ics.md new file mode 100644 index 0000000000..4c861ee7ab --- /dev/null +++ b/.changelog/v13.0.0/state-breaking/2732-bump-ics.md @@ -0,0 +1,3 @@ +- Bump [interchain-security](https://github.com/cosmos/interchain-security) to + [v2.1.0-provider-lsm](https://github.com/cosmos/interchain-security/releases/tag/v2.1.0-provider-lsm) + ([\#2732](https://github.com/cosmos/gaia/pull/2732)) \ No newline at end of file diff --git a/.changelog/v13.0.0/summary.md b/.changelog/v13.0.0/summary.md new file mode 100644 index 0000000000..1d32a4b791 --- /dev/null +++ b/.changelog/v13.0.0/summary.md @@ -0,0 +1 @@ +*September 18, 2023* diff --git a/.changelog/v13.0.1/bug-fixes/2771-bump-pfm.md b/.changelog/v13.0.1/bug-fixes/2771-bump-pfm.md new file mode 100644 index 0000000000..eb6a54022f --- /dev/null +++ b/.changelog/v13.0.1/bug-fixes/2771-bump-pfm.md @@ -0,0 +1,3 @@ +- Bump [PFM](https://github.com/cosmos/ibc-apps/tree/main/middleware) + to [v4.1.1](https://github.com/cosmos/ibc-apps/releases/tag/middleware%2Fpacket-forward-middleware%2Fv4.1.1) + ([\#2771](https://github.com/cosmos/gaia/pull/2771)) \ No newline at end of file diff --git a/.changelog/v13.0.1/dependencies/2771-bump-pfm.md b/.changelog/v13.0.1/dependencies/2771-bump-pfm.md new file mode 100644 index 0000000000..eb6a54022f --- /dev/null +++ b/.changelog/v13.0.1/dependencies/2771-bump-pfm.md @@ -0,0 +1,3 @@ +- Bump [PFM](https://github.com/cosmos/ibc-apps/tree/main/middleware) + to [v4.1.1](https://github.com/cosmos/ibc-apps/releases/tag/middleware%2Fpacket-forward-middleware%2Fv4.1.1) + ([\#2771](https://github.com/cosmos/gaia/pull/2771)) \ No newline at end of file diff --git a/.changelog/v13.0.1/summary.md b/.changelog/v13.0.1/summary.md new file mode 100644 index 0000000000..515fb8e551 --- /dev/null +++ b/.changelog/v13.0.1/summary.md @@ -0,0 +1 @@ +*October 25, 2023* diff --git a/.changelog/v13.0.2/bug-fixes/2763-ledger-fix.md b/.changelog/v13.0.2/bug-fixes/2763-ledger-fix.md new file mode 100644 index 0000000000..990c38921f --- /dev/null +++ b/.changelog/v13.0.2/bug-fixes/2763-ledger-fix.md @@ -0,0 +1,4 @@ +- Bump [cosmos/ledger-cosmos-go](https://github.com/cosmos/ledger-cosmos-go) to + [v0.12.4](https://github.com/cosmos/ledger-cosmos-go/releases/tag/v0.12.4) + to fix signing with ledger through the binary on newest versions of macOS and Xcode + ([\#2763](https://github.com/cosmos/gaia/pull/2763)) \ No newline at end of file diff --git a/.changelog/v13.0.2/summary.md b/.changelog/v13.0.2/summary.md new file mode 100644 index 0000000000..36a2ea69ca --- /dev/null +++ b/.changelog/v13.0.2/summary.md @@ -0,0 +1 @@ +*November 7, 2023* diff --git a/.changelog/v14.0.0/api-breaking/2814-bump-ics.md b/.changelog/v14.0.0/api-breaking/2814-bump-ics.md new file mode 100644 index 0000000000..f171df2c9f --- /dev/null +++ b/.changelog/v14.0.0/api-breaking/2814-bump-ics.md @@ -0,0 +1 @@ +- Deprecate equivocation proposals of ICS provider module ([\#2814](https://github.com/cosmos/gaia/pull/2814)) \ No newline at end of file diff --git a/.changelog/v14.0.0/dependencies/2814-bump-ics.md b/.changelog/v14.0.0/dependencies/2814-bump-ics.md new file mode 100644 index 0000000000..c621f2bb80 --- /dev/null +++ b/.changelog/v14.0.0/dependencies/2814-bump-ics.md @@ -0,0 +1 @@ +- Bump [ICS] to [v2.3.0-provider-lsm](https://github.com/cosmos/interchain-security/releases/tag/v2.3.0-provider-lsm) ([\#2814](https://github.com/cosmos/gaia/pull/2814)) \ No newline at end of file diff --git a/.changelog/v14.0.0/features/2814-bump-ics.md b/.changelog/v14.0.0/features/2814-bump-ics.md new file mode 100644 index 0000000000..06408cd40e --- /dev/null +++ b/.changelog/v14.0.0/features/2814-bump-ics.md @@ -0,0 +1 @@ +- Introducing the cryptographic verification of equivocation feature to the ICS provider module ([\#2814](https://github.com/cosmos/gaia/pull/2814)) \ No newline at end of file diff --git a/.changelog/v14.0.0/state-breaking/2814-bump-ics.md b/.changelog/v14.0.0/state-breaking/2814-bump-ics.md new file mode 100644 index 0000000000..c621f2bb80 --- /dev/null +++ b/.changelog/v14.0.0/state-breaking/2814-bump-ics.md @@ -0,0 +1 @@ +- Bump [ICS] to [v2.3.0-provider-lsm](https://github.com/cosmos/interchain-security/releases/tag/v2.3.0-provider-lsm) ([\#2814](https://github.com/cosmos/gaia/pull/2814)) \ No newline at end of file diff --git a/.changelog/v14.0.0/summary.md b/.changelog/v14.0.0/summary.md new file mode 100644 index 0000000000..09ecc72ad6 --- /dev/null +++ b/.changelog/v14.0.0/summary.md @@ -0,0 +1,3 @@ +*November 15, 2023* + +❗***This release is deprecated and should not be used in production. Use v14.1.0 instead.*** diff --git a/.changelog/v14.1.0/api-breaking/2825-bump-ics.md b/.changelog/v14.1.0/api-breaking/2825-bump-ics.md new file mode 100644 index 0000000000..593251b289 --- /dev/null +++ b/.changelog/v14.1.0/api-breaking/2825-bump-ics.md @@ -0,0 +1 @@ +- Deprecate equivocation proposals of ICS provider module ([\#2825](https://github.com/cosmos/gaia/pull/2825)) \ No newline at end of file diff --git a/.changelog/v14.1.0/dependencies/2825-bump-ics.md b/.changelog/v14.1.0/dependencies/2825-bump-ics.md new file mode 100644 index 0000000000..78c44554ea --- /dev/null +++ b/.changelog/v14.1.0/dependencies/2825-bump-ics.md @@ -0,0 +1 @@ +- Bump [ICS] to [v2.4.0-lsm](https://github.com/cosmos/interchain-security/releases/tag/v2.4.0-lsm) ([\#2825](https://github.com/cosmos/gaia/pull/2825)) \ No newline at end of file diff --git a/.changelog/v14.1.0/features/2821-evidence-height.md b/.changelog/v14.1.0/features/2821-evidence-height.md new file mode 100644 index 0000000000..00bfa1d910 --- /dev/null +++ b/.changelog/v14.1.0/features/2821-evidence-height.md @@ -0,0 +1,3 @@ +- Set in the v14 upgrade handler the min evidence height for `neutron-1` + at `4552189` and for `stride-1` at `6375035`. + ([\#2821](https://github.com/cosmos/gaia/pull/2821)) \ No newline at end of file diff --git a/.changelog/v14.1.0/features/2825-bump-ics.md b/.changelog/v14.1.0/features/2825-bump-ics.md new file mode 100644 index 0000000000..1ffe596333 --- /dev/null +++ b/.changelog/v14.1.0/features/2825-bump-ics.md @@ -0,0 +1 @@ +- Introducing the cryptographic verification of equivocation feature to the ICS provider module ([\#2825](https://github.com/cosmos/gaia/pull/2825)) \ No newline at end of file diff --git a/.changelog/v14.1.0/state-breaking/2825-bump-ics.md b/.changelog/v14.1.0/state-breaking/2825-bump-ics.md new file mode 100644 index 0000000000..78c44554ea --- /dev/null +++ b/.changelog/v14.1.0/state-breaking/2825-bump-ics.md @@ -0,0 +1 @@ +- Bump [ICS] to [v2.4.0-lsm](https://github.com/cosmos/interchain-security/releases/tag/v2.4.0-lsm) ([\#2825](https://github.com/cosmos/gaia/pull/2825)) \ No newline at end of file diff --git a/.changelog/v14.1.0/summary.md b/.changelog/v14.1.0/summary.md new file mode 100644 index 0000000000..64a8f95923 --- /dev/null +++ b/.changelog/v14.1.0/summary.md @@ -0,0 +1,2 @@ +*November 21, 2023* + diff --git a/.github/ISSUE_TEMPLATE/upgrade-checklist.md b/.github/ISSUE_TEMPLATE/upgrade-checklist.md index b04d7ac01d..1aaef755e5 100644 --- a/.github/ISSUE_TEMPLATE/upgrade-checklist.md +++ b/.github/ISSUE_TEMPLATE/upgrade-checklist.md @@ -4,69 +4,55 @@ about: Create a checklist for an upgrade labels: epic, needs-triage --- -## Cosmos Hub Upgrade Epic +## Cosmos Hub Upgrade to Gaia -### - -**Create an issue for each item** and mark complete once it has been done. - - + ```[tasklist] -### Communication (during entire lifecycle) -- [ ] Signaling proposal (before development starts) -- [ ] Testnet blog post - target validators on Cosmos Medium -- [ ] Tweet link to testnet upgrade blog - @ cosmohub -- [ ] Testnet upgrade info (discord only) -- [ ] Tweet updates on proposal status - @ cosmohub -- [ ] Mainnet blog post - target wider audience on Cosmos Medium -- [ ] Tweet link to mainnet upgrade blog - @ cosmos @ cosmoshub -- [ ] Link to mainnet upgrade instructions (all channels - Discord, Telegram, Slack) -- [ ] Tweet upgrade countdown during voting period - @ cosmos @ cosmoshub -- [ ] Tweet upgrade success story - @ cosmos @ cosmoshub +### After Cutting Release Candidate +- [ ] Coordinate with Hypha to test release candidate +- [ ] Create proposal text draft +- [ ] Post proposal text draft on forum +- [ ] Upgrade release and replicated security testnets (note: on Wednesdays) +- [ ] Review post-upgrade status of affected features if necessary ``` ```[tasklist] -### Library dependencies -- [ ] Upgrade to SDK version -- [ ] Upgrade to IBC version -- [ ] Upgrade to ICS version -- [ ] Upgrade to PFM version -- [ ] Upgrade to Liquidity version -- [ ] Integrate new modules ([checklist](https://github.com/cosmos/hub-eng/blob/main/module_qa/module_checklist.md)) +### Before Proposal Submission (TODO sync on a call) +- [ ] Cut final release +- [ ] Predict block height for target date +- [ ] Update/proofread proposal text +- [ ] Transfer deposit amount (i.e., 250 ATOMs) to submitter wallet +- [ ] Create upgrade docs (with disclaimer upgrade prop still being voted on) +- [ ] Coordinate with marketing/comms to prep communication channels/posts ``` ```[tasklist] -### Testnet -- [ ] Communication prep -- [ ] Docs: - - [ ] [testnets](https://github.com/cosmos/testnets) updated with most recent rc - - [ ] [join-testnet](https://github.com/cosmos/gaia/blob/main/docs/hub-tutorials/join-testnet.md) -- [ ] Release candidate -- [ ] Create testnet proposal -- [ ] Run testnet for one week -- [ ] Final Release +### Voting Period +- [ ] Estimate threshold of validators that are aware of proposal and have voted or confirmed their vote +- [ ] Coordinate with marketing/comms to update on voting progress (and any change in upgrade time) ``` ```[tasklist] -### Docs -- On release branch - - [ ] Quickstart in `docs/getting-started/quickstart.md` - - [ ] Join mainnet in `docs/hub-tutorials/join-mainnet.md` - - [ ] Migration docs in `docs/migration/` - - [ ] Update `CHANGELOG.md` - - [ ] Breaking REST api changes - - [ ] Breaking CLI api changes -- Post Upgrade - - [ ] [chain-registry.json](https://github.com/cosmos/chain-registry/blob/master/cosmoshub/chain.json) - - [ ] Update [cosmos mainnet repo](https://github.com/cosmos/mainnet) +## Proposal Passed +- [ ] Determine "on-call" team: available on Discord in [#cosmos-hub-validators-verified](https://discord.com/channels/669268347736686612/798937713474142229) during upgrade +- [ ] Coordinate with marketing/comms on who will be available, increase regular upgrade time updates and validator outreach +- [ ] Prep Gaia docs: `docs/getting-started/quickstart.md`, `docs/hub-tutorials/join-mainnet.md`, `docs/migration/` (open PR) +- [ ] Prep chain-registry update: [cosmoshub/chain.json](https://github.com/toschdev/chain-registry/blob/master/cosmoshub/chain.json) (open PR) +- [ ] Prep [cosmos mainnet repo](https://github.com/cosmos/mainnet) update (open PR) +- [ ] Prep internal statesync node for upgrade (confirm cosmovisor configured) +- [ ] Reach out to main dependency teams -- Comet, IBC, SDK -- for assistance during the upgrade (#gaia-release-warroom on Slack) ``` ```[tasklist] -### Mainnet Proposal -- [ ] Predict block height for target date -- [ ] Create forum post -- [ ] Submit on-chain proposal +## During Upgrade (note: on Wednesdays at 15:00 UTC) +- [ ] Available on Discord in [#cosmos-hub-validators-verified](https://discord.com/channels/669268347736686612/798937713474142229) +- [ ] Available on Twitter / Slack / Telegram ``` - +```[tasklist] +## Post Upgrade +- [ ] Merge PRs for Gaia docs & chain-registry update +- [ ] FAQ: collect issues on upgrade from discord +- [ ] Hold validator feedback session +``` diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 576bda07bb..1296f84bd5 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -21,7 +21,7 @@ updates: directory: "/" schedule: interval: daily - target-branch: "release/v10.0.x" + target-branch: "release/v14.1.x" # Only allow automated security-related dependency updates on release branches. open-pull-requests-limit: 0 labels: @@ -31,7 +31,17 @@ updates: directory: "/" schedule: interval: daily - target-branch: "release/v9.1.x" + target-branch: "release/v13.x" + # Only allow automated security-related dependency updates on release branches. + open-pull-requests-limit: 0 + labels: + - dependencies + + - package-ecosystem: gomod + directory: "/" + schedule: + interval: daily + target-branch: "release/v12.x" # Only allow automated security-related dependency updates on release branches. open-pull-requests-limit: 0 labels: diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 3f9656eee3..887e7a38fd 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -23,7 +23,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3.5.2 + uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: go-version: "1.21" diff --git a/.github/workflows/docker-push.yml b/.github/workflows/docker-push.yml index 8d277c6924..71ecf62e0a 100644 --- a/.github/workflows/docker-push.yml +++ b/.github/workflows/docker-push.yml @@ -18,10 +18,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3.5.2 + uses: actions/checkout@v4 - name: Log in to the Container registry - uses: docker/login-action@v2.2.0 + uses: docker/login-action@v3.0.0 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -29,12 +29,12 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v4.6.0 + uses: docker/metadata-action@v5.2.0 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - name: Build and push Docker image - uses: docker/build-push-action@v4.1.1 + uses: docker/build-push-action@v5.1.0 with: context: . push: true @@ -42,7 +42,7 @@ jobs: labels: ${{ steps.meta.outputs.labels }} - name: Build and push e2e docker image - uses: docker/build-push-action@v4.1.1 + uses: docker/build-push-action@v5.1.0 with: context: . file: Dockerfile.e2e diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 8af0369a22..257a5851e2 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -13,7 +13,7 @@ jobs: image: tendermintdev/docker-website-deployment steps: - name: Checkout 🛎️ - uses: actions/checkout@v3.5.2 + uses: actions/checkout@v4 with: persist-credentials: false fetch-depth: 0 @@ -24,7 +24,7 @@ jobs: make build-docs LEDGER_ENABLED=false - name: Deploy 🚀 - uses: JamesIves/github-pages-deploy-action@v4.4.2 + uses: JamesIves/github-pages-deploy-action@v4.5.0 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} BRANCH: gh-pages diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ecac002828..bac5c0f5b5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,7 +13,7 @@ jobs: name: golangci-lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.5.2 + - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: go-version: "1.21" diff --git a/.github/workflows/md-link-checker.yml b/.github/workflows/md-link-checker.yml index 8a5f8f1277..b9071633b5 100644 --- a/.github/workflows/md-link-checker.yml +++ b/.github/workflows/md-link-checker.yml @@ -1,12 +1,13 @@ name: Check Markdown links on: + workflow_dispatch: schedule: - cron: '* */24 * * *' jobs: markdown-link-check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: gaurav-nelson/github-action-markdown-link-check@1.0.15 with: folder-path: "docs" \ No newline at end of file diff --git a/.github/workflows/nightly-tests.yml b/.github/workflows/nightly-tests.yml index 23de2453c6..dd78d4a10e 100644 --- a/.github/workflows/nightly-tests.yml +++ b/.github/workflows/nightly-tests.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 steps: - - uses: actions/checkout@v3.5.2 + - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: go-version: "1.21" diff --git a/.github/workflows/release-sims.yml b/.github/workflows/release-sims.yml index f37525e3ab..7ef80a8951 100644 --- a/.github/workflows/release-sims.yml +++ b/.github/workflows/release-sims.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, 'skip-sims')" steps: - - uses: actions/checkout@v3.5.2 + - uses: actions/checkout@v4 - run: | make build @@ -29,7 +29,7 @@ jobs: go-version: 1.21.x - name: Install runsim run: go install github.com/cosmos/tools/cmd/runsim@v1.0.0 - - uses: actions/cache@v3.3.1 + - uses: actions/cache@v3.3.2 with: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary @@ -40,7 +40,7 @@ jobs: steps: - name: install runsim run: go install github.com/cosmos/tools/cmd/runsim@v1.0.0 - - uses: actions/cache@v3.3.1 + - uses: actions/cache@v3.3.2 with: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary @@ -49,8 +49,8 @@ jobs: runs-on: ubuntu-latest needs: [build, install-runsim] steps: - - uses: actions/checkout@v3.5.2 - - uses: actions/cache@v3.3.1 + - uses: actions/checkout@v4 + - uses: actions/cache@v3.3.2 with: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary @@ -62,7 +62,7 @@ jobs: runs-on: ubuntu-latest needs: newbuild steps: - - uses: actions/checkout@v3.5.2 + - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: go-version: 1.21.x @@ -72,7 +72,7 @@ jobs: **/**.go go.mod go.sum - - uses: actions/cache@v3.3.1 + - uses: actions/cache@v3.3.2 with: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6afb60fbaa..2b3d862591 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,9 +14,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 + - run: git fetch --force --tags - uses: actions/setup-go@v4 with: @@ -26,7 +27,7 @@ jobs: run: echo "TM_VERSION=$(go list -m github.com/tendermint/tendermint | sed 's:.* ::')" >> $GITHUB_ENV - name: Release - uses: goreleaser/goreleaser-action@v4 + uses: goreleaser/goreleaser-action@v5 with: version: latest args: release --clean --release-notes ./RELEASE_NOTES.md diff --git a/.github/workflows/sim-label.yml b/.github/workflows/sim-label.yml index ce6dd57dab..80a2cae87d 100644 --- a/.github/workflows/sim-label.yml +++ b/.github/workflows/sim-label.yml @@ -20,7 +20,7 @@ jobs: go-version: 1.21.x - name: Install runsim run: go install github.com/cosmos/tools/cmd/runsim@v1.0.0 - - uses: actions/cache@v3.3.1 + - uses: actions/cache@v3.3.2 with: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary @@ -30,11 +30,11 @@ jobs: runs-on: ubuntu-latest needs: newbuild steps: - - uses: actions/checkout@v3.5.2 + - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: go-version: 1.21.x - - uses: actions/cache@v3.3.1 + - uses: actions/cache@v3.3.2 with: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary diff --git a/.github/workflows/sims.yml b/.github/workflows/sims.yml index ac08bddd5d..4813c55525 100644 --- a/.github/workflows/sims.yml +++ b/.github/workflows/sims.yml @@ -24,7 +24,7 @@ jobs: go-version: 1.21.x - name: Install runsim run: go install github.com/cosmos/tools/cmd/runsim@v1.0.0 - - uses: actions/cache@v3.3.1 + - uses: actions/cache@v3.3.2 with: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary @@ -33,7 +33,7 @@ jobs: runs-on: ubuntu-latest needs: newbuild steps: - - uses: actions/checkout@v3.5.2 + - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: go-version: 1.21.x @@ -43,7 +43,7 @@ jobs: **/**.go go.mod go.sum - - uses: actions/cache@v3.3.1 + - uses: actions/cache@v3.3.2 with: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary @@ -57,7 +57,7 @@ jobs: runs-on: ubuntu-latest needs: build steps: - - uses: actions/checkout@v3.5.2 + - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: go-version: 1.21.x @@ -67,7 +67,7 @@ jobs: **/**.go go.mod go.sum - - uses: actions/cache@v3.3.1 + - uses: actions/cache@v3.3.2 with: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary @@ -85,7 +85,7 @@ jobs: go-version: 1.21.x - name: Install runsim run: go install github.com/cosmos/tools/cmd/runsim@v1.0.0 - - uses: actions/cache@v3.3.1 + - uses: actions/cache@v3.3.2 with: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary @@ -96,7 +96,7 @@ jobs: steps: - name: install runsim run: go install github.com/cosmos/tools/cmd/runsim@v1.0.0 - - uses: actions/cache@v3.3.1 + - uses: actions/cache@v3.3.2 with: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary @@ -108,8 +108,8 @@ jobs: - uses: actions/setup-go@v4 with: go-version: 1.21.x - - uses: actions/checkout@v3.5.2 - - uses: actions/cache@v3.3.1 + - uses: actions/checkout@v4 + - uses: actions/cache@v3.3.2 with: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f42ebf99ea..0d4653439b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: tests: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.5.2 + - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: go-version: "1.21" @@ -41,7 +41,7 @@ jobs: **/go.sum **/Makefile Makefile - - uses: actions/cache@v3.3.1 + - uses: actions/cache@v3.3.2 with: path: | ~/.cache/go-build @@ -66,7 +66,7 @@ jobs: - uses: actions/setup-go@v4 with: go-version: 1.21.x - - uses: actions/checkout@v3.5.2 + - uses: actions/checkout@v4 - uses: technote-space/get-diff-action@v6.0.1 with: PATTERNS: | @@ -84,7 +84,7 @@ jobs: runs-on: ubuntu-latest needs: [tests] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: technote-space/get-diff-action@v6.1.2 id: git_diff with: @@ -109,7 +109,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - uses: actions/checkout@v3.5.2 + - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: go-version: 1.21.x @@ -136,7 +136,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 steps: - - uses: actions/checkout@v3.5.2 + - uses: actions/checkout@v4 with: fetch-depth: 0 - uses: technote-space/get-diff-action@v6.0.1 @@ -147,38 +147,41 @@ jobs: go.sum - uses: actions/setup-go@v4 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 v10.0.0 + git checkout v14.0.0 make build - cp ./build/gaiad ./build/gaiad10 + cp ./build/gaiad ./build/gaiadold go clean -modcache if: env.GIT_DIFF - - name: Install GaiaV11 + - name: Install New Gaiad run: | git checkout - make build - cp ./build/gaiad ./build/gaiad11 + cp ./build/gaiad ./build/gaiadnew + go clean -modcache if: env.GIT_DIFF - name: Install Cosmovisor run: | go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@latest if: env.GIT_DIFF - - name: Start GaiaV10 + - name: Start Old Gaiad Binary run: | go env GOPATH - ./contrib/scripts/upgrade_test_scripts/v11/run_gaia_v10.sh + ./contrib/scripts/upgrade_test_scripts/run_gaia.sh if: env.GIT_DIFF - name: Submit Upgrade Commands run: | - ./contrib/scripts/upgrade_test_scripts/v11/run_upgrade_commands_v11.sh 15 + ./contrib/scripts/upgrade_test_scripts/run_upgrade_commands.sh 15 if: env.GIT_DIFF - name: Check for successful upgrade run: | ./contrib/scripts/upgrade_test_scripts/test_upgrade.sh 20 5 16 localhost if: env.GIT_DIFF - - name: Check for successful migration - run: | - ./contrib/scripts/upgrade_test_scripts/v11/test_migration_v11.sh localhost - if: env.GIT_DIFF diff --git a/.golangci.yml b/.golangci.yml index 9b6e8ad471..6eae92cbe7 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -6,10 +6,10 @@ run: linters: disable-all: true enable: - - depguard - dogsled - errcheck - exportloopref + - gci - goconst - gocritic - gofumpt @@ -31,25 +31,25 @@ linters: issues: exclude-rules: - - text: "Use of weak random number generator" + - text: 'Use of weak random number generator' linters: - gosec - - text: "comment on exported var" + - text: 'comment on exported var' linters: - golint - text: "don't use an underscore in package name" linters: - golint - - text: "ST1003:" + - text: 'ST1003:' linters: - stylecheck # FIXME: Disabled until golangci-lint updates stylecheck with this fix: # https://github.com/dominikh/go-tools/issues/389 - - text: "ST1016:" + - text: 'ST1016:' linters: - stylecheck - - path: "migrations" - text: "SA1019:" + - path: 'migrations' + text: 'SA1019:' linters: - staticcheck @@ -57,6 +57,18 @@ issues: max-same-issues: 10000 linters-settings: + gci: + custom-order: true + sections: + - standard # Standard section: captures all standard packages. + - default # Default section: contains all imports that could not be matched to another section type. + - blank # blank imports + - dot # dot imports + - prefix(github.com/cometbft/cometbft) # comet + - prefix(github.com/cosmos) # cosmos org + - prefix(cosmossdk.io) # new modules + - prefix(github.com/cosmos/cosmos-sdk) # cosmos sdk + - prefix(github.com/cosmos/gaia) # Gaia dogsled: max-blank-identifiers: 3 maligned: @@ -94,4 +106,4 @@ linters-settings: - name: empty-block - name: superfluous-else - name: unreachable-code - - name: redefines-builtin-id \ No newline at end of file + - name: redefines-builtin-id diff --git a/.goreleaser.yml b/.goreleaser.yml index 16e6b85ed1..be707e4218 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -16,7 +16,7 @@ builds: - CGO_ENABLED=0 ldflags: # .Env.TM_VERSION is provided in the workflow runner environment -> see .github/workflows/release.yml - - -s -w -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} -X github.com/cosmos/cosmos-sdk/version.Name=gaia -X github.com/cosmos/cosmos-sdk/version.AppName=gaiad -X github.com/cosmos/cosmos-sdk/version.Version={{ .Version }} -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }} -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger -X github.com/tendermint/tendermint/version.TMCoreSemVer={{ .Env.TM_VERSION }} + - -s -w -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} -X github.com/cosmos/cosmos-sdk/version.Name=gaia -X github.com/cosmos/cosmos-sdk/version.AppName=gaiad -X github.com/cosmos/cosmos-sdk/version.Version=v{{ .Version }} -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }} -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger -X github.com/tendermint/tendermint/version.TMCoreSemVer={{ .Env.TM_VERSION }} goos: - darwin - linux @@ -54,3 +54,11 @@ snapshot: changelog: skip: false + +git: + # What should be used to sort tags when gathering the current and previous + # tags if there are more than one tag in the same commit. + # + # source: https://goreleaser.com/customization/git/ + tag_sort: -version:refname + prerelease_suffix: "-rc" diff --git a/.mergify.yml b/.mergify.yml index 5de6010b1f..aac2b9a54e 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -24,20 +24,29 @@ pull_request_rules: {{ title }} (#{{ number }}) {{ body }} - - name: Backport patches to the release/v9.1.x branch + - name: Backport patches to the release/v12.x branch conditions: - base=main - - label=A:backport/v9.1.x + - label=A:backport/v12.x actions: backport: branches: - - release/v9.1.x + - release/v12.x - - name: Backport patches to the release/v10.0.x branch + - name: Backport patches to the release/v13.x branch conditions: - base=main - - label=A:backport/v10.0.x + - label=A:backport/v13.x actions: backport: branches: - - release/v10.0.x + - release/v13.x + + - name: Backport patches to the release/v14.1.x branch + conditions: + - base=main + - label=A:backport/v14.1.x + actions: + backport: + branches: + - release/v14.1.x \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ecc6eb656..571a47462c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,209 @@ # CHANGELOG +## v14.1.0 + +*November 21, 2023* + +### API BREAKING + +- Deprecate equivocation proposals of ICS provider module ([\#2825](https://github.com/cosmos/gaia/pull/2825)) + +### DEPENDENCIES + +- Bump [ICS] to [v2.4.0-lsm](https://github.com/cosmos/interchain-security/releases/tag/v2.4.0-lsm) ([\#2825](https://github.com/cosmos/gaia/pull/2825)) + +### FEATURES + +- Set in the v14 upgrade handler the min evidence height for `neutron-1` + at `4552189` and for `stride-1` at `6375035`. + ([\#2821](https://github.com/cosmos/gaia/pull/2821)) +- Introducing the cryptographic verification of equivocation feature to the ICS provider module ([\#2825](https://github.com/cosmos/gaia/pull/2825)) + +### STATE BREAKING + +- Bump [ICS] to [v2.4.0-lsm](https://github.com/cosmos/interchain-security/releases/tag/v2.4.0-lsm) ([\#2825](https://github.com/cosmos/gaia/pull/2825)) + +## v14.0.0 + +*November 15, 2023* + +❗***This release is deprecated and should not be used in production. Use v14.1.0 instead.*** + +### API BREAKING + +- Deprecate equivocation proposals of ICS provider module ([\#2814](https://github.com/cosmos/gaia/pull/2814)) + +### DEPENDENCIES + +- Bump [ICS] to [v2.3.0-provider-lsm](https://github.com/cosmos/interchain-security/releases/tag/v2.3.0-provider-lsm) ([\#2814](https://github.com/cosmos/gaia/pull/2814)) + +### FEATURES + +- Introducing the cryptographic verification of equivocation feature to the ICS provider module ([\#2814](https://github.com/cosmos/gaia/pull/2814)) + +### STATE BREAKING + +- Bump [ICS] to [v2.3.0-provider-lsm](https://github.com/cosmos/interchain-security/releases/tag/v2.3.0-provider-lsm) ([\#2814](https://github.com/cosmos/gaia/pull/2814)) + +## v13.0.2 + +*November 7, 2023* + +### BUG FIXES + +- Bump [cosmos/ledger-cosmos-go](https://github.com/cosmos/ledger-cosmos-go) to + [v0.12.4](https://github.com/cosmos/ledger-cosmos-go/releases/tag/v0.12.4) + to fix signing with ledger through the binary on newest versions of macOS and Xcode + ([\#2763](https://github.com/cosmos/gaia/pull/2763)) + +## v13.0.1 + +*October 25, 2023* + +### BUG FIXES + +- Bump [PFM](https://github.com/cosmos/ibc-apps/tree/main/middleware) + to [v4.1.1](https://github.com/cosmos/ibc-apps/releases/tag/middleware%2Fpacket-forward-middleware%2Fv4.1.1) + ([\#2771](https://github.com/cosmos/gaia/pull/2771)) + +### DEPENDENCIES + +- Bump [PFM](https://github.com/cosmos/ibc-apps/tree/main/middleware) + to [v4.1.1](https://github.com/cosmos/ibc-apps/releases/tag/middleware%2Fpacket-forward-middleware%2Fv4.1.1) + ([\#2771](https://github.com/cosmos/gaia/pull/2771)) + +## v13.0.0 + +*September 18, 2023* + +### DEPENDENCIES + +- Remove [Liquidity](https://github.com/Gravity-Devs/liquidity) + ([\#2716](https://github.com/cosmos/gaia/pull/2716)) +- Bump [interchain-security](https://github.com/cosmos/interchain-security) to + [v2.1.0-provider-lsm](https://github.com/cosmos/interchain-security/releases/tag/v2.1.0-provider-lsm) + ([\#2732](https://github.com/cosmos/gaia/pull/2732)) + +### STATE BREAKING + +- Bump [interchain-security](https://github.com/cosmos/interchain-security) to + [v2.1.0-provider-lsm](https://github.com/cosmos/interchain-security/releases/tag/v2.1.0-provider-lsm) + ([\#2732](https://github.com/cosmos/gaia/pull/2732)) + +## v12.0.0 + +*August 18, 2023* + +### API BREAKING + +- Add Liquid Staking Module (LSM) and initialize the LSM params: + ValidatorBondFactor, ValidatorLiquidStakingCap, GlobalLiquidStakingCap + ([\#2643](https://github.com/cosmos/gaia/pull/2643)) + +### BUG FIXES + +- Bump [PFM](https://github.com/cosmos/ibc-apps/tree/main/middleware) + to [v4.1.0](https://github.com/cosmos/ibc-apps/releases/tag/middleware%2Fpacket-forward-middleware%2Fv4.1.0) + ([\#2677](https://github.com/cosmos/gaia/pull/2677)) + +### DEPENDENCIES + +- Bump [interchain-security](https://github.com/cosmos/interchain-security) to + [v2.0.0-lsm](https://github.com/cosmos/interchain-security/releases/tag/v2.0.0-lsm) + ([\#2643](https://github.com/cosmos/gaia/pull/2643)) +- Bump [cosmos-sdk](https://github.com/cosmos/cosmos-sdk) to + [v0.45.16-ics-lsm](https://github.com/cosmos/cosmos-sdk/tree/v0.45.16-ics-lsm) + ([\#2643](https://github.com/cosmos/gaia/pull/2643)) +- Bump [PFM](https://github.com/cosmos/ibc-apps/tree/main/middleware) + to [v4.1.0](https://github.com/cosmos/ibc-apps/releases/tag/middleware%2Fpacket-forward-middleware%2Fv4.1.0) + ([\#2677](https://github.com/cosmos/gaia/pull/2677)) + +### FEATURES + +- Add Liquid Staking Module (LSM) and initialize the LSM params: + ValidatorBondFactor, ValidatorLiquidStakingCap, GlobalLiquidStakingCap + ([\#2643](https://github.com/cosmos/gaia/pull/2643)) + +### STATE BREAKING + +- Add Liquid Staking Module (LSM) and initialize the LSM params: + ValidatorBondFactor, ValidatorLiquidStakingCap, GlobalLiquidStakingCap + ([\#2643](https://github.com/cosmos/gaia/pull/2643)) +- Bump [PFM](https://github.com/cosmos/ibc-apps/tree/main/middleware) + to [v4.1.0](https://github.com/cosmos/ibc-apps/releases/tag/middleware%2Fpacket-forward-middleware%2Fv4.1.0) + ([\#2677](https://github.com/cosmos/gaia/pull/2677)) + +## v11.0.0 + +*July 18, 2023* + +### API BREAKING + +- [GlobalFee](x/globalfee) + - Add `bypass-min-fee-msg-types` and `maxTotalBypassMinFeeMsgGagUsage` to + globalfee params. `bypass-min-fee-msg-types` in `config/app.toml` is + deprecated ([\#2424](https://github.com/cosmos/gaia/pull/2424)) + +### BUG FIXES + +- Fix logic bug in `GovPreventSpamDecorator` that allows bypassing the + `MinInitialDeposit` requirement + ([a759409](https://github.com/cosmos/gaia/commit/a759409c9da2780663244308b430a7847b95139b)) + +### DEPENDENCIES + +- Bump [PFM](https://github.com/strangelove-ventures/packet-forward-middleware) to + [v4.0.5](https://github.com/strangelove-ventures/packet-forward-middleware/releases/tag/v4.0.5) + ([\#2185](https://github.com/cosmos/gaia/issues/2185)) +- Bump [Interchain-Security](https://github.com/cosmos/interchain-security) to + [v2.0.0](https://github.com/cosmos/interchain-security/releases/tag/v2.0.0) + ([\#2616](https://github.com/cosmos/gaia/pull/2616)) +- Bump [Liquidity](https://github.com/Gravity-Devs/liquidity) to + [v1.6.0-forced-withdrawal](https://github.com/Gravity-Devs/liquidity/releases/tag/v1.6.0-forced-withdrawal) + ([\#2652](https://github.com/cosmos/gaia/pull/2652)) + +### STATE BREAKING + +- General + - Fix logic bug in `GovPreventSpamDecorator` that allows bypassing the + `MinInitialDeposit` requirement + ([a759409](https://github.com/cosmos/gaia/commit/a759409c9da2780663244308b430a7847b95139b)) + - Bump [Interchain-Security](https://github.com/cosmos/interchain-security) to + [v2.0.0](https://github.com/cosmos/interchain-security/releases/tag/v2.0.0) + ([\#2616](https://github.com/cosmos/gaia/pull/2616)) + - Bump [Liquidity](https://github.com/Gravity-Devs/liquidity) to + [v1.6.0-forced-withdrawal](https://github.com/Gravity-Devs/liquidity/releases/tag/v1.6.0-forced-withdrawal) + ([\#2652](https://github.com/cosmos/gaia/pull/2652)) +- [GlobalFee](x/globalfee) + - Create the upgrade handler and params migration for the new Gloabal Fee module + parameters introduced in [#2424](https://github.com/cosmos/gaia/pull/2424) + ([\#2352](https://github.com/cosmos/gaia/pull/2352)) + - Add `bypass-min-fee-msg-types` and `maxTotalBypassMinFeeMsgGagUsage` to + globalfee params ([\#2424](https://github.com/cosmos/gaia/pull/2424)) + - Update Global Fee's AnteHandler to check tx fees against the network min gas + prices in DeliverTx mode ([\#2447](https://github.com/cosmos/gaia/pull/2447)) + +## v10.0.2 + +*July 03, 2023* + +This release bumps several dependencies and enables extra queries. + +### DEPENDENCIES + +- Bump [ibc-go](https://github.com/cosmos/ibc-go) to + [v4.4.2](https://github.com/cosmos/ibc-go/releases/tag/v4.4.2) + ([\#2554](https://github.com/cosmos/gaia/pull/2554)) +- Bump [CometBFT](https://github.com/cometbft/cometbft) to + [v0.34.29](https://github.com/cometbft/cometbft/releases/tag/v0.34.29) + ([\#2594](https://github.com/cosmos/gaia/pull/2594)) + +### FEATURES + +- Register NodeService to enable query `/cosmos/base/node/v1beta1/config` + gRPC query to disclose node operator's configured minimum-gas-price. + ([\#2629](https://github.com/cosmos/gaia/issues/2629)) + ## [v10.0.1] 2023-05-25 * (deps) [#2543](https://github.com/cosmos/gaia/pull/2543) Bump [ibc-go](https://github.com/cosmos/ibc-go) to [v4.4.1](https://github.com/cosmos/ibc-go/releases/tag/v4.4.1). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b17ad3bca6..97ee84b16a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,6 +6,7 @@ - [Ease of reviewing](#ease-of-reviewing) - [Workflow](#workflow) - [Project Board](#project-board) + - [Architecture Decision Records (ADR)](#architecture-decision-records-adr) - [Development Procedure](#development-procedure) - [Testing](#testing) - [Pull Requests](#pull-requests) @@ -99,6 +100,14 @@ We use self-organizing principles to coordinate and collaborate across organizat The developers work in sprints, which are available in a [GitHub Project](https://github.com/orgs/cosmos/projects/28/views/2). +## Architecture Decision Records (ADR) + +When proposing an architecture decision for Gaia, please start by opening an [issue](https://github.com/cosmos/gaia/issues/new/choose) or a [discussion](https://github.com/cosmos/gaia/discussions/new) with a summary of the proposal. Once the proposal has been discussed and there is rough alignment on a high-level approach to the design, you may either start development, or write an ADR. + +If your architecture decision is a simple change, you may contribute directly without writing an ADR. However, if you are proposing a significant change, please include a corresponding ADR. + +To create an ADR, follow the [template](./docs/architecture/adr-template.md) and [doc](./docs/architecture/README.md). If you would like to see examples of how these are written, please refer to the current [ADRs](https://github.com/cosmos/gaia/tree/main/docs/architecture). + ## Development Procedure `main` must be stable, include only completed features and never fail `make lint`, `make run-tests`, or `make build/install`. @@ -234,7 +243,8 @@ where: - `section` is one of `dependencies`, `improvements`, `features`, `bug-fixes`, `state-breaking`, `api-breaking`, - and _**if multiple apply, create multiple files**_; + and _**if multiple apply, create multiple files**_, + not necessarily with the same `short-description` or content; - `pr-number` is the PR number; - `short-description` is a short (4 to 6 word), hyphen separated description of the change; - `component` is used for changes that affect one of the components defined in the [config](.changelog/config.toml), e.g., `tests`, `globalfee`. @@ -263,14 +273,18 @@ where `${description}` is a detailed description of the changelog entry. For example, ```bash # add an entry for bumping IBC to v4.4.2 -unclog add -i "2554-bump-ibc" -p 2554 -s "dependencies" -m "Bump [ibc-go](https://github.com/cosmos/ibc-go) to [v4.4.2](https://github.com/cosmos/ibc-go/releases/tag/v4.4.2)" +unclog add -i "2554-bump-ibc" -p 2554 -s dependencies -m "Bump [ibc-go](https://github.com/cosmos/ibc-go) to [v4.4.2](https://github.com/cosmos/ibc-go/releases/tag/v4.4.2)" # add an entry for changing the global fee module; # note that the entry is added to both state-breaking and api-breaking sections -unclog add -i "2424-params" -p 2424 -c globalfee -s "state-breaking" -m "Add \`bypass-min-fee-msg-types\` and \`maxTotalBypassMinFeeMsgGagUsage\` to globalfee params" -unclog add -i "2424-params" -p 2424 -c globalfee -s "api-breaking" -m "Add \`bypass-min-fee-msg-types\` and \`maxTotalBypassMinFeeMsgGagUsage\` to globalfee params" +unclog add -i "2424-params" -p 2424 -c globalfee -s state-breaking -m "Add \`bypass-min-fee-msg-types\` and \`maxTotalBypassMinFeeMsgGagUsage\` to globalfee params" +unclog add -i "2424-params" -p 2424 -c globalfee -s api-breaking -m "Add \`bypass-min-fee-msg-types\` and \`maxTotalBypassMinFeeMsgGagUsage\` to globalfee params" ``` +**Note:** `unclog add` requires an editor. This can be set either by configuring +an `$EDITOR` environment variable or by manually specify an editor binary path +via the `--editor` flag. + **Note:** Changelog entries should answer the question: "what is important about this change for users to know?" or "what problem does this solve for users?". It should not simply be a reiteration of the title of the associated PR, unless the diff --git a/Makefile b/Makefile index b77454f060..6fe8098572 100644 --- a/Makefile +++ b/Makefile @@ -242,7 +242,7 @@ docker-build-all: docker-build-debug docker-build-hermes ### Linting ### ############################################################################### golangci_lint_cmd=golangci-lint -golangci_version=v1.52.2 +golangci_version=v1.53.3 lint: @echo "--> Running linter" diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 12b4ee9e1f..7930557978 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -10,10 +10,10 @@ ## 📝 Changelog -Check out the [changelog](https://github.com/cosmos/gaia/blob//CHANGELOG.md) for a list of relevant changes or [compare all changes](https://github.com/cosmos/cosmos-sdk/compare/release/...) from last release. +Check out the [changelog](https://github.com/cosmos/gaia/blob//CHANGELOG.md) for a list of relevant changes or [compare all changes](https://github.com/cosmos/gaia/compare/...) from last release. -Refer to the [upgrading guide](https://github.com/cosmos/cosmos-sdk/blob/release//UPGRADING.md) when migrating from `` to ``. +Refer to the [upgrading guide](https://github.com/cosmos/gaia/blob/release//UPGRADING.md) when migrating from `` to ``. ## 🚀 Highlights diff --git a/RELEASE_PROCESS.md b/RELEASE_PROCESS.md index c9317343d6..499cc6132f 100644 --- a/RELEASE_PROCESS.md +++ b/RELEASE_PROCESS.md @@ -1,8 +1,12 @@ # Release Process - [Release Process](#release-process) + - [Breaking Changes](#breaking-changes) - [Major Release Procedure](#major-release-procedure) - [Changelog](#changelog) + - [Creating a new release branch](#creating-a-new-release-branch) + - [Cutting a new release](#cutting-a-new-release) + - [Update the changelog on main](#update-the-changelog-on-main) - [Release Notes](#release-notes) - [Tagging Procedure](#tagging-procedure) - [Test building artifacts](#test-building-artifacts) @@ -17,20 +21,19 @@ This document outlines the release process for Cosmos Hub (Gaia). Gaia follows [semantic versioning](https://semver.org), but with the following deviations to account for state-machine and API breaking changes: - State-machine breaking changes will result in an increase of the major version X (X.y.z). -- Emergency releases & API breaking changes (changes in node interactions e.g. queries) will result in an increase of the minor version Y (x.Y.z | x > 0). +- Emergency releases & API breaking changes will result in an increase of the minor version Y (x.Y.z | x > 0). - All other changes will result in an increase of the patch version Z (x.y.Z | x > 0). -**State compatibility**: -It is critical for the patch releases to be state-machine compatible with prior releases in the same minor version. -For example, v9.2.1 must be compatible with v9.2.0. +**Note:** In case a major release is deprecated before ending up on the network (due to potential bugs), +it is replaced by a minor release (eg: `v14.0.0` → `v14.1.0`). +As a result, this minor release is considered state-machine breaking. -Minor releases will be handled on a case-by-case basis, but generally should only arise in case of safety or security issues that require a co-ordinated network upgrade without a governance process. +### Breaking Changes -This is to ensure determinism, i.e. that given the same input, the nodes will always produce the same output. -State-incompatibility is allowed for major upgrades because all nodes in the network perform it at the same time. -Therefore, after the upgrade, the nodes continue functioning in a deterministic way. +A change is considered to be ***state-machine breaking*** if it requires a coordinated upgrade for the network to preserve [state compatibility](./STATE-COMPATIBILITY.md). +Note that when bumping the dependencies of [Cosmos SDK](https://github.com/cosmos/cosmos-sdk), [IBC](https://github.com/cosmos/ibc-go), and [ICS](https://github.com/cosmos/interchain-security) we will only treat patch releases as non state-machine breaking. -**Note**: State-machine breaking changes include changes that impact the amount of gas needed to execute a transaction as it results in a different `apphash` after the code is executed. +A change is considered to be ***API breaking*** if it modifies the provided API. This includes events, queries, CLI interfaces. ## Major Release Procedure @@ -39,19 +42,15 @@ A _major release_ is an increment of the first number (eg: `v9.1.0` → `v10.0.0 **Note**: Generally, PRs should target either `main` or a long-lived feature branch (see [CONTRIBUTING.md](./CONTRIBUTING.md#pull-requests)). An exception are PRs open via the Github mergify integration (i.e., backported PRs). -* Once the team feels that `main` is _**feature complete**_, we create a `release/vY` branch (going forward known a release branch), +* Once the team feels that `main` is _**feature complete**_, we create a `release/vY` branch (going forward known as release branch), where `Y` is the version number, with the minor and patch part substituted to `x` (eg: 11.x). * Update the [GitHub mergify integration](./.mergify.yml) by adding instructions for automatically backporting commits from `main` to the `release/vY` using the `A:backport/vY` label. * **PRs targeting directly a release branch can be merged _only_ when exceptional circumstances arise**. * In the release branch - * Create a new version section in the `CHANGELOG.md` - * All links must point to their respective pull request. - * The `CHANGELOG.md` must contain only the changes of that specific released version. - All other changelog entries must be deleted and linked to the `main` branch changelog ([example]([TBA](https://github.com/cosmos/gaia/blob/release/v9.0.x/CHANGELOG.md))). - * Note: `CHANGELOG.md` should not contain release candidate entries. + * Create a new version section in the `CHANGELOG.md` (follow the procedure described [below](#changelog)) * Create release notes, in `RELEASE_NOTES.md`, highlighting the new features and changes in the version. This is needed so the bot knows which entries to add to the release page on GitHub. - * Additionally verify that the `UPGRADING.md` file is up to date and contains all the necessary information for upgrading to the new version. + * (To be added in the future) ~~Additionally verify that the `UPGRADING.md` file is up to date and contains all the necessary information for upgrading to the new version.~~ * We freeze the release branch from receiving any new features and focus on releasing a release candidate. * Finish audits and reviews. * Add more tests. @@ -62,21 +61,84 @@ An exception are PRs open via the Github mergify integration (i.e., backported P * When bugs are found, create a PR for `main`, and backport fixes to the release branch. * Create new release candidate tags after bugs are fixed. * After the team feels the release candidate is mainnet ready, create a full release: - * Update `CHANGELOG.md`. - * Run `make format` to format the code. + * **Note:** The final release MUST have the same commit hash as the latest corresponding release candidate. * Create a new annotated git tag in the release branch (follow the [Tagging Procedure](#tagging-procedure)). This will trigger the automated release process (which will also create the release artifacts). * Once the release process completes, modify release notes if needed. ### Changelog -You can obtain the changelog by running: -```bash -git log --oneline --decorate .. - -# example -git log --oneline --decorate v9.0.0..v9.1.0 -``` - +For PRs that are changing production code, please add a changelog entry in `.changelog` (for details, see [contributing guidelines](./CONTRIBUTING.md#changelog)). + +To manage and generate the changelog on Gaia, we currently use [unclog](https://github.com/informalsystems/unclog). + +#### Creating a new release branch + +Unreleased changes are collected on `main` in `.changelog/unreleased/`. +However, `.changelog/` on `main` contains also existing releases (e.g., `v10.0.0`). +Thus, when creating a new release branch (e.g., `release/v11.x`), the following steps are necessary: + +- create a new release branch, e.g., `release/v11.x` + ```bash + git checkout main + git pull + git checkout -b release/v11.x + ``` +- delete all the sub-folders in `.changelog/` except `unreleased/` + ```bash + find ./.changelog -mindepth 1 -maxdepth 1 -type d -not -name unreleased | xargs rm -r + ``` +- replace the content of `.changelog/epilogue.md` with the following text + ```md + ## Previous Versions + + [CHANGELOG of previous versions](https://github.com/cosmos/gaia/blob/main/CHANGELOG.md) + ``` +- push the release branch upstream + ```bash + git push + ``` + +#### Cutting a new release + +Before cutting a _**release candidate**_ (e.g., `v11.0.0-rc0`), the following steps are necessary: + +- move to the release branch, e.g., `release/v11.x` + ```bash + git checkout release/v11.x + ``` +- move all entries in ".changelog/unreleased" to the release version, e.g., `v11.0.0`, i.e., + ```bash + unclog release v11.0.0 + ``` +- update `CHANGELOG.md`, i.e., + ```bash + unclog build > CHANGELOG.md + ``` +- open a PR (from this new created branch) against the release branch, e.g., `release/v11.x` + +Now you can cut the release candidate, e.g., v11.0.0-rc0 (follow the [Tagging Procedure](#tagging-procedure)). + +#### Update the changelog on main + +Once the **final release** is cut, the new changelog section must be added to main: + +- checkout a new branch from the `main` branch, i.e., + ```bash + git checkout main + git pull + git checkout -b /backport_changelog + ``` +- bring the new changelog section from the release branch into this branch, e.g., + ```bash + git checkout release/v11.x .changelog/v11.0.0 + ``` +- remove duplicate entries that are both in `.changelog/unreleased/` and the new changelog section, e.g., `.changelog/v11.0.0` +- update `CHANGELOG.md`, i.e., + ```bash + unclog build > CHANGELOG.md + ``` +- open a PR (from this new created branch) against `main` + ### Release Notes Release notes will be created using the `RELEASE_NOTES.md` from the release branch. diff --git a/RELEASING.md b/RELEASING.md deleted file mode 100644 index 091c31504f..0000000000 --- a/RELEASING.md +++ /dev/null @@ -1,182 +0,0 @@ -# Releasing - -This document outlines the release process for . We use [Long-Lived Version Branch Approach](x) on a `main` branch and a `release` branch. - -We follow [Semver](https://semver.org/) in that any patch releases are non-breaking changes. It's important to note, that breaking changes in a Blockchain context include non-determinism. So if a code change is backwards compatible, it may still impact the amount of gas needed to execute an action, which means the change is in fact breaking as it results in a different apphash after the code is executed. It's important for non-breaking changes to be possible to be used on the live network prior to the release. - -Each major release will have a release branch and patch releases will be tagged on this branch. No patched release has its own branch. (This branch strategy only applies to `v7` and later releases.) - -## Long-Lived Version Branch Approach - -In the Gaia repo, there are two categories of long-lived branches: - -### Branch: `main` - -The `main` branch should be targeted for PRs that contain a bug-fix/feature/improvement that will be included for the next release. - -### Branch: `release` - -There are multiple long-lived branches with the `release/` prefix. Each release series follows the format `release/vn.0.x`, e.g. `release/v7.0.x`. The branch `release/vn.0.x` should point to the most updated `vn` release, e.g. `release/v5.0.x` should be the same as `release/v5.0.8` if that's the latest `v5.0` release. - -## Other Branches - -### branches for the next release - -Other feature/fix branches targeting at `main` contain commits preparing for the next release. When the `release-prepare-branch` is ready for next release, add label `A:backport/vn.0.x` to the PR of `release-prepare-branch` against `main`, then the mergifybot will create a new PR of `mergify/bp/release/vn.0.x` against `Release/vn.0.x`. - -### branches for the backport release - -If the feature/fix branches are for a backport release, `main` branch already contains the commits for the next major release `vn`, the feature/fix branch's PR should target at `Release/vn-1` rather than `main`. - -## Release Procedure - -### Checks and tests - -Before merge and release, the following tests checks need to be conducted: - -- check the `replace` line in `go.mod`, check all the versions in `go.mod` are correct. -- run tests and simulations by `make run-tests`. -- test version compatibilities for minor releases. - -### Major and minor Release - -For a new major release `n`, checkout `release/vn.0.x` from `main`. Merge or use mergify to merge the commits to `release/vn.0.x`, and tag the version. -For minor release. Merge or use mergify to merge the commits to `release/vn.0.x`, and tag the version. - -Usually the first release on the `release/vn.0.x` is a release candidate. - -#### example of releasing `v8.0.0-rc0` - -1. checkout `release/v8.0.x` off `main` -1. get the `v8-prepare-branch` ready including CHANGELOG.md, create a PR to merge `v8-prepare-branch` to `main`, label this PR `A:backport/v8.0.x`. -1. after merge `v8-prepare-branch` to `main`, mergifybot will create a new PR of `mergify/bp/release/v8.0.x` to `release/v8.0.x`. Check the PR, and merge this PR. -1. checkout `release/v8.0.x` and tag `v8.0.0-rc0`. - -#### example of releasing `v8.0.0` - -1. get the `v800-prepare-branch` ready including CHANGELOG.md, create a PR to merge `v800-prepare-branch` to `main`, label this PR `A:backport/v8.0.x`. -1. after merge `v800-prepare-branch` to `main`, mergifybot will create a new PR of `mergify/bp/release/v8.0.x` to `release/v8.0.x`. Check the PR, and merge this PR. -1. checkout `release/v8.0.x` and tag `v8.0.0`. - -#### example of releasing `v8.0.1` - -1. get the `v801-prepare-branch`(off `main`) ready including CHANGELOG.md, create a PR to merge `v801-prepare-branch` to `main`, label this PR `A:backport/v8.0.x`. -1. after merge `v801-prepare-branch` to `main`, mergifybot will create a new PR of `mergify/bp/release/v8.0.x` to `release/v8.0.x`. Check the PR, and merge this PR. -1. checkout `release/v8.0.x` and tag `v8.0.1`. - -### backport release - -For a backport release, checkout a new branch from the right release branch, for example, `release/vn-1.0.x`. Commits to this new branch and merge into `release/vn-1.0.x`, tag the backport version from `release/vn-1.0.x`. - -#### example of backport release `v7.0.5` - -assume main branch is at `v8`. - -1. checkout `v705-prepare-branch` off `release/v7.0.x`, get the backport changes ready including CHANGELOG.md on `v705-prepare-branch`. -1. create a PR to merge `v705-prepare-branch` to `release/v7.0.x`, and merge. -1. checkout `release/v7.0.x` tag `v7.0.5`. - -### Test building artifacts - -Before tagging the version, please test the building releasing artifacts by - -```bash -make distclean build-reproducible -``` - -The above command will generate a directory -`gaia/artifacts` with different os and architecture binaries. If the above command runs sucessfully, delete the directory `rm -r gaia/artifacts`. - -### Tagging - -The following steps are the default for tagging a specific branch commit (usually on a branch labeled `release/vX.X.X`): - -1. Ensure you have checked out the commit you wish to tag -1. `git pull --tags --dry-run` -1. `git pull --tags` -1. `git tag -s v3.0.1 -m 'Release v3.0.1'` - 1. optional, add the `-s` tag to create a signed commit using your PGP key (which should be added to github beforehand) -1. `git push --tags --dry-run` -1. `git push --tags` - -To re-create a tag: - -1. `git tag -d v4.0.0` to delete a tag locally -1. `git push --delete origin v4.0.0`, to push the deletion to the remote -1. Proceed with the above steps to create a tag - -To tag and build without a public release (e.g., as part of a timed security release): - -1. Follow the steps above for tagging locally, but do not push the tags to the repository. -1. After adding the tag locally, you can build the binary, e.g., `make build-reproducible`. -1. To finalize the release, push the local tags, create a release based off the newly pushed tag, and attach the binaries. - -### Release notes - -Ensure you run the reproducible build in order to generate sha256 hashes and platform binaries; -these artifacts should be included in the release. - -```bash -make distclean build-reproducible -``` - -This runs the docker image [tendermintdev/rbuilder](https://hub.docker.com/r/tendermintdev/rbuilder) with a copy of the [rbuilder](https://github.com/tendermint/images/tree/master/rbuilder) docker file. - -Then use the following release text template: - -```markdown -# Gaia v4.0.0 Release Notes - -Note, that this specific release will be updated with a newer changelog, and the below hashes and binaries will also be updated. - -This release includes bug fixes for prop29, as well as additional support for IBC and Ledger signing. - -As there is a breaking change from Gaia v3, the Gaia module has been incremented to v4. - -See the [Cosmos SDK v0.41.0 Release](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.41.0) for details. - -```bash -$ make distclean build-reproducible -App: gaiad -Version: 4.0.0 -Commit: 2bb04266266586468271c4ab322367acbf41188f -Files: - 2e801c7424ef67e6d9fc092c2b75c2d3 gaiad-4.0.0-darwin-amd64 - dc21eb861480e0f55af876f271b512fe gaiad-4.0.0-linux-amd64 - bda165f91bc065afb8a445e72be9a868 gaiad-4.0.0-linux-arm64 - c7203d53bd596679b39b6a94d1dbe0dc gaiad-4.0.0-windows-amd64.exe - 81299b602e1760078e03c97813edda60 gaiad-4.0.0.tar.gz -Checksums-Sha256: - de764e52acc31dd98fa49d8d0eef851f3b7b53e4f1d4fbfda2c07b1a8b115b91 gaiad-4.0.0-darwin-amd64 - e5244ccd98a05479cc35753da1bb5b6bd873f6d8ebe6f8c5d112cf4d9e2761b4 gaiad-4.0.0-linux-amd64 - 7b7c4ea3e2de5f228436dcbb177455906239603b11eca1fb1015f33973d7b567 gaiad-4.0.0-linux-arm64 - b418c5f296ee6f946f44da8497af594c6ad0ece2b1da09a93a45d7d1b1457f27 gaiad-4.0.0-windows-amd64.exe - 3895518436b74be8b042d7d0b868a60d03e1656e2556b12132be0f25bcb061ef gaiad-4.0.0.tar.gz -``` - -# Major Release Maintenance - -Major Release series continue to receive bug fixes (released as a Patch Release) until they reach End Of Life. Major Release series are maintained in compliance with the Stable Release Policy as described in this document. Note: not every Major Release is denoted as a stable release. - -Only the following major release series have a stable release status: - -v7 Theta is supported until v9 Lambda. A fairly strict **bugfix-only** rule applies to pull requests that are requested to be included into a stable point-release. - -v6 Vega is supported until v8 Rho. A fairly strict **bugfix-only** rule applies to pull requests that are requested to be included into a stable point-release. - -v5 Delta is supported until v7 Theta. A fairly strict **bugfix-only** rule applies to pull requests that are requested to be included into a stable point-release. - -After two releases, a supported version will be transitioned to unsupported and will be deemed EOL with no further updates. - -# Stable Release Policy - -The intention of the Stable Release Policy is to ensure that all major release series that are not EOL, are maintained with the following categories of fixes: - -- Tooling improvements (including code formatting, linting, static analysis and updates to testing frameworks) -- Performance enhancements for running archival and synching nodes -- Test and benchmarking suites, ensuring that fixes are sound and there are no performance regressions -- Library updates including point releases for core libraries such as IBC-Go, Cosmos SDK, CometBFT and other dependencies -- General maintenance improvements, that are deemed necessary by the stewarding team, that help align different releases and reduce the workload on the stewarding team -- Security fixes - -Issues that are likely excluded, are any issues that impact operating a block producing network. diff --git a/SECURITY.md b/SECURITY.md index 636d34e850..1a7a1d514a 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,79 +1,30 @@ -# Coordinated Vulnerability Disclosure Policy +## How to Report a Security Bug -The Cosmos ecosystem believes that strong security is a blend of highly -technical security researchers who care about security and the forward -progression of the ecosystem and the attentiveness and openness of Cosmos core -contributors to help continually secure our operations. +If you believe you have found a security vulnerability in Gaia, +you can report it to our primary vulnerability disclosure channel, the +[Cosmos HackerOne Bug Bounty program](https://hackerone.com/cosmos?type=team). -> **IMPORTANT**: *DO NOT* open public issues on this repository for security -> vulnerabilities. +If you prefer to report an issue via email, you may send a bug report to +security@interchain.io with the issue details, reproduction, impact, and other +information. Please submit only one unique email thread per vulnerability. +Any issues reported via email are ineligible for bounty rewards. -## Scope +Artifacts from an email report are saved at the time the email is triaged. +Please note: our team is not able to monitor dynamic content (e.g. a Google +Docs link that is edited after receipt) throughout the lifecycle of a report. +If you would like to share additional information or modify previous +information, please include it in an additional reply as an additional attachment. -| Scope | -|-----------------------| -| last release (tagged) | -| main branch | +***Please DO NOT file a public issue in this repository to report a security vulnerability.*** -The latest **release tag** of this repository is supported for security updates -as well as the **main** branch. Security vulnerabilities should be reported if -the vulnerability can be reproduced on either one of those. -## Reporting a Vulnerability +## Coordinated Vulnerability Disclosure Policy and Safe Harbor -| Reporting methods | -|---------------------------------------------------------------| -| [GitHub Private Vulnerability Reporting][gh-private-advisory] | -| [HackerOne bug bounty program][h1] | +For the most up-to-date version of the policies that govern vulnerability +disclosure, please consult the [HackerOne program page](https://hackerone.com/cosmos?type=team&view_policy=true). -All security vulnerabilities can be reported under GitHub's [Private -vulnerability reporting][gh-private-advisory] system. This will open a private -issue for the developers. Try to fill in as much of the questions as possible. -If you are not familiar with the CVSS system for assessing vulnerabilities, just -use the Low/High/Critical severity ratings. A partially filled in report for a -critical vulnerability is still better than no report at all. - -Vulnerabilities associated with the **Go, Rust or Protobuf code** of the -repository may be eligible for a [bug bounty][h1]. Please see the bug bounty -page for more details on submissions and rewards. If you think the vulnerability -is eligible for a payout, **report on HackerOne first**. - -Vulnerabilities in services and their source codes (JavaScript, web page, Google -Workspace) are not in scope for the bug bounty program, but they are welcome to -be reported in GitHub. - -### Guidelines - -We require that all researchers: - -* Abide by this policy to disclose vulnerabilities, and avoid posting - vulnerability information in public places, including GitHub, Discord, - Telegram, and Twitter. -* Make every effort to avoid privacy violations, degradation of user experience, - disruption to production systems (including but not limited to the Cosmos - Hub), and destruction of data. -* Keep any information about vulnerabilities that you’ve discovered confidential - between yourself and the Cosmos engineering team until the issue has been - resolved and disclosed. -* Avoid posting personally identifiable information, privately or publicly. - -If you follow these guidelines when reporting an issue to us, we commit to: - -* Not pursue or support any legal action related to your research on this - vulnerability -* Work with you to understand, resolve and ultimately disclose the issue in a - timely fashion - -### More information - -* See [TIMELINE.md] for an example timeline of a disclosure. -* See [DISCLOSURE.md] to see more into the inner workings of the disclosure - process. -* See [EXAMPLES.md] for some of the examples that we are interested in for the - bug bounty program. - -[gh-private-advisory]: /../../security/advisories/new -[h1]: https://hackerone.com/cosmos -[TIMELINE.md]: https://github.com/cosmos/security/blob/main/TIMELINE.md -[DISCLOSURE.md]: https://github.com/cosmos/security/blob/main/DISCLOSURE.md -[EXAMPLES.md]: https://github.com/cosmos/security/blob/main/EXAMPLES.md +The policy hosted on HackerOne is the official Coordinated Vulnerability +Disclosure policy and Safe Harbor for the Interchain Stack, and the teams and +infrastructure it supports, and it supersedes previous security policies that +have been used in the past by individual teams and projects with targets in +scope of the program. diff --git a/STATE-COMPATIBILITY.md b/STATE-COMPATIBILITY.md new file mode 100644 index 0000000000..262444f45d --- /dev/null +++ b/STATE-COMPATIBILITY.md @@ -0,0 +1,211 @@ +# State-Compatibility + +- [State-Compatibility](#state-compatibility) + - [Scope](#scope) + - [Validating State-Compatibility](#validating-state-compatibility) + - [AppHash](#apphash) + - [LastResultsHash](#lastresultshash) + - [Major Sources of State-incompatibility](#major-sources-of-state-incompatibility) + - [Creating Additional State](#creating-additional-state) + - [Changing Proto Field Definitions](#changing-proto-field-definitions) + - [Returning Different Errors Given Same Input](#returning-different-errors-given-same-input) + - [Variability in Gas Usage](#variability-in-gas-usage) + - [Secondary Limitations To Keep In Mind](#secondary-limitations-to-keep-in-mind) + - [Network Requests to External Services](#network-requests-to-external-services) + - [Randomness](#randomness) + - [Parallelism and Shared State](#parallelism-and-shared-state) + - [Hardware Errors](#hardware-errors) + + +It is critical for the patch and minor releases to be state-machine compatible with prior releases in the same minor version. +For example, v13.0.2 must be state-machine compatible with v13.0.1. +_An exception are minor releases that are either emergency releases or replacements of deprecated major releases_. + +This is to ensure **determinism**, i.e., given the same input, the nodes will always produce the same output. + +State-incompatibility is allowed for major upgrades because all nodes in the network perform it at the same time. Therefore, after the upgrade, the nodes continue functioning in a deterministic way. + +## Scope + +The state-machine scope includes the following areas: + +- All ICS messages including: + - Every msg's ValidateBasic method + - Every msg's MsgServer method + - Net gas usage, in all execution paths + - Error result returned + - State changes (namely every store write) +- AnteHandlers in "DeliverTx" mode +- All `BeginBlock`/`EndBlock` logic + +The following are **NOT** in the state-machine scope: + +- Events +- Queries that are not whitelisted +- CLI interfaces + +## Validating State-Compatibility + +CometBFT ensures state compatibility by validating a number of hashes that can be found [here](https://github.com/cometbft/cometbft/blob/v0.38.2/proto/tendermint/types/types.proto#L59-L66). + +`AppHash` and `LastResultsHash` are the common sources of problems stemming from our work. +To avoid these problems, let's now examine how these hashes work. + +### AppHash + +**Note:** The following explanation is simplified for clarity. + +An app hash is a hash of hashes of every store's Merkle root that is returned by ABCI's `Commit()` from Cosmos-SDK to CometBFT. +Cosmos-SDK [takes an app hash of the application state](https://github.com/cosmos/cosmos-sdk/blob/v0.47.6/store/rootmulti/store.go#L468), and propagates it to CometBFT which, in turn, compares it to the app hash of the rest of the network. +Then, CometBFT ensures that the app hash of the local node matches the app hash of the network. + +### LastResultsHash + +`LastResultsHash` is the root hash of all results from the transactions in the block returned by the ABCI's `DeliverTx`. + +The [`LastResultsHash`](https://github.com/cometbft/cometbft/blob/v0.34.29/types/results.go#L47-L54) +in CometBFT [v0.34.29](https://github.com/cometbft/cometbft/releases/tag/v0.34.29) contains: + +1. Tx `GasWanted` + +2. Tx `GasUsed` + > `GasUsed` being Merkelized means that we cannot freely reorder methods that consume gas. + > We should also be careful of modifying any validation logic since changing the + > locations where we error or pass might affect transaction gas usage. + > + > There are plans to remove this field from being Merkelized in a subsequent CometBFT release, + > at which point we will have more flexibility in reordering operations / erroring. + +3. Tx response `Data` + + > The `Data` field includes the proto marshalled Tx response. Therefore, we cannot + > change these in patch releases. + +4. Tx response `Code` + + > This is an error code that is returned by the transaction flow. In the case of + > success, it is `0`. On a general error, it is `1`. Additionally, each module + > defines its custom error codes. + > + > As a result, it is important to avoid changing custom error codes or change + > the semantics of what is valid logic in transaction flows. + +Note that all of the above stem from `DeliverTx` execution path, which handles: + +- `AnteHandler`'s marked as deliver tx +- `msg.ValidateBasic` +- execution of a message from the message server + +The `DeliverTx` return back to the CometBFT is defined [here](https://github.com/cosmos/cosmos-sdk/blob/d11196aad04e57812dbc5ac6248d35375e6603af/baseapp/abci.go#L293-L303). + +## Major Sources of State-incompatibility + +### Creating Additional State + +By erroneously creating database entries that exist in Version A but not in +Version B, we can cause the app hash to differ across nodes running +these versions in the network. Therefore, this must be avoided. + +### Changing Proto Field Definitions + +For example, if we change a field that gets persisted to the database, +the app hash will differ across nodes running these versions in the network. + +Additionally, this affects `LastResultsHash` because it contains a `Data` field that is a marshaled proto message. + +### Returning Different Errors Given Same Input + +```go +// Version A +func (sk Keeper) validateAmount(ctx context.Context, amount math.Int) error { + if amount.IsNegative() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "amount must be positive or zero") + } + return nil +} +``` + +```go +// Version B +func (sk Keeper) validateAmount(ctx context.Context, amount math.Int) error { + if amount.IsNegative() || amount.IsZero() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "amount must be positive") + } + return nil +} +``` + +Note that now an amount of 0 can be valid in "Version A", but invalid in "Version B". +Therefore, if some nodes are running "Version A" and others are running "Version B", +the final app hash might not be deterministic. + +Additionally, a different error message does not matter because it +is not included in any hash. However, an error code `sdkerrors.ErrInvalidRequest` does. +It translates to the `Code` field in the `LastResultsHash` and participates in +its validation. + +### Variability in Gas Usage + +For transaction flows (or any other flow that consumes gas), it is important +that the gas usage is deterministic. + +Currently, gas usage is being Merklized in the state. As a result, reordering functions +becomes risky. + +Suppose my gas limit is 2000 and 1600 is used up before entering +`someInternalMethod`. Consider the following: + +```go +func someInternalMethod(ctx sdk.Context) { + object1 := readOnlyFunction1(ctx) # consumes 1000 gas + object2 := readOnlyFunction2(ctx) # consumes 500 gas + doStuff(ctx, object1, object2) +} +``` + +- It will run out of gas with `gasUsed = 2600` where 2600 getting merkelized +into the tx results. + +```go +func someInternalMethod(ctx sdk.Context) { + object2 := readOnlyFunction2(ctx) # consumes 500 gas + object1 := readOnlyFunction1(ctx) # consumes 1000 gas + doStuff(ctx, object1, object2) +} +``` + +- It will run out of gas with `gasUsed = 2100` where 2100 is getting merkelized +into the tx results. + +Therefore, we introduced a state-incompatibility by merklezing diverging gas +usage. + +## Secondary Limitations To Keep In Mind + +### Network Requests to External Services + +It is critical to avoid performing network requests to external services +since it is common for services to be unavailable or rate-limit. + +Imagine a service that returns exchange rates when clients query its HTTP endpoint. +This service might experience downtime or be restricted in some geographical areas. + +As a result, nodes may get diverging responses where some +get successful responses while others errors, leading to state breakage. + +### Randomness + +Randomness cannot be used in the state machine, as the state machine must be deterministic. + +**Note:** Iteration order over `map`s is non-deterministic, so to be deterministic +you must gather the keys, and sort them all prior to iterating over all values. + +### Parallelism and Shared State + +Threads and Goroutines might preempt differently in different hardware. Therefore, +they should be avoided for the sake of determinism. Additionally, it is hard +to predict when the multi-threaded state can be updated. + +### Hardware Errors + +This is out of the developer's control but is mentioned for completeness. \ No newline at end of file diff --git a/ante/ante.go b/ante/ante.go index be5ceb890c..e7eb225745 100644 --- a/ante/ante.go +++ b/ante/ante.go @@ -2,6 +2,7 @@ package ante import ( errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/ante" @@ -11,8 +12,8 @@ import ( 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/v11/types/errors" - gaiafeeante "github.com/cosmos/gaia/v11/x/globalfee/ante" + gaiaerrors "github.com/cosmos/gaia/v15/types/errors" + gaiafeeante "github.com/cosmos/gaia/v15/x/globalfee/ante" ) // HandlerOptions extend the SDK's AnteHandler options by requiring the IBC diff --git a/ante/gov_ante.go b/ante/gov_ante.go index 465123795c..4f39379747 100644 --- a/ante/gov_ante.go +++ b/ante/gov_ante.go @@ -2,14 +2,14 @@ package ante import ( errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - - gaiaerrors "github.com/cosmos/gaia/v11/types/errors" - "github.com/cosmos/cosmos-sdk/x/authz" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + + gaiaerrors "github.com/cosmos/gaia/v15/types/errors" ) // initial deposit must be greater than or equal to 10% of the minimum deposit diff --git a/ante/gov_ante_test.go b/ante/gov_ante_test.go index 79a147f200..2564bdc77c 100644 --- a/ante/gov_ante_test.go +++ b/ante/gov_ante_test.go @@ -14,17 +14,22 @@ import ( govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "github.com/cosmos/gaia/v11/ante" - gaiahelpers "github.com/cosmos/gaia/v11/app/helpers" - - gaiaapp "github.com/cosmos/gaia/v11/app" + "github.com/cosmos/gaia/v15/ante" + gaiaapp "github.com/cosmos/gaia/v15/app" + gaiahelpers "github.com/cosmos/gaia/v15/app/helpers" ) var ( - insufficientCoins = sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 100)) - minCoins = sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 1000000)) - moreThanMinCoins = sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 2500000)) - testAddr = sdk.AccAddress("test1") + insufficientCoins = sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 100)) + insufficientMultiDenomCoins = sdk.NewCoins( + sdk.NewInt64Coin(sdk.DefaultBondDenom, 100), + sdk.NewInt64Coin("ibc/example", 100)) + minCoins = sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 1000000)) + moreThanMinCoins = sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 2500000)) + moreThanMinMultiDenomCoins = sdk.NewCoins( + sdk.NewInt64Coin(sdk.DefaultBondDenom, 1000000), + sdk.NewInt64Coin("ibc/example", 100)) + testAddr = sdk.AccAddress("test1") ) type GovAnteHandlerTestSuite struct { @@ -67,7 +72,9 @@ func (s *GovAnteHandlerTestSuite) TestGlobalFeeMinimumGasFeeAnteHandler() { }{ {"Passing proposal 1", "the purpose of this proposal is to pass", govv1beta1.ProposalTypeText, testAddr, minCoins, true}, {"Passing proposal 2", "the purpose of this proposal is to pass with more coins than minimum", govv1beta1.ProposalTypeText, testAddr, moreThanMinCoins, true}, - {"Failing proposal", "the purpose of this proposal is to fail", govv1beta1.ProposalTypeText, testAddr, insufficientCoins, false}, + {"Passing proposal 3", "the purpose of this proposal is to pass with multi denom coins", govv1beta1.ProposalTypeText, testAddr, moreThanMinMultiDenomCoins, true}, + {"Failing proposal 1", "the purpose of this proposal is to fail", govv1beta1.ProposalTypeText, testAddr, insufficientCoins, false}, + {"Failing proposal 2", "the purpose of this proposal is to fail with multi denom coins", govv1beta1.ProposalTypeText, testAddr, insufficientMultiDenomCoins, false}, } decorator := ante.NewGovPreventSpamDecorator(s.app.AppCodec(), s.app.GovKeeper) diff --git a/app/app.go b/app/app.go index 6f1831cdeb..3619dad654 100644 --- a/app/app.go +++ b/app/app.go @@ -7,7 +7,7 @@ import ( "os" "path/filepath" - "github.com/cosmos/gaia/v11/app/params" + "github.com/cosmos/gaia/v15/app/params" autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" @@ -48,12 +48,11 @@ import ( "github.com/rakyll/statik/fs" "github.com/spf13/cast" - gaiaante "github.com/cosmos/gaia/v11/ante" - "github.com/cosmos/gaia/v11/app/keepers" - "github.com/cosmos/gaia/v11/app/upgrades" - v11 "github.com/cosmos/gaia/v11/app/upgrades/v11" - - "github.com/cosmos/gaia/v11/x/globalfee" + gaiaante "github.com/cosmos/gaia/v15/ante" + "github.com/cosmos/gaia/v15/app/keepers" + "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" @@ -63,7 +62,7 @@ var ( // DefaultNodeHome default home directories for the application daemon DefaultNodeHome string - Upgrades = []upgrades.Upgrade{v11.Upgrade} + Upgrades = []upgrades.Upgrade{v15.Upgrade} ) var ( @@ -353,6 +352,11 @@ func (app *GaiaApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APICo } } +// RegisterTxService allows query minimum-gas-prices in app.toml +func (app *GaiaApp) RegisterNodeService(clientCtx client.Context) { + nodeservice.RegisterNodeService(clientCtx, app.GRPCQueryRouter()) +} + // RegisterTxService implements the Application.RegisterTxService method. func (app *GaiaApp) RegisterTxService(clientCtx client.Context) { authtx.RegisterTxService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.BaseApp.Simulate, app.interfaceRegistry) @@ -368,11 +372,6 @@ func (app *GaiaApp) RegisterTendermintService(clientCtx client.Context) { ) } -// RegisterTxService allows query minimum-gas-prices in app.toml -func (app *GaiaApp) RegisterNodeService(clientCtx client.Context) { - nodeservice.RegisterNodeService(clientCtx, app.GRPCQueryRouter()) -} - // configure store loader that checks if version == upgradeHeight and applies store upgrades func (app *GaiaApp) setupUpgradeStoreLoaders() { upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() @@ -385,8 +384,10 @@ func (app *GaiaApp) setupUpgradeStoreLoaders() { } for _, upgrade := range Upgrades { + upgrade := upgrade if upgradeInfo.Name == upgrade.UpgradeName { - app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &upgrade.StoreUpgrades)) + storeUpgrades := upgrade.StoreUpgrades + app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) } } } diff --git a/app/app_test.go b/app/app_test.go index 289ea020fb..592613731f 100644 --- a/app/app_test.go +++ b/app/app_test.go @@ -5,12 +5,13 @@ import ( 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" - "github.com/stretchr/testify/require" - gaia "github.com/cosmos/gaia/v11/app" - gaiahelpers "github.com/cosmos/gaia/v11/app/helpers" + gaia "github.com/cosmos/gaia/v15/app" + gaiahelpers "github.com/cosmos/gaia/v15/app/helpers" ) type EmptyAppOptions struct{} diff --git a/app/encoding.go b/app/encoding.go index bf2a44ad9b..a6daee4921 100644 --- a/app/encoding.go +++ b/app/encoding.go @@ -3,7 +3,7 @@ package gaia import ( "github.com/cosmos/cosmos-sdk/std" - "github.com/cosmos/gaia/v11/app/params" + "github.com/cosmos/gaia/v15/app/params" ) func RegisterEncodingConfig() params.EncodingConfig { diff --git a/app/genesis.go b/app/genesis.go index 1cf906d1a6..6c7a804a25 100644 --- a/app/genesis.go +++ b/app/genesis.go @@ -3,7 +3,7 @@ package gaia import ( "encoding/json" - "github.com/cosmos/gaia/v11/app/params" + "github.com/cosmos/gaia/v15/app/params" ) // The genesis state of the blockchain is represented here as a map of raw json diff --git a/app/genesis_account.go b/app/genesis_account.go index c4bbbbe226..0c170ee589 100644 --- a/app/genesis_account.go +++ b/app/genesis_account.go @@ -28,16 +28,25 @@ type SimGenesisAccount struct { // Validate checks for errors on the vesting and module account parameters func (sga SimGenesisAccount) Validate() error { + if sga.OriginalVesting.IsAnyNil() { + return errors.New("OriginalVesting amount must not be nil") + } + if !sga.OriginalVesting.IsZero() { if sga.StartTime >= sga.EndTime { return errors.New("vesting start-time cannot be before end-time") } } + if sga.BaseAccount == nil { + return errors.New("BaseAccount must not be nil") + } + if sga.ModuleName != "" { ma := authtypes.ModuleAccount{ BaseAccount: sga.BaseAccount, Name: sga.ModuleName, Permissions: sga.ModulePermissions, } + if err := ma.Validate(); err != nil { return err } diff --git a/app/genesis_account_fuzz_test.go b/app/genesis_account_fuzz_test.go new file mode 100644 index 0000000000..79153cec0b --- /dev/null +++ b/app/genesis_account_fuzz_test.go @@ -0,0 +1,35 @@ +package gaia + +import ( + "runtime/debug" + "testing" + + "github.com/google/gofuzz" +) + +func TestFuzzGenesisAccountValidate(t *testing.T) { + if testing.Short() { + t.Skip("running in -short mode") + } + + t.Parallel() + + acct := new(SimGenesisAccount) + i := 0 + defer func() { + r := recover() + if r == nil { + return + } + + // Otherwise report on the configuration and iteration. + t.Fatalf("Failed SimGenesisAccount on iteration #%d: %#v\n\n%s\n\n%s", i, acct, r, debug.Stack()) + }() + + f := fuzz.New() + for i = 0; i < 1e5; i++ { + acct = new(SimGenesisAccount) + f.Fuzz(acct) + acct.Validate() //nolint:errcheck + } +} diff --git a/app/helpers/test_helpers.go b/app/helpers/test_helpers.go index 25e4a2dbce..dcab4eb3b1 100644 --- a/app/helpers/test_helpers.go +++ b/app/helpers/test_helpers.go @@ -23,7 +23,7 @@ import ( stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/stretchr/testify/require" - gaiaapp "github.com/cosmos/gaia/v11/app" + gaiaapp "github.com/cosmos/gaia/v15/app" ) // SimAppChainID hardcoded chainID for simulation @@ -159,17 +159,16 @@ func genesisStateWithValSet(t *testing.T, pkAny, err := codectypes.NewAnyWithValue(pk) require.NoError(t, err) validator := stakingtypes.Validator{ - OperatorAddress: sdk.ValAddress(val.Address).String(), - ConsensusPubkey: pkAny, - Jailed: false, - Status: stakingtypes.Bonded, - Tokens: bondAmt, - DelegatorShares: sdk.OneDec(), - Description: stakingtypes.Description{}, - UnbondingHeight: int64(0), - UnbondingTime: time.Unix(0, 0).UTC(), - Commission: stakingtypes.NewCommission(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()), - MinSelfDelegation: sdk.ZeroInt(), + OperatorAddress: sdk.ValAddress(val.Address).String(), + ConsensusPubkey: pkAny, + Jailed: false, + Status: stakingtypes.Bonded, + Tokens: bondAmt, + DelegatorShares: sdk.OneDec(), + Description: stakingtypes.Description{}, + UnbondingHeight: int64(0), + UnbondingTime: time.Unix(0, 0).UTC(), + Commission: stakingtypes.NewCommission(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()), } validators = append(validators, validator) delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress(), val.Address.Bytes(), sdk.OneDec())) diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index ad1aa9a94d..eb490400d7 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -31,13 +31,12 @@ import ( govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" - "github.com/cosmos/gaia/v11/x/globalfee" + "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" - 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" @@ -51,6 +50,9 @@ 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" @@ -64,9 +66,6 @@ import ( 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" - pfmrouter "github.com/strangelove-ventures/packet-forward-middleware/v7/router" - pfmrouterkeeper "github.com/strangelove-ventures/packet-forward-middleware/v7/router/keeper" - pfmroutertypes "github.com/strangelove-ventures/packet-forward-middleware/v7/router/types" // unnamed import of statik for swagger UI support _ "github.com/cosmos/cosmos-sdk/client/docs/statik" @@ -331,7 +330,6 @@ func NewAppKeeper( // Set legacy router for backwards compatibility with gov v1beta1 appKeepers.GovKeeper.SetLegacyRouter(govRouter) - // appKeepers.GovKeeper = *govKeeper appKeepers.GovKeeper = appKeepers.GovKeeper.SetHooks( appKeepers.ProviderKeeper.Hooks(), ) @@ -360,15 +358,16 @@ func NewAppKeeper( ) // PFMRouterKeeper must be created before TransferKeeper + authority := authtypes.NewModuleAddress(govtypes.ModuleName).String() appKeepers.PFMRouterKeeper = pfmrouterkeeper.NewKeeper( appCodec, appKeepers.keys[pfmroutertypes.StoreKey], - appKeepers.GetSubspace(pfmroutertypes.ModuleName), - appKeepers.TransferKeeper, + nil, // Will be zero-value here. Reference is set later on with SetTransferKeeper. appKeepers.IBCKeeper.ChannelKeeper, appKeepers.DistrKeeper, appKeepers.BankKeeper, appKeepers.IBCKeeper.ChannelKeeper, + authority, ) appKeepers.TransferKeeper = ibctransferkeeper.NewKeeper( @@ -395,7 +394,7 @@ func NewAppKeeper( // TODO: Move inline appKeepers.ICAModule = ica.NewAppModule(nil, &appKeepers.ICAHostKeeper) // TODO: Move inline - appKeepers.PFMRouterModule = pfmrouter.NewAppModule(appKeepers.PFMRouterKeeper) + appKeepers.PFMRouterModule = pfmrouter.NewAppModule(appKeepers.PFMRouterKeeper, appKeepers.GetSubspace(pfmroutertypes.ModuleName)) // create IBC module from bottom to top of stack var transferStack porttypes.IBCModule diff --git a/app/keepers/keys.go b/app/keepers/keys.go index 700ffc819b..26e967a723 100644 --- a/app/keepers/keys.go +++ b/app/keepers/keys.go @@ -1,6 +1,8 @@ package keepers import ( + routertypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types" + storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -22,8 +24,6 @@ import ( 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" - routertypes "github.com/strangelove-ventures/packet-forward-middleware/v7/router/types" - // liquiditytypes "github.com/gravity-devs/liquidity/x/liquidity/types" ) func (appKeepers *AppKeepers) GenerateKeys() { diff --git a/app/modules.go b/app/modules.go index ba3be8ab08..cee101d5ea 100644 --- a/app/modules.go +++ b/app/modules.go @@ -1,6 +1,9 @@ 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" + "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/auth" authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" @@ -52,11 +55,8 @@ import ( icsproviderclient "github.com/cosmos/interchain-security/v3/x/ccv/provider/client" providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" - "github.com/strangelove-ventures/packet-forward-middleware/v7/router" - routertypes "github.com/strangelove-ventures/packet-forward-middleware/v7/router/types" - - gaiaparams "github.com/cosmos/gaia/v11/app/params" - "github.com/cosmos/gaia/v11/x/globalfee" + gaiaappparams "github.com/cosmos/gaia/v15/app/params" + "github.com/cosmos/gaia/v15/x/globalfee" ) var maccPerms = map[string][]string{ @@ -92,6 +92,7 @@ var ModuleBasics = module.NewBasicManager( ibcclientclient.UpgradeProposalHandler, icsproviderclient.ConsumerAdditionProposalHandler, icsproviderclient.ConsumerRemovalProposalHandler, + icsproviderclient.ChangeRewardDenomsProposalHandler, }, ), sdkparams.AppModuleBasic{}, @@ -105,7 +106,7 @@ var ModuleBasics = module.NewBasicManager( evidence.AppModuleBasic{}, transfer.AppModuleBasic{}, vesting.AppModuleBasic{}, - router.AppModuleBasic{}, + pfmrouter.AppModuleBasic{}, ica.AppModuleBasic{}, globalfee.AppModule{}, icsprovider.AppModuleBasic{}, @@ -114,7 +115,7 @@ var ModuleBasics = module.NewBasicManager( func appModules( app *GaiaApp, - encodingConfig gaiaparams.EncodingConfig, + encodingConfig gaiaappparams.EncodingConfig, skipGenesisInvariants bool, ) []module.AppModule { appCodec := encodingConfig.Marshaler @@ -154,7 +155,7 @@ func appModules( // define the order of the modules for deterministic simulations func simulationModules( app *GaiaApp, - encodingConfig gaiaparams.EncodingConfig, + encodingConfig gaiaappparams.EncodingConfig, _ bool, ) []module.AppModuleSimulation { appCodec := encodingConfig.Marshaler @@ -208,7 +209,7 @@ func orderBeginBlockers() []string { ibcexported.ModuleName, ibctransfertypes.ModuleName, icatypes.ModuleName, - routertypes.ModuleName, + pfmroutertypes.ModuleName, genutiltypes.ModuleName, authz.ModuleName, feegrant.ModuleName, @@ -236,7 +237,7 @@ func orderEndBlockers() []string { ibcexported.ModuleName, ibctransfertypes.ModuleName, icatypes.ModuleName, - routertypes.ModuleName, + pfmroutertypes.ModuleName, capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, @@ -282,7 +283,7 @@ func orderInitBlockers() []string { evidencetypes.ModuleName, authz.ModuleName, feegrant.ModuleName, - routertypes.ModuleName, + pfmroutertypes.ModuleName, paramstypes.ModuleName, upgradetypes.ModuleName, vestingtypes.ModuleName, diff --git a/app/sim/sim_state.go b/app/sim/sim_state.go index fd6b8a24df..f622569cb0 100644 --- a/app/sim/sim_state.go +++ b/app/sim/sim_state.go @@ -8,15 +8,13 @@ import ( "os" "time" - "github.com/cosmos/gaia/v11/app/params" + "github.com/cosmos/gaia/v15/app/params" "cosmossdk.io/math" tmjson "github.com/cometbft/cometbft/libs/json" tmtypes "github.com/cometbft/cometbft/types" - gaia "github.com/cosmos/gaia/v11/app" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" @@ -25,6 +23,8 @@ import ( 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" + + gaia "github.com/cosmos/gaia/v15/app" ) // Simulation parameter constants diff --git a/app/sim/sim_utils.go b/app/sim/sim_utils.go index f0b3b4872f..35472831d7 100644 --- a/app/sim/sim_utils.go +++ b/app/sim/sim_utils.go @@ -9,11 +9,11 @@ import ( dbm "github.com/cometbft/cometbft-db" - gaia "github.com/cosmos/gaia/v11/app" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + + gaia "github.com/cosmos/gaia/v15/app" ) // SimulationOperations retrieves the simulation params from the provided file path diff --git a/app/sim_bench_test.go b/app/sim_bench_test.go index b83f7a2cdc..c6e1f2e083 100644 --- a/app/sim_bench_test.go +++ b/app/sim_bench_test.go @@ -10,12 +10,12 @@ import ( simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli" "github.com/stretchr/testify/require" - gaia "github.com/cosmos/gaia/v11/app" + gaia "github.com/cosmos/gaia/v15/app" simulation2 "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/cosmos/gaia/v11/app/sim" + "github.com/cosmos/gaia/v15/app/sim" ) // Profile with: diff --git a/app/sim_test.go b/app/sim_test.go index 4605b3441e..5547c5811f 100644 --- a/app/sim_test.go +++ b/app/sim_test.go @@ -20,10 +20,10 @@ import ( simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli" "github.com/stretchr/testify/require" - gaia "github.com/cosmos/gaia/v11/app" + gaia "github.com/cosmos/gaia/v15/app" // "github.com/cosmos/gaia/v11/app/helpers" // "github.com/cosmos/gaia/v11/app/params" - "github.com/cosmos/gaia/v11/app/sim" + "github.com/cosmos/gaia/v15/app/sim" ) // AppChainID hardcoded chainID for simulation diff --git a/app/upgrades/types.go b/app/upgrades/types.go index a4b8c3ac3e..06ba7265b6 100644 --- a/app/upgrades/types.go +++ b/app/upgrades/types.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - "github.com/cosmos/gaia/v11/app/keepers" + "github.com/cosmos/gaia/v15/app/keepers" ) // Upgrade defines a struct containing necessary fields that a SoftwareUpgradeProposal diff --git a/app/upgrades/v10/constants.go b/app/upgrades/v10/constants.go index c5884c1c0d..04cfab5f79 100644 --- a/app/upgrades/v10/constants.go +++ b/app/upgrades/v10/constants.go @@ -1,7 +1,7 @@ package v10 import ( - "github.com/cosmos/gaia/v11/app/upgrades" + "github.com/cosmos/gaia/v15/app/upgrades" ) const ( diff --git a/app/upgrades/v10/upgrades.go b/app/upgrades/v10/upgrades.go index 908561bf1e..3e362c138b 100644 --- a/app/upgrades/v10/upgrades.go +++ b/app/upgrades/v10/upgrades.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - "github.com/cosmos/gaia/v11/app/keepers" + "github.com/cosmos/gaia/v15/app/keepers" ) func CreateUpgradeHandler( diff --git a/app/upgrades/v11/constants.go b/app/upgrades/v11/constants.go index 13055c67ee..e9e3685cd0 100644 --- a/app/upgrades/v11/constants.go +++ b/app/upgrades/v11/constants.go @@ -1,7 +1,7 @@ package v11 import ( - "github.com/cosmos/gaia/v11/app/upgrades" + "github.com/cosmos/gaia/v15/app/upgrades" ) const ( diff --git a/app/upgrades/v11/upgrades.go b/app/upgrades/v11/upgrades.go index f01ba40b2b..ff2380114a 100644 --- a/app/upgrades/v11/upgrades.go +++ b/app/upgrades/v11/upgrades.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - "github.com/cosmos/gaia/v11/app/keepers" + "github.com/cosmos/gaia/v15/app/keepers" ) func CreateUpgradeHandler( diff --git a/app/upgrades/v12/constants.go b/app/upgrades/v12/constants.go new file mode 100644 index 0000000000..5f255c844e --- /dev/null +++ b/app/upgrades/v12/constants.go @@ -0,0 +1,30 @@ +package v12 + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/cosmos/gaia/v15/app/upgrades" +) + +const ( + // UpgradeName defines the on-chain upgrade name. + UpgradeName = "v12" +) + +var ( + // The ValidatorBondFactor dictates the cap on the liquid shares + // for a validator - determined as a multiple to their validator bond + // (e.g. ValidatorBondShares = 1000, BondFactor = 250 -> LiquidSharesCap: 250,000) + ValidatorBondFactor = sdk.NewDec(250) + // GlobalLiquidStakingCap represents a cap on the portion of stake that + // comes from liquid staking providers for a specific validator + ValidatorLiquidStakingCap = sdk.MustNewDecFromStr("0.5") // 50% + // GlobalLiquidStakingCap represents the percentage cap on + // the portion of a chain's total stake can be liquid + GlobalLiquidStakingCap = sdk.MustNewDecFromStr("0.25") // 25% +) + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + CreateUpgradeHandler: CreateUpgradeHandler, +} diff --git a/app/upgrades/v12/upgrades.go b/app/upgrades/v12/upgrades.go new file mode 100644 index 0000000000..a30204a0ab --- /dev/null +++ b/app/upgrades/v12/upgrades.go @@ -0,0 +1,35 @@ +package v12 + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + + "github.com/cosmos/gaia/v15/app/keepers" +) + +func CreateUpgradeHandler( + mm *module.Manager, + configurator module.Configurator, + keepers *keepers.AppKeepers, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + ctx.Logger().Info("Starting module migrations...") + + vm, err := mm.RunMigrations(ctx, configurator, vm) + if err != nil { + return vm, err + } + + // Set liquid staking module parameters + params := keepers.StakingKeeper.GetParams(ctx) + params.ValidatorBondFactor = ValidatorBondFactor + params.ValidatorLiquidStakingCap = ValidatorLiquidStakingCap + params.GlobalLiquidStakingCap = GlobalLiquidStakingCap + + keepers.StakingKeeper.SetParams(ctx, params) + + ctx.Logger().Info("Upgrade complete") + return vm, err + } +} diff --git a/app/upgrades/v13/constants.go b/app/upgrades/v13/constants.go new file mode 100644 index 0000000000..dce0714f35 --- /dev/null +++ b/app/upgrades/v13/constants.go @@ -0,0 +1,15 @@ +package v13 + +import ( + "github.com/cosmos/gaia/v15/app/upgrades" +) + +const ( + // UpgradeName defines the on-chain upgrade name. + UpgradeName = "v13" +) + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + CreateUpgradeHandler: CreateUpgradeHandler, +} diff --git a/app/upgrades/v13/upgrades.go b/app/upgrades/v13/upgrades.go new file mode 100644 index 0000000000..ce2cdb6cc6 --- /dev/null +++ b/app/upgrades/v13/upgrades.go @@ -0,0 +1,27 @@ +package v13 + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + + "github.com/cosmos/gaia/v15/app/keepers" +) + +func CreateUpgradeHandler( + mm *module.Manager, + configurator module.Configurator, + keepers *keepers.AppKeepers, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + ctx.Logger().Info("Starting module migrations...") + + vm, err := mm.RunMigrations(ctx, configurator, vm) + if err != nil { + return vm, err + } + + ctx.Logger().Info("Upgrade complete") + return vm, err + } +} diff --git a/app/upgrades/v14/constants.go b/app/upgrades/v14/constants.go new file mode 100644 index 0000000000..7265314293 --- /dev/null +++ b/app/upgrades/v14/constants.go @@ -0,0 +1,15 @@ +package v14 + +import ( + "github.com/cosmos/gaia/v15/app/upgrades" +) + +const ( + // UpgradeName defines the on-chain upgrade name. + UpgradeName = "v14" +) + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + CreateUpgradeHandler: CreateUpgradeHandler, +} diff --git a/app/upgrades/v14/upgrades.go b/app/upgrades/v14/upgrades.go new file mode 100644 index 0000000000..9dfc1b0f61 --- /dev/null +++ b/app/upgrades/v14/upgrades.go @@ -0,0 +1,32 @@ +package v14 + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + + "github.com/cosmos/gaia/v15/app/keepers" +) + +func CreateUpgradeHandler( + mm *module.Manager, + configurator module.Configurator, + keepers *keepers.AppKeepers, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + ctx.Logger().Info("Starting module migrations...") + + vm, err := mm.RunMigrations(ctx, configurator, vm) + if err != nil { + return vm, err + } + + // Set the minimum height of a valid consumer equivocation evidence + // for the existing consumer chains: neutron-1 and stride-1 + keepers.ProviderKeeper.SetEquivocationEvidenceMinHeight(ctx, "neutron-1", 4552189) + keepers.ProviderKeeper.SetEquivocationEvidenceMinHeight(ctx, "stride-1", 6375035) + + ctx.Logger().Info("Upgrade complete") + return vm, err + } +} diff --git a/app/upgrades/v15/constants.go b/app/upgrades/v15/constants.go new file mode 100644 index 0000000000..18216ab7dd --- /dev/null +++ b/app/upgrades/v15/constants.go @@ -0,0 +1,15 @@ +package v15 + +import ( + "github.com/cosmos/gaia/v15/app/upgrades" +) + +const ( + // UpgradeName defines the on-chain upgrade name. + UpgradeName = "v15" +) + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + CreateUpgradeHandler: CreateUpgradeHandler, +} diff --git a/app/upgrades/v15/upgrades.go b/app/upgrades/v15/upgrades.go new file mode 100644 index 0000000000..ee9c0b485d --- /dev/null +++ b/app/upgrades/v15/upgrades.go @@ -0,0 +1,27 @@ +package v15 + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + + "github.com/cosmos/gaia/v15/app/keepers" +) + +func CreateUpgradeHandler( + mm *module.Manager, + configurator module.Configurator, + keepers *keepers.AppKeepers, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + ctx.Logger().Info("Starting module migrations...") + + vm, err := mm.RunMigrations(ctx, configurator, vm) + if err != nil { + return vm, err + } + + ctx.Logger().Info("Upgrade complete") + return vm, err + } +} diff --git a/app/upgrades/v7/constants.go b/app/upgrades/v7/constants.go index b5ab2db967..803800da45 100644 --- a/app/upgrades/v7/constants.go +++ b/app/upgrades/v7/constants.go @@ -6,7 +6,9 @@ import ( store "github.com/cosmos/cosmos-sdk/store/types" icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" - "github.com/cosmos/gaia/v11/app/upgrades" + store "github.com/cosmos/cosmos-sdk/store/types" + + "github.com/cosmos/gaia/v15/app/upgrades" ) const ( diff --git a/app/upgrades/v7/upgrades.go b/app/upgrades/v7/upgrades.go index 3d7e9f2b68..f3d86567ca 100644 --- a/app/upgrades/v7/upgrades.go +++ b/app/upgrades/v7/upgrades.go @@ -11,7 +11,11 @@ import ( icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" - "github.com/cosmos/gaia/v11/app/keepers" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + + "github.com/cosmos/gaia/v15/app/keepers" ) func CreateUpgradeHandler( diff --git a/app/upgrades/v8/constants.go b/app/upgrades/v8/constants.go index 827076bc27..a5507ed8d2 100644 --- a/app/upgrades/v8/constants.go +++ b/app/upgrades/v8/constants.go @@ -5,8 +5,8 @@ package v8 import ( store "github.com/cosmos/cosmos-sdk/store/types" - "github.com/cosmos/gaia/v11/app/upgrades" - "github.com/cosmos/gaia/v11/x/globalfee" + "github.com/cosmos/gaia/v15/app/upgrades" + "github.com/cosmos/gaia/v15/x/globalfee" ) const ( diff --git a/app/upgrades/v8/upgrades.go b/app/upgrades/v8/upgrades.go index 898b1c3c7e..850ede2be5 100644 --- a/app/upgrades/v8/upgrades.go +++ b/app/upgrades/v8/upgrades.go @@ -15,7 +15,7 @@ import ( icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" ibcchanneltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - "github.com/cosmos/gaia/v11/app/keepers" + "github.com/cosmos/gaia/v15/app/keepers" ) func FixBankMetadata(ctx sdk.Context, keepers *keepers.AppKeepers) error { diff --git a/app/upgrades/v9/constants.go b/app/upgrades/v9/constants.go index a63bfdad09..d0b8c792a3 100644 --- a/app/upgrades/v9/constants.go +++ b/app/upgrades/v9/constants.go @@ -6,7 +6,9 @@ import ( store "github.com/cosmos/cosmos-sdk/store/types" ccvprovider "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" - "github.com/cosmos/gaia/v11/app/upgrades" + store "github.com/cosmos/cosmos-sdk/store/types" + + "github.com/cosmos/gaia/v15/app/upgrades" ) const ( diff --git a/app/upgrades/v9/upgrades.go b/app/upgrades/v9/upgrades.go index 5cdb6a59fa..0f26347fdc 100644 --- a/app/upgrades/v9/upgrades.go +++ b/app/upgrades/v9/upgrades.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - "github.com/cosmos/gaia/v11/app/keepers" + "github.com/cosmos/gaia/v15/app/keepers" ) func CreateUpgradeHandler( diff --git a/cmd/gaiad/cmd/bech32_convert.go b/cmd/gaiad/cmd/bech32_convert.go index ab16076a39..283592a54a 100644 --- a/cmd/gaiad/cmd/bech32_convert.go +++ b/cmd/gaiad/cmd/bech32_convert.go @@ -3,9 +3,9 @@ package cmd import ( "fmt" - addressutil "github.com/cosmos/gaia/v11/pkg/address" - "github.com/spf13/cobra" + + addressutil "github.com/cosmos/gaia/v15/pkg/address" ) var flagBech32Prefix = "prefix" diff --git a/cmd/gaiad/cmd/genaccounts.go b/cmd/gaiad/cmd/genaccounts.go deleted file mode 100644 index 473e3f85a6..0000000000 --- a/cmd/gaiad/cmd/genaccounts.go +++ /dev/null @@ -1,194 +0,0 @@ -package cmd - -// -// import ( -// "bufio" -// "encoding/json" -// "errors" -// "fmt" -// -// "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" -// "github.com/spf13/cobra" -//) -// -// 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) -// 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 = k.GetAddress() -// } -// -// 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 a9bb5cca8d..7c0e243cbe 100644 --- a/cmd/gaiad/cmd/root.go +++ b/cmd/gaiad/cmd/root.go @@ -39,8 +39,8 @@ import ( "github.com/spf13/cast" "github.com/spf13/cobra" - gaia "github.com/cosmos/gaia/v11/app" - "github.com/cosmos/gaia/v11/app/params" + gaia "github.com/cosmos/gaia/v15/app" + "github.com/cosmos/gaia/v15/app/params" ) // NewRootCmd creates a new root command for simd. It is called once in the diff --git a/cmd/gaiad/cmd/root_test.go b/cmd/gaiad/cmd/root_test.go index b30bca9382..52a61bc988 100644 --- a/cmd/gaiad/cmd/root_test.go +++ b/cmd/gaiad/cmd/root_test.go @@ -3,11 +3,12 @@ package cmd_test import ( "testing" - svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" "github.com/stretchr/testify/require" - app "github.com/cosmos/gaia/v11/app" - "github.com/cosmos/gaia/v11/cmd/gaiad/cmd" + svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" + + app "github.com/cosmos/gaia/v15/app" + "github.com/cosmos/gaia/v15/cmd/gaiad/cmd" ) func TestRootCmdConfig(t *testing.T) { diff --git a/cmd/gaiad/main.go b/cmd/gaiad/main.go index 542d2940da..06aa0743a7 100644 --- a/cmd/gaiad/main.go +++ b/cmd/gaiad/main.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" - app "github.com/cosmos/gaia/v11/app" - "github.com/cosmos/gaia/v11/cmd/gaiad/cmd" + app "github.com/cosmos/gaia/v15/app" + "github.com/cosmos/gaia/v15/cmd/gaiad/cmd" ) func main() { diff --git a/contrib/scripts/local-gaia.sh b/contrib/scripts/local-gaia.sh new file mode 100755 index 0000000000..c307b5c8e7 --- /dev/null +++ b/contrib/scripts/local-gaia.sh @@ -0,0 +1,65 @@ +#!/bin/bash +set -eux + +# User balance of stake tokens +USER_COINS="100000000000stake" +# Amount of stake tokens staked +STAKE="100000000stake" +# Node IP address +NODE_IP="127.0.0.1" + +# Home directory +HOME_DIR="/Users/msalopek" + +# Validator moniker +MONIKER="coordinator" + +# Validator directory +PROV_NODE_DIR=${HOME_DIR}/provider-${MONIKER} + +# Coordinator key +PROV_KEY=${MONIKER}-key + + +# Clean start +pkill -f gaiad &> /dev/null || true +rm -rf ${PROV_NODE_DIR} + +# Build file and node directory structure +gaiad init $MONIKER --chain-id provider --home ${PROV_NODE_DIR} + jq ".app_state.gov.voting_params.voting_period = \"20s\" | .app_state.staking.params.unbonding_time = \"86400s\"" \ + ${PROV_NODE_DIR}/config/genesis.json > \ + ${PROV_NODE_DIR}/edited_genesis.json && mv ${PROV_NODE_DIR}/edited_genesis.json ${PROV_NODE_DIR}/config/genesis.json + +sleep 1 + +# Create account keypair +gaiad keys add $PROV_KEY --home ${PROV_NODE_DIR} --keyring-backend test --output json > ${PROV_NODE_DIR}/${PROV_KEY}.json 2>&1 +sleep 1 + +# Add stake to user +PROV_ACCOUNT_ADDR=$(jq -r '.address' ${PROV_NODE_DIR}/${PROV_KEY}.json) +gaiad add-genesis-account $PROV_ACCOUNT_ADDR $USER_COINS --home ${PROV_NODE_DIR} --keyring-backend test +sleep 1 + + +# Stake 1/1000 user's coins +gaiad gentx $PROV_KEY $STAKE --chain-id provider --home ${PROV_NODE_DIR} --keyring-backend test --moniker $MONIKER +sleep 1 + +gaiad collect-gentxs --home ${PROV_NODE_DIR} --gentx-dir ${PROV_NODE_DIR}/config/gentx/ +sleep 1 + +sed -i -r "/node =/ s/= .*/= \"tcp:\/\/${NODE_IP}:26658\"/" ${PROV_NODE_DIR}/config/client.toml +sed -i -r 's/timeout_commit = "5s"/timeout_commit = "3s"/g' ${PROV_NODE_DIR}/config/config.toml +sed -i -r 's/timeout_propose = "3s"/timeout_propose = "1s"/g' ${PROV_NODE_DIR}/config/config.toml + + +# Start gaia +gaiad start \ + --home ${PROV_NODE_DIR} \ + --rpc.laddr tcp://${NODE_IP}:26658 \ + --grpc.address ${NODE_IP}:9091 \ + --address tcp://${NODE_IP}:26655 \ + --p2p.laddr tcp://${NODE_IP}:26656 \ + --grpc-web.enable=false &> ${PROV_NODE_DIR}/logs diff --git a/contrib/scripts/upgrade_test_scripts/run_gaia.sh b/contrib/scripts/upgrade_test_scripts/run_gaia.sh new file mode 100755 index 0000000000..9859bb8261 --- /dev/null +++ b/contrib/scripts/upgrade_test_scripts/run_gaia.sh @@ -0,0 +1,93 @@ +#!/bin/sh + +set -o errexit -o nounset + +# find the highest upgrade version number($UPGRADE_VERSION_NUMBER) within the 'app/upgrades' dir. +# the highest upgrade version is used to propose upgrade and create /cosmovisor/upgrades/$UPGRADE_VERSION/bin dir. +UPGRADES_DIR=$(realpath ./app/upgrades) +UPGRADE_VERSION_NUMBER=0 + +for dir in "$UPGRADES_DIR"/*; do + if [ -d "$dir" ]; then + DIR_NAME=$(basename "$dir") + VERSION_NUMBER="${DIR_NAME#v}" + if [ "$VERSION_NUMBER" -gt "$UPGRADE_VERSION_NUMBER" ]; then + UPGRADE_VERSION_NUMBER=$VERSION_NUMBER + fi + fi +done + +if [ -n "$UPGRADE_VERSION_NUMBER" ]; then + echo "Upgrade to version: $UPGRADE_VERSION_NUMBER" +else + echo "No upgrade version found in app/upgrades." +fi + +UPGRADE_VERSION=v$UPGRADE_VERSION_NUMBER +NODE_HOME=$(realpath ./build/.gaia) +echo "NODE_HOME = ${NODE_HOME}" +BINARY=$NODE_HOME/cosmovisor/genesis/bin/gaiad +echo "BINARY = ${BINARY}" +CHAINID=cosmoshub-4 + +USER_MNEMONIC="abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon art" + +if ! test -f "./build/gaiadold"; then + echo "old gaiad binary does not exist" + exit +fi + +rm -rf ./build/.gaia + +mkdir -p "$NODE_HOME"/cosmovisor/genesis/bin +cp ./build/gaiadold "$NODE_HOME"/cosmovisor/genesis/bin/gaiad +$BINARY init upgrader --chain-id $CHAINID --home "$NODE_HOME" + +if ! test -f "./build/gaiadnew"; then + echo "new gaiad binary does not exist" + exit +fi + +mkdir -p "$NODE_HOME"/cosmovisor/upgrades/$UPGRADE_VERSION/bin +cp ./build/gaiadnew "$NODE_HOME"/cosmovisor/upgrades/$UPGRADE_VERSION/bin/gaiad + +GOPATH=$(go env GOPATH) + +export DAEMON_NAME=gaiad +export DAEMON_HOME=$NODE_HOME +COSMOVISOR=$GOPATH/bin/cosmovisor + +$BINARY config chain-id $CHAINID --home $NODE_HOME +$BINARY config keyring-backend test --home $NODE_HOME +tmp=$(mktemp) + +# add bank part of genesis +jq --argjson foo "$(jq -c '.' contrib/denom.json)" '.app_state.bank.denom_metadata = $foo' $NODE_HOME/config/genesis.json >"$tmp" && mv "$tmp" $NODE_HOME/config/genesis.json + +# replace default stake token with uatom +sed -i -e '/total_liquid_staked_tokens/!s/stake/uatom/g' $NODE_HOME/config/genesis.json + +# min deposition amount (this one isn't working) +sed -i -e 's/"amount": "10000000",/"amount": "1",/g' $NODE_HOME/config/genesis.json +# min voting power that a proposal requires in order to be a valid proposal +sed -i -e 's/"quorum": "0.334000000000000000",/"quorum": "0.000000000000000001",/g' $NODE_HOME/config/genesis.json +# the minimum proportion of "yes" votes requires for the proposal to pass +sed -i -e 's/"threshold": "0.500000000000000000",/"threshold": "0.000000000000000001",/g' $NODE_HOME/config/genesis.json +# voting period to 30s +sed -i -e 's/"voting_period": "172800s"/"voting_period": "30s"/g' $NODE_HOME/config/genesis.json + +echo $USER_MNEMONIC | $BINARY --home $NODE_HOME keys add val --recover --keyring-backend=test +$BINARY add-genesis-account val 10000000000000000000000000uatom --home $NODE_HOME --keyring-backend test +$BINARY gentx val 1000000000uatom --home $NODE_HOME --chain-id $CHAINID +$BINARY collect-gentxs --home $NODE_HOME + +sed -i.bak'' 's/minimum-gas-prices = ""/minimum-gas-prices = "0uatom"/' $NODE_HOME/config/app.toml + +perl -i~ -0777 -pe 's/# Enable defines if the API server should be enabled. +enable = false/# Enable defines if the API server should be enabled. +enable = true/g' $NODE_HOME/config/app.toml + +pwd +ls $NODE_HOME + +$COSMOVISOR run start --home $NODE_HOME --x-crisis-skip-assert-invariants >log.out 2>&1 & diff --git a/contrib/scripts/upgrade_test_scripts/run_upgrade_commands.sh b/contrib/scripts/upgrade_test_scripts/run_upgrade_commands.sh new file mode 100755 index 0000000000..454cf07e83 --- /dev/null +++ b/contrib/scripts/upgrade_test_scripts/run_upgrade_commands.sh @@ -0,0 +1,96 @@ +#!/bin/sh + +set -o errexit -o nounset + +UPGRADES_DIR=$(realpath ./app/upgrades) +UPGRADE_VERSION_NUMBER=0 + +for dir in "$UPGRADES_DIR"/*; do + if [ -d "$dir" ]; then + DIR_NAME=$(basename "$dir") + VERSION_NUMBER="${DIR_NAME#v}" + if [ "$VERSION_NUMBER" -gt "$UPGRADE_VERSION_NUMBER" ]; then + UPGRADE_VERSION_NUMBER=$VERSION_NUMBER + fi + fi +done + +if [ -n "$UPGRADE_VERSION_NUMBER" ]; then + echo "Upgrade to version: $UPGRADE_VERSION_NUMBER" +else + echo "No upgrade version found in app/upgrades." +fi + +UPGRADE_VERSION=v$UPGRADE_VERSION_NUMBER +UPGRADE_HEIGHT=$1 + +if [ -z "$1" ]; then + echo "Need to add an upgrade height" + exit 1 +fi + +NODE_HOME=$(realpath ./build/.gaia) + +echo "NODE_HOME = ${NODE_HOME}" + +BINARY=$NODE_HOME/cosmovisor/genesis/bin/gaiad +echo "BINARY = ${BINARY}" + +$BINARY version + +USER_MNEMONIC="abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon art" +CHAINID=cosmoshub-4 + +if test -f "$BINARY"; then + + echo "wait 10 seconds for blockchain to start" + sleep 10 + + $BINARY config chain-id $CHAINID --home $NODE_HOME + $BINARY config output json --home $NODE_HOME + $BINARY config keyring-backend test --home $NODE_HOME + $BINARY config --home $NODE_HOME + + key=$($BINARY keys show val --home $NODE_HOME) + if [ -z "$key" ]; then + echo $USER_MNEMONIC | $BINARY --home $NODE_HOME keys add val --recover --keyring-backend=test + fi + + echo "\n" + echo "Submitting proposal... \n" + $BINARY tx gov submit-proposal software-upgrade $UPGRADE_VERSION \ + --title $UPGRADE_VERSION \ + --deposit 10000000uatom \ + --upgrade-height $UPGRADE_HEIGHT \ + --upgrade-info "upgrade" \ + --description "upgrade" \ + --fees 400uatom \ + --from val \ + --keyring-backend test \ + --chain-id $CHAINID \ + --home $NODE_HOME \ + --node tcp://localhost:26657 \ + --yes + echo "Done \n" + + sleep 6 + echo "Casting vote... \n" + + $BINARY tx gov vote 1 yes \ + --from val \ + --keyring-backend test \ + --chain-id $CHAINID \ + --home $NODE_HOME \ + --fees 400uatom \ + --node tcp://localhost:26657 \ + --yes + + echo "Done \n" + + $BINARY q gov proposals \ + --home $NODE_HOME \ + --node tcp://localhost:26657 + +else + echo "Please build old gaia binary and move to ./build/gaiadold" +fi diff --git a/contrib/scripts/upgrade_test_scripts/v12/run_gaia_v11.sh b/contrib/scripts/upgrade_test_scripts/v12/run_gaia_v11.sh new file mode 100755 index 0000000000..3804078080 --- /dev/null +++ b/contrib/scripts/upgrade_test_scripts/v12/run_gaia_v11.sh @@ -0,0 +1,73 @@ +#!/bin/sh + +set -o errexit -o nounset + +NODE_HOME=$(realpath ./build/.gaia) +echo "NODE_HOME = ${NODE_HOME}" +BINARY=$NODE_HOME/cosmovisor/genesis/bin/gaiad +echo "BINARY = ${BINARY}" +CHAINID=cosmoshub-4 + +USER_MNEMONIC="abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon art" + +if ! test -f "./build/gaiad11"; then + echo "gaiad v11 does not exist" + exit +fi + + +rm -rf ./build/.gaia + +mkdir -p "$NODE_HOME"/cosmovisor/genesis/bin +cp ./build/gaiad11 "$NODE_HOME"/cosmovisor/genesis/bin/gaiad +$BINARY init upgrader --chain-id $CHAINID --home "$NODE_HOME" + + +if ! test -f "./build/gaiad12"; then + echo "gaiad v12 does not exist" + exit +fi + +mkdir -p "$NODE_HOME"/cosmovisor/upgrades/v12/bin +cp ./build/gaiad12 "$NODE_HOME"/cosmovisor/upgrades/v12/bin/gaiad + +GOPATH=$(go env GOPATH) + +export DAEMON_NAME=gaiad +export DAEMON_HOME=$NODE_HOME +COSMOVISOR=$GOPATH/bin/cosmovisor + + +$BINARY config chain-id $CHAINID --home $NODE_HOME +$BINARY config keyring-backend test --home $NODE_HOME +tmp=$(mktemp) + +# add bank part of genesis +jq --argjson foo "$(jq -c '.' contrib/denom.json)" '.app_state.bank.denom_metadata = $foo' $NODE_HOME/config/genesis.json > "$tmp" && mv "$tmp" $NODE_HOME/config/genesis.json + +# replace default stake token with uatom +sed -i -e 's/stake/uatom/g' $NODE_HOME/config/genesis.json +# min deposition amount (this one isn't working) +sed -i -e 's%"amount": "10000000",%"amount": "1",%g' $NODE_HOME/config/genesis.json +# min voting power that a proposal requires in order to be a valid proposal +sed -i -e 's%"quorum": "0.334000000000000000",%"quorum": "0.000000000000000001",%g' $NODE_HOME/config/genesis.json +# the minimum proportion of "yes" votes requires for the proposal to pass +sed -i -e 's%"threshold": "0.500000000000000000",%"threshold": "0.000000000000000001",%g' $NODE_HOME/config/genesis.json +# voting period to 30s +sed -i -e 's%"voting_period": "172800s"%"voting_period": "30s"%g' $NODE_HOME/config/genesis.json + +echo $USER_MNEMONIC | $BINARY --home $NODE_HOME keys add val --recover --keyring-backend=test +$BINARY add-genesis-account val 10000000000000000000000000uatom --home $NODE_HOME --keyring-backend test +$BINARY gentx val 1000000000uatom --home $NODE_HOME --chain-id $CHAINID +$BINARY collect-gentxs --home $NODE_HOME + +sed -i.bak'' 's/minimum-gas-prices = ""/minimum-gas-prices = "0uatom"/' $NODE_HOME/config/app.toml + +perl -i~ -0777 -pe 's/# Enable defines if the API server should be enabled. +enable = false/# Enable defines if the API server should be enabled. +enable = true/g' $NODE_HOME/config/app.toml + +pwd +ls $NODE_HOME + +$COSMOVISOR run start --home $NODE_HOME --x-crisis-skip-assert-invariants > v11.out 2>&1 & diff --git a/contrib/scripts/upgrade_test_scripts/v12/run_upgrade_commands_v12.sh b/contrib/scripts/upgrade_test_scripts/v12/run_upgrade_commands_v12.sh new file mode 100755 index 0000000000..12c110f02d --- /dev/null +++ b/contrib/scripts/upgrade_test_scripts/v12/run_upgrade_commands_v12.sh @@ -0,0 +1,73 @@ +#!/bin/sh + +set -o errexit -o nounset + +UPGRADE_HEIGHT=$1 + +if [ -z "$1" ]; then +echo "Need to add an upgrade height" +exit 1 +fi + +NODE_HOME=$(realpath ./build/.gaia) + +echo "NODE_HOME = ${NODE_HOME}" + +BINARY=$NODE_HOME/cosmovisor/genesis/bin/gaiad +echo "BINARY = ${BINARY}" + +$BINARY version + +USER_MNEMONIC="abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon art" +CHAINID=cosmoshub-4 + +if test -f "$BINARY"; then + +echo "wait 10 seconds for blockchain to start" +sleep 10 + +$BINARY config chain-id $CHAINID --home $NODE_HOME +$BINARY config output json --home $NODE_HOME +$BINARY config keyring-backend test --home $NODE_HOME +$BINARY config --home $NODE_HOME + +key=$($BINARY keys show val --home $NODE_HOME) +if [ -z "$key" ]; then +echo $USER_MNEMONIC | $BINARY --home $NODE_HOME keys add val --recover --keyring-backend=test +fi + + +echo "\n" +echo "Submitting proposal... \n" +$BINARY tx gov submit-proposal software-upgrade v12 \ +--title v12 \ +--deposit 10000000uatom \ +--upgrade-height $UPGRADE_HEIGHT \ +--upgrade-info "upgrade to v12" \ +--description "upgrade to v12" \ +--fees 400uatom \ +--from val \ +--keyring-backend test \ +--chain-id $CHAINID \ +--home $NODE_HOME \ +--node tcp://localhost:26657 \ +--yes +echo "Done \n" + +sleep 6 +echo "Casting vote... \n" + +$BINARY tx gov vote 1 yes \ +--from val \ +--keyring-backend test \ +--chain-id $CHAINID \ +--home $NODE_HOME \ +--fees 400uatom \ +--node tcp://localhost:26657 \ +--yes + +echo "Done \n" + +else +echo "Please build gaia v11 and move to ./build/gaiad11" +fi diff --git a/docs/architecture/PROCESS.md b/docs/architecture/PROCESS.md new file mode 100644 index 0000000000..a547cc2918 --- /dev/null +++ b/docs/architecture/PROCESS.md @@ -0,0 +1,57 @@ +# ADR Creation Process + +1. Copy the `adr-template.md` file. Use the following filename pattern: `adr-next_number-title.md` +2. Create a draft Pull Request and solicit input from the stewarding team, if you want to get an early feedback. +3. Make sure that the problem, the context and a recommended solution is clear and well documented. Be sure to document alternate solution spaces and give reasons why they have been discarded. +4. Add an entry to a list in the README file [Table of Contents](./README.md#adr-table-of-contents). +5. Create a Pull Request to propose a new ADR. + +## ADR life cycle + +ADR creation is an **iterative** process. Instead of trying to solve all decisions in a single ADR pull request, we MUST firstly understand the problem and collect feedback through a GitHub Issue. + +1. Every proposal SHOULD start with a new GitHub Issue or be a result of existing Issues. The Issue should contain just a brief proposal summary. + +2. Once the motivation is validated, a GitHub Pull Request (PR) is created with a new document based on the `adr-template.md`. + +3. An ADR doesn't have to arrive to `main` with an _accepted_ status in a single PR. If the motivation is clear and the solution is sound, we SHOULD be able to merge it and keep a _proposed_ status. It's preferable to have an iterative approach rather than long, not merged Pull Requests. + +4. If a _proposed_ ADR is merged, then it should clearly document outstanding issues either in ADR document notes or in a GitHub Issue. + +5. The PR SHOULD always be merged. In the case of a faulty ADR, we still prefer to merge it with a _rejected_ status. The only time the ADR SHOULD NOT be merged is if the author abandons it. + +6. Merged ADRs SHOULD NOT be deleted. + +### ADR status + +Status has two components: + +```text +{CONSENSUS STATUS} {IMPLEMENTATION STATUS} +``` + +IMPLEMENTATION STATUS is either `Implemented` or `Not Implemented`. + +#### Consensus Status + +```mermaid +flowchart TD + A[DRAFT] --> B[PROPOSED] + B --> C[LAST CALL YYYY-MM-DD] + B --> D[ABANDONED] + C --> E[ACCEPTED or REJECTED] + E --> F[SUPERSEDED by ADR-xxx] +``` + +* `DRAFT`: [optional] an ADR which is work in progress, not being ready for a general review. This is to present an early work and get an early feedback in a Draft Pull Request form. +* `PROPOSED`: an ADR covering a full solution architecture and still in the review - project stakeholders haven't reached an agreement yet. +* `LAST CALL `: [optional] clear notify that we are close to accept updates. Changing a status to `LAST CALL` means that social consensus (of Cosmos SDK maintainers) has been reached and we still want to give it a time to let the community react or analyze. +* `ACCEPTED`: ADR which will represent a currently implemented or to be implemented architecture design. +* `REJECTED`: ADR can go from PROPOSED or ACCEPTED to rejected if the consensus among project stakeholders will decide so. +* `SUPERSEEDED by ADR-xxx`: ADR which has been superseded by a new ADR. +* `ABANDONED`: the ADR is no longer pursued by the original authors. + +## Language used in ADR + +* The context/background should be written in the present tense. +* Avoid using a first, personal form. diff --git a/docs/architecture/README.md b/docs/architecture/README.md new file mode 100644 index 0000000000..bbf11bd7e2 --- /dev/null +++ b/docs/architecture/README.md @@ -0,0 +1,64 @@ + + +# Architecture Decision Records (ADR) + +This is a location to record all high-level architecture decisions for new feature and module proposals in the Cosmos Hub. + +An Architectural Decision (**AD**) is a software design choice that addresses a functional or non-functional requirement that is architecturally significant. +An Architecturally Significant Requirement (**ASR**) is a requirement that has a measurable effect on a software system’s architecture and quality. +An Architectural Decision Record (**ADR**) captures a single AD, such as often done when writing personal notes or meeting minutes; the collection of ADRs created and maintained in a project constitute its decision log. All these are within the topic of Architectural Knowledge Management (AKM). + +You can read more about the ADR concept [here](https://adr.github.io/). + +## Rationale + +ADRs are intended to be the primary mechanism for proposing new feature designs and new processes, for collecting community input on an issue, and for documenting the design decisions. +An ADR should provide: + +- Context on the relevant goals and the current state +- Proposed changes to achieve the goals +- Summary of pros and cons +- Discarded solution spaces and why they were discarded +- References +- Changelog + +Note the distinction between an ADR and a spec. The ADR provides the context, intuition, reasoning, and +justification for a change in architecture, or for the architecture of something +new. The spec is much more compressed and streamlined summary of everything as +it stands today. + +If recorded decisions turn out to be lacking, convene a discussion, record the new decisions here, and then modify the code to match. + +## Creating new ADR + +Read about the [PROCESS](./PROCESS.md). + +### Use RFC 2119 Keywords + +When writing ADRs, follow the same best practices for writing RFCs. +When writing RFCs, key words are used to signify the requirements in the specification. +These words are often capitalized: "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL. +They are to be interpreted as described in [RFC 2119](https://datatracker.ietf.org/doc/html/rfc2119). + +## ADR Table of Contents + +### Accepted + +- [ADR 002: Globalfee Module](./adr-002-globalfee.md) + +### Proposed + +- n/a + +### Draft + +- n/a + +### Rejected + +- [ADR 001: Interchain Accounts](./adr-001-interchain-accounts.md) diff --git a/docs/readiness/adr-001-interchain-accounts.md b/docs/architecture/adr-001-interchain-accounts.md similarity index 92% rename from docs/readiness/adr-001-interchain-accounts.md rename to docs/architecture/adr-001-interchain-accounts.md index c73c97c5d7..30f0b57abf 100644 --- a/docs/readiness/adr-001-interchain-accounts.md +++ b/docs/architecture/adr-001-interchain-accounts.md @@ -2,26 +2,19 @@ order: 2 --> ---- - -ADR: 001 -Title: Interchain Accounts -Status: Draft Implements -Category: Feature -Author: Sean King & Damian Nolan -Created: 2022-01-19 -Mdified: 2022-01-19 -Requires: Cosmos-SDK, go-ibc -Required-By: mauth -Implements: Interchain Accounts ---- - # ADR 001: Interchain Accounts ## Changelog - 2022-02-04: added content - 2022-01-19: init +- 2023-06-28: mark as rejected + +## Status + +REJECTED Not Implemented + +**Reason:** The IBC team decided to integrate this functionality directly into their codebase and maintain it, because multiple users require it. ## Abstract @@ -98,4 +91,4 @@ There are future releases of Interchain Accounts which are expected to be backwa ## Additional Research & References - [Why Interchain Accounts Change Everything for Cosmos Interoperability](https://medium.com/chainapsis/why-interchain-accounts-change-everything-for-cosmos-interoperability-59c19032bf11) -- [Interchain Account Auth Module Demo Repo](https://github.com/cosmos/interchain-accounts) +- [Interchain Account Auth Module Demo Repo](https://github.com/cosmos/interchain-accounts) \ No newline at end of file diff --git a/docs/architecture/adr-002-globalfee.md b/docs/architecture/adr-002-globalfee.md new file mode 100644 index 0000000000..f48e23d894 --- /dev/null +++ b/docs/architecture/adr-002-globalfee.md @@ -0,0 +1,165 @@ +# ADR 002: Globalfee Module + +## Changelog +* 2023-06-12: Initial Draft + +## Status +ACCEPTED Implemented + +## Context + +The globalfee module was created to manage a parameter called `MinimumGasPricesParam`, which sets a network-wide minimum fee requirement. The intention was to stop random denominations from entering fee collections and to reduce the time validators take to check a long list of transaction fees. To address scenarios where no fee payment is required but the denominations for volunteered paid fees are still restricted, the zero coins was introduced to serve as a means of limiting the denoms. Nevertheless, the initial version of the globalfee module had some issues: + +- In the globalfee module, several Cosmos SDK coins methods were redefined because of the allowance of zero-value coins in the `MinimumGasPricesParam`. The `MinimumGasPricesParam` is of `sdk.DecCoins` type. In the Cosmos SDK, `sdk.DecCoins` are [sanitized](https://github.com/cosmos/cosmos-sdk/blob/67f04e629623d4691c4b2e48806f7793a3aa211e/types/dec_coin.go#L160-L177) to remove zero-value coins. As a result, several methods from `sdk.Coins` were [redefined in the Gaia fee antehandler](https://github.com/cosmos/gaia/blob/890ab3aa2e5788537b0d2ebc9bafdc968340e0e5/x/globalfee/ante/fee_utils.go#L46-L104). + +- `BypassMinFeeMsgTypes` exists in `app.toml`, which means each node can define its own value. Thus, it's not clear whether a transaction containing bypass-messages will be exempted from paying a fee. + +- The fee check logic is only executed in `CheckTx`. This could enable malicious validators to change the fee check code and propose transactions that do not meet the fee requirement. + +## Decision +To fix these problems, the following changes are added to the globalfee module: +- **ZeroCoins in `MinimumGasPricesParam`:**\ +Refactor the fee check logics, in order to use the Cosmos SDK coins' methods instead of the redefined methods. +- **Bypass Message Types:**\ +`BypassMinFeeMsgTypes` is refactored to be a param of the globalfee module, in order to make the bypass messages deterministic. +- **Check Fees in `DeliverTx`:**\ +The fee check is factored to executed in both `DeliverTx` and `CheckTx`. This is to prevent malicious validators from changing the fee check logic and allowing any transactions to pass fee check. As a consequence, `MinimumGasPricesParam` is introduced as a globalfee param. + +### ZeroCoins in `MinimumGasPricesParam` +#### Coins Split +`CombinedFeeRequirement` refers to the fee requirement that takes into account both `globalFees` (`MinimumGasPricesParam` in the globalfee module) and `localFees` (`minimum-gas-prices` in `app.toml`). This requirement is calculated as the maximum value between `globalFees` and `localFees` for denomination exists `globalFees`. +The allowance of zero coins in the `MinimumGasPricesParam` within the globalfee module implies that `CombinedFeeRequirement(globalFees, localFees)` also permits zero coins. Therefore, the `CombinedFeeRequirement` doesn't meet the requirements of certain `sdk.Coins` methods. For instance, the `DenomsSubsetOf` method requires coins that do not contain zero coins. + +To address this issue, the `CombinedFeeRequirement` and `feeCoins` are split as shown in the chart below. + +```mermaid +--- +title: Fee Requirements and Fee Splits +--- +flowchart TD + subgraph feeReq + A[CombinedFeeRequirement]-->B[/Split zero/nonzero coins/] + B-->|zero coins| C[zeroCoinFeesDenomReq]; + B-->|nonzero coins| D[nonzeroCoinFeesDenomReq]; + + end + + subgraph feeCoin + E[feeCoins]-->F[/Split by the denoms in zero/nonzero CoinFeesDenomReq/] + F-->|denoms in zeroCoinFeesDenomReq set| G[feeCoinsZeroDenom] + F-->|denoms in nonzeroCoinFeesDenomReq set| H[feeCoinsNonZeroDenom] + end +``` + +The `CombinedFeeRequirement` is split into zero and non-zero coins, forming `nonZeroCoinFeesReq` and `zeroCoinFeesDenomReq`. Similarly, the paid fees (feeCoins) are split into `feeCoinsNonZeroDenom` and `feeCoinsZeroDenom`, based on the denominations of `nonZeroCoinFeesReq` and `zeroCoinFeesDenomReq` as shown in the following code snippet. + +```go + nonZeroCoinFeesReq, zeroCoinFeesDenomReq := getNonZeroFees(feeRequired) + + // feeCoinsNonZeroDenom contains non-zero denominations from the feeRequired + // feeCoinsNonZeroDenom is used to check if the fees meets the requirement imposed by nonZeroCoinFeesReq + // when feeCoins does not contain zero coins' denoms in feeRequired + feeCoinsNonZeroDenom, feeCoinsZeroDenom := splitCoinsByDenoms(feeCoins, zeroCoinFeesDenomReq) + +``` +#### Fee Checks +The Workflow of feeCheck is shown below: +```mermaid +--- +title: Fee Check +--- +flowchart TD + +A[feeCoinsNonZeroDenom]-->B[/DenomsSubsetOf_nonZeroCoinFeesReq/]; +B-->|yes|C[is_bypass_msg]; +B-->|no|D((reject)); + +C-->|yes|pass1((pass)); +C-->|no|D[/contain_zeroCoinFeesDenomReq_denom/]; + +D-->|yes|pass2((pass)); +D-->|no|E[/feeCoinsZeroDenom_nonEmpty/]; + + +E-->|yes|pass3((pass)); +E-->|no|F[/IsAnyGTE_nonZeroCoinFeesDenomReq/]; + +F-->|yes|pass4((pass)); +F-->|no|reject2((reject)); +``` + +The split enable checking `feeCoinsNonZeroDenom` against `nonZeroCoinFeesReq`, and `feeCoinsZeroDenom` against +`zeroCoinFeesDenomReq` (as shown in the following code snippet). In the check of `feeCoinsNonZeroDenom` against `nonZeroCoinFeesReq`, the Cosmos SDK coins' methods can be used since zero coins are removed from the `nonZeroCoinFeesReq`, while in the check `feeCoinsZeroDenom` against `zeroCoinFeesDenomReq`, only denoms need to be checked. + +Checking `feeCoinsNonZeroDenom` against `nonZeroCoinFeesReq`: +```go + if !feeCoinsNonZeroDenom.IsAnyGTE(nonZeroCoinFeesReq) { + return ctx, sdkerrors.Wrapf(sdkerrors.ErrInsufficientFee, "insufficient fees; got: %s required: %s", feeCoins.String(), feeRequired.String()) + } +``` + +Here is an example of how the coins split and checked in fee antehandler:\ +**assumption**:\ +`globalfee=[1photon, 0uatom, 1stake]` and `local min-gas-prices=[0.5stake]` + +**fee requirement**:\ +`combinedFeeRequirement=[1photon, 0uatom, 1stake]` + +**split fee requirement**:\ +the `combinedFeeRequirement` into `nonZeroCoinFeesReq=[0uatom]`, and `nonZeroCoinFeesReq=[1photon, 1stake]` + +**split the paid fees**:\ +if `paidFee=[1uatom, 0.5photon]`, +the `splitCoinsByDenoms` splits the paidFee into `feeCoinsZeroDenom=[1uatom]` (the same denom as zero coins in `combinedFeeRequirement`), and `feeCoinsNonZeroDenom=[0.5stake]` +then `feeCoinsZeroDenom=[1uatom]` is checked by `nonZeroCoinFeesReq=[1photon, 1stake]`. + +Please note that `feeCoins` does not contain zero coins. The fee coins are split according to the denoms in `zeroCoinFeesDenomReq` or `nonZeroCoinFeesDenomReq`. If feeCoins contains coins not in both `zeroCoinFeesDenomReq` and `nonZeroCoinFeesDenomReq`, the transaction should be rejected. On the contrary, if feeCoins' denoms are in either `zeroCoinFeesDenomReq` or `nonZeroCoinFeesDenomReq`, and `len(zeroCoinFeesDenomReq)!=0`, the transaction can directly pass, otherwise, the fee amount need to be checked. + + +### Bypass Message Types +`BypassMinFeeMsgTypes` was a setup in `config/app.toml` before the refactor. `BypassMinFeeMsgTypes` is refactored to be a param of the globalfee module to get a network level agreement. Correspondingly,`MaxTotalBypassMinFeeMsgGasUsage` is also introduced as a globalfee param. + +### Fee Checks in `DeliverTx` +Implementing fee checks within the `DeliverTx` function introduces a few requirements: +- **Deterministic Minimum Fee Requirement**: For the `DeliverTx` process, it is essential to have a deterministic minimum fee requirement. In `CheckTx`, fee is checked by the `CombinedFeeRequirement(globalFees, localFees)`, which considers both `minimum-gas-prices` from `config/app.toml` and `MinimumGasPricesParam` from the globalfee Params (For more details, see [globalfee.md](../modules/globalfee.md)). `CombinedFeeRequirement` contains non-deterministic part: `minimum-gas-prices` from `app.toml`. Therefore, `CombinedFeeRequirement` cannot be used in `DeliverTx`. In `DeliverTx`, only `MinimumGasPricesParam` in globalfee Params is used for fee verification. The code implementation is shown below. + +```go +func (mfd FeeDecorator) GetTxFeeRequired(ctx sdk.Context, tx sdk.FeeTx) (sdk.Coins, error) { + // Get required global fee min gas prices + // Note that it should never be empty since its default value is set to coin={"StakingBondDenom", 0} + globalFees, err := mfd.GetGlobalFee(ctx, tx) + if err != nil { + return sdk.Coins{}, err + } + + // In DeliverTx, the global fee min gas prices are the only tx fee requirements. + if !ctx.IsCheckTx() { + return globalFees, nil + } + + // In CheckTx mode, the local and global fee min gas prices are combined + // to form the tx fee requirements + + // Get local minimum-gas-prices + localFees := GetMinGasPrice(ctx, int64(tx.GetGas())) + + // Return combined fee requirements + return CombinedFeeRequirement(globalFees, localFees) +} +``` + +- **Deterministic Bypass Parameters**: The decision of whether a message can bypass the minimum fee has to be deterministic as well. To ensure this, `BypassMinFeeMsgTypes` and `MaxTotalBypassMinFeeMsgGasUsage` parameters are moved to a persistent store. + +- **Module Initialization Order**: The genutils module must be initialized before the globalfee module. This is due to the `DeliverGenTxs` in the genutils module, is called during `initGenesis`. This function executes `DeliverTx`, which subsequently calls the AnteHandle in FeeDecorator, triggering the fee check in `DeliverTx`. + To prevent the `DeliverGenTxs` go through a fee check, the initialization of the globalfee module should occur after the genutils module. This sequencing ensures that all necessary components are in place when the fee check occurs. See [Gaia Issue #2489](https://github.com/cosmos/gaia/issues/2489) for more context. + +## Consequences +### Positive +This refactor results in code that is easier to maintain. It prevents malicious validators from escaping fee checks and make the bypass messages work at network level. +### Negative +The introduction of FeeDecorator has replaced the usage of `MempoolFeeDecorator` in the Cosmos SDK. Currently, if both FeeDecorator and MempoolFeeDecorator are added to the AnteDecorator chain, it will result in redundant checks. However, there's potential for FeeDecorator and MempoolFeeDecorator to become incompatible in the future, depending on updates to the Cosmos SDK. + + +## References + +* [Documentation of the globalfee module](../modules/globalfee.md) diff --git a/docs/architecture/adr-template.md b/docs/architecture/adr-template.md new file mode 100644 index 0000000000..95e5a5886e --- /dev/null +++ b/docs/architecture/adr-template.md @@ -0,0 +1,58 @@ + + +# ADR {ADR-NUMBER}: {TITLE} + +## Changelog + +- {date}: {changelog} + +## Status + +{DRAFT | PROPOSED} Not Implemented + +> Please have a look at the [PROCESS](./PROCESS.md#adr-status) page. +> Use DRAFT if the ADR is in a draft stage (draft PR) or PROPOSED if it's in review. + +## Abstract + +> "If you can't explain it simply, you don't understand it well enough." Provide +> a simplified and layman-accessible explanation of the ADR. +> A short (~200 word) description of the issue being addressed. + +## Context + +> This section contains all the context one needs to understand the current state, and why there is a problem. +> It should be as succinct as possible and introduce the high level idea behind the solution. +> The language in this section is value-neutral. It is simply describing facts. + +## Decision + +> This section explains all of the details of the proposed solution, including implementation details. +It should also describe affects / corollary items that may need to be changed as a part of this. +If the proposed change will be large, please also indicate a way to do the change to maximize ease of review. +(e.g. the optimal split of things to do between separate PR's) + +## Consequences + +> This section describes the consequences, after applying the decision. +> All consequences should be summarized here, not just the "positive" ones. + +### Positive + +> {positive consequences} + +### Negative + +> {negative consequences} + +### Neutral + +> {neutral consequences} + +## References + +> Are there any relevant PR comments, issues that led up to this, or articles referrenced for why we made the given design choice? If so link them here! + +* {reference link} diff --git a/docs/client/gaia/globalfee/v1beta1/query.swagger.json b/docs/client/gaia/globalfee/v1beta1/query.swagger.json index 59ff06b016..9f1da5b517 100644 --- a/docs/client/gaia/globalfee/v1beta1/query.swagger.json +++ b/docs/client/gaia/globalfee/v1beta1/query.swagger.json @@ -11,14 +11,14 @@ "application/json" ], "paths": { - "/gaia/globalfee/v1beta1/minimum_gas_prices": { + "/gaia/globalfee/v1beta1/params": { "get": { - "operationId": "MinimumGasPrices", + "operationId": "Params", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/gaia.globalfee.v1beta1.QueryMinimumGasPricesResponse" + "$ref": "#/definitions/gaia.globalfee.v1beta1.QueryParamsResponse" } }, "default": { @@ -47,14 +47,36 @@ }, "description": "DecCoin defines a token with a denomination and a decimal amount.\n\nNOTE: The amount field is an Dec which implements the custom method\nsignatures required by gogoproto." }, - "gaia.globalfee.v1beta1.QueryMinimumGasPricesResponse": { + "gaia.globalfee.v1beta1.Params": { "type": "object", "properties": { "minimum_gas_prices": { "type": "array", "items": { "$ref": "#/definitions/cosmos.base.v1beta1.DecCoin" - } + }, + "title": "minimum_gas_prices stores the minimum gas price(s) for all TX on the chain.\nWhen multiple coins are defined then they are accepted alternatively.\nThe list must be sorted by denoms asc. No duplicate denoms or zero amount\nvalues allowed. For more information see\nhttps://docs.cosmos.network/main/modules/auth#concepts" + }, + "bypass_min_fee_msg_types": { + "type": "array", + "items": { + "type": "string" + }, + "description": "bypass_min_fee_msg_types defines a list of message type urls\nthat are free of fee charge." + }, + "max_total_bypass_min_fee_msg_gas_usage": { + "type": "string", + "format": "uint64", + "description": "max_total_bypass_min_fee_msg_gas_usage defines the total maximum gas usage\nallowed for a transaction containing only messages of types in bypass_min_fee_msg_types\nto bypass fee charge." + } + }, + "description": "Params defines the set of module parameters." + }, + "gaia.globalfee.v1beta1.QueryParamsResponse": { + "type": "object", + "properties": { + "params": { + "$ref": "#/definitions/gaia.globalfee.v1beta1.Params" } }, "description": "QueryMinimumGasPricesResponse is the response type for the\nQuery/MinimumGasPrices RPC method." diff --git a/docs/delegators/delegator-faq.md b/docs/delegators/delegator-faq.md index e643b4d716..016d092832 100644 --- a/docs/delegators/delegator-faq.md +++ b/docs/delegators/delegator-faq.md @@ -25,7 +25,7 @@ In order to choose their validators, delegators have access to a range of inform - **Initial commission rate**: The commission rate on revenue charged to any delegator by the validator (see below for more detail). - **Commission max change rate:** The maximum daily increase of the validator's commission. This parameter cannot be changed by the validator operator. - **Maximum commission:** The maximum commission rate this validator candidate can charge. This parameter cannot be changed by the validator operator. -- **Minimum self-bond amount**: Minimum amount of Atoms the validator candidate need to have bonded at all time. If the validator's self-bonded stake falls below this limit, their entire staking pool (i.e. all its delegators) will unbond. This parameter exists as a safeguard for delegators. Indeed, when a validator misbehaves, part of their total stake gets slashed. This included the validator's self-delegateds stake as well as their delegators' stake. Thus, a validator with a high amount of self-delegated Atoms has more skin-in-the-game than a validator with a low amount. The minimum self-bond amount parameter guarantees to delegators that a validator will never fall below a certain amount of self-bonded stake, thereby ensuring a minimum level of skin-in-the-game. This parameter can only be increased by the validator operator. +- **Validator self-bond amount**: A validator with a high amount of self-delegated Atoms has more skin-in-the-game than a validator with a low amount. ## Directives of delegators @@ -61,6 +61,33 @@ Our validator's staking pool represents 10% of the total stake, which means the Then, each delegator in the staking pool can claim their portion of the delegators' total revenue. +## Liquid Staking + +The Liquid Staking module enacts a safety framework and associated governance-controlled parameters to regulate the adoption of liquid staking. + +The LSM mitigates liquid staking risks by limiting the total amount of ATOM that can be liquid staked to a percentage of all staked ATOM. As an additional risk-mitigation feature, the LSM introduces a requirement that validators self-bond ATOM to be eligible for delegations from liquid staking providers or to be eligible to mint LSM tokens. This mechanism is called the “validator bond”, and is technically distinct from the current self-bond mechanism, but functions similarly. + +At the same time, the LSM introduces the ability for staked ATOM to be instantly liquid staked, without having to wait for the unbonding period. + +The LSM enables users to instantly liquid stake their staked ATOM, without having to wait the twenty-one day unbonding period. This is important, because a very large portion of the ATOM supply is currently staked. Liquid staking ATOM that is already staked incurs a switching cost in the form of three weeks’ forfeited staking rewards. The LSM eliminates this switching cost. + +A user would be able to visit any liquid staking provider that has integrated with the LSM and click a button to convert her staked ATOM to liquid staked ATOM. It would be as easy as liquid staking unstaked ATOM. + +Technically speaking, this is accomplished by using something called an “LSM share.” Using the liquid staking module, a user can tokenize their staked ATOM and turn it into LSM shares. LSM shares can be redeemed for underlying staked tokens and are transferable. After staked ATOM is tokenized it can be immediately transferred to a liquid staking provider in exchange for liquid staking tokens - without having to wait for the unbonding period. + +### Toggling the ability to tokenize shares + +Currently the liquid staking module facilitates the immediate conversion of staked assets into liquid staked tokens. Despite the many benefits that come with this capability, it does inadvertently negate a protective measure available via traditional staking, where an account can stake their tokens to render them illiquid in the event that their wallet is compromised (the attacker would first need to unbond, then transfer out the tokens). + +Tokenization obviates this potential recovery measure, as an attacker could tokenize and immediately transfer staked tokens to another wallet. So, as an additional protective measure, the staking module permit accounts to selectively disable the tokenization of their stake with the `DisableTokenizeShares` message. + +The `DisableTokenizeShares` message is exposed by the staking module and can be executed as follows: +``` +gaiad tx staking disable-tokenize-shares --from mykey +``` + +When tokenization is disabled, a lock is placed on the account, effectively preventing the tokenization of any delegations. Re-enabling tokenization would initiate the removal of the lock, but the process is not immediate. The lock removal is queued, with the lock itself persisting throughout the unbonding period. Following the completion of the unbonding period, the lock would be completely removed, restoring the account's ablility to tokenize. For liquid staking protocols that enable the lock, this delay better positions the base layer to coordinate a recovery in the event of an exploit. + ## Risks Staking Atoms is not free of risk. First, staked Atoms are locked up, and retrieving them requires a 3 week waiting period called unbonding period. Additionally, if a validator misbehaves, a portion of their total stake can be slashed (i.e. destroyed). This includes the stake of their delegators. diff --git a/docs/delegators/delegator-guide-cli.md b/docs/delegators/delegator-guide-cli.md index 5f24b6dc25..917646d38a 100644 --- a/docs/delegators/delegator-guide-cli.md +++ b/docs/delegators/delegator-guide-cli.md @@ -182,7 +182,7 @@ To create an account, you just need to have `gaiad` installed. Before creating i When you initialize your ledger, a 24-word mnemonic is generated and stored in the device. This mnemonic is compatible with Cosmos and Cosmos accounts can be derived from it. Therefore, all you have to do is make your ledger compatible with `gaiad`. To do so, you need to go through the following steps: -1. Download the Ledger Live app [here](https://www.ledger.com/pages/ledger-live). +1. Download the Ledger Live app [here](https://www.ledger.com/ledger-live). 2. Connect your ledger via USB and update to the latest firmware 3. Go to the ledger live app store, and download the "Cosmos" application (this can take a while). **Note: You may have to enable `Dev Mode` in the `Settings` of Ledger Live to be able to download the "Cosmos" application**. 4. Navigate to the Cosmos app on your ledger device diff --git a/docs/delegators/delegator-security.md b/docs/delegators/delegator-security.md index 97768a26c6..0145e3acfc 100644 --- a/docs/delegators/delegator-security.md +++ b/docs/delegators/delegator-security.md @@ -9,7 +9,7 @@ The launch of any public blockchain is an incredibly exciting time, and it's def ## Social Engineering -_[Social engineering](https://en.wikipedia.org/wiki/Social_engineering_(security))_ has existed for about as long as human beings have been on the planet, and in the technical era, it usually takes in the form of [phishing](https://ssd.eff.org/en/module/how-avoid-phishing-attacks) or [spearphishing](https://en.wikipedia.org/wiki/Phishing#Spear_phishing) . Both of these attacks are wildly successful forms of trickery that are responsible for over 95% of account security breaches, and they don't just happen via email: these days, opportunistic and targeted phishing attempts take place [anywhere that you have an inbox](https://www.umass.edu/it/security/phishing-fraudulent-emails-text-messages-phone-calls) . It doesn't matter if you're using Signal, Telegram, SMS, Twitter, or just checking your DMs on forums or social networks, attackers have a [plethora of opportunities](https://jia.sipa.columbia.edu/weaponization-social-media-spear-phishing-and-cyberattacks-democracy) to gain foothold in your digital life in effort to separate you from valuable information and assets that you most definitely don't want to lose. If a deal pops up that [sounds too good to be true](https://www.psychologytoday.com/us/blog/mind-in-the-machine/201712/how-fear-is-being-used-manipulate-cryptocurrency-markets) , or a message shows up asking for information that should never, ever be shared with someone else, you can always verify it before engaging with it by navigating to our official website or an official Cosmos communication channel on your own. +_[Social engineering](https://en.wikipedia.org/wiki/Social_engineering_(security))_ has existed for about as long as human beings have been on the planet, and in the technical era, it usually takes in the form of [phishing](https://ssd.eff.org/en/module/how-avoid-phishing-attacks) or [spearphishing](https://en.wikipedia.org/wiki/Phishing#Spear_phishing) . Both of these attacks are wildly successful forms of trickery that are responsible for over 95% of account security breaches, and they don't just happen via email: these days, opportunistic and targeted phishing attempts take place [anywhere that you have an inbox](https://www.umass.edu/it/security/phishing-fraudulent-emails-text-messages-phone-calls) . It doesn't matter if you're using Signal, Telegram, SMS, Twitter, or just checking your DMs on forums or social networks, attackers have a [plethora of opportunities](https://www.researchgate.net/publication/328497447_The_Weaponization_of_Social_Media_Spear_Phishing_and_Cyberattacks_on_Democracy) to gain foothold in your digital life in effort to separate you from valuable information and assets that you most definitely don't want to lose. If a deal pops up that [sounds too good to be true](https://www.psychologytoday.com/us/blog/mind-in-the-machine/201712/how-fear-is-being-used-manipulate-cryptocurrency-markets) , or a message shows up asking for information that should never, ever be shared with someone else, you can always verify it before engaging with it by navigating to our official website or an official Cosmos communication channel on your own. * **Be skeptical of unexpected attachments, or emails that ask you to visit a suspicious or unfamiliar website in the context of blockchains or cryptocurrency.** An attacker may attempt to lure you to a [compromised site](https://blog.malwarebytes.com/cybercrime/2013/02/tools-of-the-trade-exploit-kits/) designed to steal sensitive information from your computer. If you're a Gmail user, test your resilience against the latest email-based phishing tactics [here](https://phishingquiz.withgoogle.com/) . diff --git a/docs/getting-started/quickstart.md b/docs/getting-started/quickstart.md index 6d00552608..9f7c17e47a 100644 --- a/docs/getting-started/quickstart.md +++ b/docs/getting-started/quickstart.md @@ -27,7 +27,7 @@ For reference, the list of `rpc_servers` and `persistent` peers can be found in ```bash # Build gaiad binary and initialize chain cd $HOME -git clone -b v10.0.0 https://github.com/cosmos/gaia --depth=1 +git clone -b v14.1.0 https://github.com/cosmos/gaia --depth=1 cd gaiad make install gaiad init CUSTOM_MONIKER --chain-id cosmoshub-4 diff --git a/docs/getting-started/system-requirements.md b/docs/getting-started/system-requirements.md new file mode 100644 index 0000000000..542cfe7667 --- /dev/null +++ b/docs/getting-started/system-requirements.md @@ -0,0 +1,14 @@ + +# System requirements + +The Gaia application typically needs at least 32GB RAM for smooth operation. + +If you have less than 32GB RAM, you might try creating a swapfile to swap an idle program onto the hard disk to free up memory. This can allow your machine to run the binary than it could run in RAM alone. + +```shell +# Linux instructions +sudo fallocate -l 16G /swapfile +sudo chmod 600 /swapfile +sudo mkswap /swapfile +sudo swapon /swapfile +``` diff --git a/docs/governance/proposal-types/param-change.md b/docs/governance/proposal-types/param-change.md index a71aff0f05..37165fd463 100644 --- a/docs/governance/proposal-types/param-change.md +++ b/docs/governance/proposal-types/param-change.md @@ -6,7 +6,7 @@ parent: # Parameter Change -This Cosmos Hub educational documentation aims to outline the [Hub's parameters](#params-wiki), describe their functions, and describe the potential implications of modifying each parameter. This documentation also aims to provide guidelines for creating and assessing parameter-change proposals. +This Cosmos Hub educational documentation aims to outline the Hub's parameters, describe their functions, and describe the potential implications of modifying each parameter. This documentation also aims to provide guidelines for creating and assessing parameter-change proposals. diff --git a/docs/governance/proposal-types/params-change/Distribution.md b/docs/governance/proposal-types/params-change/Distribution.md index 3f3e6d23fd..b60a898db2 100644 --- a/docs/governance/proposal-types/params-change/Distribution.md +++ b/docs/governance/proposal-types/params-change/Distribution.md @@ -125,4 +125,4 @@ base_proposer_reward: "0.999000000000000000" bonus_proposer_reward: "0.040000000000000000" ``` -Though the system will not allow eg. `baseproposerreward` to be a value greater than 1.0, it will allow the [`communitytax`](#1-communitytax), [`baseproposerreward`](#2-baseproposerreward), and [`bonusproposerreward`](#3-bonusproposerreward) parameters values to total an amount greater than 1.00, which will apparently cause the chain to panic and halt. You can [read more about the reported issue here](https://github.com/cosmos/cosmos-sdk/issues/5808). +Though the system will not allow eg. `baseproposerreward` to be a value greater than 1.0, it will allow the [`communitytax`](#communitytax), [`baseproposerreward`](#baseproposerreward), and [`bonusproposerreward`](#bonusproposerreward) parameters values to total an amount greater than 1.00, which will apparently cause the chain to panic and halt. You can [read more about the reported issue here](https://github.com/cosmos/cosmos-sdk/issues/5808). diff --git a/docs/governance/proposal-types/params-change/Governance.md b/docs/governance/proposal-types/params-change/Governance.md index 7585d5ab8e..6e29879a96 100644 --- a/docs/governance/proposal-types/params-change/Governance.md +++ b/docs/governance/proposal-types/params-change/Governance.md @@ -31,7 +31,7 @@ The `gov` module is responsible for the on-chain governance system. In this syst * `cosmoshub-4` default: `512000000` `uatom` * `cosmoshub-3` default: `512000000` `uatom` -Prior to a governance proposal entering the [voting period](#votingperiod) (ie. for the proposal to be voted upon), there must be at least a minimum number of ATOMs deposited. Anyone may contribute to this deposit. Deposits of passed and failed proposals are returned to the contributors. Deposits are burned when proposals 1) [expire](#maxdepositperiod), 2) fail to reach [quorum](#quorum), or 3) are [vetoed](#veto). This parameter subkey value represents the minimum deposit required for a proposal to enter the [voting period](#votingperiod) in micro-ATOMs, where `512000000uatom` is equivalent to 512 ATOM. +Prior to a governance proposal entering the [voting period](#votingperiod) (ie. for the proposal to be voted upon), there must be at least a minimum number of ATOMs deposited. Anyone may contribute to this deposit. Deposits of passed and failed proposals are returned to the contributors. Deposits are burned when proposals 1) [expire](#max_deposit_period), 2) fail to reach [quorum](#quorum), or 3) are [vetoed](#veto_threshold). This parameter subkey value represents the minimum deposit required for a proposal to enter the [voting period](#votingperiod) in micro-ATOMs, where `512000000uatom` is equivalent to 512 ATOM. ##### Decreasing the value of `mindeposit` Decreasing the value of the `mindeposit` subkey will enable governance proposals to enter the [voting period](#votingperiod) with fewer ATOMs at risk. This will likely increase the volume of new governance proposals. diff --git a/docs/governance/proposal-types/params-change/Mint.md b/docs/governance/proposal-types/params-change/Mint.md index 6a27bde725..1a35d7069f 100644 --- a/docs/governance/proposal-types/params-change/Mint.md +++ b/docs/governance/proposal-types/params-change/Mint.md @@ -46,7 +46,7 @@ Changing the `MintDenom` will change the asset that the Cosmos Hub mints from th * `cosmoshub-3` default: `0.130000000000000000` Cosmos Hub's inflation rate can change faster or slower, depending on staking participation, and is limited to a minimum of 7% and maximum of 20%. The inflation rate cannot increase or decrease faster than 13% per year (`InflationRateChange`). The speed that the inflation rate changes depends upon two things: -1. how far away the *current staking participation ratio* is from [`GoalBonded`](#5-GoalBonded) (67%) +1. how far away the *current staking participation ratio* is from [`GoalBonded`](#goalbonded) (67%) 2. the value of `InflationRateChange`, which is `{{ $themeConfig.currentParameters.mint.InflationRateChange }}` ``` inflationRateChangePerYear = (1 - bondedRatio/params.GoalBonded) * params.InflationRateChange @@ -56,10 +56,10 @@ inflationRateChangePerYear = (1 - bondedRatio/params.GoalBonded) * params.Inflat The inflation rate increases when under 67% of the token supply is staking, and it will take less time to reach the maximum of rate of 20% inflation if (for example) 30% of the token supply is staking than if 50% is staking. #### Decreasing the value of `InflationRateChange` -Decreasing the value of the `InflationRateChange` parameter will decrease both how fast the inflation rate changes and also the maximum speed that it can potentially change. It will then take longer for inflation to reach [`InflationMin`](#InflationMin) or [`InflationMax`](#InflationMax). This may lessen the response of staking behaviour to the incentive mechanism [described in the notes below](#notes). +Decreasing the value of the `InflationRateChange` parameter will decrease both how fast the inflation rate changes and also the maximum speed that it can potentially change. It will then take longer for inflation to reach [`InflationMin`](#inflationmin) or [`InflationMax`](#inflationmax). This may lessen the response of staking behaviour to the incentive mechanism [described in the notes below](#notes). #### Increasing the value of `InflationRateChange` -Increasing the value of the `InflationRateChange` parameter will increase both how fast the inflation rate changes and also the maximum speed that it can potentially change. It will then take less time for inflation to reach [`InflationMin`](#InflationMin) or [`InflationMax`](#InflationMax). This may quicken the response of staking behaviour to the incentive mechanism [described in the notes below](#notes). +Increasing the value of the `InflationRateChange` parameter will increase both how fast the inflation rate changes and also the maximum speed that it can potentially change. It will then take less time for inflation to reach [`InflationMin`](#inflationmin) or [`InflationMax`](#inflationmax). This may quicken the response of staking behaviour to the incentive mechanism [described in the notes below](#notes). #### Notes **Example:** if the current staking participation ratio (aka "bond ratio") is 73%, then this is the calculation for speed that the inflation rate will change: @@ -79,7 +79,7 @@ The Cosmos Hub's inflation rate is tied to its staking participation ratio in or * `cosmoshub-4` default: `0.200000000000000000` * `cosmoshub-3` default: `0.200000000000000000` -The maximum rate that the Cosmos Hub can be set to mint new ATOMs is determined by `InflationMax`, which is 20% (`0.200000000000000000`) of the ATOM supply per year and based on the assumption that there are 4,855,015 blocks produced per year (see [`BlocksPerYear`](#BlocksPerYear)). If the Cosmos Hub's staking ratio (ie. the number of ATOMs staked vs total supply) remains below [`GoalBonded`](#GoalBonded)(67%) for long enough, its inflation setting will eventually reach this maximum. +The maximum rate that the Cosmos Hub can be set to mint new ATOMs is determined by `InflationMax`, which is 20% (`0.200000000000000000`) of the ATOM supply per year and based on the assumption that there are 4,855,015 blocks produced per year (see [`BlocksPerYear`](#blocksperyear)). If the Cosmos Hub's staking ratio (ie. the number of ATOMs staked vs total supply) remains below [`GoalBonded`](#goalbonded)(67%) for long enough, its inflation setting will eventually reach this maximum. #### Decreasing the value of `InflationMax` Decreasing the value of the `InflationMax` parameter will lower the maximum rate that the Cosmos Hub produces new ATOMs and reduce the rate at which the ATOM supply expands. This will reduce the rate at which token-holders' assets are diluted and may reduce the incentive for staking participation. @@ -97,7 +97,7 @@ The effective rate of inflation tends to be different than the set rate of infla * `cosmoshub-4` default: `0.070000000000000000` * `cosmoshub-3` default: `0.070000000000000000` -The minimum rate that the Cosmos Hub can be set to mint new ATOMs is determined by `InflationMin`, which is 7% (`0.070000000000000000`) of the ATOM supply per year and based on the assumption that there are 4,855,015 blocks produced per year (see [`BlocksPerYear`](#BlocksPerYear)). If the Cosmos Hub's staking ratio (ie. the number of ATOMs staked vs total supply) remains above [`GoalBonded`](#GoalBonded)(67%) for long enough, its inflation setting will eventually reach this minimum. +The minimum rate that the Cosmos Hub can be set to mint new ATOMs is determined by `InflationMin`, which is 7% (`0.070000000000000000`) of the ATOM supply per year and based on the assumption that there are 4,855,015 blocks produced per year (see [`BlocksPerYear`](#blocksperyear)). If the Cosmos Hub's staking ratio (ie. the number of ATOMs staked vs total supply) remains above [`GoalBonded`](#goalbonded)(67%) for long enough, its inflation setting will eventually reach this minimum. #### Decreasing the value of `InflationMin` Decreasing the value of the `InflationMin` parameter will lower the minimum rate that the Cosmos Hub produces new ATOMs and reduce the rate at which the ATOM supply expands. This will reduce the rate at which token-holders' assets are diluted and may reduce the incentive for staking participation. @@ -115,7 +115,7 @@ The effective rate of inflation tends to be different than the set rate of infla * `cosmoshub-4` default: `0.670000000000000000` * `cosmoshub-3` default: `0.670000000000000000` -`GoalBonded` is the target proportion of staking participation, relative to the ATOM supply. Currently the goal of the system's design is to have 67% (`0.670000000000000000`) of the total ATOM supply bonded and participating in staking. When over 67% of the supply is staked, the inflation set rate begins decreasing at a maximum yearly rate of [`InflationRateChange`](#InflationRateChange) until it reaches and remains at the [`InflationMin`](#InflationMin) of 7%. When under 67% of the supply is staked, the inflation set rate begins increasing at a maximum yearly rate of [`InflationRateChange`](#InflationRateChange) until it reaches and remains at the [`InflationMax`](#InflationMax) of 20%. +`GoalBonded` is the target proportion of staking participation, relative to the ATOM supply. Currently the goal of the system's design is to have 67% (`0.670000000000000000`) of the total ATOM supply bonded and participating in staking. When over 67% of the supply is staked, the inflation set rate begins decreasing at a maximum yearly rate of [`InflationRateChange`](#inflationratechange) until it reaches and remains at the [`InflationMin`](#inflationmin) of 7%. When under 67% of the supply is staked, the inflation set rate begins increasing at a maximum yearly rate of [`InflationRateChange`](#inflationratechange) until it reaches and remains at the [`InflationMax`](#inflationmax) of 20%. #### Decreasing the value of `GoalBonded` Decreasing the value of the `GoalBonded` parameter will cause the Cosmos Hub's inflation setting to begin decreasing at a lower participation rate, and this may reduce the incentive for staking participation. diff --git a/docs/governance/proposal-types/params-change/Slashing.md b/docs/governance/proposal-types/params-change/Slashing.md index f0bb945fd9..82b1e61949 100644 --- a/docs/governance/proposal-types/params-change/Slashing.md +++ b/docs/governance/proposal-types/params-change/Slashing.md @@ -22,14 +22,14 @@ The `slashing` module is responsible for enabling the Cosmos Hub to penalize any * `cosmoshub-4` default: `0.200000000000000000` * `cosmoshub-3` default: `0.200000000000000000` -If a validator in the active set is offline for too long, the validator will be slashed by [`SlashFractionDowntime`](#SlashFractionDowntime) and temporarily removed from the active set for at least the [`DowntimeJailDuration`](#DowntimeJailDuration), which is 10 minutes. +If a validator in the active set is offline for too long, the validator will be slashed by [`SlashFractionDowntime`](#slashfractiondowntime) and temporarily removed from the active set for at least the [`DowntimeJailDuration`](#downtimejailduration), which is 10 minutes. -How long is being offline for too long? There are two components: `SignedBlocksWindow` and [`MinSignedPerWindow`](#MinSignedPerWindow). Since `MinSignedPerWindow` is 5% and `SignedBlocksWindow` is 10,000, a validator must have signed at least 5% of 10,000 blocks (500 out of 10,000) at any given time to comply with protocol rules. That means a validator that misses 9,500 consecutive blocks will be considered by the system to have committed a liveness violation. The time window for being offline without breaking system rules is proportional to this parameter. +How long is being offline for too long? There are two components: `SignedBlocksWindow` and [`MinSignedPerWindow`](#minsignedperwindow). Since `MinSignedPerWindow` is 5% and `SignedBlocksWindow` is 10,000, a validator must have signed at least 5% of 10,000 blocks (500 out of 10,000) at any given time to comply with protocol rules. That means a validator that misses 9,500 consecutive blocks will be considered by the system to have committed a liveness violation. The time window for being offline without breaking system rules is proportional to this parameter. More about liveness [here](https://docs.cosmos.network/main/modules/slashing#signing-info-liveness). #### Decreasing the value of `SignedBlocksWindow` -Decreasing the value of the `SignedBlocksWindow` parameter will decrease the window for complying with the system's liveness rules. This will make it more likely that offline validators will be slashed by [`SlashFractionDowntime`](#SlashFractionDowntime) and temporarily removed from the active set for at least [`DowntimeJailDuration`](#DowntimeJailDuration). While out of the active set, the votes of the validator and its delegators do not count toward governance proposals. +Decreasing the value of the `SignedBlocksWindow` parameter will decrease the window for complying with the system's liveness rules. This will make it more likely that offline validators will be slashed by [`SlashFractionDowntime`](#slashfractiondowntime) and temporarily removed from the active set for at least [`DowntimeJailDuration`](#downtimejailduration). While out of the active set, the votes of the validator and its delegators do not count toward governance proposals. **Example:** @@ -40,7 +40,7 @@ Validators must now sign at least 5% of 5,000 blocks, which is 250 blocks. That That's ~9.25 hours instead of ~18.5 hours, assuming 7s block times. #### Increasing the value of `SignedBlocksWindow` -Increasing the value of the `SignedBlocksWindow` parameter will increase the window for complying with the system's liveness rules. This will make it less likely that offline validators will be slashed by [`SlashFractionDowntime`](#SlashFractionDowntime) and temporarily removed from the active set for at least [`DowntimeJailDuration`](#DowntimeJailDuration). +Increasing the value of the `SignedBlocksWindow` parameter will increase the window for complying with the system's liveness rules. This will make it less likely that offline validators will be slashed by [`SlashFractionDowntime`](#slashfractiondowntime) and temporarily removed from the active set for at least [`DowntimeJailDuration`](#downtimejailduration). **Example:** @@ -57,15 +57,15 @@ That's ~37 hours instead of ~18.5 hours, assuming 7s block times. * `cosmoshub-4` default: `0.050000000000000000` * `cosmoshub-3` default: `0.050000000000000000` -If a validator in the active set is offline for too long, the validator will be slashed by [`SlashFractionDowntime`](#SlashFractionDowntime) and temporarily removed from the active set for at least the [`DowntimeJailDuration`](#DowntimeJailDuration), which is 10 minutes. +If a validator in the active set is offline for too long, the validator will be slashed by [`SlashFractionDowntime`](#slashfractiondowntime) and temporarily removed from the active set for at least the [`DowntimeJailDuration`](#downtimejailduration), which is 10 minutes. -How long is being offline for too long? There are two components: [`SignedBlocksWindow`](#SignedBlocksWindow) and `MinSignedPerWindow`. Since `MinSignedPerWindow` is 5% and `SignedBlocksWindow` is 10,000, a validator must have signed at least 5% of 10,000 blocks (500 out of 10,000) at any given time to comply with protocol rules. That means a validator that misses 9,500 consecutive blocks will be considered by the system to have committed a liveness violation. The threshold-proportion of blocks is determined by this parameter, so the greater that `MinSignedPerWindow` is, the lower the tolerance for missed blocks by the system. +How long is being offline for too long? There are two components: [`SignedBlocksWindow`](#signedblockswindow) and `MinSignedPerWindow`. Since `MinSignedPerWindow` is 5% and `SignedBlocksWindow` is 10,000, a validator must have signed at least 5% of 10,000 blocks (500 out of 10,000) at any given time to comply with protocol rules. That means a validator that misses 9,500 consecutive blocks will be considered by the system to have committed a liveness violation. The threshold-proportion of blocks is determined by this parameter, so the greater that `MinSignedPerWindow` is, the lower the tolerance for missed blocks by the system. More about liveness [here](https://docs.cosmos.network/main/modules/slashing#signing-info-liveness). #### Decreasing the value of `MinSignedPerWindow` -Decreasing the value of the `MinSignedPerWindow` parameter will increase the threshold for complying with the system's liveness rules. This will make it less likely that offline validators will be slashed by [`SlashFractionDowntime`](#5-SlashFractionDowntime) and temporarily removed from the active set for at least [`DowntimeJailDuration`](#3-DowntimeJailDuration). While out of the active set, the votes of the validator and its delegators do not count toward governance proposals. +Decreasing the value of the `MinSignedPerWindow` parameter will increase the threshold for complying with the system's liveness rules. This will make it less likely that offline validators will be slashed by [`SlashFractionDowntime`](#slashfractiondowntime) and temporarily removed from the active set for at least [`DowntimeJailDuration`](#downtimejailduration). While out of the active set, the votes of the validator and its delegators do not count toward governance proposals. **Example:** @@ -76,7 +76,7 @@ Validators must now sign at least 2.5% of 10,000 blocks, which is 250 blocks. Th That's ~19 hours instead of ~18.5 hours, assuming 7s block times. #### Increasing the value of `MinSignedPerWindow` -Increasing the value of the `MinSignedPerWindow` parameter will decrease the threshold for complying with the system's liveness rules. This will make it more likely that offline validators will be slashed by [`SlashFractionDowntime`](#SlashFractionDowntime) and temporarily removed from the active set for at least [`DowntimeJailDuration`](#DowntimeJailDuration). While out of the active set, the votes of the validator and its delegators do not count toward governance proposals. +Increasing the value of the `MinSignedPerWindow` parameter will decrease the threshold for complying with the system's liveness rules. This will make it more likely that offline validators will be slashed by [`SlashFractionDowntime`](#slashfractiondowntime) and temporarily removed from the active set for at least [`DowntimeJailDuration`](#downtimejailduration). While out of the active set, the votes of the validator and its delegators do not count toward governance proposals. **Example:** @@ -94,7 +94,7 @@ That's ~17.5 hours instead of ~18.5 hours, assuming 7s block times. * `cosmoshub-3` default: `600000000000` -A validator in the active set that's offline for too long, besides being slashed, will be temporarily removed from the active set (aka "[jailed](https://docs.cosmos.network/main/modules/slashing#unjail)") for at least [`DowntimeJailDuration`](#DowntimeJailDuration), which is 10 minutes (`600000000000` nanoseconds). During this time, a validator is not able to sign blocks and its delegators will not earn staking rewards. After the `DowntimeJailDuration` period has passed, the validator operator may send an "[unjail](https://docs.cosmos.network/main/modules/slashing#unjail)" transaction to resume validator operations. +A validator in the active set that's offline for too long, besides being slashed, will be temporarily removed from the active set (aka "[jailed](https://docs.cosmos.network/main/modules/slashing#unjail)") for at least [`DowntimeJailDuration`](#downtimejailduration), which is 10 minutes (`600000000000` nanoseconds). During this time, a validator is not able to sign blocks and its delegators will not earn staking rewards. After the `DowntimeJailDuration` period has passed, the validator operator may send an "[unjail](https://docs.cosmos.network/main/modules/slashing#unjail)" transaction to resume validator operations. More about liveness [here](https://docs.cosmos.network/main/modules/slashing#signing-info-liveness). diff --git a/docs/governance/proposal-types/params-change/Staking.md b/docs/governance/proposal-types/params-change/Staking.md index 15b284e3c3..b878f71218 100644 --- a/docs/governance/proposal-types/params-change/Staking.md +++ b/docs/governance/proposal-types/params-change/Staking.md @@ -61,14 +61,14 @@ Prior to `cosmoshub-3`, the Cosmos Hub had a maximum set of 100 active validator It may be argued that after the Cosmos creators, the validator cohort may be the largest group of contributors to the Cosmos Hub community. Changes to the number of active validator participants may also affect the non-validator contributions to the Cosmos Hub. ### `KeyMaxEntries` -* **The maximum number of unbondings between a delegator and validator within the [unbonding period](#UnbondingTime).** -* **A delegator's maximum number of simultaneous redelegations from one validator to another validator within the [unbonding period](#1-UnbondingTime).** +* **The maximum number of unbondings between a delegator and validator within the [unbonding period](#unbondingtime).** +* **A delegator's maximum number of simultaneous redelegations from one validator to another validator within the [unbonding period](#unbondingtime).** * on-chain value: `{{ $themeConfig.currentParameters.staking.KeyMaxEntries }}` * `cosmoshub-4` default: `7` * `cosmoshub-3` default: `7` -Each delegator has a limited number of times that they may unbond ATOM amounts from a unique validator within the [unbonding period](#1-UnbondingTime). Each delegator also has a limited number of times that they may redelegate from one unique validator to another unique validator within the unbonding period. This limit is set by the parameter `KeyMaxEntries`, which is currently `7`. To be clear, this limit does not apply to a delegator that is redelegating from one validator to different validators. +Each delegator has a limited number of times that they may unbond ATOM amounts from a unique validator within the [unbonding period](#unbondingtime). Each delegator also has a limited number of times that they may redelegate from one unique validator to another unique validator within the unbonding period. This limit is set by the parameter `KeyMaxEntries`, which is currently `7`. To be clear, this limit does not apply to a delegator that is redelegating from one validator to different validators. #### Decreasing the value of `KeyMaxEntries` Decreasing the value of the `KeyMaxEntries` parameter will, within the unbonding period, decrease the number of times that a delegator may unbond ATOM amounts from a single, unique validator. It will also decrease the number of redelegations a delegator may initiate between two unique validators. Since this activity across many accounts can affect the performance of the Cosmos Hub, decreasing this parameter's value decreases the likelihood of a performance reduction in the network. diff --git a/docs/gtm-interchain.md b/docs/gtm-interchain.md index 2f90834062..ddc3bc094e 100644 --- a/docs/gtm-interchain.md +++ b/docs/gtm-interchain.md @@ -72,4 +72,4 @@ Further, we will need technical support that goes beyond the different phase rol The go-to-market team should be tracking the extent to which IBC is succeeding or failing in terms of key metrics. This will require continuous experimentation and coordination between entities. An example of a metric that best represents IBC go to market would be # of distinct IBC connections that transport x amount of value. To get to these metrics we need the developer resources and proven business models that encourage developers to use this technology. -The Cosmos-SDK exposes some [existing metrics for IBC](https://docs.cosmos.network/main/core/telemetry.html#supported-metrics). +The Cosmos-SDK exposes some [existing metrics for IBC](https://docs.cosmos.network/v0.45/core/telemetry.html#supported-metrics). diff --git a/docs/guidelines/code-guidelines.md b/docs/guidelines/code-guidelines.md index 2c5b2548a4..8bef7f6f29 100644 --- a/docs/guidelines/code-guidelines.md +++ b/docs/guidelines/code-guidelines.md @@ -2,12 +2,26 @@ If you want to contribute to a project and improve it, your help is welcome. We want to make Gaia as good as it can be. Contributing is also a great way to learn more about blockchain technology and improve it. Please read this document and follow our guidelines to make the process as smooth as possible. We are happy to review your code but please ensure that you have a reasonable and clean pull request. -This documents idiomatic conventions in the Go code that we follow at Uber. A lot of these are general guidelines for Go, while others extend upon external resources: +This documents idiomatic conventions in the Go code that we follow for gaia development. A lot of these are general guidelines for Go, while others extend upon external resources: 1. [Effective Go](https://golang.org/doc/effective_go.html) 2. [Go Common Mistakes](https://github.com/golang/go/wiki/CommonMistakes) 3. [Go Code Review Comments](https://github.com/golang/go/wiki/CodeReviewComments) +## Maintainability + +From a maintainance, performance and security perspective, it is important to keep the footprint of the `gaiad` application as lean as possible. + +When adding any new feature, you must ensure that any libraries you wish to include are well maintained and have sufficient usage in the wider ecosystem. This is necessary to avoid having to rework the `gaiad` application at a later date, if a library is no longer maintained or is abandoned by its core contributors. + +In addition to the above, if any library is to be included, it is necessary to check that the version used does not have any known vunerabilities. As a developer working on a feature, before making a pull request, ensure that you run, along with the testing targets, the vulnerability checking target in the root of the gaia repository directory: + +```sh +make govulncheck +``` + +The above command will run the vulnerability checker that will detail any known issues for the library version that your using. If any issues are raised, or you have any concerns, please reach out to the core-developers who will be able to advise further. + ## Run tests - Run unit tests @@ -36,7 +50,7 @@ make docker-build-debug && \ make test-e2e ``` -# Guidelines +## Guidelines These guidelines are the conventions that govern our code. These conventions cover far more than just source file formatting. Can `gofmt` and `goimports` handle that for us. @@ -44,48 +58,58 @@ The goal of this guide is to manage this complexity by describing in detail the Try to avoid extensive methods and always test your code. All PRs should have at least 95% of code coverage. -- [Project organization](#project-organization) -- [How to test this project locally](#how-to-test-this-project-locally) +- [Contributing](#contributing) + - [Maintainability](#maintainability) + - [Run tests](#run-tests) + - [Guidelines](#guidelines) + - [Project organization](#project-organization) + - [How to test this project locally](#how-to-test-this-project-locally) - [Unit Tests](#unit-tests) - [End-to-End Tests](#end-to-end-tests) - [Upgrade Test](#upgrade-test) -- [Guidelines](#guidelines) + - [Build current version and move into ./build:](#build-current-version-and-move-into-build) + - [Build gaia v9.0.0 and move into ./build:](#build-gaia-v900-and-move-into-build) + - [Go back to your previous working branch](#go-back-to-your-previous-working-branch) + - [Install cosmovisor](#install-cosmovisor) + - [Run the Chain](#run-the-chain) + - [Run the upgrade](#run-the-upgrade) + - [Monitor for success](#monitor-for-success) + - [Guidelines](#guidelines-1) - [Line Length](#line-length) - [Doc Comments](#doc-comments) - - [Declaring Empty Slices](#declaring-smpty-slices) + - [Declaring Empty Slices](#declaring-empty-slices) - [Indent Error Flow](#indent-error-flow) - [Unnecessary Else](#unnecessary-else) - [Named Result Parameters](#named-result-parameters) - [Package Comments](#package-comments) - [Package Names](#package-names) - [Function Names](#function-names) - - [Pointers](#pointers) + - [Pointers](#pointers) - [Receiver Names](#receiver-names) - [Variable Names](#variable-names) - [Zero-value Mutexes](#zero-value-mutexes) - [Copy Slices and Maps at Boundaries](#copy-slices-and-maps-at-boundaries) - - [Receiving Slices and Maps](#receiving-slices-and-maps) - - [Returning Slices and Maps](#returning-slices-and-maps) + - [Receiving Slices and Maps](#receiving-slices-and-maps) + - [Returning Slices and Maps](#returning-slices-and-maps) - [Errors](#errors) - - [Error Types](#error-types) - - [Error Wrapping](#error-wrapping) - - [Error Naming](#error-naming) + - [Error Types](#error-types) + - [Error Wrapping](#error-wrapping) + - [Error Naming](#error-naming) - [Handle Type Assertion Failures](#handle-type-assertion-failures) - [Avoid Embedding Types in Public Structs](#avoid-embedding-types-in-public-structs) - [Avoid `init()`](#avoid-init) - - [Performance](#Performance) - - [Prefer strconv over fmt](#prefer-strconv-over-fmt) - - [Avoid string-to-byte conversion](#avoid-string-to-byte-conversion) - - [Prefer Specifying Container Capacity](#prefer-specifying-container-capacity) - - [Specifying Map Capacity Hints](#specifying-map-capacity-hints) - - [Specifying Slice Capacity](#specifying-slice-capacity) + - [Performance](#performance) + - [Prefer strconv over fmt](#prefer-strconv-over-fmt) + - [Avoid string-to-byte conversion](#avoid-string-to-byte-conversion) + - [Prefer Specifying Container Capacity](#prefer-specifying-container-capacity) + - [Specifying Map Capacity Hints](#specifying-map-capacity-hints) + - [Specifying Slice Capacity](#specifying-slice-capacity) - [Function Grouping and Ordering](#function-grouping-and-ordering) - [Reduce Nesting](#reduce-nesting) - [Writing Tests](#writing-tests) - [Use Subtests](#use-subtests) - [Avoid writing directly in the stdout](#avoid-writing-directly-in-the-stdout) - [Avoid panic](#avoid-panic) - - [Handle error on the top level](#handle-error-on-the-top-level) ## Project organization @@ -1324,5 +1348,4 @@ It's also easier to maintain. We don't need to find all prints and change the co ### Avoid panic Avoid panic in simple and small methods; all errors should be handled on the top level and application, and we can decide if we will panic or not. -We can also create a proper panic recovery to close all states, open connection from the application, and graceful exit without breaking anything. - +We can also create a proper panic recovery to close all states, open connection from the application, and graceful exit without breaking anything. diff --git a/docs/hub-overview/overview.md b/docs/hub-overview/overview.md index ce1d31c9c5..ae229cbe43 100644 --- a/docs/hub-overview/overview.md +++ b/docs/hub-overview/overview.md @@ -4,10 +4,10 @@ title: Introduction --- ::: warning -### **v10 Upgrade** -Cosmos Hub will be upgraded to [v10](https://github.com/cosmos/gaia/releases/tag/v10.0.0) at block height: **15,816,200** +### **v14 Upgrade** +Cosmos Hub will be upgraded to [v14.1](https://github.com/cosmos/gaia/releases/tag/v14.1.0) at block height: **[18,262,000](https://www.mintscan.io/cosmos/blocks/18262000)** -To upgrade from v9-Lambda check the [**upgrade guide**](../migration/cosmoshub-4-v10-upgrade.md) +To upgrade from v13 check the [**upgrade guide**](../migration/cosmoshub-4-v14-upgrade.md) ::: ![Welcome to the Cosmos Hub](../images/cosmos-hub-image.jpg) @@ -18,7 +18,7 @@ The Cosmos Hub is the first of [thousands of interconnected blockchains](https:/ ## The ATOM -Do you have ATOM tokens? With ATOM, you have the superpower to contribute to the security and governance of the Cosmos Hub. Delegate your ATOM to one or more of the 125 validators on the Cosmos Hub blockchain to earn more ATOM through Proof-of-Stake. You can also vote with your ATOM to influence the future of the Cosmos Hub through on-chain governance proposals. +Do you have ATOM tokens? With ATOM, you have the superpower to contribute to the security and governance of the Cosmos Hub. Delegate your ATOM to one or more of the 180 validators on the Cosmos Hub blockchain to earn more ATOM through Proof-of-Stake. You can also vote with your ATOM to influence the future of the Cosmos Hub through on-chain governance proposals. Learn more about [being a delegator](../delegators/delegator-faq.md), learn about [the security risks](../delegators/delegator-security.md), and start participating with one of the following wallets. @@ -40,26 +40,30 @@ These community-maintained web and mobile wallets allow you to store & transfer * [imToken](https://token.im/) - Android, iOS * [Keplr](https://wallet.keplr.app) - Web * [Ledger](https://www.ledger.com/cosmos-wallet) - Hardware -* [Lunie](https://lunie.io) - Web * [Math Wallet](https://www.mathwallet.org/en/) - Android, iOS, Web * [Rainbow Wallet](https://www.rainbow.one) - Android, iOS * [Trust Wallet](https://trustwallet.com/) Android, iOS -* [Wetez](https://www.wetez.io/pc/homepage) - Android, iOS +* [Komodo Wallet](https://atomicdex.io/en/) +* [Leap Wallet](https://www.leapwallet.io/) - Android, iOS, Web + +## Metamask Snaps + +* [Leap Wallet](https://www.leapwallet.io/snaps) +* [Mystic Lab](https://metamask.mysticlabs.xyz/) ## Cosmos Hub Explorers These block explorers allow you to search, view and analyze Cosmos Hub data—like blocks, transactions, validators, etc. -* [Anthem](https://anthem.chorus.one) * [ATOMScan](https://atomscan.com) * [Big Dipper](https://cosmos.bigdipper.live) -* [Cosmos Overview](https://genesislab.net) -* [Cosmoscan](https://cosmoscan.net/) * [IOBScan](https://cosmoshub.iobscan.io/) -* [LOOK Explorer](https://cosmos.ping.pub) -* [Lunie](https://lunie.io) * [Mintscan](https://mintscan.io) -* [Union Market](https://union.market/token/cosmos) +* [Ping.Pub](https://ping.pub/cosmos) +* [BronBro](https://monitor.bronbro.io/d/cosmos-stats/cosmos) +* [Numia](https://www.datalenses.zone/chain/cosmos) + +* [SmartStake](https://cosmos.smartstake.io/stats) ## Cosmos Hub CLI diff --git a/docs/hub-tutorials/gaiad.md b/docs/hub-tutorials/gaiad.md index 13e3cf945d..91013984d5 100644 --- a/docs/hub-tutorials/gaiad.md +++ b/docs/hub-tutorials/gaiad.md @@ -41,7 +41,7 @@ gaiad config chain-id cosmoshub-2 The keyring holds the private/public keypairs used to interact with a node. For instance, a validator key needs to be set up before running the blockchain node, so that blocks can be correctly signed. The private key can be stored in different locations, called "backends", such as a file or the operating system's own key storage. -Headless environments are recommended to use either the `file` or `pass` backends. More information is available at the [SDK documentation page](https://docs.cosmos.network/main/run-node/keyring.html). +Headless environments are recommended to use either the `file` or `pass` backends. More information is available at the [SDK documentation page](https://docs.cosmos.network/v0.45/run-node/keyring.html). #### Key Types diff --git a/docs/hub-tutorials/join-mainnet.md b/docs/hub-tutorials/join-mainnet.md index 5fdefcfba5..6136fa153f 100644 --- a/docs/hub-tutorials/join-mainnet.md +++ b/docs/hub-tutorials/join-mainnet.md @@ -5,17 +5,24 @@ title: Joining Mainnet # Join the Cosmos Hub Mainnet +The current Cosmos Hub mainnet, `cosmoshub-4`, has been performing in place store migration upgrades as of the [Delta Upgrade](https://github.com/cosmos/gaia/blob/main/docs/migration/cosmoshub-4-delta-upgrade.md) July 2021. The most recent upgrade is [Gaia v14.1.x](https://github.com/cosmos/gaia/blob/main/docs/migration/cosmoshub-4-v14-upgrade.md) Dec 2023. +This type of upgrade preserves the same chain-id but state before the upgrade height is only accessible by corresponding versions of the binary: + +## Release History -The current Cosmos Hub mainnet, `cosmoshub-4`, has been performing in place store migration upgrades as of the [Delta Upgrade](https://github.com/cosmos/gaia/blob/main/docs/migration/cosmoshub-4-delta-upgrade.md) July 2021. The most recent upgrade was [Lambda](https://github.com/cosmos/gaia/blob/main/docs/migration/cosmoshub-4-v9-Lambda-upgrade.md) March 2023. This type of upgrade preserves the same chain-id but state before the upgrade height is only accessible by corresponding versions of the binary: - use `gaia v5.0.x` (Delta) for queries of state between height `6,910,000` and `8,695,000` - use `gaia v6.0.x` (Vega) between `8,695,000` and `10,085,397` - use `gaia v7.0.x` (Theta) between `10,085,397` and `14,099,412` - use `gaia v8.0.x` (Rho) between `14,099,412` and `14,470,501` -- use `gaia v9.0.x` (Lambda) between `14470501` and `15213800` -- use `gaia v9.1.x` between `15213800` and `15816200` -- use `gaia v10.0.x` from `15816200` - -(ie. queries of state between height `6,910,000` and `8,695,000` should use `gaia v5.0.x` (Delta), between `8,695,000` and `10,085,397` use `gaia v6.0.x` (Vega), between `10,085,397` and `14,099,412` use `gaia v7.0.x` (Theta), between `14,099,412` and `14,470,501` use `gaia v8.0.x` (Rho), after `14,470,501` use `gaia v9.0.x` (Lambda) to guarantee correctly encoded responses. The roadmap documentation contains a [history of upgrades](https://github.com/cosmos/gaia/tree/main/docs/roadmap).). Visit the [migration section](https://github.com/cosmos/gaia/tree/main/docs/migration) of the Hub's docs for more information on previous chain migrations. +- use `gaia v9.0.x` (Lambda) between `14,470,501` and `15,213,800` +- use `gaia v9.1.x` between `15,213,800` and `15,816,200` +- use `gaia v10.0.x` between `15,816,200` and `16,596,000` +- use `gaia v11.x` between `16,596,000` and `16,985,500` +- use `gaia v12.x` between `16,985,500` and `17,380,000` +- use `gaia v13.x` between `17,380,000` and `18,262,000` +- use `gaia v14.1.x` from `18,262,000` + +For more details, see the [history of upgrades](https://github.com/cosmos/gaia/tree/main/docs/roadmap) or visit the [migration section](https://github.com/cosmos/gaia/tree/main/docs/migration) of the Hub's docs. **This guide includes full instructions for joining the mainnet either as an archive/full node or a pruned node.** @@ -26,6 +33,7 @@ For instructions to join as a validator, please also see the [Validator Guide](h ### Overview - [Join the Cosmos Hub Mainnet](#join-the-cosmos-hub-mainnet) + - [Release History](#release-history) - [Overview](#overview) - [Background](#background) - [Explorers](#explorers) @@ -70,7 +78,7 @@ Make sure the following prerequisites are completed: - Choose the proper hardware/server configuration. See the [hardware guide](#hardware). - Ensure Gaia is properly installed. See the [installation guide](https://hub.cosmos.network/main/getting-started/installation.html) for a walk-through. -- Follow the [configuration guide](#General-Configuration) to initialize and prepare the node to sync with the network. +- Follow the [configuration guide](#general-configuration) to initialize and prepare the node to sync with the network. ## Hardware @@ -200,7 +208,7 @@ Passing a flag when starting `gaia` will always override settings in the `app.to By default, the REST API is disabled. To enable the REST API, edit the `~/.gaia/config/app.toml` file, and set `enable` to `true` in the `[api]` section. -``` +```toml ############################################################################### ### API Configuration ### ############################################################################### @@ -222,7 +230,7 @@ After restarting the application, access the REST API on `:1317`. By default, gRPC is enabled on port `9090`. The `~/.gaia/config/app.toml` file is where changes can be made in the gRPC section. To disable the gRPC endpoint, set `enable` to `false`. To change the port, use the `address` parameter. -``` +```toml ############################################################################### ### gRPC Configuration ### ############################################################################### @@ -245,11 +253,11 @@ There are two types of concerns when deciding which sync option is right. _Data | Moderate Historical Data | Quicksync - Default | | | Full Historical Data | Quicksync - Archive | Blocksync | -If a node operator wishes to run a full node, it is possible to start from scratch but will take a significant amount of time to catch up. Node operators not concerned with rebuilding original state from the beginning of `cosmoshub-4` can also leverage [Quicksync](#Quicksync)'s available archive history. +If a node operator wishes to run a full node, it is possible to start from scratch but will take a significant amount of time to catch up. Node operators not concerned with rebuilding original state from the beginning of `cosmoshub-4` can also leverage [Quicksync](#quicksync)'s available archive history. -For operators interested in bootstrapping a pruned node, either [Quicksync](#Quicksync) or [State Sync](#State-Sync) would be sufficient. +For operators interested in bootstrapping a pruned node, either [Quicksync](#quicksync) or [State Sync](#state-sync) would be sufficient. -Make sure to consult the [hardware](#Hardware) section for guidance on the best configuration for the type of node operating. +Make sure to consult the [hardware](#hardware) section for guidance on the best configuration for the type of node operating. ::::::: tabs :options="{ useUrlFragment: false }" @@ -260,9 +268,9 @@ Make sure to consult the [hardware](#Hardware) section for guidance on the best Blocksync is faster than traditional consensus and syncs the chain from genesis by downloading blocks and verifying against the merkle tree of validators. For more information see [CometBFT's Fastsync Docs](https://docs.cometbft.com/v0.34/core/fast-sync) -When syncing via Blocksync, node operators will either need to manually upgrade the chain or set up [Cosmovisor](#Cosmovisor) to upgrade automatically. +When syncing via Blocksync, node operators will either need to manually upgrade the chain or set up [Cosmovisor](#cosmovisor) to upgrade automatically. -For more information on performing the manual upgrades, see [Releases & Upgrades](#Releases-amp=-Upgrades). +For more information on performing the manual upgrades, see [Releases & Upgrades](#releases--upgrades). It is possible to sync from previous versions of the Cosmos Hub. See the matrix below for the correct `gaia` version. See the [mainnet archive](https://github.com/cosmos/mainnet) for historical genesis files. @@ -275,7 +283,7 @@ It is possible to sync from previous versions of the Cosmos Hub. See the matrix ##### Getting Started -Start Gaia to begin syncing with the `skip-invariants` flag. For more information on this see [Verify Mainnet](#Verify-Mainnet). +Start Gaia to begin syncing with the `skip-invariants` flag. For more information on this see [Verify Mainnet](#verify-mainnet). ```bash gaiad start --x-crisis-skip-assert-invariants @@ -297,7 +305,7 @@ With the block height and hash selected, update the configuration in `~/.gaia/co > **Note**: In the future, the RPC server requirement will be deprecated as state sync is [moved to the p2p layer in Tendermint 0.38](https://github.com/tendermint/tendermint/issues/6491). -``` +```toml ####################################################### ### State Sync Configuration Options ### ####################################################### @@ -360,7 +368,7 @@ While not advised, if a node operator needs to customize this feature, it can be In `app.toml` -``` +```toml ############################################################################### ### State Sync Configuration ### ############################################################################### @@ -381,10 +389,9 @@ snapshot-keep-recent = 10 **See all [Gaia Releases](https://github.com/cosmos/gaia/releases)** -The most up to date release of Gaia is [`V9.1.1`](https://github.com/cosmos/gaia/releases/tag/v9.1.1). For those that want to use state sync or quicksync to get their node up to speed, starting with the most recent version of Gaia is sufficient. - +The most up to date release of Gaia is above. For those that want to use state sync or quicksync to get their node up to speed, starting with the most recent version of Gaia is sufficient. -To sync an archive or full node from scratch, it is important to note that you must start with [`V4.2.1`](https://github.com/cosmos/gaia/releases/tag/v4.2.1) and proceed through two different upgrades Delta at block height `6,910,000`, Vega at block height `8,695,000`, Theta at block height `10,085,397`, Rho at block height `14099412` and Lambda at block height `14,470,501`. +To sync an archive or full node from scratch, it is important to note that you must start with [`V4.2.1`](https://github.com/cosmos/gaia/releases/tag/v4.2.1) and proceed through two different upgrades Delta at block height `6,910,000`, Vega at block height `8,695,000`, Theta at block height `10,085,397`, Rho at block height `14099412` and Lambda at block height `14,470,501` and so on. The process is summarized below but make sure to follow the manual upgrade instructions for each release: @@ -449,6 +456,7 @@ Again, make sure to backup `~/.gaia` Install Gaia [`V9.0.0`](https://github.com/cosmos/gaia/releases/tag/v9.0.0) and restart the daemon. +Repeat the process for newer versions of the Gaia application at the [stated block heights above](#release-history). ## Cosmovisor diff --git a/docs/hub-tutorials/join-testnet.md b/docs/hub-tutorials/join-testnet.md index 5d96075c21..7ec7c4e061 100644 --- a/docs/hub-tutorials/join-testnet.md +++ b/docs/hub-tutorials/join-testnet.md @@ -7,12 +7,12 @@ title: Joining Testnet This tutorial will provide all necessary instructions for joining the current public testnet. If you're interested in more advanced configuration and synchronization options, see [Join Mainnet](./join-mainnet.md) for a detailed walkthrough. -* Current Version: v9-Lambda +* Current Version: v14 * Chain ID: `theta-testnet-001` ## Background -The Cosmos Hub Public Testnet is currently running Gaia v8. Visit the [testnet explorer](https://explorer.theta-testnet.polypore.xyz/) to view all on-chain activity. +The Cosmos Hub Public Testnet is currently running Gaia v13. Visit the [testnet explorer](https://explorer.theta-testnet.polypore.xyz/) to view all on-chain activity. For those who just need instructions on performing the upgrade, see the [Upgrading Your Node](#upgrading-your-node) section. @@ -20,12 +20,17 @@ For those who just need instructions on performing the upgrade, see the [Upgradi The table below shows all past and upcoming versions of the public testnet. -| Release | Upgrade Block Height | Upgrade Date | -|:----------:|:--------------------:|:-------------------:| -| v9.0.0-rc3 | 14,476,206 | 2023-02-08 | -| v8.0.0-rc3 | 14,175,595 | 2023-01-20 | -| v7.0.0-rc0 | 9,283,650 | 2022-03-17 | -| v6.0.0 | Genesis | Launched 2022-03-10 | +| Release | Upgrade Block Height | Upgrade Date | +| :---------: | :------------------: | :-----------------: | +| v14.0.0-rc0 | TBA | TBA | +| v13.0.0-rc0 | 17,996,550 | 2023-09-20 | +| v12.0.0-rc0 | 17,550,150 | 2023-08-23 | +| v11.0.0-rc0 | 17,107,825 | 2023-07-26 | +| v10.0.0-rc0 | 16,117,530 | 2023-05-24 | +| v9.0.0-rc3 | 14,476,206 | 2023-02-08 | +| v8.0.0-rc3 | 14,175,595 | 2023-01-20 | +| v7.0.0-rc0 | 9,283,650 | 2022-03-17 | +| v6.0.0 | Genesis | Launched 2022-03-10 | See the [Gaia release page](https://github.com/cosmos/gaia/releases) for details on each release. @@ -40,7 +45,7 @@ We offer three ways to set up a node in the testnet: * Step-by-step instructions * The rest of this document provides a step-by-step walkthrough for setting up a testnet node. -We recommend running public testnet nodes on machines with at least 8 cores, 16GB of RAM, and 300GB of disk space. +We recommend running public testnet nodes on machines with at least 8 cores, 32GB of RAM, and 300GB of disk space. ## Sync Options @@ -54,33 +59,36 @@ State Sync is far faster and more efficient than Fast Sync, but Fast Sync offers ## Step-by-Step Setup The following set of instructions assumes you are logged in as root. + * You can run the relevant commands from a sudoer account. * The `/root/` part in service file paths can be changed to `/home//`. ### Build Tools Install build tools and Go. + ```shell sudo apt-get update sudo apt-get install -y make gcc -wget https://go.dev/dl/go1.20.3.linux-amd64.tar.gz -sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.20.3.linux-amd64.tar.gz +wget https://go.dev/dl/go1.20.linux-amd64.tar.gz +sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.20.linux-amd64.tar.gz export PATH=$PATH:/usr/local/go/bin ``` ### Installation & Configuration -You will need to install and configure the Gaia binary using the script below. The Cosmos Hub Public Testnet is running Gaia [`v9.0.0-rc6`](https://github.com/cosmos/gaia/releases/tag/v9.0.0-rc6). +You will need to install and configure the Gaia binary using the script below. The Cosmos Hub Public Testnet is running Gaia [`v13.0.0-rc0`](https://github.com/cosmos/gaia/releases/tag/v13.0.0-rc0). * For up-to-date endpoints like seeds and state sync RPC servers, visit the [testnets repository](https://github.com/cosmos/testnets/tree/master/public). Build the gaiad binary and initialize the chain home folder. -``` + +```shell cd $HOME git clone https://github.com/cosmos/gaia cd gaia # To sync from genesis, comment out the next line. -git checkout v9.0.0-rc6 +git checkout v13.0.0-rc0 # To sync from genesis, uncomment the next line and skip the State Sync Setup section. # git checkout v6.0.4 make install @@ -89,7 +97,8 @@ gaiad init ``` Prepare the genesis file. -``` + +```shell cd $HOME wget https://github.com/cosmos/testnets/raw/master/public/genesis.json.gz gzip -d genesis.json.gz @@ -108,8 +117,7 @@ State sync requires you to configure a trust height and trust hash. These depend * Visit a [testnet explorer](https://explorer.theta-testnet.polypore.xyz/) to find the block and hash for the current height - 1000. * Set these parameters in the code snippet below: `` and ``. - -``` +```shell cd $HOME/.gaia/config sed -i 's/enable = false/enable = true/' config.toml sed -i 's/trust_height = 0/trust_height = /' config.toml @@ -121,7 +129,7 @@ sed -i 's/rpc_servers = ""/rpc_servers = "http:\/\/state-sync-01.theta-testnet.p ### Cosmovisor Setup (Optional) -Cosmovisor is a process manager that monitors the governance module for incoming chain upgrade proposals. When a proposal is approved, Cosmovisor can automatically download the new binary, stop the chain binary when it hits the upgrade height, switch to the new binary, and restart the daemon. Cosmovisor can be used with either Fast Sync or State Sync. +Cosmovisor is a process manager that monitors the governance module for incoming chain upgrade proposals. When a proposal is approved, Cosmovisor can automatically download the new binary, stop the chain binary when it hits the upgrade height, switch to the new binary, and restart the daemon. Cosmovisor can be used with either Fast Sync or State Sync. The instructions below provide a simple way to sync via Cosmovisor. For more information on configuration, check out the Cosmos SDK's [Cosmovisor documentation](https://github.com/cosmos/cosmos-sdk/tree/main/tools/cosmovisor). @@ -135,9 +143,10 @@ Cosmovisor requires the creation of the following directory structure: └── gaiad ``` -Install Cosmovisor and copy Gaia binary to genesis folder -``` -go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@v1.3.0 +Install Cosmovisor and copy Gaia binary to genesis folder: + +```shell +go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.5.0 mkdir -p ~/.gaia/cosmovisor/genesis/bin cp ~/go/bin/gaiad ~/.gaia/cosmovisor/genesis/bin/ ``` @@ -146,11 +155,11 @@ cp ~/go/bin/gaiad ~/.gaia/cosmovisor/genesis/bin/ * Cosmos Hub recommends running `gaiad` or `cosmovisor` with the `--x-crisis-skip-assert-invariants` flag. If checking for invariants, operators are likely to see `rounding error withdrawing rewards from validator`. These are expected. For more information see [Verify Mainnet](./join-mainnet.md#verify-mainnet). - Create one of the following service files. If you are not using Cosmovisor: `/etc/systemd/system/gaiad.service` -``` + +```toml [Unit] Description=Gaia service After=network-online.target @@ -166,7 +175,8 @@ WantedBy=multi-user.target ``` If you are using Cosmovisor: `/etc/systemd/system/cosmovisor.service` -``` + +```toml [Unit] Description=Cosmovisor service After=network-online.target @@ -190,19 +200,22 @@ WantedBy=multi-user.target ### Start the Service Reload the systemd manager configuration. -``` + +```shell systemctl daemon-reload systemctl restart systemd-journald ``` If you are not using Cosmovisor: -``` + +```shell systemctl enable gaiad.service systemctl start gaiad.service ``` If you are using Cosmovisor: -``` + +```shell systemctl enable cosmovisor.service systemctl start cosmovisor.service ``` @@ -223,16 +236,17 @@ Follow these instructions if you have a node that is already synced and wish to When the chain reaches the upgrade block height specified by a software upgrade proposal, the chain binary will halt and expect the new binary to be run (the system log will show `ERR UPGRADE "" NEEDED at height: XXXX` or something similar). There are three ways you can update the binary: + 1. Without Cosmovisor: You must build or download the new binary ahead of the upgrade. When the chain binary halts at the upgrade height: - * Stop the gaiad service with `systemctl stop gaiad.service`. - * Build or download the new binary, replacing the existing `~/go/bin` one. - * Start the gaiad service with `systemctl start gaiad.service`. +* Stop the gaiad service with `systemctl stop gaiad.service`. +* Build or download the new binary, replacing the existing `~/go/bin` one. +* Start the gaiad service with `systemctl start gaiad.service`. 2. With Cosmovisor: You must build or download the new binary and copy it to the appropriate folder ahead of the upgrade. 3. With Cosmovisor: Using the auto-download feature, assuming the proposal includes the binaries for your system architecture. The instructions below are for option 2. For more information on auto-download with Cosmovisor, see the relevant [documentation](https://github.com/cosmos/cosmos-sdk/tree/main/tools/cosmovisor#auto-download) in the Cosmos SDK repo. -If the environment variable `DAEMON_ALLOW_DOWNLOAD_BINARIES` is set to `false`, Cosmovisor will look for the new binary in a folder that matches the name of the upgrade specified in the software upgrade proposal. For the `v9-Lambda` upgrade, the expected folder structure would look as follows: +If the environment variable `DAEMON_ALLOW_DOWNLOAD_BINARIES` is set to `false`, Cosmovisor will look for the new binary in a folder that matches the name of the upgrade specified in the software upgrade proposal. For the `v14` upgrade, the expected folder structure would look as follows: ```shell .gaia @@ -242,27 +256,27 @@ If the environment variable `DAEMON_ALLOW_DOWNLOAD_BINARIES` is set to `false`, │ └── bin | └── gaiad └── upgrades - └── v9-lambda + └── v14 └── bin └── gaiad ``` -> Note: for Cosmovisor v1.0.0, the upgrade name folder is not lowercased (use `cosmovisor/upgrades/v9-Lambda/bin` instead) - Prepare the upgrade directory -``` -mkdir -p ~/.gaia/cosmovisor/upgrades/v8-rho/bin + +```shell +mkdir -p ~/.gaia/cosmovisor/upgrades/v14/bin ``` Download and install the new binary version. -``` + +```shell cd $HOME/gaia git pull -git checkout v8.0.0 +git checkout v14.0.0-rc0 make install -# Copy the new binary to the v8-Rho upgrade directory -cp ~/go/bin/gaiad ~/.gaia/cosmovisor/upgrades/v9-lambda/bin/gaiad +# Copy the new binary to the v14 upgrade directory +cp ~/go/bin/gaiad ~/.gaia/cosmovisor/upgrades/v14/bin/gaiad ``` When the upgrade height is reached, Cosmovisor will stop the gaiad binary, copy the new binary to the `current/bin` folder and restart. After a few minutes, the node should start syncing blocks using the new binary. diff --git a/docs/hub-tutorials/upgrade-node.md b/docs/hub-tutorials/upgrade-node.md index 1aa5b1666a..570369cdf5 100644 --- a/docs/hub-tutorials/upgrade-node.md +++ b/docs/hub-tutorials/upgrade-node.md @@ -80,10 +80,6 @@ gaiad start ## Upgrade Genesis File -:::warning -If the new version you are upgrading to has breaking changes, you will have to restart your chain. If it is not breaking, you can skip to [Restart](#restart) -::: - To upgrade the genesis file, you can either fetch it from a trusted source or export it locally. ### Fetching from a Trusted Source @@ -122,10 +118,6 @@ At this point, you might want to run a script to update the exported genesis int ## Reset Data -:::warning -If the version you are upgrading to is not breaking from the previous one, you should not reset the data. If it is not breaking, you can skip to [Restart](#restart) -::: - ::: warning If you are running a **validator node** on the mainnet, always be careful when doing `gaiad unsafe-reset-all`. You should never use this command if you are not switching `chain-id`. ::: diff --git a/docs/interchain-security.md b/docs/interchain-security.md deleted file mode 100644 index 16954f26c5..0000000000 --- a/docs/interchain-security.md +++ /dev/null @@ -1,161 +0,0 @@ -# Interchain Security - -# Introduction - -Interchain Security has been referred to in many different ways: Shared Security, Cross Chain Validation, Cross Chain Collateralization, Shared Staking. This document will restrict use to the following three terms: - -* **Shared Security** - * Shared security is a family of technologies that include optimistic rollups, zk-rollups, sharding and interchain security. -* **Interchain Security** - * Interchain Security is the Cosmos specific category of Shared Security that uses IBC (Inter-Blockchain Communication). -* **Cross Chain Validation** - * Cross Chain Validation is the specific IBC level protocol that enables Interchain Security. - -While there are many ways that Interchain Security could take place, this document will focus on one instance of Interchain Security that has particularly valuable attributes for the ATOM token and the Cosmos Hub. The resulting technology may be applied to other scenarios with little to no modification, but I will leave those out for now (or only dedicate a small section) since the current priority is to implement this feature for the Cosmos Hub. - -At a very high level, Interchain Security is the ability for staking tokens that have been delegated to validators on a Provider Chain to inform the composition of a validator set on a Consumer Chain. Inter-Blockchain Communication is utilized to relay updates of validator stake delegations from the Provider Chain to the Consumer Chain so that the Consumer Chain will have an up-to-date model of which validators can produce blocks on the Consumer Chain. The inclusion of Provider Chain validators can be mandatory or opt-in depending on the requirements of the Consumer Chain. The Provider Chain will honor any proof of validator misbehavior produced by the Consumer Chain as evidence that results in slashing the stake of misbehaving validators on the Provider Chain. In this way the security gained from the value of the stake locked on the Provider Chain will be shared with the Consumer Chain. - -# Cosmos Hub User Story - -There are two primary reasons that Interchain Security is valuable to the Cosmos Hub. The first reason is because it allows for hub minimalism and the second is to lower the barrier to launching and running secure sovereign decentralized public blockchains. - -## Practical Hub Minimalism - -Hub Minimalism is the strategic philosophy that posits that the Cosmos Hub should have as few features as possible in order to decrease the surface area for security vulnerabilities and to reduce the chance of a conflict of interest between user groups. A hub minimalist might be against the governance module from being on the same blockchain as a DEX since users of the governance module must now accommodate users of the DEX even when they have different interests. At best, divergent user groups can peacefully coexist and at worst they may result in hard-forks that diverge in the features of an application. - -The current Cosmos Hub is adding more features, which carries some of the risks that hub minimalism is concerned with. Should Interchain Security become available, it would be possible to satisfy hub minimalists by allowing for each distinct feature of the Cosmos Hub to be an independent chain validated by the same set of ATOM delegated validators. This way the operation of each function could occur independently without affecting the operation of other ATOM secured hub-specific applications. - -## Lowering the Barrier to Security - -The security of a network is often described as a function of the cost for attacking that network. In Tendermint consensus we target ⅓ and ⅔ of locked stake for various guarantees about liveness and correctness. This means that in order to do any of a variety of attacks against the network, you would need to acquire ⅓+ or ⅔+ of all stake. The crude way to calculate the cost of an attack is to take the quantity of tokens needed to achieve these proportions and multiply it by the current market price for that token. We'll call this the Cost of Corruption. - -The Cost of Corruption calculation doesn't account for the availability of any specific token but it does give a very rough estimate for how secure a chain is. It's important that the total value locked (TVL) on a chain remains less than the Cost of Corruption, otherwise the chain should be considered insecure. Since the ability of a chain to serve a valuable purpose is often dependent on the TVL it can handle, it's important to find ways to increase the Cost of Corruption for chains in the Cosmos ecosystem. One method of doing this is to lend the value of the Cosmos ATOM to the Cost of Corruption of any chain. This becomes possible with Interchain Security as the ATOM, which already has a sizeable market cap, can increase the Cost of Corruption of a new chain. - -# The Interchain Security Stack - -How Interchain Security works at a technical level is still in the process of development but the stack at a high level is well mapped out. It requires new functionality and modifications to current functionality on both Provider Chain and Consumer Chains. The technology can be developed progressively so that a minimum viable set of functionality can be launched as a V1 before an extended set of functionality is launched at a later date. - -## Chain Registry - -### V1 - Full Validator Set - -To work iteratively, the simplest version of Interchain Security is the first milestone and includes the entire validator set of the Provider Chain. In order to ensure that the entire validator set is prepared to validate on a Consumer Chain, it must pass the Provider Chain governance process. The governance proposal is attached to a new Chain Registry module. This module keeps track of Consumer Chains who wish to use the Provider Chain's validator set. Like all governance proposals, the risks and benefits should be socialized off-chain and eventually ratified with an on-chain vote. Should the vote pass, the Consumer Chain will be able to begin the process of using Interchain Security. It is expected that the first Consumer Chains will be thought of as extensions of the Cosmos Hub itself; essentially modules that would otherwise run on the Cosmos Hub directly, but for one reason or another are better suited to be on their own application-specific blockchain. These Consumer Chains can be thought of as having the same security guarantees as the Cosmos Hub, secured by the full force of the ATOM staking token. These Consumer Chains may or may not provide fees and rewards to the Provider Chain validators, depending on the specific application design. They may be deemed valuable enough to the success of Cosmos and the ATOM that validators participate voluntarily, or they may have an application-specific governance token that is used as a fee token and rewarded to validators and their constituent delegators. - -### V2 - Partial Validator Set (Opt-In) - -Once V1 has been finalized the next milestone would be to create a version of the Chain Registry where Provider Chain validators opt-in to participating as a validator on the Consumer Chain. It is expected that the candidates for Opt-In Interchain Security are not considered part of the Cosmos Hub itself, but independent networks. It is up to each Consumer Chain to advertise the benefits that Provider Chain validators receive for their participation. This could be purely the chance to receive fees on a new network, it could be paired with some genesis distribution of tokens, it could be paired with some off chain legal agreement to pay for the staking services, or any other kind of benefit. This benefit is not enforced by Interchain Security, but able to be facilitated in a number of ways. - -Regardless of V1 or V2, one must assume that each validator has considered the work it takes to run a validator for the Consumer Chain in order to produce blocks on that network, and considered the risk of having their Provider Chain stake (ATOMs) slashed should they do a poor job validating on that network. In order to opt-in, the validator must use their validator key to submit a transaction to the Chain Registry with the intention of being included in a set of validators of a relevant Consumer Chain. - -The final piece of information relevant to the Chain Registry is the Time Til Launch (TTL) for each Consumer Chain. The TTL designates the point of no return for Validators to join or leave the Chain Registry. At that point the list of validators contained within the registry for a specific network can be exported to an initial genesis file for that network. If this network is transitioning to use Interchain Security from a sovereign validator set, this will be seen as a network upgrade where the validator set gets completely redefined. - -It will be possible for a Validator to join an already running Interchain Secured network but if they intend to be part of the original genesis validator set they should join before the TTL. A chain within the registry may not produce a TTL until there is a threshold number of validators or amount of stake reached. Future versions of Interchain Security may help automate these thresholds but an initial version will be manually controlled. - -## Provider Chain Staking Module - -Tendermint uses ABCI to get a set of validators and voting powers from the state machine in order to perform consensus on block production. This information is stored within the staking module of the Cosmos SDK application. In the configuration of Interchain Security, the Consumer Chain also has an instance of Tendermint that uses ABCI to ask for a set of validators and their voting powers. However instead of coming directly from the staking module of the Consumer Chain, in a sense it needs to come from the staking module of the Provider Chain. Practically speaking the state of the staking module of the Provider Chain is relayed periodically via IBC to the Consumer Chain, where it is stored in the Consumer Chain staking module and accessible to Tendermint via ABCI. - -In order for the Provider Chain to relay validator sets and voting powers to the Consumer Chain, it needs to be able to distinguish between validator sets relevant to different networks. In V2, not all validators within a Provider Chain staking module will have opted-in to being part of each Consumer Chain set. In order to support Interchain Security, the Provider Chain will need to be extended to differentiate between sets of validators and their voting powers with respect to various chains as designated within the Chain Registry. - -To provide the necessary functionality on the Provider Chain, a wrapper module may need to be implemented that will collate staking module validators with regard to their inclusion in sets stored within the Chain Registry. A module like this will need to import both the Chain Registry Keeper and the Staking Keeper in order to make chain specific staking queries. These queries will be requested periodically by the Cross Chain Validation module and relayed to the Consumer Chain via IBC. This module can be referred to as the "xStaking Module". - -### Validator set limits - -The current Cosmos Hub has a limit of 180 validators. This limit is imposed on validators who are interested in producing blocks as part of a validator set of the Cosmos Hub itself. This limits the number of eligible validators for Consumer Chains to the same top 180 Cosmos Hub participants. However, just because a validator doesn't have enough staked ATOM to be eligible to validate on the Cosmos Hub, doesn't mean that they shouldn't qualify to validate on another Consumer Chain. - -Interchain Security should increase the diversity of the validator ecosystem by lowering the barrier to running a profitable validator business. This will go far in creating a healthy ecosystem of diverse validators that will result in anti-fragile and robustly operated networks. In order to make it possible for the top 180 validators to remain eligible as block producers for the Cosmos Hub while increasing the number of eligible validators for Consumer Chains, the Staking Module needs to stop forcing validators to undelegate when they leave the top set of 180 validators. This will result in a longer list of validators with ATOM delegations that are not participating in block production on the Provider Chain (Cosmos Hub). These extra validators will however be eligible to produce blocks on Consumer Chains and use their delegated ATOMs to earn rewards on the Consumer Chains as well as risk their Provider Chain ATOMs to slashable events should they misbehave on Consumer Chains. - -### Chain-Specific Delegations - -In order to further fulfil the goal of creating a diverse set of validators with healthy competition it is important to work towards chain-specific delegations. As described above and for the initial version of Interchain Security, the chain-specific validation calculation is determined by the validator being included in the Consumer Chain validator set. That means that all the individual delegations made to that validator are included as part of the decision. Similar to how a validator is able to decide its own commission rate, one may decide that it is the prerogative of that validator to make this decision on behalf of its delegators. Luckily if a delegator disagrees with the choice a validator has made on their behalf, they can redelegate to a validator that is better aligned with the wishes of the delegator. - -Initially it is up to validators to evaluate whether participation in a Consumer Chain validator set is worth the extra work and risk it imposes. Subsequently it is up to a delegator to decide whether the choices of their validator are aligned with their own. However it may be the case that a delegator agrees with how a validator operates on the Provider Chain and wishes to stay delegated there, but disagrees with the choice to participate (or not) on a Consumer Chain. - -Initially the cost to validators to operate a new node instance on a new network may prohibit smaller validators from participating. It could be imagined that validating is a business of scale and the larger the operation the easier it is to scale further. This may result in only the largest validators from participating in Interchain Security. In order to ensure that delegators don't all redelegate their ATOMs to these super validators, it's important to build out the ability to delegate to validators on a per-chain basis. This would allow a delegator to delegate ATOMs to a small but well run validator on the Hub while also delegating the same ATOMs to a larger and less risk averse validator for a Consumer Chain at the same time. Should the larger validator misbehave and be slashed on the Provider Chain, the stake of that specific delegator would also be slashed. This would decrease the amount of stake the original small validator has delegated, but only with regard to that one delegator. - -The optionality around complex delegations would eventually increase the possible diversity of validator operations. However due to the complexity of such delegations, this functionality is assumed to be part of a future version of Interchain Security. - -### Epoch Staking - -The current Staking Module of the Cosmos SDK is moving towards Epoch based staking. This means that instead of validator set delegation amounts being calculated on a per block basis, they will be calculated over some length of time (or blocks) called an Epoch. This will decrease the number of times staking is calculated and generally decrease the complexity involved in staking. The additional complexity of chain relevant stake calculations will similarly benefit from a general simplification of stake calculations, and it will require less packets to be sent between the chains. - -## Provider Chain Distribution Module - -The distribution module of the Cosmos SDK uses a system called F1 to keep track of how many staking tokens that delegators have bonded to different validators and for how long they've been doing it. Block production rewards and all transaction fees are pooled into the distribution module account at the end of each block, and then distributed to each validator account based on their total voting power. When a delegator wants to withdraw rewards, the distribution module calculates the number of rewards received by their validator on their behalf since the delegator last withdrew, and calculates the outcome based on the amount of stake that belongs to the delegator compared to the total stake of the validator. - -Luckily, this system is sufficient to handle the distribution of rewards that come to the Provider Chain from a Consumer Chain. Since the distribution module is collecting all fees from the last epoch, and these fees can be in any variety of denominations, it can be similarly used to distribute Consumer Chain fees. The Consumer Chain can simply use an IBC transfer packet to send the entire batch of fees from a single epoch to the Provider Chain at the end of the epoch, targeted directly at the distribution module account. From the perspective of the distribution module account, these will look like normal fees collected and be distributed to all the validators and their delegators. This simple solution will only work when it is the entire validtor set participating in Interchain Security (V1 Full Validator Set). - -To distinguish fees in a Partial Validator Set (Opt-In), the distribution module will need to be extended to contain a chain-id as recorded in the Chain Registry in order to differentiate which pool of rewards are being distributed. If and when the xStaking module contains complex delegations, the stakingKeeper method for calculating delegations would also need to include the Chain Registry reference to chain-id in order to properly calculate the delegation rewards with regard to the specific Consumer Chain. In the meantime, for Interchain Security V1 this is unnecessary. - -## IBC & Cross Chain Validation - -There are a number of IBC application layer modules and packets that need to be developed to fully realize the IBC component of Interchain Security. This work has begun with a spec draft from Informal Systems that is visible at [@ibc/cross-chain-validation](https://github.com/cosmos/ibc/tree/main/spec/app/ics-028-cross-chain-validation). Instead of diving into the details of what they are and exactly how they work this section will be reserved for high level responsibilities of these mechanisms. - -There are three types of operations within Cross Chain Validation which must be present for Interchain Security to take place: - -* Validator Set Updates -* Evidence - -### Validator Set Updates - -The primary duty of Cross Chain Validation is to relay the set of validators and their voting power. The inclusion of a validator within a set relevant to a specific Consumer Chain is designated within the Chain Registry. The voting power denominated in Provider Chain staking token is designated within the staking module. The xStaking module allows for the collation of validators and their delegations on a chain specific designation. This collation is what must be relayed to the Consumer Chain via Cross Chain Validation. - -The rate at which these validator set updates are relayed is a function of safety. At one extreme you could imagine the validator set being collated and relayed with every single epoch that is produced on the Provider Chain. This would ensure that the Consumer Chain has an absolutely accurate representation of validator weights at every potential state update within the Provider Chain. However, since delegations are subject to unbonding periods it is possible to approach state updates more conservatively. At another extreme, one may reason that if there is no active stake unbonding happening on the Provider Chain, it may be assumed that a validator set update will not be possible within a maximum duration of that unbonding period and so a validator set update can wait until just before that moment. Based on the possibility of instant redelegations this assumption may need to be further adjusted. - -The process of recording and relaying validator set updates within safe and correct periods is the focus of the spec and research at Informal Systems. We can assume that the design will be aware of the necessary cadence that validator set updates must take place to ensure safe operation. When there are no updates it may be necessary to simply acknowledge this with something like a heartbeat IBC packet. - -### Reward Distribution - -While Interchain Security may remove the necessity for a staking token to play a role in the token design of new blockchains, it can be assumed that there will be some sort of economic system in place to reward validators for producing blocks. To follow the default capabilities of the Cosmos SDK one would assume that there is a simple inflationary reward token attached to the production of blocks. This token may also be a governance token and the value may be implied by the ability to govern an otherwise useful and valuable network. The token could have many uses or reasons to exist, but being the responsibility of each blockchain to design its own purpose, we will assume some sort of reward token exists and is used to reward validators for the production of blocks. - -In the current system rewards are pooled into the distribution module account. The distribution module imports the staking module to keep track of validator weights in order to calculate and distribute rewards on a per-delegator basis. For this to take place on the Consumer Chain it would be necessary for not only the validator set and validator voting power to be relayed with cross chain validation, but also all constituent delegators that compose each validator. This would result in an extremely large IBC packet which would make regular communication difficult if not impossible. Rather than relay all delegators, this information should stay on the Provider Chain within the Provider Chain staking module. - -Instead of distributing rewards on the Consumer Chain, the rewards collected for each block produced should be transferred to the Provider Chain at some interval. It may be a regular interval or a user initiated IBC packet, but would be similar to an ics-20 token transfer from the distribution module account of the Consumer Chain to the distribution module account of the Provider Chain. The difference between a standard ics-20 transfer being that the Provider Chain distribution module account needs to know which chain the rewards came from and over which period they were collected if this was not using V1 Full Validator Set Interchain Security. This information will be necessary to perform the Provider Chain distribution module's responsibility of distributed rewards to delegators and validators on a per chain basis informed by the Chain Registry. - -### Evidence - -In a single chain system, a validator may misbehave in various ways that result in the stake attached to that validator being slashed. This can occur automatically within the state machine or only after evidence of the misbehaviour has been collected and submitted to the chain. In a scenario where the validator set for a Consumer Chain is secured by stake that exists only on the Provider Chain, the evidence of misbehaviour needs to be submitted to the Provider Chain, where the tokens at stake are able to be slashed. Similar to a single chain system, this may take place automatically or only with the manual submission of evidence. If it were to occur automatically it would mean an outgoing IBC packet could be automatically generated but would still need to be manually relayed to the Provider Chain where punishment could follow. The more manual scenario would mean that the misbehaviour on the Consumer Chain results in evidence which is submitted directly to the Provider Chain, or submitted to the Consumer Chain which if successfully processed would result in an outgoing IBC packet containing the instruction to slash at the level of the Provider Chain. - -Either way comes with the question of whether it should be the Provider Chain that is verifying the evidence of slashable events, or simply trusting the Consumer Chain's commands to slash validators at the level of the Provider Chain. While there may be the ability to both, trusting the Consumer Chain makes the job of the Provider Chain much easier. In that scenario the Provider Chain doesn't need to have knowledge of the logic contained within the Consumer Chain that may be necessary for determining whether a slashable offense took place. Trusting the Consumer Chain to enforce its own rules puts a lot of trust in the Consumer Chain to not abuse the position and submit a wave of slashable commands that may reduce a validator to nothing. However this is ultimately the responsibility of the validator to ensure that the slashable risk of validating on a Consumer Chain is worth the expected rewards. This includes determining whether the state machine of the Consumer Chain includes logic that the validator is comfortable with. - -Limits on a Consumer Chain's ability to slash a Provider Chain validator may also be imposed at the Provider Chain level. For instance it is possible to make it a required parameter of a Consumer Chain within the Chain Registry to provide a maximum slashing rate. This would ensure that a validator knows even if they violate all the rules of a Consumer Chain, they can still limit the damage to their stake by some amount. It is also possible to enforce a parameter at the level of the Provider Chain that prevents a validator from joining any combination of Consumer Chain validator sets that results in a combined slashable rate over some threshold. For instance if there are 3 Consumer Chains that each have maximum slashable rates of 33% over X blocks, and the Provider Chain has a safety limit for validators that require them to stay below a total of 90% slashable events over X blocks, no validator would be allowed to join the Chain Registry for all 3 of those Consumer Chains. This parameter on the Provider Chain should be a governance parameter that can be adjusted by token staked voting to reflect the risk appetite of the actual validator set of the Provider Chain. - -Consideration should be made to the incentives around submitting evidence in order to ensure that punishable offenses do not go unnoticed. This is a similar issue to Relayer Incentivization, where currently it costs some fee to relay IBC packets but there is no reward or payment possible as part of the core IBC logic. As a result IBC packets are currently relayed in an altruistic manner. It's important to ensure that for integrity of the operation of the child and Provider Chain that slashable offenses are always submitted. It may be that the slashable amounts of tokens are used as rewards for submitting the evidence (assuming it's possible to ensure it is not the culprit submitting their own evidence and regaining their stake). Maybe some flat fee to at least pay for the transactions are required, although this may become redundant with the addition of any Relayer incentivizations into core IBC. - -## Consumer Chain Staking Module - -With Interchain Security, the Consumer Chain receives updates of the Provider Chain's set of validator's voting power via cross chain validation IBC packets. These updates are used to populate the Consumer Chain's staking module. On the Consumer Chain, Tendermint consensus is running which asks the Consumer Chain staking module for the current list of validators and their voting power. This could work virtually the same as a traditional configuration without Interchain Security, as from the perspective of Tendermint the flow is the same (ABCI asks the staking module for this information). - -### V3 Layered Security - -Instead of aligning as closely as possible with the current staking module, a wrapper staking module could be made with additional functionality. This would allow Consumer Chains to create their own staking design that extends the validator set received from the Provider Chain. For example the validator set from the Provider Chain could be stored as it is received in a staking-like module. In addition another module could be used to track delegations to an overlapping set of validators using a secondary local staking token. The actual set of validators and their voting power could be a combination of these two sets and passed to Tendermint via ABCI. This combination could be customized per chain or as per need, for instance it may just boost the power of the Provider Chain validators or eclipse the set as desired. This set of functionality is possible but should not be considered for V1 or V2 of Interchain Security, but rather a V3 called Layered Security. - -## Consumer Chain Distribution Module - -Delegators and validators on the Provider Chain would likely not risk their ATOMs in order to be included in the validator set on a Consumer Chain unless there was some incentive to do so. At a minimum, transaction fees gained from processing transactions could be considered as a possible incentive. There may also be incentives completely outside the state machine, like a service agreement that comes with regular payments through traditional means of money transmission. More likely it is expected that Consumer Chains include some type of block reward as seen in traditional validation schemes. This could be in a child-chain specific token used for gas, governance or some other use. - -Regardless of how exactly a reward is calculated it is left up to the Consumer Chain to design a system that is attractive enough for Provider Chain validators to risk their staking token in order to be eligible. Once that reward is calculated it needs to be distributed back to the validators that have earned it. These rewards could be deposited on the Consumer Chain or the Provider Chain. If deposited on the Consumer Chain it would only be possible to record to which validator they were rewarded and over which time period since the per-delegator metrics are stored only on the Provider Chain. - -In order to allow delegators to have a similar reward distribution as they currently experience, rewards should be regularly transferred to the Provider Chain where they can utilize the Provider Chain Distribution Module that tracks Cross Chain Validation client connections. These would be sent to the Provider Chain via a CCV IBC transaction similar to a traditional IBC Transfer packet but send to the Distribution Module Account with relevant information as to which validator and chain they were earned on and over what period of time. This information would allow the Provider Chain Distribution Module to distribute the rewards to the constituent delegators of each validator. - -# Roll-Out and Open Questions - -Interchain Security consists of many moving pieces, each of which has a variable scope of functionality. Throughout this document the various capabilities are referred to as V1, V2 and V3. There are further outstanding questions including the exact implementation details for each of the modules included in the Interchain Security stack. These further give rise to expected user flows for each step as well as edge cases like: - -* Child or Provider Chain halting -* Child of Provider Chain upgrading -* Contentious forks of either Provider Chain or Consumer Chain -* Versions of IBC on each side fall out of sync - -Other open questions include addressing the degree of risk this configuration adds to the Provider Chain. Should it be possible for a Provider Chain validator to validate on a large number of Consumer Chains? To what extent should this be a choice of the Validator or a limit imposed by the Provider Chain state machine? If the Validator is exposed to slashing conditions of too many Consumer Chains, could this endanger the security of the Provider Chain or is it the responsibility of the delegator to take that risk into account? - -The economic cost of validating a new chain is another open question that will be important in determining the viability of this offering. Will the cost to validate on a large number of Consumer Chains be prohibitive to smaller validators, or will it be the edge that smaller validators can take to compete against larger validators and exchanges? - -# Conclusion - -Interchain Security is a new shared security primitive that has implications for the security and scalability of single blockchains like the Cosmos Hub as well as the potential to dramatically lower the barrier to running secure public blockchains for new applications. It could be thought of as a competitive configuration to sharding and put the Cosmos Hub on par with Eth 2.0 or Polkadot in terms of their security offerings to applications included in their environment. The design philosophy around the Cosmos ecosystem has always prioritized autonomy and sovereignty over guarantees around security—"Bring your own security" is a term that has been used in the past. The design of Interchain Security discussed here tries to incorporate the Cosmos design philosophy of autonomy and sovereignty with the offering of shared security. Even within the balance between those considerations there is a spectrum of possibilities and it might be the case that multiple versions and configurations are implemented in parallel in order to satisfy as many needs as possible. - -# Further Reading - -* [Interchain Security is Coming to the Cosmos Hub](https://blog.cosmos.network/interchain-security-is-coming-to-the-cosmos-hub-f144c45fb035) - Billy Rennekamp -* [Interchain Security Slidedeck from Cosmoverse Community Conference](https://docs.google.com/presentation/d/1XaPrbcNksnVdhZO1eyshyDDDQkA6buvKt90yxRF7sLs/edit?usp=sharing) - Billy Rennekamp diff --git a/docs/ko/delegators/delegator-guide-cli.md b/docs/ko/delegators/delegator-guide-cli.md index 297d8cb9f1..49fd3c1eeb 100644 --- a/docs/ko/delegators/delegator-guide-cli.md +++ b/docs/ko/delegators/delegator-guide-cli.md @@ -151,7 +151,7 @@ __새로 주문한 렛저 기기 또는 신뢰할 수 있는 렛저 기기만을 렛저 기기를 처음 활성화할때 24개 단어로 구성된 시드키가 생성되고 기기에 저장됩니다. 렛저 기기의 시드키는 코스모스와 코스모스 계정과 호환이 되며, 해당 시드키를 기반으로 계정을 생성할 수 있습니다. 렛저 기기는 `gaiad`와 호환될 수 있게 설정이 되어야 합니다. 렛저 기기를 설정하는 방법은 다음과 같습니다: -1. [Ledger Live 앱](https://www.ledger.com/pages/ledger-live) 다운로드 +1. [Ledger Live 앱](https://www.ledger.com/ledger-live) 다운로드 2. 렛저 기기를 USB로 연결한 후 최신 펌웨어 버전으로 업데이트 3. Ledger Live 앱스토어로 이동한 후, "Cosmos" 애플리케이션 다운로드. (이 단계는 다소 시간이 걸릴 수 있습니다) 4. 렛저 기기에서 코스모스 앱 선택 diff --git a/docs/migration/README.md b/docs/migration/README.md index bef08933f8..36cc1ecaeb 100644 --- a/docs/migration/README.md +++ b/docs/migration/README.md @@ -12,6 +12,6 @@ markdown-link-check-disable This directory houses Cosmos Hub major upgrade migration instructions. -- [Upgrading from `cosmoshub-2` to `cosmoshub-3`](cosmoshub-2.md) -- [Upgrading from `cosmoshub-3` to `cosmoshub-4`](cosmoshub-3.md) +- [Upgrading from `cosmoshub-2` to `cosmoshub-3`](./cosmoshub-2/cosmoshub-2.md) +- [Upgrading from `cosmoshub-3` to `cosmoshub-4`](./cosmoshub-3/cosmoshub-3.md) \ No newline at end of file diff --git a/docs/migration/cosmoshub-2.md b/docs/migration/cosmoshub-2/cosmoshub-2.md similarity index 100% rename from docs/migration/cosmoshub-2.md rename to docs/migration/cosmoshub-2/cosmoshub-2.md diff --git a/docs/migration/cosmoshub-3.md b/docs/migration/cosmoshub-3/cosmoshub-3.md similarity index 100% rename from docs/migration/cosmoshub-3.md rename to docs/migration/cosmoshub-3/cosmoshub-3.md diff --git a/docs/migration/cosmoshub-3[ES_es].md b/docs/migration/cosmoshub-3/cosmoshub-3[ES_es].md similarity index 100% rename from docs/migration/cosmoshub-3[ES_es].md rename to docs/migration/cosmoshub-3/cosmoshub-3[ES_es].md diff --git a/docs/migration/cosmoshub-3[KR_kr].md b/docs/migration/cosmoshub-3/cosmoshub-3[KR_kr].md similarity index 100% rename from docs/migration/cosmoshub-3[KR_kr].md rename to docs/migration/cosmoshub-3/cosmoshub-3[KR_kr].md diff --git a/docs/migration/cosmoshub-4-delta-upgrade.md b/docs/migration/cosmoshub-4-delta-upgrade.md index 755597eab5..24a583d5cd 100644 --- a/docs/migration/cosmoshub-4-delta-upgrade.md +++ b/docs/migration/cosmoshub-4-delta-upgrade.md @@ -1,6 +1,6 @@ --- title: Cosmos Hub 4, Delta Upgrade -order: 4 +order: 1 --- # Cosmos Hub 4, Delta Upgrade, Instructions diff --git a/docs/migration/cosmoshub-4-v10-upgrade.md b/docs/migration/cosmoshub-4-v10-upgrade.md index ce1bd79b15..152493c786 100644 --- a/docs/migration/cosmoshub-4-v10-upgrade.md +++ b/docs/migration/cosmoshub-4-v10-upgrade.md @@ -1,6 +1,6 @@ --- title: Cosmos Hub 4, v10 Upgrade -order: 1 +order: 6 --- # Cosmos Hub 4, v10 Upgrade, Instructions diff --git a/docs/migration/cosmoshub-4-v11-upgrade.md b/docs/migration/cosmoshub-4-v11-upgrade.md new file mode 100644 index 0000000000..3d177a8552 --- /dev/null +++ b/docs/migration/cosmoshub-4-v11-upgrade.md @@ -0,0 +1,277 @@ +--- +title: Cosmos Hub 4, Gaia v11 Upgrade +order: 7 +--- + +# Cosmos Hub 4, Gaia v11 Upgrade, Instructions + +This document describes the steps for validators and full node operators, to upgrade successfully to the Gaia v11 release. +For more details on the release, please see the [release notes](https://github.com/cosmos/gaia/releases/tag/v11.0.0) + +## Instructions + +- [Cosmos Hub 4, Gaia v11 Upgrade, Instructions](#cosmos-hub-4-gaia-v11-upgrade-instructions) + - [Instructions](#instructions) + - [On-chain governance proposal attains consensus](#on-chain-governance-proposal-attains-consensus) + - [Upgrade date](#upgrade-date) + - [Chain-id will remain the same](#chain-id-will-remain-the-same) + - [Preparing for the upgrade](#preparing-for-the-upgrade) + - [System requirement](#system-requirement) + - [Backups](#backups) + - [Testing](#testing) + - [Current runtime](#current-runtime) + - [Target runtime](#target-runtime) + - [Upgrade steps](#upgrade-steps) + - [Method I: Manual Upgrade](#method-i-manual-upgrade) + - [Method II: Upgrade using Cosmovisor](#method-ii-upgrade-using-cosmovisor) + - [Manually preparing the binary](#manually-preparing-the-binary) + - [Preparation](#preparation) + - [Expected upgrade result](#expected-upgrade-result) + - [Auto-Downloading the Gaia binary](#auto-downloading-the-gaia-binary) + - [Preparation](#preparation-1) + - [Expected result](#expected-result) + - [Upgrade duration](#upgrade-duration) + - [Rollback plan](#rollback-plan) + - [Communications](#communications) + - [Risks](#risks) + - [Reference](#reference) + +## On-chain governance proposal attains consensus + +[Proposal 804](https://www.mintscan.io/cosmos/proposals/804) is the reference on-chain governance proposal for this upgrade, which is still in its voting period. Neither core developers nor core funding entities control the governance, and this governance proposal has passed in a _fully decentralized_ way. + +## Upgrade date + +The upgrade will take place at a block height of `16596000`. The date/time of the upgrade is subject to change as blocks are not generated at a constant interval. You can stay up-to-date using this [live countdown](https://www.mintscan.io/cosmos/blocks/16596000) page. + +## Chain-id will remain the same + +The chain-id of the network will remain the same, `cosmoshub-4`. This is because an in-place migration of state will take place, i.e., this upgrade does not export any state. + +## Preparing for the upgrade + +### System requirement + +32GB RAM is recommended to ensure a smooth upgrade. + +If you have less than 32GB RAM, you might try creating a swapfile to swap an idle program onto the hard disk to free up memory. This can +allow your machine to run the binary than it could run in RAM alone. + +```shell +sudo fallocate -l 16G /swapfile +sudo chmod 600 /swapfile +sudo mkswap /swapfile +sudo swapon /swapfile +``` + +### Backups + +Prior to the upgrade, validators are encouraged to take a full data snapshot. Snapshotting depends heavily on infrastructure, but generally this can be done by backing up the `.gaia` directory. +If you use Cosmovisor to upgrade, by default, Cosmovisor will backup your data upon upgrade. See below [upgrade using cosmovisor](#method-ii-upgrade-using-cosmovisor) section. + +It is critically important for validator operators to back-up the `.gaia/data/priv_validator_state.json` file after stopping the gaiad process. This file is updated every block as your validator participates in consensus rounds. It is a critical file needed to prevent double-signing, in case the upgrade fails and the previous chain needs to be restarted. + +### Testing + +For those validator and full node operators that are interested in ensuring preparedness for the impending upgrade, you can run a [v11 Local Testnet](https://github.com/cosmos/testnets/tree/master/local) or join in our [Cosmos Hub Public Testnet](https://github.com/cosmos/testnets/tree/master/public). + +### Current runtime + +The Cosmos Hub mainnet network, `cosmoshub-4`, is currently running [Gaia v10.0.2](https://github.com/cosmos/gaia/releases/v10.0.2). We anticipate that operators who are running on v10.0.x, will be able to upgrade successfully. Validators are expected to ensure that their systems are up to date and capable of performing the upgrade. This includes running the correct binary, or if building from source, building with go `1.20`. + +### Target runtime + +The Cosmos Hub mainnet network, `cosmoshub-4`, will run [Gaia v11.0.0](https://github.com/cosmos/gaia/releases/tag/v11.0.0). Operators _**MUST**_ use this version post-upgrade to remain connected to the network. + +## Upgrade steps + +There are 2 major ways to upgrade a node: + +- Manual upgrade +- Upgrade using [Cosmovisor](https://github.com/cosmos/cosmos-sdk/tree/master/cosmovisor) + - Either by manually preparing the new binary + - Or by using the auto-download functionality (this is not yet recommended) + +If you prefer to use Cosmovisor to upgrade, some preparation work is needed before upgrade. + +### Method I: Manual Upgrade + +Make sure Gaia v11.0.0 is installed by either downloading a [compatible binary](https://github.com/cosmos/gaia/releases/tag/v11.0.0), or building from source. Building from source requires **Golang 1.20**. + +Run Gaia v10.0.x till upgrade height, the node will panic: + +```shell +ERR UPGRADE "v11" NEEDED at height: 16596000: upgrade to v11 and applying upgrade "v11" at height:16596000 +``` + +Stop the node, and switch the binary to Gaia v11.0.0 and re-start by `gaiad start`. + +It may take several minutes to a few hours until validators with a total sum voting power > 2/3 to complete their node upgrades. After that, the chain can continue to produce blocks. + +### Method II: Upgrade using Cosmovisor + +### Manually preparing the binary + +##### Preparation + +Install the latest version of Cosmovisor (`1.5.0`): + +```shell +go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@latest +``` + +**Verify Cosmovisor Version** +```shell +cosmovisor version +cosmovisor version: v1.5.0 +``` + +Create a cosmovisor folder: + +create a Cosmovisor folder inside `$GAIA_HOME` and move Gaia v9.1.1 into `$GAIA_HOME/cosmovisor/genesis/bin` + +```shell +mkdir -p $GAIA_HOME/cosmovisor/genesis/bin +cp $(which gaiad) $GAIA_HOME/cosmovisor/genesis/bin +```` + +build Gaia v11.0.0, and move gaiad v11.0.0 to `$GAIA_HOME/cosmovisor/upgrades/v11/bin` + +```shell +mkdir -p $GAIA_HOME/cosmovisor/upgrades/v11/bin +cp $(which gaiad) $GAIA_HOME/cosmovisor/upgrades/v11/bin +``` + +Then you should get the following structure: + +```shell +. +├── current -> genesis or upgrades/ +├── genesis +│ └── bin +│ └── gaiad #v10.0.x +└── upgrades + └── v11 + └── bin + └── gaiad #v11.0.0 +``` + +Export the environmental variables: + +```shell +export DAEMON_NAME=gaiad +# please change to your own gaia home dir +# please note `DAEMON_HOME` has to be absolute path +export DAEMON_HOME=$GAIA_HOME +export DAEMON_RESTART_AFTER_UPGRADE=true +``` + +Start the node: + +```shell +cosmovisor run start --x-crisis-skip-assert-invariants --home $DAEMON_HOME +``` + +Skipping the invariant checks is strongly encouraged since it decreases the upgrade time significantly and since there are some other improvements coming to the crisis module in the next release of the Cosmos SDK. + +#### Expected upgrade result + +When the upgrade block height is reached, Gaia will panic and stop: + +This may take 7 minutes to a few hours. +After upgrade, the chain will continue to produce blocks when validators with a total sum voting power > 2/3 complete their node upgrades. + +### Auto-Downloading the Gaia binary + +**This method is not recommended!** + +#### Preparation + +Install the latest version of Cosmovisor (`1.5.0`): + +```shell +go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@latest +``` + +Create a cosmovisor folder: + +create a cosmovisor folder inside gaia home and move gaiad v10.0.x into `$GAIA_HOME/cosmovisor/genesis/bin` + +```shell +mkdir -p $GAIA_HOME/cosmovisor/genesis/bin +cp $(which gaiad) $GAIA_HOME/cosmovisor/genesis/bin +``` + +```shell +. +├── current -> genesis or upgrades/ +└── genesis + └── bin + └── gaiad #v10.0.x +``` + +Export the environmental variables: + +```shell +export DAEMON_NAME=gaiad +# please change to your own gaia home dir +export DAEMON_HOME=$GAIA_HOME +export DAEMON_RESTART_AFTER_UPGRADE=true +export DAEMON_ALLOW_DOWNLOAD_BINARIES=true +``` + +Start the node: + +```shell +cosmovisor run start --x-crisis-skip-assert-invariants --home $DAEMON_HOME +``` + +Skipping the invariant checks can help decrease the upgrade time significantly. + +#### Expected result + +When the upgrade block height is reached, you can find the following information in the log: + +```shell +ERR UPGRADE "v11" NEEDED at height: 16596000: upgrade to v11 and applying upgrade "v11" at height:16596000 +``` + +Then the Cosmovisor will create `$GAIA_HOME/cosmovisor/upgrades/v11/bin` and download the Gaia v11.0.0 binary to this folder according to links in the `--info` field of the upgrade proposal. +This may take 7 minutes to a few hours, afterwards, the chain will continue to produce blocks once validators with a total sum voting power > 2/3 complete their nodes upgrades. + +_Please Note:_ + +- In general, auto-download comes with the risk that the verification of correct download is done automatically. If users want to have the highest guarantee users should confirm the check-sum manually. We hope more node operators will use the auto-download for this release but please be aware this is a risk and users should take at your own discretion. +- Users should run their node on v10.0.x if they use the cosmovisor v1.5.0 with auto-download enabled for upgrade process. + +## Upgrade duration + +The upgrade may take a few minutes to several hours to complete because cosmoshub-4 participants operate globally with differing operating hours and it may take some time for operators to upgrade their binaries and connect to the network. + +## Rollback plan + +During the network upgrade, core Cosmos teams will be keeping an ever vigilant eye and communicating with operators on the status of their upgrades. During this time, the core teams will listen to operator needs to determine if the upgrade is experiencing unintended challenges. In the event of unexpected challenges, the core teams, after conferring with operators and attaining social consensus, may choose to declare that the upgrade will be skipped. + +Steps to skip this upgrade proposal are simply to resume the cosmoshub-4 network with the (downgraded) v10.0.2 binary using the following command: + +> gaiad start --unsafe-skip-upgrade 16596000 + +Note: There is no particular need to restore a state snapshot prior to the upgrade height, unless specifically directed by core Cosmos teams. + +Important: A social consensus decision to skip the upgrade will be based solely on technical merits, thereby respecting and maintaining the decentralized governance process of the upgrade proposal's successful YES vote. + +## Communications + +Operators are encouraged to join the `#cosmos-hub-validators-verified` channel of the Cosmos Hub Community Discord. This channel is the primary communication tool for operators to ask questions, report upgrade status, report technical issues, and to build social consensus should the need arise. This channel is restricted to known operators and requires verification beforehand. Requests to join the `#cosmos-hub-validators-verified` channel can be sent to the `#general-support` channel. + +## Risks + +As a validator performing the upgrade procedure on your consensus nodes carries a heightened risk of double-signing and being slashed. The most important piece of this procedure is verifying your software version and genesis file hash before starting your validator and signing. + +The riskiest thing a validator can do is discover that they made a mistake and repeat the upgrade procedure again during the network startup. If you discover a mistake in the process, the best thing to do is wait for the network to start before correcting it. + +## Reference + +[Join Cosmos Hub Mainnet](https://github.com/cosmos/mainnet) + + diff --git a/docs/migration/cosmoshub-4-v12-upgrade.md b/docs/migration/cosmoshub-4-v12-upgrade.md new file mode 100644 index 0000000000..9b43cf34aa --- /dev/null +++ b/docs/migration/cosmoshub-4-v12-upgrade.md @@ -0,0 +1,284 @@ +--- +title: Cosmos Hub 4, Gaia v12 Upgrade +order: 8 +--- + +# Cosmos Hub 4, Gaia v12 Upgrade, Instructions + +This document describes the steps for validators and full node operators, to upgrade successfully to the Gaia v12 release. +For more details on the release, please see the [release notes](https://github.com/cosmos/gaia/releases/tag/v12.0.0) + +## Instructions + +- [Cosmos Hub 4, Gaia v12 Upgrade, Instructions](#cosmos-hub-4-gaia-v12-upgrade-instructions) + - [Instructions](#instructions) + - [On-chain governance proposal attains consensus](#on-chain-governance-proposal-attains-consensus) + - [Liquid Staking](#liquid-staking) + - [Upgrade date](#upgrade-date) + - [Chain-id will remain the same](#chain-id-will-remain-the-same) + - [Preparing for the upgrade](#preparing-for-the-upgrade) + - [System requirement](#system-requirement) + - [Backups](#backups) + - [Testing](#testing) + - [Current runtime](#current-runtime) + - [Target runtime](#target-runtime) + - [Upgrade steps](#upgrade-steps) + - [Method I: Manual Upgrade](#method-i-manual-upgrade) + - [Method II: Upgrade using Cosmovisor](#method-ii-upgrade-using-cosmovisor) + - [Manually preparing the binary](#manually-preparing-the-binary) + - [Preparation](#preparation) + - [Expected upgrade result](#expected-upgrade-result) + - [Auto-Downloading the Gaia binary](#auto-downloading-the-gaia-binary) + - [Preparation](#preparation-1) + - [Expected result](#expected-result) + - [Upgrade duration](#upgrade-duration) + - [Rollback plan](#rollback-plan) + - [Communications](#communications) + - [Risks](#risks) + - [Reference](#reference) + +## On-chain governance proposal attains consensus + +[Proposal 821](https://www.mintscan.io/cosmos/proposals/821) is the reference on-chain governance proposal for this upgrade, which is still in its voting period. Neither core developers nor core funding entities control the governance, and this governance proposal has passed in a _fully decentralized_ way. + +## Liquid Staking + +Validators please be aware that this release will include a new liquid staking module which has been included via the Cosmos SDK. Please see the [release notes](https://github.com/cosmos/gaia/releases/tag/v12.0.0) for v12 for more information about this module. + +**IMPORTANT:** Inclusion of this module requires validators to set a validation-bond to be eligiable for Liquid Staked delegations. Please see the [Validator FAQ](../validators/validator-faq.html#liquid-staking-module) for more information. + +## Upgrade date + +The upgrade will take place at a block height of `16985500`. The date/time of the upgrade is subject to change as blocks are not generated at a constant interval. You can stay up-to-date using this [live countdown](https://www.mintscan.io/cosmos/blocks/16985500) page. + +## Chain-id will remain the same + +The chain-id of the network will remain the same, `cosmoshub-4`. This is because an in-place migration of state will take place, i.e., this upgrade does not export any state. + +## Preparing for the upgrade + +### System requirement + +32GB RAM is recommended to ensure a smooth upgrade. + +If you have less than 32GB RAM, you might try creating a swapfile to swap an idle program onto the hard disk to free up memory. This can +allow your machine to run the binary than it could run in RAM alone. + +```shell +sudo fallocate -l 16G /swapfile +sudo chmod 600 /swapfile +sudo mkswap /swapfile +sudo swapon /swapfile +``` + +### Backups + +Prior to the upgrade, validators are encouraged to take a full data snapshot. Snapshotting depends heavily on infrastructure, but generally this can be done by backing up the `.gaia` directory. +If you use Cosmovisor to upgrade, by default, Cosmovisor will backup your data upon upgrade. See below [upgrade using cosmovisor](#method-ii-upgrade-using-cosmovisor) section. + +It is critically important for validator operators to back-up the `.gaia/data/priv_validator_state.json` file after stopping the gaiad process. This file is updated every block as your validator participates in consensus rounds. It is a critical file needed to prevent double-signing, in case the upgrade fails and the previous chain needs to be restarted. + +### Testing + +For those validator and full node operators that are interested in ensuring preparedness for the impending upgrade, you can run a [v12 Local Testnet](https://github.com/cosmos/testnets/tree/master/local) or join in our [Cosmos Hub Public Testnet](https://github.com/cosmos/testnets/tree/master/public). + +### Current runtime + +The Cosmos Hub mainnet network, `cosmoshub-4`, is currently running [Gaia v11.0.0](https://github.com/cosmos/gaia/releases/v11.0.0). We anticipate that operators who are running on v11.0.x, will be able to upgrade successfully. Validators are expected to ensure that their systems are up to date and capable of performing the upgrade. This includes running the correct binary, or if building from source, building with go `1.20`. + +### Target runtime + +The Cosmos Hub mainnet network, `cosmoshub-4`, will run [Gaia v12.0.0](https://github.com/cosmos/gaia/releases/tag/v12.0.0). Operators _**MUST**_ use this version post-upgrade to remain connected to the network. + +## Upgrade steps + +There are 2 major ways to upgrade a node: + +- Manual upgrade +- Upgrade using [Cosmovisor](https://pkg.go.dev/cosmossdk.io/tools/cosmovisor) + - Either by manually preparing the new binary + - Or by using the auto-download functionality (this is not yet recommended) + +If you prefer to use Cosmovisor to upgrade, some preparation work is needed before upgrade. + +### Method I: Manual Upgrade + +Make sure Gaia v12.0.0 is installed by either downloading a [compatible binary](https://github.com/cosmos/gaia/releases/tag/v12.0.0), or building from source. Building from source requires **Golang 1.20**. + +Run Gaia v11.0.0 till upgrade height, the node will panic: + +```shell +ERR UPGRADE "v12" NEEDED at height: 16985500: upgrade to v12 and applying upgrade "v12" at height:16985500 +``` + +Stop the node, and switch the binary to Gaia v12.0.0 and re-start by `gaiad start`. + +It may take several minutes to a few hours until validators with a total sum voting power > 2/3 to complete their node upgrades. After that, the chain can continue to produce blocks. + +### Method II: Upgrade using Cosmovisor + +### Manually preparing the binary + +##### Preparation + +Install the latest version of Cosmovisor (`1.5.0`): + +```shell +go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest +``` + +**Verify Cosmovisor Version** +```shell +cosmovisor version +cosmovisor version: v1.5.0 +``` + +Create a cosmovisor folder: + +create a Cosmovisor folder inside `$GAIA_HOME` and move Gaia v11.0.0 into `$GAIA_HOME/cosmovisor/genesis/bin` + +```shell +mkdir -p $GAIA_HOME/cosmovisor/genesis/bin +cp $(which gaiad) $GAIA_HOME/cosmovisor/genesis/bin +```` + +build Gaia v12.0.0, and move gaiad v12.0.0 to `$GAIA_HOME/cosmovisor/upgrades/v12/bin` + +```shell +mkdir -p $GAIA_HOME/cosmovisor/upgrades/v12/bin +cp $(which gaiad) $GAIA_HOME/cosmovisor/upgrades/v12/bin +``` + +Then you should get the following structure: + +```shell +. +├── current -> genesis or upgrades/ +├── genesis +│ └── bin +│ └── gaiad #v11.0.x +└── upgrades + └── v12 + └── bin + └── gaiad #v12.0.0 +``` + +Export the environmental variables: + +```shell +export DAEMON_NAME=gaiad +# please change to your own gaia home dir +# please note `DAEMON_HOME` has to be absolute path +export DAEMON_HOME=$GAIA_HOME +export DAEMON_RESTART_AFTER_UPGRADE=true +``` + +Start the node: + +```shell +cosmovisor run start --x-crisis-skip-assert-invariants --home $DAEMON_HOME +``` + +Skipping the invariant checks is strongly encouraged since it decreases the upgrade time significantly and since there are some other improvements coming to the crisis module in the next release of the Cosmos SDK. + +#### Expected upgrade result + +When the upgrade block height is reached, Gaia will panic and stop: + +This may take 7 minutes to a few hours. +After upgrade, the chain will continue to produce blocks when validators with a total sum voting power > 2/3 complete their node upgrades. + +### Auto-Downloading the Gaia binary + +**This method is not recommended!** + +#### Preparation + +Install the latest version of Cosmovisor (`1.5.0`): + +```shell +go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest +``` + +Create a cosmovisor folder: + +create a cosmovisor folder inside gaia home and move gaiad v11.0.x into `$GAIA_HOME/cosmovisor/genesis/bin` + +```shell +mkdir -p $GAIA_HOME/cosmovisor/genesis/bin +cp $(which gaiad) $GAIA_HOME/cosmovisor/genesis/bin +``` + +```shell +. +├── current -> genesis or upgrades/ +└── genesis + └── bin + └── gaiad #v11.0.x +``` + +Export the environmental variables: + +```shell +export DAEMON_NAME=gaiad +# please change to your own gaia home dir +export DAEMON_HOME=$GAIA_HOME +export DAEMON_RESTART_AFTER_UPGRADE=true +export DAEMON_ALLOW_DOWNLOAD_BINARIES=true +``` + +Start the node: + +```shell +cosmovisor run start --x-crisis-skip-assert-invariants --home $DAEMON_HOME +``` + +Skipping the invariant checks can help decrease the upgrade time significantly. + +#### Expected result + +When the upgrade block height is reached, you can find the following information in the log: + +```shell +ERR UPGRADE "v12" NEEDED at height: 16985500: upgrade to v12 and applying upgrade "v12" at height:16985500 +``` + +Then the Cosmovisor will create `$GAIA_HOME/cosmovisor/upgrades/v12/bin` and download the Gaia v12.0.0 binary to this folder according to links in the `--info` field of the upgrade proposal. +This may take 7 minutes to a few hours, afterwards, the chain will continue to produce blocks once validators with a total sum voting power > 2/3 complete their nodes upgrades. + +_Please Note:_ + +- In general, auto-download comes with the risk that the verification of correct download is done automatically. If users want to have the highest guarantee users should confirm the check-sum manually. We hope more node operators will use the auto-download for this release but please be aware this is a risk and users should take at your own discretion. +- Users should run their node on v11.0.x if they use the cosmovisor v1.5.0 with auto-download enabled for upgrade process. + +## Upgrade duration + +The upgrade may take a few minutes to several hours to complete because cosmoshub-4 participants operate globally with differing operating hours and it may take some time for operators to upgrade their binaries and connect to the network. + +## Rollback plan + +During the network upgrade, core Cosmos teams will be keeping an ever vigilant eye and communicating with operators on the status of their upgrades. During this time, the core teams will listen to operator needs to determine if the upgrade is experiencing unintended challenges. In the event of unexpected challenges, the core teams, after conferring with operators and attaining social consensus, may choose to declare that the upgrade will be skipped. + +Steps to skip this upgrade proposal are simply to resume the cosmoshub-4 network with the (downgraded) v11.0.0 binary using the following command: + +> gaiad start --unsafe-skip-upgrade 16985500 + +Note: There is no particular need to restore a state snapshot prior to the upgrade height, unless specifically directed by core Cosmos teams. + +Important: A social consensus decision to skip the upgrade will be based solely on technical merits, thereby respecting and maintaining the decentralized governance process of the upgrade proposal's successful YES vote. + +## Communications + +Operators are encouraged to join the `#cosmos-hub-validators-verified` channel of the Cosmos Hub Community Discord. This channel is the primary communication tool for operators to ask questions, report upgrade status, report technical issues, and to build social consensus should the need arise. This channel is restricted to known operators and requires verification beforehand. Requests to join the `#cosmos-hub-validators-verified` channel can be sent to the `#general-support` channel. + +## Risks + +As a validator performing the upgrade procedure on your consensus nodes carries a heightened risk of double-signing and being slashed. The most important piece of this procedure is verifying your software version and genesis file hash before starting your validator and signing. + +The riskiest thing a validator can do is discover that they made a mistake and repeat the upgrade procedure again during the network startup. If you discover a mistake in the process, the best thing to do is wait for the network to start before correcting it. + +## Reference + +[Join Cosmos Hub Mainnet](https://github.com/cosmos/mainnet) + + diff --git a/docs/migration/cosmoshub-4-v13-upgrade.md b/docs/migration/cosmoshub-4-v13-upgrade.md new file mode 100644 index 0000000000..187721954a --- /dev/null +++ b/docs/migration/cosmoshub-4-v13-upgrade.md @@ -0,0 +1,277 @@ +--- +title: Cosmos Hub 4, Gaia v13 Upgrade +order: 8 +--- + +# Cosmos Hub 4, Gaia v13 Upgrade, Instructions + +This document describes the steps for validators and full node operators, to upgrade successfully to the Gaia v13 release. +For more details on the release, please see the [release notes](https://github.com/cosmos/gaia/releases/tag/v13.0.0) + +## Instructions + +- [Cosmos Hub 4, Gaia v13 Upgrade, Instructions](#cosmos-hub-4-gaia-v13-upgrade-instructions) + - [Instructions](#instructions) + - [On-chain governance proposal attains consensus](#on-chain-governance-proposal-attains-consensus) + - [Upgrade date](#upgrade-date) + - [Chain-id will remain the same](#chain-id-will-remain-the-same) + - [Preparing for the upgrade](#preparing-for-the-upgrade) + - [System requirement](#system-requirement) + - [Backups](#backups) + - [Testing](#testing) + - [Current runtime](#current-runtime) + - [Target runtime](#target-runtime) + - [Upgrade steps](#upgrade-steps) + - [Method I: Manual Upgrade](#method-i-manual-upgrade) + - [Method II: Upgrade using Cosmovisor](#method-ii-upgrade-using-cosmovisor) + - [Manually preparing the binary](#manually-preparing-the-binary) + - [Preparation](#preparation) + - [Expected upgrade result](#expected-upgrade-result) + - [Auto-Downloading the Gaia binary](#auto-downloading-the-gaia-binary) + - [Preparation](#preparation-1) + - [Expected result](#expected-result) + - [Upgrade duration](#upgrade-duration) + - [Rollback plan](#rollback-plan) + - [Communications](#communications) + - [Risks](#risks) + - [Reference](#reference) + +## On-chain governance proposal attains consensus + +[Proposal 825](https://www.mintscan.io/cosmos/proposals/825) is the reference on-chain governance proposal for this upgrade, which is still in its voting period. Neither core developers nor core funding entities control the governance, and this governance proposal has passed in a _fully decentralized_ way. + +## Upgrade date + +The upgrade will take place at a block height of `17380000`. The date/time of the upgrade is subject to change as blocks are not generated at a constant interval. You can stay up-to-date using this [live countdown](https://www.mintscan.io/cosmos/blocks/17380000) page. + +## Chain-id will remain the same + +The chain-id of the network will remain the same, `cosmoshub-4`. This is because an in-place migration of state will take place, i.e., this upgrade does not export any state. + +## Preparing for the upgrade + +### System requirement + +32GB RAM is recommended to ensure a smooth upgrade. + +If you have less than 32GB RAM, you might try creating a swapfile to swap an idle program onto the hard disk to free up memory. This can +allow your machine to run the binary than it could run in RAM alone. + +```shell +sudo fallocate -l 16G /swapfile +sudo chmod 600 /swapfile +sudo mkswap /swapfile +sudo swapon /swapfile +``` + +### Backups + +Prior to the upgrade, validators are encouraged to take a full data snapshot. Snapshotting depends heavily on infrastructure, but generally this can be done by backing up the `.gaia` directory. +If you use Cosmovisor to upgrade, by default, Cosmovisor will backup your data upon upgrade. See below [upgrade using cosmovisor](#method-ii-upgrade-using-cosmovisor) section. + +It is critically important for validator operators to back-up the `.gaia/data/priv_validator_state.json` file after stopping the gaiad process. This file is updated every block as your validator participates in consensus rounds. It is a critical file needed to prevent double-signing, in case the upgrade fails and the previous chain needs to be restarted. + +### Testing + +For those validator and full node operators that are interested in ensuring preparedness for the impending upgrade, you can run a [v13 Local Testnet](https://github.com/cosmos/testnets/tree/master/local) or join in our [Cosmos Hub Public Testnet](https://github.com/cosmos/testnets/tree/master/public). + +### Current runtime + +The Cosmos Hub mainnet network, `cosmoshub-4`, is currently running [Gaia v12.0.0](https://github.com/cosmos/gaia/releases/v12.0.0). We anticipate that operators who are running on v11.0.x, will be able to upgrade successfully. Validators are expected to ensure that their systems are up to date and capable of performing the upgrade. This includes running the correct binary, or if building from source, building with go `1.20`. + +### Target runtime + +The Cosmos Hub mainnet network, `cosmoshub-4`, will run [Gaia v13.0.0](https://github.com/cosmos/gaia/releases/tag/v13.0.0). Operators _**MUST**_ use this version post-upgrade to remain connected to the network. + +## Upgrade steps + +There are 2 major ways to upgrade a node: + +- Manual upgrade +- Upgrade using [Cosmovisor](https://pkg.go.dev/cosmossdk.io/tools/cosmovisor) + - Either by manually preparing the new binary + - Or by using the auto-download functionality (this is not yet recommended) + +If you prefer to use Cosmovisor to upgrade, some preparation work is needed before upgrade. + +### Method I: Manual Upgrade + +Make sure Gaia v13.0.0 is installed by either downloading a [compatible binary](https://github.com/cosmos/gaia/releases/tag/v13.0.0), or building from source. Building from source requires **Golang 1.20.x**. + +Run Gaia v12.0.0 till upgrade height, the node will panic: + +```shell +ERR UPGRADE "v13" NEEDED at height: 17380000: upgrade to v13 and applying upgrade "v13" at height:17380000 +``` + +Stop the node, and switch the binary to Gaia v13.0.0 and re-start by `gaiad start`. + +It may take several minutes to a few hours until validators with a total sum voting power > 2/3 to complete their node upgrades. After that, the chain can continue to produce blocks. + +### Method II: Upgrade using Cosmovisor + +### Manually preparing the binary + +##### Preparation + +Install the latest version of Cosmovisor (`1.5.0`): + +```shell +go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest +``` + +**Verify Cosmovisor Version** +```shell +cosmovisor version +cosmovisor version: v1.5.0 +``` + +Create a cosmovisor folder: + +create a Cosmovisor folder inside `$GAIA_HOME` and move Gaia v12.0.0 into `$GAIA_HOME/cosmovisor/genesis/bin` + +```shell +mkdir -p $GAIA_HOME/cosmovisor/genesis/bin +cp $(which gaiad) $GAIA_HOME/cosmovisor/genesis/bin +```` + +build Gaia v13.0.0, and move gaiad v13.0.0 to `$GAIA_HOME/cosmovisor/upgrades/v13/bin` + +```shell +mkdir -p $GAIA_HOME/cosmovisor/upgrades/v13/bin +cp $(which gaiad) $GAIA_HOME/cosmovisor/upgrades/v13/bin +``` + +Then you should get the following structure: + +```shell +. +├── current -> genesis or upgrades/ +├── genesis +│ └── bin +│ └── gaiad #v12.0.x +└── upgrades + └── v13 + └── bin + └── gaiad #v13.0.0 +``` + +Export the environmental variables: + +```shell +export DAEMON_NAME=gaiad +# please change to your own gaia home dir +# please note `DAEMON_HOME` has to be absolute path +export DAEMON_HOME=$GAIA_HOME +export DAEMON_RESTART_AFTER_UPGRADE=true +``` + +Start the node: + +```shell +cosmovisor run start --x-crisis-skip-assert-invariants --home $DAEMON_HOME +``` + +Skipping the invariant checks is strongly encouraged since it decreases the upgrade time significantly and since there are some other improvements coming to the crisis module in the next release of the Cosmos SDK. + +#### Expected upgrade result + +When the upgrade block height is reached, Gaia will panic and stop: + +This may take a few minutes to a few hours. +After upgrade, the chain will continue to produce blocks when validators with a total sum voting power > 2/3 complete their node upgrades. + +### Auto-Downloading the Gaia binary + +**This method is not recommended!** + +#### Preparation + +Install the latest version of Cosmovisor (`1.5.0`): + +```shell +go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest +``` + +Create a cosmovisor folder: + +create a cosmovisor folder inside gaia home and move gaiad v12.0.x into `$GAIA_HOME/cosmovisor/genesis/bin` + +```shell +mkdir -p $GAIA_HOME/cosmovisor/genesis/bin +cp $(which gaiad) $GAIA_HOME/cosmovisor/genesis/bin +``` + +```shell +. +├── current -> genesis or upgrades/ +└── genesis + └── bin + └── gaiad #v12.0.x +``` + +Export the environmental variables: + +```shell +export DAEMON_NAME=gaiad +# please change to your own gaia home dir +export DAEMON_HOME=$GAIA_HOME +export DAEMON_RESTART_AFTER_UPGRADE=true +export DAEMON_ALLOW_DOWNLOAD_BINARIES=true +``` + +Start the node: + +```shell +cosmovisor run start --x-crisis-skip-assert-invariants --home $DAEMON_HOME +``` + +Skipping the invariant checks can help decrease the upgrade time significantly. + +#### Expected result + +When the upgrade block height is reached, you can find the following information in the log: + +```shell +ERR UPGRADE "v13" NEEDED at height: 17380000: upgrade to v13 and applying upgrade "v13" at height:17380000 +``` + +Then the Cosmovisor will create `$GAIA_HOME/cosmovisor/upgrades/v13/bin` and download the Gaia v13.0.0 binary to this folder according to links in the `--info` field of the upgrade proposal. +This may take 7 minutes to a few hours, afterwards, the chain will continue to produce blocks once validators with a total sum voting power > 2/3 complete their nodes upgrades. + +_Please Note:_ + +- In general, auto-download comes with the risk that the verification of correct download is done automatically. If users want to have the highest guarantee users should confirm the check-sum manually. We hope more node operators will use the auto-download for this release but please be aware this is a risk and users should take at your own discretion. +- Users should run their node on v12.0.x if they use the cosmovisor v1.5.0 with auto-download enabled for upgrade process. + +## Upgrade duration + +The upgrade may take a few minutes to several hours to complete because cosmoshub-4 participants operate globally with differing operating hours and it may take some time for operators to upgrade their binaries and connect to the network. + +## Rollback plan + +During the network upgrade, core Cosmos teams will be keeping an ever vigilant eye and communicating with operators on the status of their upgrades. During this time, the core teams will listen to operator needs to determine if the upgrade is experiencing unintended challenges. In the event of unexpected challenges, the core teams, after conferring with operators and attaining social consensus, may choose to declare that the upgrade will be skipped. + +Steps to skip this upgrade proposal are simply to resume the cosmoshub-4 network with the (downgraded) v12.0.0 binary using the following command: + +> gaiad start --unsafe-skip-upgrade 17380000 + +Note: There is no particular need to restore a state snapshot prior to the upgrade height, unless specifically directed by core Cosmos teams. + +Important: A social consensus decision to skip the upgrade will be based solely on technical merits, thereby respecting and maintaining the decentralized governance process of the upgrade proposal's successful YES vote. + +## Communications + +Operators are encouraged to join the `#cosmos-hub-validators-verified` channel of the Cosmos Hub Community Discord. This channel is the primary communication tool for operators to ask questions, report upgrade status, report technical issues, and to build social consensus should the need arise. This channel is restricted to known operators and requires verification beforehand. Requests to join the `#cosmos-hub-validators-verified` channel can be sent to the `#general-support` channel. + +## Risks + +As a validator performing the upgrade procedure on your consensus nodes carries a heightened risk of double-signing and being slashed. The most important piece of this procedure is verifying your software version and genesis file hash before starting your validator and signing. + +The riskiest thing a validator can do is discover that they made a mistake and repeat the upgrade procedure again during the network startup. If you discover a mistake in the process, the best thing to do is wait for the network to start before correcting it. + +## Reference + +[Join Cosmos Hub Mainnet](https://github.com/cosmos/mainnet) + + diff --git a/docs/migration/cosmoshub-4-v14-upgrade.md b/docs/migration/cosmoshub-4-v14-upgrade.md new file mode 100644 index 0000000000..f0e898cdf7 --- /dev/null +++ b/docs/migration/cosmoshub-4-v14-upgrade.md @@ -0,0 +1,210 @@ +--- +title: Cosmos Hub 4, Gaia v14 Upgrade +order: 8 +--- + +# Cosmos Hub 4, Gaia v14 Upgrade, Instructions + +This document describes the steps for validators and full node operators, to upgrade successfully to the Gaia v14 release. + +For more details on the release, please see the [release notes](https://github.com/cosmos/gaia/releases/tag/v14.1.0) + +## Release Binary + +> Please note that the **v14.0.0** binary is depreceated and **ALL** validators **MUST** use the **v14.1.0** binary instead. + +## Instructions + +- [Cosmos Hub 4, Gaia v14 Upgrade, Instructions](#cosmos-hub-4-gaia-v14-upgrade-instructions) + - [Release Binary](#release-binary) + - [Instructions](#instructions) + - [On-chain governance proposal attains consensus](#on-chain-governance-proposal-attains-consensus) + - [Upgrade date](#upgrade-date) + - [Chain-id will remain the same](#chain-id-will-remain-the-same) + - [Preparing for the upgrade](#preparing-for-the-upgrade) + - [System requirement](#system-requirement) + - [Backups](#backups) + - [Testing](#testing) + - [Current runtime](#current-runtime) + - [Target runtime](#target-runtime) + - [Upgrade steps](#upgrade-steps) + - [Method I: Manual Upgrade](#method-i-manual-upgrade) + - [Method II: Upgrade using Cosmovisor](#method-ii-upgrade-using-cosmovisor) + - [Manually preparing the binary](#manually-preparing-the-binary) + - [Preparation](#preparation) + - [Expected upgrade result](#expected-upgrade-result) + - [Auto-Downloading the Gaia binary](#auto-downloading-the-gaia-binary) + - [Upgrade duration](#upgrade-duration) + - [Rollback plan](#rollback-plan) + - [Communications](#communications) + - [Risks](#risks) + - [Reference](#reference) + +## On-chain governance proposal attains consensus + +[Proposal 854](https://www.mintscan.io/cosmos/proposals/854) is the reference on-chain governance proposal for this upgrade, which is still in its voting period. Neither core developers nor core funding entities control the governance, and this governance proposal has passed in a _fully decentralized_ way. + +## Upgrade date + +The upgrade will take place at a block height of `18262000`. The date/time of the upgrade is subject to change as blocks are not generated at a constant interval. You can stay up-to-date using this [live countdown](https://www.mintscan.io/cosmos/blocks/18262000) page. + +## Chain-id will remain the same + +The chain-id of the network will remain the same, `cosmoshub-4`. This is because an in-place migration of state will take place, i.e., this upgrade does not export any state. + +## Preparing for the upgrade + +System requirements for validator nodes can be found [here](../getting-started/system-requirements.md). + +### Backups + +Prior to the upgrade, validators are encouraged to take a full data snapshot. Snapshotting depends heavily on infrastructure, but generally this can be done by backing up the `.gaia` directory. +If you use Cosmovisor to upgrade, by default, Cosmovisor will backup your data upon upgrade. See below [upgrade using cosmovisor](#method-ii-upgrade-using-cosmovisor) section. + +It is critically important for validator operators to back-up the `.gaia/data/priv_validator_state.json` file after stopping the gaiad process. This file is updated every block as your validator participates in consensus rounds. It is a critical file needed to prevent double-signing, in case the upgrade fails and the previous chain needs to be restarted. + +### Testing + +For those validator and full node operators that are interested in ensuring preparedness for the impending upgrade, you can run a [v14 Local Testnet](https://github.com/cosmos/testnets/tree/master/local) or join in our [Cosmos Hub Public Testnet](https://github.com/cosmos/testnets/tree/master/public). + +### Current runtime + +The Cosmos Hub mainnet network, `cosmoshub-4`, is currently running [Gaia v13.0.0](https://github.com/cosmos/gaia/releases/v13.0.0). We anticipate that operators who are running on v13.0.x, will be able to upgrade successfully. Validators are expected to ensure that their systems are up to date and capable of performing the upgrade. This includes running the correct binary, or if building from source, building with go `1.20`. + +### Target runtime + +The Cosmos Hub mainnet network, `cosmoshub-4`, will run **[Gaia v14.1.0](https://github.com/cosmos/gaia/releases/tag/v14.1.0)**. Operators _**MUST**_ use this version post-upgrade to remain connected to the network. + +## Upgrade steps + +There are 2 major ways to upgrade a node: + +- Manual upgrade +- Upgrade using [Cosmovisor](https://pkg.go.dev/cosmossdk.io/tools/cosmovisor) + - Either by manually preparing the new binary + - Or by using the auto-download functionality (this is not yet recommended) + +If you prefer to use Cosmovisor to upgrade, some preparation work is needed before upgrade. + +### Method I: Manual Upgrade + +Make sure **Gaia v14.1.0** is installed by either downloading a [compatible binary](https://github.com/cosmos/gaia/releases/tag/v13.0.0), or building from source. Building from source requires **Golang 1.20.x**. + +Run Gaia v13.0.0 till upgrade height, the node will panic: + +```shell +ERR UPGRADE "v14" NEEDED at height: 18262000: upgrade to v14 and applying upgrade "v14" at height:18262000 +``` + +Stop the node, and switch the binary to **Gaia v14.1.0** and re-start by `gaiad start`. + +It may take several minutes to a few hours until validators with a total sum voting power > 2/3 to complete their node upgrades. After that, the chain can continue to produce blocks. + +### Method II: Upgrade using Cosmovisor + +### Manually preparing the binary + +##### Preparation + +Install the latest version of Cosmovisor (`1.5.0`): + +```shell +go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest +``` + +**Verify Cosmovisor Version** +```shell +cosmovisor version +cosmovisor version: v1.5.0 +``` + +Create a cosmovisor folder: + +create a Cosmovisor folder inside `$GAIA_HOME` and move Gaia v13.0.0 into `$GAIA_HOME/cosmovisor/genesis/bin` + +```shell +mkdir -p $GAIA_HOME/cosmovisor/genesis/bin +cp $(which gaiad) $GAIA_HOME/cosmovisor/genesis/bin +```` + +Build Gaia **v14.1.0**, and move gaiad **v14.1.0** to `$GAIA_HOME/cosmovisor/upgrades/v14/bin` + +```shell +mkdir -p $GAIA_HOME/cosmovisor/upgrades/v14/bin +cp $(which gaiad) $GAIA_HOME/cosmovisor/upgrades/v14/bin +``` + +Then you should get the following structure: + +```shell +. +├── current -> genesis or upgrades/ +├── genesis +│ └── bin +│ └── gaiad #v13.0.x +└── upgrades + └── v14 + └── bin + └── gaiad #v14.1.0 +``` + +Export the environmental variables: + +```shell +export DAEMON_NAME=gaiad +# please change to your own gaia home dir +# please note `DAEMON_HOME` has to be absolute path +export DAEMON_HOME=$GAIA_HOME +export DAEMON_RESTART_AFTER_UPGRADE=true +``` + +Start the node: + +```shell +cosmovisor run start --x-crisis-skip-assert-invariants --home $DAEMON_HOME +``` + +Skipping the invariant checks is strongly encouraged since it decreases the upgrade time significantly and since there are some other improvements coming to the crisis module in the next release of the Cosmos SDK. + +#### Expected upgrade result + +When the upgrade block height is reached, Gaia will panic and stop: + +This may take a few minutes to a few hours. +After upgrade, the chain will continue to produce blocks when validators with a total sum voting power > 2/3 complete their node upgrades. + +### Auto-Downloading the Gaia binary + +**This method is not recommended!** + +## Upgrade duration + +The upgrade may take a few minutes to several hours to complete because cosmoshub-4 participants operate globally with differing operating hours and it may take some time for operators to upgrade their binaries and connect to the network. + +## Rollback plan + +During the network upgrade, core Cosmos teams will be keeping an ever vigilant eye and communicating with operators on the status of their upgrades. During this time, the core teams will listen to operator needs to determine if the upgrade is experiencing unintended challenges. In the event of unexpected challenges, the core teams, after conferring with operators and attaining social consensus, may choose to declare that the upgrade will be skipped. + +Steps to skip this upgrade proposal are simply to resume the cosmoshub-4 network with the (downgraded) v13.0.x binary using the following command: + +> gaiad start --unsafe-skip-upgrade 18262000 + +Note: There is no particular need to restore a state snapshot prior to the upgrade height, unless specifically directed by core Cosmos teams. + +Important: A social consensus decision to skip the upgrade will be based solely on technical merits, thereby respecting and maintaining the decentralized governance process of the upgrade proposal's successful YES vote. + +## Communications + +Operators are encouraged to join the `#cosmos-hub-validators-verified` channel of the Cosmos Hub Community Discord. This channel is the primary communication tool for operators to ask questions, report upgrade status, report technical issues, and to build social consensus should the need arise. This channel is restricted to known operators and requires verification beforehand. Requests to join the `#cosmos-hub-validators-verified` channel can be sent to the `#general-support` channel. + +## Risks + +As a validator performing the upgrade procedure on your consensus nodes carries a heightened risk of double-signing and being slashed. The most important piece of this procedure is verifying your software version and genesis file hash before starting your validator and signing. + +The riskiest thing a validator can do is discover that they made a mistake and repeat the upgrade procedure again during the network startup. If you discover a mistake in the process, the best thing to do is wait for the network to start before correcting it. + +## Reference + +[Join Cosmos Hub Mainnet](https://github.com/cosmos/mainnet) + + diff --git a/docs/migration/cosmoshub-4-v7-Theta-upgrade.md b/docs/migration/cosmoshub-4-v7-Theta-upgrade.md index 21ab16097a..e218e49167 100644 --- a/docs/migration/cosmoshub-4-v7-Theta-upgrade.md +++ b/docs/migration/cosmoshub-4-v7-Theta-upgrade.md @@ -1,6 +1,6 @@ --- title: Cosmos Hub 4, Theta Upgrade -order: 2 +order: 3 --- # Cosmos Hub 4, v7-Theta Upgrade, Instructions diff --git a/docs/migration/cosmoshub-4-v8-Rho-upgrade.md b/docs/migration/cosmoshub-4-v8-Rho-upgrade.md index f60d35c956..1984cb2494 100644 --- a/docs/migration/cosmoshub-4-v8-Rho-upgrade.md +++ b/docs/migration/cosmoshub-4-v8-Rho-upgrade.md @@ -1,6 +1,6 @@ --- title: Cosmos Hub 4, Rho Upgrade -order: 2 +order: 4 --- # Cosmos Hub 4, v8-Rho Upgrade, Instructions diff --git a/docs/migration/cosmoshub-4-v9-Lambda-upgrade.md b/docs/migration/cosmoshub-4-v9-Lambda-upgrade.md index 94462b5043..7ee8ceff73 100644 --- a/docs/migration/cosmoshub-4-v9-Lambda-upgrade.md +++ b/docs/migration/cosmoshub-4-v9-Lambda-upgrade.md @@ -1,6 +1,6 @@ --- title: Cosmos Hub 4, Lambda Upgrade -order: 1 +order: 5 --- # Cosmos Hub 4, v9-Lambda Upgrade, Instructions diff --git a/docs/migration/cosmoshub-4-vega-upgrade.md b/docs/migration/cosmoshub-4-vega-upgrade.md index 4f8eda6bbe..36ef3607f8 100644 --- a/docs/migration/cosmoshub-4-vega-upgrade.md +++ b/docs/migration/cosmoshub-4-vega-upgrade.md @@ -1,6 +1,6 @@ --- title: Cosmos Hub 4, Vega Upgrade -order: 3 +order: 2 --- # Cosmos Hub 4, Vega Upgrade, Instructions diff --git a/docs/modules/globalfee.md b/docs/modules/globalfee.md index 7d9769258d..688d77cb05 100644 --- a/docs/modules/globalfee.md +++ b/docs/modules/globalfee.md @@ -297,4 +297,4 @@ bypass-min-fee-msg-types = [\ ## References -- [Gas and Fees in Cosmos SDK](https://docs.cosmos.network/main/basics/gas-fees.html) +- [Gas and Fees in Cosmos SDK](https://docs.cosmos.network/v0.45/basics/gas-fees.html) diff --git a/docs/proto/proto-docs.md b/docs/proto/proto-docs.md deleted file mode 100644 index 6a2ef42117..0000000000 --- a/docs/proto/proto-docs.md +++ /dev/null @@ -1,141 +0,0 @@ - -# Protobuf Documentation - - -## Table of Contents - -- [gaia/globalfee/v1beta1/query.proto](#gaia/globalfee/v1beta1/query.proto) - - [QueryParamsRequest](#gaia.globalfee.v1beta1.QueryParamsRequest) - - [QueryParamsResponse](#gaia.globalfee.v1beta1.QueryParamsResponse) - - - [Query](#gaia.globalfee.v1beta1.Query) - -- [gaia/globalfee/v1beta1/genesis.proto](#gaia/globalfee/v1beta1/genesis.proto) - - [GenesisState](#gaia.globalfee.v1beta1.GenesisState) - - [Params](#gaia.globalfee.v1beta1.Params) - -- [Scalar Value Types](#scalar-value-types) - - - - -

Top

- -## gaia/globalfee/v1beta1/query.proto - - - - - -### QueryParamsRequest -QueryMinimumGasPricesRequest is the request type for the -Query/MinimumGasPrices RPC method. - - - - - - - - -### QueryParamsResponse -QueryMinimumGasPricesResponse is the response type for the -Query/MinimumGasPrices RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `params` | [Params](#gaia.globalfee.v1beta1.Params) | | | - - - - - - - - - - - - - - -### Query -Query defines the gRPC querier service. - -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `Params` | [QueryParamsRequest](#gaia.globalfee.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#gaia.globalfee.v1beta1.QueryParamsResponse) | | GET|/gaia/globalfee/v1beta1/params| - - - - - - -

Top

- -## gaia/globalfee/v1beta1/genesis.proto - - - - - -### GenesisState -GenesisState - initial state of module - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `params` | [Params](#gaia.globalfee.v1beta1.Params) | | Params of this module | - - - - - - - - -### Params -Params defines the set of module parameters. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `minimum_gas_prices` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | minimum_gas_prices stores the minimum gas price(s) for all TX on the chain. When multiple coins are defined then they are accepted alternatively. The list must be sorted by denoms asc. No duplicate denoms or zero amount values allowed. For more information see https://docs.cosmos.network/main/modules/auth#concepts | -| `bypass_min_fee_msg_types` | [string](#string) | repeated | bypass_min_fee_msg_types defines a list of message type urls that are free of fee charge. | -| `max_total_bypass_min_fee_msg_gas_usage` | [uint64](#uint64) | | max_total_bypass_min_fee_msg_gas_usage defines the total maximum gas usage allowed for a transaction containing only messages of types in bypass_min_fee_msg_types to bypass fee charge. | - - - - - - - - - - - - - - - -## Scalar Value Types - -| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | -| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- | -| double | | double | double | float | float64 | double | float | Float | -| float | | float | float | float | float32 | float | float | Float | -| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | -| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum | -| uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) | -| uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) | -| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | -| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum | -| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) | -| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum | -| sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | -| sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum | -| bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass | -| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) | -| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) | - diff --git a/docs/proto/protodoc-markdown.tmpl b/docs/proto/protodoc-markdown.tmpl deleted file mode 100644 index 28201837e5..0000000000 --- a/docs/proto/protodoc-markdown.tmpl +++ /dev/null @@ -1,105 +0,0 @@ - -# Protobuf Documentation - - -## Table of Contents -{{range .Files}} -{{$file_name := .Name}}- [{{.Name}}](#{{.Name}}) - {{- if .Messages }} - {{range .Messages}} - [{{.LongName}}](#{{.FullName}}) - {{end}} - {{- end -}} - {{- if .Enums }} - {{range .Enums}} - [{{.LongName}}](#{{.FullName}}) - {{end}} - {{- end -}} - {{- if .Extensions }} - {{range .Extensions}} - [File-level Extensions](#{{$file_name}}-extensions) - {{end}} - {{- end -}} - {{- if .Services }} - {{range .Services}} - [{{.Name}}](#{{.FullName}}) - {{end}} - {{- end -}} -{{end}} -- [Scalar Value Types](#scalar-value-types) - -{{range .Files}} -{{$file_name := .Name}} - -

Top

- -## {{.Name}} -{{.Description}} - -{{range .Messages}} - - -### {{.LongName}} -{{.Description}} - -{{if .HasFields}} -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -{{range .Fields -}} - | `{{.Name}}` | [{{.LongType}}](#{{.FullType}}) | {{.Label}} | {{if (index .Options "deprecated"|default false)}}**Deprecated.** {{end}}{{nobr .Description}}{{if .DefaultValue}} Default: {{.DefaultValue}}{{end}} | -{{end}} -{{end}} - -{{if .HasExtensions}} -| Extension | Type | Base | Number | Description | -| --------- | ---- | ---- | ------ | ----------- | -{{range .Extensions -}} - | `{{.Name}}` | {{.LongType}} | {{.ContainingLongType}} | {{.Number}} | {{nobr .Description}}{{if .DefaultValue}} Default: {{.DefaultValue}}{{end}} | -{{end}} -{{end}} - -{{end}} - -{{range .Enums}} - - -### {{.LongName}} -{{.Description}} - -| Name | Number | Description | -| ---- | ------ | ----------- | -{{range .Values -}} - | {{.Name}} | {{.Number}} | {{nobr .Description}} | -{{end}} - -{{end}} - -{{if .HasExtensions}} - - -### File-level Extensions -| Extension | Type | Base | Number | Description | -| --------- | ---- | ---- | ------ | ----------- | -{{range .Extensions -}} - | `{{.Name}}` | {{.LongType}} | {{.ContainingLongType}} | {{.Number}} | {{nobr .Description}}{{if .DefaultValue}} Default: `{{.DefaultValue}}`{{end}} | -{{end}} -{{end}} - -{{range .Services}} - - -### {{.Name}} -{{.Description}} - -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -{{range .Methods -}} - | `{{.Name}}` | [{{.RequestLongType}}](#{{.RequestFullType}}){{if .RequestStreaming}} stream{{end}} | [{{.ResponseLongType}}](#{{.ResponseFullType}}){{if .ResponseStreaming}} stream{{end}} | {{nobr .Description}} | {{with (index .Options "google.api.http")}}{{range .Rules}}{{.Method}}|{{.Pattern}}{{end}}{{end}}| -{{end}} -{{end}} - -{{end}} - -## Scalar Value Types - -| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | -| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- | -{{range .Scalars -}} - | {{.ProtoType}} | {{.Notes}} | {{.CppType}} | {{.JavaType}} | {{.PythonType}} | {{.GoType}} | {{.CSharp}} | {{.PhpType}} | {{.RubyType}} | -{{end}} diff --git a/docs/readiness/README.md b/docs/readiness/README.md deleted file mode 100644 index 98d8e19ac7..0000000000 --- a/docs/readiness/README.md +++ /dev/null @@ -1,112 +0,0 @@ - - -# Architecture Decision Records (ADR) - -This is a location to record all high-level architecture decisions for new feature and module proposals in the Cosmos Hub. - -An Architectural Decision (**AD**) is a software design choice that addresses a functional or non-functional requirement that is architecturally significant. -An Architecturally Significant Requirement (**ASR**) is a requirement that has a measurable effect on a software system’s architecture and quality. -An Architectural Decision Record (**ADR**) captures a single AD, such as often done when writing personal notes or meeting minutes; the collection of ADRs created and maintained in a project constitute its decision log. All these are within the topic of Architectural Knowledge Management (AKM). - -You can read more about the ADR concept in this [blog post](https://product.reverb.com/documenting-architecture-decisions-the-reverb-way-a3563bb24bd0#.78xhdix6t). - -## Rationale - -ADRs are intended to be the primary mechanism for proposing new feature designs and new processes, for collecting community input on an issue, and for documenting the design decisions. -An ADR should provide: - -- Context on the relevant goals and the current state -- Proposed changes to achieve the goals -- Summary of pros and cons -- References -- Changelog - -Note the distinction between an ADR and a spec. The ADR provides the context, intuition, reasoning, and -justification for a change in architecture, or for the architecture of something -new. The spec is much more compressed and streamlined summary of everything as -it stands today. - -If recorded decisions turned out to be lacking, convene a discussion, record the new decisions here, and then modify the code to match. - -## Creating new ADR - -### Process - -1. Copy the `template.md` file. Use the following filename pattern: `adr-next_number-title.md` -2. Link the ADR in the related feature epic -3. Create a draft Pull Request if you want to get early feedback. -4. Make sure the context and a solution is clear and well documented. -5. Add an entry to a list in the README file [Table of Contents](#adr-table-of-contents). -6. Create a Pull Request to publish the ADR proposal. - -### Life cycle - -ADR creation is an **iterative** process. Rather than solving all decisions in a single PR, it's best to first understand the problem and then solicit feedback through Github Issues. - -1. Every proposal should start with a new GitHub Issue and be linked to the corresponding Feature Epic. The Issue should contain a brief proposal summary. - -2. Once the motivation is validated, a GitHub Pull Request (PR) is created with a new document based on the `template.md`. - -3. An ADR doesn't have to arrive to `master` with an `accepted` status in a single PR. If the motivation is clear and the solution is sound, we should be able to merge it and keep a `proposed` status. - -4. If a `proposed` ADR is merged, then it should clearly document outstanding issues in the Feature Epic. - -5. The PR should always be merged. In the case of a faulty ADR, it's still preferable to merge it with a `rejected` status. The only time the ADR should not be merged is if the author abandons it. - -6. Merged ADRs **should not** be pruned. - -### Status - -Status has two components: - -``` -{CONSENSUS STATUS} {IMPLEMENTATION STATUS} -``` - -IMPLEMENTATION STATUS is either `Implemented` or `Not Implemented`. - -#### Consensus Status - -``` -DRAFT -> PROPOSED -> LAST CALL yyyy-mm-dd -> ACCEPTED | REJECTED -> SUPERSEDED by ADR-xxx - \ | - \ | - v v - ABANDONED -``` - -- `DRAFT`: [optional] an ADR which is work in progress, not being ready for a general review. This is to present an early work and get an early feedback in a Draft Pull Request form. -- `PROPOSED`: an ADR covering a full solution architecture and still in the review - project stakeholders haven't reached an agreed yet. -- `LAST CALL `: [optional] clear notify that we are close to accept updates. Changing a status to `LAST CALL` means that social consensus (of Cosmos Hub maintainers) has been reached and we still want to give it a time to let the community react or analyze. -- `ACCEPTED`: ADR which will represent a currently implemented or to be implemented architecture design. -- `REJECTED`: ADR can go from PROPOSED or ACCEPTED to rejected if the consensus among project stakeholders will decide so. -- `SUPERSEEDED by ADR-xxx`: ADR which has been superseded by a new ADR. -- `ABANDONED`: the ADR is no longer pursued by the original authors. - -### Language used in ADR - -- The context/background should be written in the present tense. -- Avoid using a first, personal form. - -**Use RFC 2119 Keywords** - -When writing ADRs, follow the same best practices for writing RFCs. When writing RFCs, key words are used to signify the requirements in the specification. These words are often capitalized: "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL. They are to be interpreted as described in [RFC 2119](https://datatracker.ietf.org/doc/html/rfc2119). - -## ADR Table of Contents - -### Accepted - -- n/a - -### Proposed - -- n/a - -### Draft - -- [ADR 001: Interchain Accounts](./adr-001-interchain-accounts.md) diff --git a/docs/readiness/template.md b/docs/readiness/template.md deleted file mode 100644 index e7f148a2b9..0000000000 --- a/docs/readiness/template.md +++ /dev/null @@ -1,95 +0,0 @@ - - ---- - -ADR: (number) -Title: (short title) -Status: (current ADR status) -Category: (Module or Feature) -Author: (primary & additional authors) -Created: (creation date) -Mdified: (modification date) -Requires: (optional list of downstream ADRs) -Required-By: (optional list of upstream ADRs) -Implements: (optional list of component ADRs) ---- - -# ADR {ADR-NUMBER}: {TITLE} - -## Changelog - -- {date}: {changelog} - -## Abstract - -> "If you can't explain it simply, you don't understand it well enough." Provide a short (~200 word) high level description of the issue being addressed and rationale for such. - -## Rationale - -> Describe the context and rationale for proposing a new feature or module. The language in this section is value-neutral and should clearly explain the problem and motivation that the proposal aims to resolve. - -## Desired Outcome - -> Provides succinct answers to the issues documented above. Response should include desired characteristics / properties of feature/protocol, and effects if properties are violated. - -## Consequences - -> This section describes the resulting context, after applying the decision (positive, neutral, and negative). - -#### Backwards Compatibility - -> Discussion of compatibility or lack thereof with previous standards. - -#### Forward Compatibility - -> Discussion of compatibility or lack thereof with expected future standards. - -## Technical Specification - -> Details main technical standard, may include some of the following: syntax, semantics, sub-protocols, algorithms, data structures, etc. - -## Development - -> Documents the following for readiness/deployment milestones - -- Integration requirements (CLI) -- Testing (Simulations, Core Team Testing, Partner Testing) -- Audits (Internal Dev review, Third-party review, Bug Bounty) -- Networks (Testnets, Productionnets, Mainnets) - -### Backwards Compatibility - -> Discussion of compatibility or lack thereof with expected future standards. - -## Governance [optional] - -> If relevant, will include: - -- Linked Hub Governance proposal -- Core Community Governance -- Steering Community -- Timelines & Roadmap - -## Project Integrations [optional] - -> Document internal and/or external integration partners - -- Gaia Integrations -- Integration Partner -- IBC Readiness - -#### Downstream User Impact Report - -#### Upstream Partner Impact Report - -#### Inter-module Dependence - -## Support - -> Includes additional technical, marketing, educational, etc support - -## Additional Research & References - -> Additional links or sections to address diff --git a/docs/resources/genesis.md b/docs/resources/genesis.md index db03440a03..5f74ec2aa5 100644 --- a/docs/resources/genesis.md +++ b/docs/resources/genesis.md @@ -172,7 +172,7 @@ Let us break down the parameters: ### Mint -The `mint` module governs the logic of inflating the supply of token. The `mint` section in the genesis file looks like the follwing: +The `mint` module governs the logic of inflating the supply of token. The `mint` section in the genesis file looks like the following: ```json "mint": { @@ -206,7 +206,7 @@ Let us break down the parameters: ### Distribution -The `distribution` module handles the logic of distribution block provisions and fees to validators and delegators. The `distribution` section in the genesis file looks like the follwing: +The `distribution` module handles the logic of distribution block provisions and fees to validators and delegators. The `distribution` section in the genesis file looks like the following: ```json "distribution": { diff --git a/docs/resources/ledger.md b/docs/resources/ledger.md index 4cdd8a32a6..0950153fa2 100644 --- a/docs/resources/ledger.md +++ b/docs/resources/ledger.md @@ -15,9 +15,9 @@ Do not lose or share your 24 words with anyone. To prevent theft or loss of fund ## Install the Cosmos Ledger application -Installing the `Cosmos` application on your ledger device is required before you can use either [Keplr](#keplr-+-ledger-nano) or [`gaiad`](#gaia-cli-+-ledger-nano). To do so, you need to: +Installing the `Cosmos` application on your ledger device is required before you can use either [Keplr](#keplr--ledger-nano) or [`gaiad`](#gaia-cli--ledger-nano). To do so, you need to: -1. Install [Ledger Live](https://shop.ledger.com/pages/ledger-live) on your machine. +1. Install [Ledger Live](https://www.ledger.com/ledger-live) on your machine. 2. Using Ledger Live, [update your Ledger Nano S with the latest firmware](https://support.ledger.com/hc/en-us/articles/360002731113?docs=true). diff --git a/docs/resources/service-providers.md b/docs/resources/service-providers.md index a8311b553a..2c8f145829 100644 --- a/docs/resources/service-providers.md +++ b/docs/resources/service-providers.md @@ -11,19 +11,20 @@ Service Providers are expected to act as trusted points of contact to the blockc This document describes: -- [Connection Options](#connection-options) -- [Running a Full Node](#running-a-full-node) - - [What is a Full Node?](#what-is-a-full-node) - - [Installation and Configuration](#installation-and-configuration) -- [Command-Line Interface](#command-line-interface) - - [Available Commands](#available-commands) - - [Remote Access to gaiad](#remote-access-to-gaiad) - - [Create a Key pair](#create-a-key-pair) - - [Check your Account](#check-your-account) - - [Check your Balance](#check-your-balance) - - [Send coins using the CLI](#send-coins-using-the-cli) -- [REST API](#rest-api) - - [Listen for incoming transactions](#listen-for-incoming-transaction) +- [Service Providers](#service-providers) + - [Connection Options](#connection-options) + - [Running a Full Node](#running-a-full-node) + - [What is a Full Node?](#what-is-a-full-node) + - [Installation and Configuration](#installation-and-configuration) + - [Command-Line Interface](#command-line-interface) + - [Available Commands](#available-commands) + - [Remote Access to gaiad](#remote-access-to-gaiad) + - [Create a Key Pair](#create-a-key-pair) + - [Check your Account](#check-your-account) + - [Check your Balance](#check-your-balance) + - [Send Coins Using the CLI](#send-coins-using-the-cli) + - [REST API](#rest-api) + - [Listen for Incoming Transactions](#listen-for-incoming-transactions) ## Connection Options diff --git a/docs/roadmap/README.md b/docs/roadmap/README.md index e2bfd009fc..e104833266 100644 --- a/docs/roadmap/README.md +++ b/docs/roadmap/README.md @@ -7,75 +7,7 @@ parent: # Previous Releases -Please see the table below for libray versions and other dependencies. - - -## Cosmos Hub Release Details - -### Delta Upgrade (Completed July 12, 2021) - -- Gaia v5.0.x -- Gravity DEX: - - A scalable AMM model for token swaps - - Drives liquidity for tokens on the Cosmos Hub - - Delivers price consistency and order execution - -### Vega Upgrade (Completed December 14, 2021) - -- Gaia v6.0.x -- Cosmos SDK v0.44 - - Fee grant module: - - Allows paying fees on behalf of another account - - Authz module: - - Provide governance functions to execute transactions on behalf of another account -- Liquidity Module v1.4.2 - - The Gravity DEX with updates for dependencies -- IBC v2.0.0 -- Tendermint v0.34.14 -- Cosmosvisor v0.1.0 -- IBC packet forward middleware v1.0.1 - - Cosmos Hub as a router - -- External chain launch: Gravity Bridge - - Transfer ATOM, ETH, ERC-20, and other Cosmos tokens between Ethereum and the Gravity Bridge Chain and by extension all IBC connected chains. - - Fee and reward model hosted across Cosmos and Ethereum - -### v7-Theta Upgrade (Completed March 25, 2022) - -- Gaia v7.0.x -- Cosmos SDK v0.45 - - Minimal update with small fixes -- Gravity DEX: Liquidity v1.4.5 - - Adds a circuit breaker governance proposal type to disable adding new liquidity in order to make a migration possible. -- IBC 3.0.0 - - Interchain Account Module - - Allows the creation of accounts on a "Host" blockchain which are controlled by an authentication module on a "Controller" blockchain. - - Arbitrary messages are able to be submitted from the "Controller" blockchain to the "Host" blockchain to be executed on behalf of the Interchain Account. - - Uses ordered IBC channels, one per account. - -### v8-Rho Upgrade (expected Q1 2023) - -- Gaia v8.0.x -- Cosmos SDK v0.45.12 - - Version bump with a number of fixes - - See [changelog](https://github.com/cosmos/cosmos-sdk/blob/v0.45.12/CHANGELOG.md) for details -- IBC v3.4 - - See [changelog](https://github.com/cosmos/ibc-go/blob/v3.4.0/CHANGELOG.md) for details -- IBC Packet Forward Middleware v3.1.1 -- IBC Msg Whitelist to skip MinFee in CheckTX -- Global Fee Module - - Allows denoms and min-fees to be governance parameters so gas can be paid in various denoms. - - Visible on [tgrade](https://github.com/confio/tgrade/tree/main/x/globalfee) already and enabled in [ante.go](https://github.com/confio/tgrade/blob/main/app/ante.go#L72-L92) - -### v9-Lambda Upgrade (expected Q1 2023) - -- Gaia v9.0.x -- Cosmos SDK v0.45-ics -- IBC 4.2 -- Interchain Security - Replicated Security - - The Cosmos solution to shared security that uses IBC Cross Chain Validation (CCV) to relay validator set composition from a Provider Chain (Cosmos Hub) to a Consumer Chain. This validator set is in charge of producing blocks on both networks using separate nodes. Misbehavior on the Consumer Chain results in slashing Provider Chain staking tokens (ATOM). - -## Cosmos Hub Summary +The following table below, shows the the versions of the main dependencies. | Upgrade Name | Date | Height | Chain Identifier | Tm | Cosmos SDK | Gaia | IBC | |---------------------|---------------|-----------|---------------|------------|------------|--------------------------|--------------------------| @@ -83,13 +15,15 @@ Please see the table below for libray versions and other dependencies. | [Security Hard Fork](https://forum.cosmos.network/t/critical-cosmossdk-security-advisory-updated/2211) | 21/04/19 | 482,100 | `cosmoshub-1` | [v0.31.x](https://github.com/tendermint/tendermint/releases/tag/v0.31.11) | [v0.34.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.34.6) | _Included in Cosmos SDK_) | n/a | | Upgrade #1 | 21/01/20 | 500043 | `cosmoshub-2` | [v0.31.x](https://github.com/tendermint/tendermint/releases/tag/v0.31.11) | [v0.34.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.34.10) | _Included in Cosmos SDK_) | n/a | | Upgrade #2 | 07/08/20 | 2902000 | `cosmoshub-3` | [v0.32.x](https://github.com/tendermint/tendermint/releases/tag/v0.32.14) | [v0.37.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.37.15) | [v2.0.x](https://github.com/cosmos/gaia/releases/tag/v2.0.14) | n/a | -| Stargate | 18/02/21 | 5200791 | `cosmoshub-4` | [v0.34.x](https://github.com/tendermint/tendermint/releases/tag/v0.34.3) | [v0.40.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.40.1) | [v4.0.x](https://github.com/cosmos/gaia/releases/tag/v4.0.6) | _Included in Cosmos SDK_ | +| [Stargate](https://github.com/cosmos/gaia/releases/tag/v4.0.0) | 18/02/21 | 5200791 | `cosmoshub-4` | [v0.34.x](https://github.com/tendermint/tendermint/releases/tag/v0.34.3) | [v0.40.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.40.1) | [v4.0.x](https://github.com/cosmos/gaia/releases/tag/v4.0.6) | _Included in Cosmos SDK_ | | Security Hard Fork | ? | ? | `cosmoshub-4` | [v0.34.x](https://github.com/tendermint/tendermint/releases/tag/v0.34.8) | [v0.41.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.41.4) | [v4.2.x](https://github.com/cosmos/gaia/releases/tag/v4.2.1) | _Included in Cosmos SDK_ | -| Delta (Gravity DEX) | 13/07/21 | 6910000 | `cosmoshub-4` | [v0.34.x](https://github.com/tendermint/tendermint/releases/tag/v0.34.13) | [v0.42.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.10) | [v5.0.x](https://github.com/cosmos/gaia/releases/tag/v5.0.8) | _Included in Cosmos SDK_ | -| Vega v6 | 13/12/21 | 8695000 | `cosmoshub-4` | [v0.34.x](https://github.com/tendermint/tendermint/releases/tag/v0.34.14) | [v0.44.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.44.5) | [v6.0.x](https://github.com/cosmos/gaia/releases/tag/v6.0.4) | [v2.0.x](https://github.com/cosmos/ibc-go/releases/tag/v2.0.3) | -| Theta v7 | 12/04/22 | 10085397 | `cosmoshub-4` | [v0.34.x](https://github.com/tendermint/tendermint/releases/tag/v0.34.14) | [v0.45.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.1) | [v7.0.x](https://github.com/cosmos/gaia/releases/tag/v7.0.0) | [v3.0.x](https://github.com/cosmos/ibc-go/releases/tag/v3.0.0) | -| Rho v8 | 16/02/23 | 14099412 | `cosmoshub-4` | [v0.34.x](https://github.com/informalsystems/tendermint/releases/tag/v0.34.24) | [v0.45.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.12) | [v8.0.x](https://github.com/cosmos/gaia/releases/tag/v8.0.0) | [v3.4.x](https://github.com/cosmos/ibc-go/releases/tag/v3.4.0) | -| Lambda v9 | 15/03/23 | 14470501 | `cosmoshub-4` | [v0.34.x](https://github.com/informalsystems/tendermint/releases/tag/v0.34.25) | [v0.45.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.13-ics) | [v9.0.x](https://github.com/cosmos/gaia/releases/tag/v9.0.0) | [v4.2.x](https://github.com/cosmos/ibc-go/releases/tag/v4.2.0) | -| Epsilon v10 | 21/06/23 | 15816200 | `cosmoshub-4` | [v0.34.x](https://github.com/cometbft/cometbft/releases/tag/v0.34.28) | [v0.45.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.16-ics) | [v10.0.x](https://github.com/cosmos/gaia/releases/tag/v10.0.0) | [v4.4.x](https://github.com/cosmos/ibc-go/releases/tag/v4.4.0) | - - +| [Delta (Gravity DEX)](https://github.com/cosmos/gaia/releases/tag/v5.0.0) | 13/07/21 | 6910000 | `cosmoshub-4` | [v0.34.x](https://github.com/tendermint/tendermint/releases/tag/v0.34.13) | [v0.42.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.10) | [v5.0.x](https://github.com/cosmos/gaia/releases/tag/v5.0.8) | _Included in Cosmos SDK_ | +| [Vega v6](https://github.com/cosmos/gaia/releases/tag/v6.0.0) | 13/12/21 | 8695000 | `cosmoshub-4` | [v0.34.x](https://github.com/tendermint/tendermint/releases/tag/v0.34.14) | [v0.44.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.44.5) | [v6.0.x](https://github.com/cosmos/gaia/releases/tag/v6.0.4) | [v2.0.x](https://github.com/cosmos/ibc-go/releases/tag/v2.0.3) | +| [Theta v7](https://github.com/cosmos/gaia/releases/tag/v7.0.0) | 12/04/22 | 10085397 | `cosmoshub-4` | [v0.34.x](https://github.com/tendermint/tendermint/releases/tag/v0.34.14) | [v0.45.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.1) | [v7.0.x](https://github.com/cosmos/gaia/releases/tag/v7.0.0) | [v3.0.x](https://github.com/cosmos/ibc-go/releases/tag/v3.0.0) | +| [Rho v8](https://github.com/cosmos/gaia/releases/tag/v8.0.0) | 16/02/23 | 14099412 | `cosmoshub-4` | [v0.34.x](https://github.com/informalsystems/tendermint/releases/tag/v0.34.24) | [v0.45.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.12) | [v8.0.x](https://github.com/cosmos/gaia/releases/tag/v8.0.0) | [v3.4.x](https://github.com/cosmos/ibc-go/releases/tag/v3.4.0) | +| [Lambda v9](https://github.com/cosmos/gaia/releases/tag/v9.0.0) | 15/03/23 | 14470501 | `cosmoshub-4` | [v0.34.x](https://github.com/informalsystems/tendermint/releases/tag/v0.34.25) | [v0.45.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.13-ics) | [v9.0.x](https://github.com/cosmos/gaia/releases/tag/v9.0.0) | [v4.2.x](https://github.com/cosmos/ibc-go/releases/tag/v4.2.0) | +| [v10](https://github.com/cosmos/gaia/releases/tag/v10.0.0) | 21/06/23 | 15816200 | `cosmoshub-4` | [v0.34.x](https://github.com/cometbft/cometbft/releases/tag/v0.34.28) | [v0.45.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.16-ics) | [v10.0.x](https://github.com/cosmos/gaia/releases/tag/v10.0.0) | [v4.4.x](https://github.com/cosmos/ibc-go/releases/tag/v4.4.0) | +| [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 diff --git a/docs/validators/validator-faq.md b/docs/validators/validator-faq.md index 8ab1c4cdc6..42c6fc266f 100644 --- a/docs/validators/validator-faq.md +++ b/docs/validators/validator-faq.md @@ -33,7 +33,7 @@ You can find more details about the requirements in the [Joining Mainnet Tutoria ### What is a delegator? -Delegators are ATOM holders who cannot, or do not want to, run a validator themselves. ATOM holders can delegate ATOM to a validator and obtain a part of their revenue in exchange. For details on how revenue is distributed, see [What is the incentive to stake?](#what-is-the-incentive-to-stake?) and [What are validators commission?](#what-are-validators-commission?) in this document. +Delegators are ATOM holders who cannot, or do not want to, run a validator themselves. ATOM holders can delegate ATOM to a validator and obtain a part of their revenue in exchange. For details on how revenue is distributed, see [What is the incentive to stake?](#what-is-the-incentive-to-stake) and [What is a validator commission?](#what-is-a-validator-commission) in this document. Because delegators share revenue with their validators, they also share risks. If a validator misbehaves, each of their delegators are partially slashed in proportion to their delegated stake. This penalty is one of the reasons why delegators must perform due diligence on validators before delegating. Spreading their stake over multiple validators is another layer of protection. @@ -53,7 +53,6 @@ Any participant in the network can signal that they want to become a validator b - **Initial commission rate**: The commission rate on block rewards and fees charged to delegators. - **Maximum commission:** The maximum commission rate that this validator can charge. This parameter is fixed and cannot be changed after the `create-validator` transaction is processed. - **Commission max change rate:** The maximum daily increase of the validator commission. This parameter is fixed cannot be changed after the `create-validator` transaction is processed. -- **Minimum self-delegation:** Minimum amount of ATOM the validator requires to have bonded at all time. If the validator's self-delegated stake falls below this limit, their validator gets jailed and kicked out of the active validator set. After a validator is created, ATOM holders can delegate ATOM to them, effectively adding stake to the validator's pool. The total stake of an address is the combination of ATOM bonded by delegators and ATOM self-bonded by the validator. @@ -95,9 +94,13 @@ After a validator is created with a `create-validator` transaction, the validato - `unbonded`: Validator is not in the active set, and therefore not signing blocks. The validator cannot be slashed and does not earn any reward. It is still possible to delegate ATOM to an unbonded validator. Undelegating from an `unbonded` validator is immediate, meaning that the tokens are not subject to the unbonding period. ### What is self-delegation? How can I increase my self-delegation? - + Self-delegation is a delegation of ATOM from a validator to themselves. The delegated amount can be increased by sending a `delegate` transaction from your validator's `application` application key. +### What is validator bond? How can I increase my validator bond? + +Validator bond is a delegation of ATOM from a delegator to a validator. Validator operators can validator bond to themselves. The validator bond amount can be increased by sending a `ValidatorBond` transaction from any account delegated to your validator. Validator bond is required before a validator can accept delegations from liquid staking providers. As such it forces validators to put “skin in the game” in order to be entrusted with delegations from liquid staking providers. This disincentivizes malicious behavior and enables the validator to negotiate its relationship with liquid staking providers. + ### Is there a minimum amount of ATOM that must be delegated to be an active (bonded) validator? The minimum is 1 ATOM. But the network is currently secured by much higher values. You can check the minimum required ATOM to become part of the active validator set on the [Mintscan validator page](https://www.mintscan.io/cosmos/validators). @@ -106,7 +109,7 @@ The minimum is 1 ATOM. But the network is currently secured by much higher value Delegators are free to choose validators according to their own subjective criteria. Selection criteria includes: -- **Amount of self-delegated ATOM:** Number of ATOM a validator self-delegated to themselves. A validator with a higher amount of self-delegated ATOM indicates that the validator is sharing the risk and experienced consequences for their actions. +- **Amount of validator-bonded ATOM:** Number of ATOM a validator validator-bonded to themselves. A validator with a higher amount of self-delegated ATOM indicates that the validator is sharing the risk and consequences for their actions, or has enough goodwill from the community so that others post validator bond on the validator's behalf. - **Amount of delegated ATOM:** Total number of ATOM delegated to a validator. A high voting power shows that the community trusts this validator. Larger validators also decrease the decentralization of the network, so delegators are suggested to consider delegating to smaller validators. - **Commission rate:** Commission applied on revenue by validators before the revenue is distributed to their delegators. - **Track record:** Delegators review the track record of the validators they plan to delegate to. This track record includes past votes on proposals and historical average uptime. @@ -158,7 +161,7 @@ This depends, currently no validators are required to validate other blockchains ### How can a validator safely quit validating on the Cosmos Hub? -If a validator simply shuts down their node, this would result in the validator and their delegators getting slashed for being offline. The only way to safely exit a validator node running on the Cosmos Hub is by unbonding the validator's self-delegated stake so that it falls below its minimum self-delegation limit. As a result, the validator gets jailed and kicked out of the active set of validators, without getting slashed. They can then proceed to shut down their node without risking their tokens. +If a validator simply shuts down their node, this would result in the validator and their delegators getting slashed for being offline. The only way to safely exit a validator node running on the Cosmos Hub is by unbonding the validator with the `UnbondValidator` message. As a result, the validator gets jailed and kicked out of the active set of validators, without getting slashed. They can then proceed to shut down their node without risking their tokens. It's highly advised to inform your delegators when doing this, as they will still be bonded to your validator after it got jailed. They will need to manually unbond and they might not have been made aware of this via their preferred wallet application. @@ -233,9 +236,7 @@ If a validator misbehaves, their delegated stake is partially slashed. Two fault ### Are validators required to self-delegate ATOM? -Yes, they do need to self-delegate at least `1 atom`. Even though there is no obligation for validators to self-delegate more than `1 atom`, delegators want their validator to have more self-delegated ATOM in their staking pool. In other words, validators share the risk. - -In order for delegators to have some guarantee about how much shared risk their validator has, the validator can signal a minimum amount of self-delegated ATOM. If a validator's self-delegation goes below the limit that it predefined, the validator gets jailed and kicked out of the active set of validators while its delegators remain bonded to it. +No, they do not need to self-delegate. Even though there is no obligation for validators to self-delegate, delegators may want their validator to have self-delegated ATOM in their staking pool. In other words, validators share the risk. Note however that it's possible that some validators decide to self-delegate via a different address for security reasons. @@ -243,6 +244,51 @@ Note however that it's possible that some validators decide to self-delegate via 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. +## 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. + ## Technical Requirements ### What are hardware requirements? diff --git a/docs/validators/validator-setup.md b/docs/validators/validator-setup.md index 548829568a..76c73bd35d 100644 --- a/docs/validators/validator-setup.md +++ b/docs/validators/validator-setup.md @@ -46,7 +46,6 @@ gaiad tx staking create-validator \ --commission-rate="0.10" \ --commission-max-rate="0.20" \ --commission-max-change-rate="0.01" \ - --min-self-delegation="1000000" \ --gas="auto" \ --gas-prices="0.0025uatom" \ --from= @@ -56,9 +55,6 @@ gaiad tx staking create-validator \ When specifying commission parameters, the `commission-max-change-rate` is used to measure % _point_ change over the `commission-rate`. E.g. 1% to 2% is a 100% rate increase, but only 1 percentage point. ::: -::: tip -`Min-self-delegation` is a stritly positive integer that represents the minimum amount of self-delegated voting power your validator must always have. A `min-self-delegation` of `1000000` means your validator will never have a self-delegation lower than `1atom` -::: It's possible that you won't have enough ATOM to be part of the active set of validators in the beginning. Users are able to delegate to inactive validators (those outside of the active set) using the [Keplr web app](https://wallet.keplr.app/#/cosmoshub/stake?tab=inactive-validators). You can confirm that you are in the validator set by using a third party explorer like [Mintscan](https://www.mintscan.io/cosmos/validators). diff --git a/docs/zh/delegator/delegator-guide-cli.md b/docs/zh/delegator/delegator-guide-cli.md index 9db6d827c0..88869e860e 100644 --- a/docs/zh/delegator/delegator-guide-cli.md +++ b/docs/zh/delegator/delegator-guide-cli.md @@ -162,7 +162,7 @@ gaiad keys add --recover 当您初始化钱包设备时,设备会产生一个24个词的助记词组。这个助记词组和Cosmos是兼容的,我们可以通过这个助记词组创建Cosmos账户。所以,您需要做的是确认您的钱包设备兼容`gaiad`,通过下面的步骤可以帮助您确认您的设备是否兼容: -1. 下载[Ledger Live应用](https://www.ledger.com/pages/ledger-live). +1. 下载[Ledger Live应用](https://www.ledger.com/ledger-live). 2. 通过USB将钱包与计算机连接,并且将钱包固件升级到最新版本。 3. 到Ledger Live钱包的应用商店下载”Cosmos“应用(这可能需要花些时间)。**下载”Cosmos“应用程序需要在Ledger Live钱包`Settings`选项中激活`Dev Mode`** 4. 在你的钱包设备上操作Cosmos APP。 diff --git a/go.mod b/go.mod index 194278c6b3..d4a96c78b0 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/cosmos/gaia/v11 +module github.com/cosmos/gaia/v15 go 1.21 @@ -9,7 +9,7 @@ require ( cosmossdk.io/tools/rosetta v0.2.1 github.com/cometbft/cometbft v0.37.2 github.com/cometbft/cometbft-db v0.8.0 - github.com/cosmos/cosmos-sdk v0.47.5 + github.com/cosmos/cosmos-sdk v0.47.6 github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/gogoproto v1.4.10 github.com/cosmos/ibc-go/v7 v7.3.1 @@ -20,12 +20,13 @@ require ( github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.16.0 - github.com/strangelove-ventures/packet-forward-middleware/v7 v7.0.0-20230412224111-136e94e98861 github.com/stretchr/testify v1.8.4 ) require ( cosmossdk.io/errors v1.0.0 + github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.2 + github.com/google/gofuzz v1.2.0 github.com/ory/dockertest/v3 v3.10.0 google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 ) @@ -161,7 +162,7 @@ require ( github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.14.0 // indirect github.com/prometheus/client_model v0.3.0 // indirect github.com/prometheus/common v0.42.0 // indirect @@ -213,6 +214,12 @@ replace ( // Use cosmos keyring github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 + // Use special SDK release with support for both ICS and LSM + github.com/cosmos/cosmos-sdk => github.com/informalsystems/cosmos-sdk v0.46.0-alpha2.0.20231206144452-5b8e28f3247b + + // Use special ICS release with support for LSM + github.com/cosmos/interchain-security/v3 => github.com/cosmos/interchain-security/v3 v3.3.0-rc0.0.20231207121941-02bc47252590 + // TODO: remove it: https://github.com/cosmos/cosmos-sdk/issues/13134 github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2 // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 @@ -225,7 +232,3 @@ replace ( // the following version across all dependencies. google.golang.org/grpc => google.golang.org/grpc v1.54.0 ) - -replace github.com/cosmos/cosmos-sdk => github.com/informalsystems/cosmos-sdk v0.46.0-alpha2.0.20231206144452-5b8e28f3247b - -replace github.com/cosmos/interchain-security/v3 => github.com/cosmos/interchain-security/v3 v3.3.0-rc0.0.20231207121941-02bc47252590 diff --git a/go.sum b/go.sum index 59d100914c..82a3c49b0b 100644 --- a/go.sum +++ b/go.sum @@ -609,6 +609,8 @@ github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoK github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= github.com/cosmos/iavl v0.20.1 h1:rM1kqeG3/HBT85vsZdoSNsehciqUQPWrR4BYmqE2+zg= github.com/cosmos/iavl v0.20.1/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= +github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.2 h1:6zjj+yIpMbCTRI2eJ2fXuflElENs3mrUSLH/TSWL8fk= +github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.1.2/go.mod h1:UvDmcGIWJPIytq+Q78/ff5NTOsuX/7IrNgEugTW5i0s= github.com/cosmos/ibc-go/v7 v7.3.1 h1:bil1IjnHdyWDASFYKfwdRiNtFP6WK3osW7QFEAgU4I8= github.com/cosmos/ibc-go/v7 v7.3.1/go.mod h1:wvx4pPBofe5ZdMNV3OFRxSI4auEP5Qfqf8JXLLNV04g= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= @@ -1260,8 +1262,9 @@ github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6J github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= @@ -1372,8 +1375,6 @@ github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DM github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= -github.com/strangelove-ventures/packet-forward-middleware/v7 v7.0.0-20230412224111-136e94e98861 h1:amfLQujq8LwWjuadoMDX7lngka6NXcvk4ugkWZ4m7o0= -github.com/strangelove-ventures/packet-forward-middleware/v7 v7.0.0-20230412224111-136e94e98861/go.mod h1:DJNSVK8NCYHM+aZHCFkcAqPwjzwHYAjhjSMlhAGtJ3c= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= diff --git a/mlc_config.json b/mlc_config.json index df064e98d3..454e885d0f 100644 --- a/mlc_config.json +++ b/mlc_config.json @@ -6,5 +6,5 @@ "retryOn429": true, "retryCount": 5, "fallbackRetryDelay": "30s", - "aliveStatusCodes": [0, 200, 206, 403] + "aliveStatusCodes": [0, 200, 206, 403, 429] } diff --git a/tests/e2e/chain.go b/tests/e2e/chain.go index 22339a351a..48df134154 100644 --- a/tests/e2e/chain.go +++ b/tests/e2e/chain.go @@ -21,7 +21,7 @@ import ( stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" - gaiaparams "github.com/cosmos/gaia/v11/app/params" + gaiaparams "github.com/cosmos/gaia/v15/app/params" ) const ( diff --git a/tests/e2e/e2e_exec_test.go b/tests/e2e/e2e_exec_test.go index 134dfdb909..e84a8f04f9 100644 --- a/tests/e2e/e2e_exec_test.go +++ b/tests/e2e/e2e_exec_test.go @@ -423,6 +423,7 @@ func (s *IntegrationTestSuite) runGovExec(c *chain, valIdx int, submitterAddr, g s.T().Logf("Successfully executed %s", govCommand) } +// NOTE: Tx unused, left here for future reference // func (s *IntegrationTestSuite) executeGKeysAddCommand(c *chain, valIdx int, name string, home string) string { // ctx, cancel := context.WithTimeout(context.Background(), time.Minute) // defer cancel() @@ -448,7 +449,8 @@ func (s *IntegrationTestSuite) runGovExec(c *chain, valIdx int, submitterAddr, g // return addrRecord.Address // } -// func (s *IntegrationTestSuite) executeKeysList(c *chain, valIdx int, home string) { +// NOTE: Tx unused, left here for future reference +// func (s *IntegrationTestSuite) executeKeysList(c *chain, valIdx int, home string) { // nolint:U1000 // ctx, cancel := context.WithTimeout(context.Background(), time.Minute) // defer cancel() @@ -705,7 +707,6 @@ func (s *IntegrationTestSuite) executeGaiaTxCommand(ctx context.Context, c *chai stdOut := outBuf.Bytes() stdErr := errBuf.Bytes() - if !validation(stdOut, stdErr) { s.Require().FailNowf("Exec validation failed", "stdout: %s, stderr: %s", string(stdOut), string(stdErr)) @@ -787,3 +788,108 @@ func (s *IntegrationTestSuite) defaultExecValidation(chain *chain, valIdx int) f return false } } + +func (s *IntegrationTestSuite) executeValidatorBond(c *chain, valIdx int, valOperAddress, delegatorAddr, home, delegateFees string) { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("Executing gaiad tx staking validator-bond %s", c.id) + + gaiaCommand := []string{ + gaiadBinary, + txCommand, + stakingtypes.ModuleName, + "validator-bond", + valOperAddress, + fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddr), + fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), + fmt.Sprintf("--%s=%s", flags.FlagGasPrices, delegateFees), + "--keyring-backend=test", + fmt.Sprintf("--%s=%s", flags.FlagHome, home), + "--output=json", + "-y", + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) + s.T().Logf("%s successfully executed validator bond tx to %s", delegatorAddr, valOperAddress) +} + +func (s *IntegrationTestSuite) executeTokenizeShares(c *chain, valIdx int, amount, valOperAddress, delegatorAddr, home, delegateFees string) { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("Executing gaiad tx staking tokenize-share %s", c.id) + + gaiaCommand := []string{ + gaiadBinary, + txCommand, + stakingtypes.ModuleName, + "tokenize-share", + valOperAddress, + amount, + delegatorAddr, + fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddr), + fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), + fmt.Sprintf("--%s=%s", flags.FlagGasPrices, delegateFees), + fmt.Sprintf("--%s=%d", flags.FlagGas, 1000000), + "--keyring-backend=test", + fmt.Sprintf("--%s=%s", flags.FlagHome, home), + "--output=json", + "-y", + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) + s.T().Logf("%s successfully executed tokenize share tx from %s", delegatorAddr, valOperAddress) +} + +func (s *IntegrationTestSuite) executeRedeemShares(c *chain, valIdx int, amount, delegatorAddr, home, delegateFees string) { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("Executing gaiad tx staking redeem-tokens %s", c.id) + + gaiaCommand := []string{ + gaiadBinary, + txCommand, + stakingtypes.ModuleName, + "redeem-tokens", + amount, + fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddr), + fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), + fmt.Sprintf("--%s=%s", flags.FlagGasPrices, delegateFees), + fmt.Sprintf("--%s=%d", flags.FlagGas, 1000000), + "--keyring-backend=test", + fmt.Sprintf("--%s=%s", flags.FlagHome, home), + "--output=json", + "-y", + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) + s.T().Logf("%s successfully executed redeem share tx for %s", delegatorAddr, amount) +} + +func (s *IntegrationTestSuite) executeTransferTokenizeShareRecord(c *chain, valIdx int, recordID, owner, newOwner, home, txFees string) { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("Executing gaiad tx staking transfer-tokenize-share-record %s", c.id) + + gaiaCommand := []string{ + gaiadBinary, + txCommand, + stakingtypes.ModuleName, + "transfer-tokenize-share-record", + recordID, + newOwner, + fmt.Sprintf("--%s=%s", flags.FlagFrom, owner), + fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), + fmt.Sprintf("--%s=%s", flags.FlagGasPrices, txFees), + "--keyring-backend=test", + fmt.Sprintf("--%s=%s", flags.FlagHome, home), + "--output=json", + "-y", + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) + s.T().Logf("%s successfully executed transfer tokenize share record for %s", owner, recordID) +} diff --git a/tests/e2e/e2e_globalfee_test.go b/tests/e2e/e2e_globalfee_test.go index bcfffa5b4b..9de4cdea8d 100644 --- a/tests/e2e/e2e_globalfee_test.go +++ b/tests/e2e/e2e_globalfee_test.go @@ -5,6 +5,7 @@ import ( "time" "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/tests/e2e/e2e_ibc_test.go b/tests/e2e/e2e_ibc_test.go index ea90f49ab6..8ac4c31899 100644 --- a/tests/e2e/e2e_ibc_test.go +++ b/tests/e2e/e2e_ibc_test.go @@ -10,9 +10,10 @@ import ( "strings" "time" + "github.com/ory/dockertest/v3/docker" + "github.com/cosmos/cosmos-sdk/client/flags" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/ory/dockertest/v3/docker" ) type ForwardMetadata struct { @@ -29,6 +30,7 @@ type PacketMetadata struct { Forward *ForwardMetadata `json:"forward"` } +//nolint:unparam func (s *IntegrationTestSuite) sendIBC(c *chain, valIdx int, sender, recipient, token, fees, note string) { ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() diff --git a/tests/e2e/e2e_lsm_test.go b/tests/e2e/e2e_lsm_test.go new file mode 100644 index 0000000000..cb30a9427b --- /dev/null +++ b/tests/e2e/e2e_lsm_test.go @@ -0,0 +1,221 @@ +package e2e + +import ( + "fmt" + "strconv" + "strings" + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" + govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +func (s *IntegrationTestSuite) testLSM() { + chainEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) + + validatorA := s.chainA.validators[0] + validatorAAddr, _ := validatorA.keyInfo.GetAddress() + + validatorAddressA := sdk.ValAddress(validatorAAddr).String() + + oldStakingParams, err := queryStakingParams(chainEndpoint) + s.Require().NoError(err) + s.writeLiquidStakingParamsUpdateProposal(s.chainA, oldStakingParams.Params) + proposalCounter++ + submitGovFlags := []string{configFile(proposalLSMParamUpdateFilename)} + depositGovFlags := []string{strconv.Itoa(proposalCounter), depositAmount.String()} + voteGovFlags := []string{strconv.Itoa(proposalCounter), "yes"} + + // gov proposing LSM parameters (global liquid staking cap, validator liquid staking cap, validator bond factor) + s.T().Logf("Proposal number: %d", proposalCounter) + s.T().Logf("Submitting, deposit and vote legacy Gov Proposal: Set parameters (global liquid staking cap, validator liquid staking cap, validator bond factor)") + s.runGovProcessV1(chainEndpoint, validatorAAddr.String(), proposalCounter, "stakingtypes.MsgUpdateProposal", submitGovFlags, depositGovFlags, voteGovFlags, "vote", false) + + // query the proposal status and new fee + s.Require().Eventually( + func() bool { + proposal, err := queryGovProposal(chainEndpoint, proposalCounter) + s.Require().NoError(err) + return proposal.GetProposal().Status == govv1beta1.StatusPassed + }, + 15*time.Second, + 5*time.Second, + ) + + s.Require().Eventually( + func() bool { + stakingParams, err := queryStakingParams(chainEndpoint) + s.T().Logf("After LSM parameters update proposal") + s.Require().NoError(err) + + s.Require().Equal(stakingParams.Params.GlobalLiquidStakingCap, sdk.NewDecWithPrec(25, 2)) + s.Require().Equal(stakingParams.Params.ValidatorLiquidStakingCap, sdk.NewDecWithPrec(50, 2)) + s.Require().Equal(stakingParams.Params.ValidatorBondFactor, sdk.NewDec(250)) + + return true + }, + 15*time.Second, + 5*time.Second, + ) + delegatorAddress, _ := s.chainA.genesisAccounts[2].keyInfo.GetAddress() + + fees := sdk.NewCoin(uatomDenom, sdk.NewInt(1)) + + // Validator bond + s.executeValidatorBond(s.chainA, 0, validatorAddressA, validatorAAddr.String(), gaiaHomePath, fees.String()) + + // Validate validator bond successful + selfBondedShares := sdk.ZeroDec() + s.Require().Eventually( + func() bool { + res, err := queryDelegation(chainEndpoint, validatorAddressA, validatorAAddr.String()) + delegation := res.GetDelegationResponse().GetDelegation() + selfBondedShares = delegation.Shares + isValidatorBond := delegation.ValidatorBond + s.Require().NoError(err) + + return isValidatorBond == true + }, + 20*time.Second, + 5*time.Second, + ) + + delegationAmount := sdk.NewInt(500000000) + delegation := sdk.NewCoin(uatomDenom, delegationAmount) // 500 atom + + // Alice delegate uatom to Validator A + s.execDelegate(s.chainA, 0, delegation.String(), validatorAddressA, delegatorAddress.String(), gaiaHomePath, fees.String()) + + // Validate delegation successful + s.Require().Eventually( + func() bool { + res, err := queryDelegation(chainEndpoint, validatorAddressA, delegatorAddress.String()) + amt := res.GetDelegationResponse().GetDelegation().GetShares() + s.Require().NoError(err) + + return amt.Equal(sdk.NewDecFromInt(delegationAmount)) + }, + 20*time.Second, + 5*time.Second, + ) + + // Tokenize shares + tokenizeAmount := sdk.NewInt(200000000) + tokenize := sdk.NewCoin(uatomDenom, tokenizeAmount) // 200 atom + s.executeTokenizeShares(s.chainA, 0, tokenize.String(), validatorAddressA, delegatorAddress.String(), gaiaHomePath, fees.String()) + + // Validate delegation reduced + s.Require().Eventually( + func() bool { + res, err := queryDelegation(chainEndpoint, validatorAddressA, delegatorAddress.String()) + amt := res.GetDelegationResponse().GetDelegation().GetShares() + s.Require().NoError(err) + + return amt.Equal(sdk.NewDecFromInt(delegationAmount.Sub(tokenizeAmount))) + }, + 20*time.Second, + 5*time.Second, + ) + + // Validate balance increased + recordID := int(1) + shareDenom := fmt.Sprintf("%s/%s", strings.ToLower(validatorAddressA), strconv.Itoa(recordID)) + s.Require().Eventually( + func() bool { + res, err := getSpecificBalance(chainEndpoint, delegatorAddress.String(), shareDenom) + s.Require().NoError(err) + return res.Amount.Equal(tokenizeAmount) + }, + 20*time.Second, + 5*time.Second, + ) + + // Bank send LSM token + sendAmount := sdk.NewCoin(shareDenom, tokenizeAmount) + s.execBankSend(s.chainA, 0, delegatorAddress.String(), validatorAAddr.String(), sendAmount.String(), standardFees.String(), false) + + // Validate tokens are sent properly + s.Require().Eventually( + func() bool { + afterSenderShareDenomBalance, err := getSpecificBalance(chainEndpoint, delegatorAddress.String(), shareDenom) + s.Require().NoError(err) + + afterRecipientShareDenomBalance, err := getSpecificBalance(chainEndpoint, validatorAAddr.String(), shareDenom) + s.Require().NoError(err) + + decremented := afterSenderShareDenomBalance.IsNil() || afterSenderShareDenomBalance.IsZero() + incremented := afterRecipientShareDenomBalance.IsEqual(sendAmount) + + return decremented && incremented + }, + time.Minute, + 5*time.Second, + ) + + // transfer reward ownership + s.executeTransferTokenizeShareRecord(s.chainA, 0, strconv.Itoa(recordID), delegatorAddress.String(), validatorAAddr.String(), gaiaHomePath, standardFees.String()) + tokenizeShareRecord := stakingtypes.TokenizeShareRecord{} + // Validate ownership transferred correctly + s.Require().Eventually( + func() bool { + record, err := queryTokenizeShareRecordByID(chainEndpoint, recordID) + s.Require().NoError(err) + tokenizeShareRecord = record + return record.Owner == validatorAAddr.String() + }, + time.Minute, + 5*time.Second, + ) + _ = tokenizeShareRecord + + // IBC transfer LSM token + ibcTransferAmount := sdk.NewCoin(shareDenom, sdk.NewInt(100000000)) + sendRecipientAddr, _ := s.chainB.validators[0].keyInfo.GetAddress() + s.sendIBC(s.chainA, 0, validatorAAddr.String(), sendRecipientAddr.String(), ibcTransferAmount.String(), standardFees.String(), "memo") + + s.Require().Eventually( + func() bool { + afterSenderShareBalance, err := getSpecificBalance(chainEndpoint, validatorAAddr.String(), shareDenom) + s.Require().NoError(err) + + decremented := afterSenderShareBalance.Add(ibcTransferAmount).IsEqual(sendAmount) + return decremented + }, + 1*time.Minute, + 5*time.Second, + ) + + // Redeem tokens for shares + redeemAmount := sendAmount.Sub(ibcTransferAmount) + s.executeRedeemShares(s.chainA, 0, redeemAmount.String(), validatorAAddr.String(), gaiaHomePath, fees.String()) + + // check redeem success + s.Require().Eventually( + func() bool { + balanceRes, err := getSpecificBalance(chainEndpoint, validatorAAddr.String(), shareDenom) + s.Require().NoError(err) + if !balanceRes.Amount.IsNil() && balanceRes.Amount.IsZero() { + return false + } + + delegationRes, err := queryDelegation(chainEndpoint, validatorAddressA, validatorAAddr.String()) + delegation := delegationRes.GetDelegationResponse().GetDelegation() + s.Require().NoError(err) + + if !delegation.Shares.Equal(selfBondedShares.Add(sdk.NewDecFromInt(redeemAmount.Amount))) { + return false + } + + // check tokenize share record module account balance + balanceRes, err = getSpecificBalance(chainEndpoint, tokenizeShareRecord.GetModuleAddress().String(), uatomDenom) + s.Require().NoError(err) + if balanceRes.Amount.IsNil() || balanceRes.Amount.IsZero() { + return false + } + return true + }, + 20*time.Second, + 5*time.Second, + ) +} diff --git a/tests/e2e/e2e_setup_test.go b/tests/e2e/e2e_setup_test.go index 992526387f..09ac482222 100644 --- a/tests/e2e/e2e_setup_test.go +++ b/tests/e2e/e2e_setup_test.go @@ -75,6 +75,7 @@ const ( proposalBypassMsgFilename = "proposal_bypass_msg.json" proposalMaxTotalBypassFilename = "proposal_max_total_bypass.json" proposalCommunitySpendFilename = "proposal_community_spend.json" + proposalLSMParamUpdateFilename = "proposal_lsm_param_update.json" // proposalAddConsumerChainFilename = "proposal_add_consumer.json" // proposalRemoveConsumerChainFilename = "proposal_remove_consumer.json" @@ -909,6 +910,47 @@ func (s *IntegrationTestSuite) writeGovLegProposal(c *chain, height int64, name s.Require().NoError(err) } +func (s *IntegrationTestSuite) writeLiquidStakingParamsUpdateProposal(c *chain, oldParams stakingtypes.Params) { + template := ` + { + "messages": [ + { + "@type": "/cosmos.staking.v1beta1.MsgUpdateParams", + "authority": "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn", + "params": { + "unbonding_time": "%s", + "max_validators": %d, + "max_entries": %d, + "historical_entries": %d, + "bond_denom": "%s", + "min_commission_rate": "%s", + "validator_bond_factor": "%s", + "global_liquid_staking_cap": "%s", + "validator_liquid_staking_cap": "%s" + } + } + ], + "metadata": "ipfs://CID", + "deposit": "0uatom", + "title": "Update LSM Params", + "summary": "e2e-test updating LSM staking params" + }` + propMsgBody := fmt.Sprintf(template, + oldParams.UnbondingTime, + oldParams.MaxValidators, + oldParams.MaxEntries, + oldParams.HistoricalEntries, + oldParams.BondDenom, + oldParams.MinCommissionRate, + sdk.NewDec(250), // validator bond factor + sdk.NewDecWithPrec(25, 2), // 25 global_liquid_staking_cap + sdk.NewDecWithPrec(50, 2), // 50 validator_liquid_staking_cap + ) + + err := writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalLSMParamUpdateFilename), []byte(propMsgBody)) + s.Require().NoError(err) +} + func configFile(filename string) string { filepath := filepath.Join(gaiaConfigPath, filename) return filepath diff --git a/tests/e2e/e2e_staking_test.go b/tests/e2e/e2e_staking_test.go index 0a616530d2..f9ffe4f438 100644 --- a/tests/e2e/e2e_staking_test.go +++ b/tests/e2e/e2e_staking_test.go @@ -25,6 +25,12 @@ func (s *IntegrationTestSuite) testStaking() { fees := sdk.NewCoin(uatomDenom, sdk.NewInt(1)) + existingDelegation := sdk.ZeroDec() + res, err := queryDelegation(chainEndpoint, validatorAddressA, delegatorAddress.String()) + if err == nil { + existingDelegation = res.GetDelegationResponse().GetDelegation().GetShares() + } + delegationAmount := sdk.NewInt(500000000) delegation := sdk.NewCoin(uatomDenom, delegationAmount) // 500 atom @@ -38,7 +44,7 @@ func (s *IntegrationTestSuite) testStaking() { amt := res.GetDelegationResponse().GetDelegation().GetShares() s.Require().NoError(err) - return amt.Equal(sdk.NewDecFromInt(delegationAmount)) + return amt.Equal(existingDelegation.Add(sdk.NewDecFromInt(delegationAmount))) }, 20*time.Second, 5*time.Second, diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go index 6f5d231b2e..92e0459023 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/e2e/e2e_test.go @@ -15,6 +15,7 @@ var ( runStakingAndDistributionTest = true runVestingTest = true runRestInterfacesTest = true + runLsmTest = true ) func (s *IntegrationTestSuite) TestRestInterfaces() { @@ -119,3 +120,10 @@ func (s *IntegrationTestSuite) TestVesting() { s.testContinuousVestingAccount(chainAAPI) // s.testPeriodicVestingAccount(chainAAPI) TODO: add back when v0.45 adds the missing CLI command. } + +func (s *IntegrationTestSuite) TestLSM() { + if !runLsmTest { + s.T().Skip() + } + s.testLSM() +} diff --git a/tests/e2e/genesis.go b/tests/e2e/genesis.go index 00ea348bdb..7e449009f7 100644 --- a/tests/e2e/genesis.go +++ b/tests/e2e/genesis.go @@ -21,8 +21,8 @@ import ( 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/v11/x/globalfee/types" + + globfeetypes "github.com/cosmos/gaia/v15/x/globalfee/types" ) func getGenDoc(path string) (*tmtypes.GenesisDoc, error) { @@ -160,17 +160,17 @@ func modifyGenesis(path, moniker, amountStr string, addrAll []sdk.AccAddress, gl appState[icatypes.ModuleName] = icaGenesisStateBz // setup global fee in genesis - // globfeeState := globfeetypes.GetGenesisStateFromAppState(cdc, appState) - // minGases, err := sdk.ParseDecCoins(globfees) - // if err != nil { - // return fmt.Errorf("failed to parse fee coins: %w", err) - // } - // globfeeState.Params.MinimumGasPrices = minGases - // globFeeStateBz, err := cdc.MarshalJSON(globfeeState) - // if err != nil { - // return fmt.Errorf("failed to marshal global fee genesis state: %w", err) - // } - // appState[globfeetypes.ModuleName] = globFeeStateBz + globfeeState := globfeetypes.GetGenesisStateFromAppState(cdc, appState) + minGases, err := sdk.ParseDecCoins(globfees) + if err != nil { + return fmt.Errorf("failed to parse fee coins: %w", err) + } + globfeeState.Params.MinimumGasPrices = minGases + globFeeStateBz, err := cdc.MarshalJSON(globfeeState) + if err != nil { + return fmt.Errorf("failed to marshal global fee genesis state: %w", err) + } + appState[globfeetypes.ModuleName] = globFeeStateBz stakingGenState := stakingtypes.GetGenesisStateFromAppState(cdc, appState) stakingGenState.Params.BondDenom = denom diff --git a/tests/e2e/query.go b/tests/e2e/query.go index 44d12bb303..b1f03ae968 100644 --- a/tests/e2e/query.go +++ b/tests/e2e/query.go @@ -14,7 +14,7 @@ import ( disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types" govtypesv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "github.com/cosmos/gaia/v11/x/globalfee/types" + "github.com/cosmos/gaia/v15/x/globalfee/types" evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" @@ -75,6 +75,20 @@ func queryGaiaAllBalances(endpoint, addr string) (sdk.Coins, error) { return balancesResp.Balances, nil } +func queryStakingParams(endpoint string) (stakingtypes.QueryParamsResponse, error) { + body, err := httpGet(fmt.Sprintf("%s/cosmos/staking/v1beta1/params", endpoint)) + if err != nil { + return stakingtypes.QueryParamsResponse{}, fmt.Errorf("failed to execute HTTP request: %w", err) + } + + var params stakingtypes.QueryParamsResponse + if err := cdc.UnmarshalJSON(body, ¶ms); err != nil { + return stakingtypes.QueryParamsResponse{}, err + } + + return params, nil +} + func queryGlobalFeeParams(endpoint string) (types.QueryParamsResponse, error) { body, err := httpGet(fmt.Sprintf("%s/gaia/globalfee/v1beta1/params", endpoint)) if err != nil { @@ -301,3 +315,17 @@ func queryAllEvidence(endpoint string) (evidencetypes.QueryAllEvidenceResponse, } return res, nil } + +func queryTokenizeShareRecordByID(endpoint string, recordID int) (stakingtypes.TokenizeShareRecord, error) { + var res stakingtypes.QueryTokenizeShareRecordByIdResponse + + body, err := httpGet(fmt.Sprintf("%s/cosmos/staking/v1beta1/tokenize_share_record_by_id/%d", endpoint, recordID)) + if err != nil { + return stakingtypes.TokenizeShareRecord{}, fmt.Errorf("failed to execute HTTP request: %w", err) + } + + if err := cdc.UnmarshalJSON(body, &res); err != nil { + return stakingtypes.TokenizeShareRecord{}, err + } + return res.Record, nil +} diff --git a/tests/e2e/validator.go b/tests/e2e/validator.go index ac804aa5dc..5969050983 100644 --- a/tests/e2e/validator.go +++ b/tests/e2e/validator.go @@ -27,7 +27,7 @@ import ( authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - gaia "github.com/cosmos/gaia/v11/app" + gaia "github.com/cosmos/gaia/v15/app" ) // diff --git a/tests/ics/interchain_security_test.go b/tests/ics/interchain_security_test.go index a2235a2b1c..e063a290a9 100644 --- a/tests/ics/interchain_security_test.go +++ b/tests/ics/interchain_security_test.go @@ -13,7 +13,7 @@ import ( "github.com/cometbft/cometbft/libs/log" ibctesting "github.com/cosmos/ibc-go/v7/testing" - gaiaApp "github.com/cosmos/gaia/v11/app" + gaiaApp "github.com/cosmos/gaia/v15/app" ) func TestCCVTestSuite(t *testing.T) { diff --git a/x/globalfee/alias.go b/x/globalfee/alias.go index 594fce105e..505e9da1c1 100644 --- a/x/globalfee/alias.go +++ b/x/globalfee/alias.go @@ -1,7 +1,7 @@ package globalfee import ( - "github.com/cosmos/gaia/v11/x/globalfee/types" + "github.com/cosmos/gaia/v15/x/globalfee/types" ) const ( diff --git a/x/globalfee/ante/antetest/fee_test.go b/x/globalfee/ante/antetest/fee_test.go index a94c4fc0f4..dee698f5b5 100644 --- a/x/globalfee/ante/antetest/fee_test.go +++ b/x/globalfee/ante/antetest/fee_test.go @@ -3,16 +3,17 @@ package antetest import ( "testing" + "github.com/stretchr/testify/suite" + 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" - "github.com/stretchr/testify/suite" - gaiafeeante "github.com/cosmos/gaia/v11/x/globalfee/ante" - globfeetypes "github.com/cosmos/gaia/v11/x/globalfee/types" + gaiafeeante "github.com/cosmos/gaia/v15/x/globalfee/ante" + globfeetypes "github.com/cosmos/gaia/v15/x/globalfee/types" ) var testGasLimit uint64 = 200_000 diff --git a/x/globalfee/ante/antetest/fee_test_setup.go b/x/globalfee/ante/antetest/fee_test_setup.go index 0cc4450796..63513162c2 100644 --- a/x/globalfee/ante/antetest/fee_test_setup.go +++ b/x/globalfee/ante/antetest/fee_test_setup.go @@ -14,13 +14,13 @@ import ( xauthsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" "github.com/stretchr/testify/suite" - gaiahelpers "github.com/cosmos/gaia/v11/app/helpers" - gaiaparams "github.com/cosmos/gaia/v11/app/params" - gaiafeeante "github.com/cosmos/gaia/v11/x/globalfee/ante" + 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/v11/app" - "github.com/cosmos/gaia/v11/x/globalfee" - globfeetypes "github.com/cosmos/gaia/v11/x/globalfee/types" + gaiaapp "github.com/cosmos/gaia/v15/app" + "github.com/cosmos/gaia/v15/x/globalfee" + globfeetypes "github.com/cosmos/gaia/v15/x/globalfee/types" ) type IntegrationTestSuite struct { diff --git a/x/globalfee/ante/fee.go b/x/globalfee/ante/fee.go index af09e2a2d8..aed5203d4c 100644 --- a/x/globalfee/ante/fee.go +++ b/x/globalfee/ante/fee.go @@ -11,10 +11,9 @@ import ( stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - gaiaerrors "github.com/cosmos/gaia/v11/types/errors" - - "github.com/cosmos/gaia/v11/x/globalfee" - "github.com/cosmos/gaia/v11/x/globalfee/types" + gaiaerrors "github.com/cosmos/gaia/v15/types/errors" + "github.com/cosmos/gaia/v15/x/globalfee" + "github.com/cosmos/gaia/v15/x/globalfee/types" ) // FeeWithBypassDecorator checks if the transaction's fee is at least as large diff --git a/x/globalfee/ante/fee_utils.go b/x/globalfee/ante/fee_utils.go index fa132e1d8b..c25151973d 100644 --- a/x/globalfee/ante/fee_utils.go +++ b/x/globalfee/ante/fee_utils.go @@ -2,9 +2,10 @@ package ante import ( errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" - gaiaerrors "github.com/cosmos/gaia/v11/types/errors" + gaiaerrors "github.com/cosmos/gaia/v15/types/errors" ) // ContainZeroCoins returns true if the given coins are empty or contain zero coins, diff --git a/x/globalfee/ante/fee_utils_test.go b/x/globalfee/ante/fee_utils_test.go index 8378e46713..7bf9e91415 100644 --- a/x/globalfee/ante/fee_utils_test.go +++ b/x/globalfee/ante/fee_utils_test.go @@ -3,8 +3,9 @@ package ante import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestContainZeroCoins(t *testing.T) { diff --git a/x/globalfee/client/cli/query.go b/x/globalfee/client/cli/query.go index b3b2056fc3..099eaed32c 100644 --- a/x/globalfee/client/cli/query.go +++ b/x/globalfee/client/cli/query.go @@ -1,11 +1,12 @@ package cli import ( + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" - "github.com/cosmos/gaia/v11/x/globalfee/types" + "github.com/cosmos/gaia/v15/x/globalfee/types" ) func GetQueryCmd() *cobra.Command { diff --git a/x/globalfee/genesis_test.go b/x/globalfee/genesis_test.go index 073e355ae2..f9f3be2e85 100644 --- a/x/globalfee/genesis_test.go +++ b/x/globalfee/genesis_test.go @@ -14,8 +14,8 @@ import ( "github.com/cosmos/cosmos-sdk/store" sdk "github.com/cosmos/cosmos-sdk/types" - gaiaparams "github.com/cosmos/gaia/v11/app/params" - "github.com/cosmos/gaia/v11/x/globalfee/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" diff --git a/x/globalfee/keeper/migrations.go b/x/globalfee/keeper/migrations.go index 64f08edd3b..25673874fa 100644 --- a/x/globalfee/keeper/migrations.go +++ b/x/globalfee/keeper/migrations.go @@ -4,7 +4,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - v2 "github.com/cosmos/gaia/v11/x/globalfee/migrations/v2" + v2 "github.com/cosmos/gaia/v15/x/globalfee/migrations/v2" ) // Migrator is a struct for handling in-place store migrations. diff --git a/x/globalfee/migrations/v2/migration.go b/x/globalfee/migrations/v2/migration.go index 176ff59d6f..99fd8ec524 100644 --- a/x/globalfee/migrations/v2/migration.go +++ b/x/globalfee/migrations/v2/migration.go @@ -4,7 +4,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/cosmos/gaia/v11/x/globalfee/types" + "github.com/cosmos/gaia/v15/x/globalfee/types" ) // MigrateStore performs in-place params migrations of diff --git a/x/globalfee/migrations/v2/v2_test/migration_test.go b/x/globalfee/migrations/v2/v2_test/migration_test.go index 7b6e5a2425..cd56078fe1 100644 --- a/x/globalfee/migrations/v2/v2_test/migration_test.go +++ b/x/globalfee/migrations/v2/v2_test/migration_test.go @@ -14,8 +14,8 @@ import ( paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/stretchr/testify/require" - v2 "github.com/cosmos/gaia/v11/x/globalfee/migrations/v2" - globalfeetypes "github.com/cosmos/gaia/v11/x/globalfee/types" + v2 "github.com/cosmos/gaia/v15/x/globalfee/migrations/v2" + globalfeetypes "github.com/cosmos/gaia/v15/x/globalfee/types" ) func TestMigrateStore(t *testing.T) { diff --git a/x/globalfee/module.go b/x/globalfee/module.go index d6add4249f..917ba8e749 100644 --- a/x/globalfee/module.go +++ b/x/globalfee/module.go @@ -5,6 +5,10 @@ import ( "encoding/json" "fmt" + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + errorsmod "cosmossdk.io/errors" abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" @@ -13,13 +17,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/gorilla/mux" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - "github.com/cosmos/gaia/v11/x/globalfee/client/cli" - "github.com/cosmos/gaia/v11/x/globalfee/keeper" - "github.com/cosmos/gaia/v11/x/globalfee/types" + "github.com/cosmos/gaia/v15/x/globalfee/client/cli" + "github.com/cosmos/gaia/v15/x/globalfee/keeper" + "github.com/cosmos/gaia/v15/x/globalfee/types" ) var ( diff --git a/x/globalfee/querier.go b/x/globalfee/querier.go index 4ddd5ac28f..b905faa0ad 100644 --- a/x/globalfee/querier.go +++ b/x/globalfee/querier.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/gaia/v11/x/globalfee/types" + "github.com/cosmos/gaia/v15/x/globalfee/types" ) var _ types.QueryServer = &GrpcQuerier{} diff --git a/x/globalfee/types/genesis.go b/x/globalfee/types/genesis.go index 253df889c6..b0e94687fb 100644 --- a/x/globalfee/types/genesis.go +++ b/x/globalfee/types/genesis.go @@ -4,6 +4,7 @@ import ( "encoding/json" errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/codec" ) diff --git a/x/globalfee/types/params.go b/x/globalfee/types/params.go index dc21409304..0a7cab846e 100644 --- a/x/globalfee/types/params.go +++ b/x/globalfee/types/params.go @@ -10,7 +10,7 @@ import ( 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/v11/types/errors" + gaiaerrors "github.com/cosmos/gaia/v15/types/errors" ) var ( diff --git a/x/globalfee/types/params_test.go b/x/globalfee/types/params_test.go index b2c2931674..78d17ba80a 100644 --- a/x/globalfee/types/params_test.go +++ b/x/globalfee/types/params_test.go @@ -3,8 +3,9 @@ package types import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestDefaultParams(t *testing.T) { From 925bfee3998b95b27040ede3af3847dbb2d3418d Mon Sep 17 00:00:00 2001 From: MSalopek Date: Tue, 12 Dec 2023 15:30:26 +0100 Subject: [PATCH 11/43] chore: merge main into feat/sdk-47-ibc-7; update broken tests (#2853) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Removed outdated ICS docs (#2634) * feat: add query local min-gas-price (#2627) * feat: add query local min-gas-price * docs: add changelog * test: add test for query local min-gas-prices * test: add test for local min-gas-price query * fix: test query min-gas-price * bring v10.0.2 changelog to main (#2648) * add missing changelog for PFM bump * fix typo in PFM changelog * Merge pull request from GHSA-354m-4qv6-x846 * refactor: use gci linter to sort imports (#2608) * use the gci linter to sort imports * enable custom ordering in gci * chore: remove depguard and bump golangci-lint (#2596) * remove depguard from gaia, bump golangci-lint * use the actual latest version of golangci-lint * update state sync script to use sg1 cached endpoint * use 1.53.3 * revert changes to statesync script * fix: use the latest release of hermes for e2e (#2644) * use the latest release of hermes for e2e * make hermes.Dockerfile work in multiplatform environments. * deps!: bump liquidity to v1.6.0-forced-withdrawal (#2652) * bump liquidity to v1.6.0-forced-withdrawal * add entries to .changelog * fix filenames to contain PR number * add changelog entry for gov bug fix (#2653) * upgrade release testnet to v11 (#2665) * docs: refactor gaia ADRs (#2628) * refactor gaia ADRs * apply review suggestions * add mermaid graph * add ADR-001 back as rejected * fix typo * mergify and dependabot for v11 (#2654) * fix: fix tag sorting in goreleaser (#2666) * chore: update Cosmos Hub Upgrade Epic (#2661) * update upgrade checklist * Update .github/ISSUE_TEMPLATE/upgrade-checklist.md Co-authored-by: Dante Sanchez --------- Co-authored-by: Dante Sanchez * fix: add "v" prefix to release binary version (#2671) * feat: update module name to v12 (#2672) * bump to v12 * feat: add upgrade handler for v12 * feat: add upgrade test for v12 (#2678) * test: fix upgrade test (#2680) * fix: upgrade test * chore: write to log file * fix: update upgrade handler to v12 (#2681) * docs: global fee adr (#2603) * docs: add adr template * tmp * docs: add globalfee ADR * docs: update globalfee adr * docs: minor change of globalfee adr * Apply suggestions from code review Co-authored-by: Simon Noetzlin * Apply suggestions from code review Co-authored-by: Simon Noetzlin * docs: update according to comment * docs: formatting * docs: add fee check details * renaming as ADR 002 * Apply suggestions from code review Co-authored-by: Marius Poke * chore: cosmos-sdk -> Cosmos SDK * chore: typo correction * docs: restructure * docs: add BypassMinFeeMsgTypes intro * docs: clean * docs * docs update * docs formatting * docs: add defination of CombinedFeeRequirement * feat: update chart * Update docs/architecture/adr-002-globalfee.md Co-authored-by: Simon Noetzlin * Update docs/architecture/adr-002-globalfee.md Co-authored-by: Simon Noetzlin --------- Co-authored-by: Simon Noetzlin Co-authored-by: mpoke * Fix pointer to store upgrades inside loop (#2675) Co-authored-by: MSalopek * docs: bring v11.0.0 changelog to main (#2676) * bring v11.0.0 changelog to main * rename 10.0.2 to v10.0.2 * remove duplicates from unreleased * unclog build * chore(deps): bump JamesIves/github-pages-deploy-action from 4.4.2 to 4.4.3 (#2651) Bumps [JamesIves/github-pages-deploy-action](https://github.com/jamesives/github-pages-deploy-action) from 4.4.2 to 4.4.3.
Release notes

Sourced from JamesIves/github-pages-deploy-action's releases.

v4.4.3

What's Changed

Full Changelog: https://github.com/JamesIves/github-pages-deploy-action/compare/v4...v4.4.3

Commits
  • a1ea191 Deploy Production Code for Commit a8bd9aef1855024c235ad911985c97e153ddc9c4 🚀
  • a8bd9ae Merge branch 'dev' into releases/v4
  • 7e13873 Bump @​types/node from 20.3.3 to 20.4.1 (#1395)
  • da98691 Bump tough-cookie from 4.0.0 to 4.1.3 (#1394)
  • 4a6bcf1 Bump semver from 5.7.1 to 5.7.2 (#1396)
  • 426d422 Bump @​types/node from 20.3.2 to 20.3.3 (#1389)
  • 6c78091 Bump @​types/node from 20.3.1 to 20.3.2 (#1387)
  • dbbf76c Deploying to dev from @ JamesIves/github-pages-deploy-action@ce9d786e639c4709...
  • ce9d786 Bump eslint-plugin-jest from 27.2.1 to 27.2.2 (#1386)
  • e33c1e2 Bump @​types/node from 20.2.5 to 20.3.1 (#1385)
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=JamesIves/github-pages-deploy-action&package-manager=github_actions&previous-version=4.4.2&new-version=4.4.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* deps!: bump PFM to v4.1.0 (#2677) * bump PFM to 4.0.6 * add entries to .changelog * bump PFM to 4.0.6 * add entries to .changelog * bump PFM to 4.1.0 * make lint-fix * chore(deps): bump cosmossdk.io/errors from 1.0.0-beta.7 to 1.0.0 (#2650) Bumps [cosmossdk.io/errors](https://github.com/cosmos/cosmos-sdk) from 1.0.0-beta.7 to 1.0.0. - [Release notes](https://github.com/cosmos/cosmos-sdk/releases) - [Changelog](https://github.com/cosmos/cosmos-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/cosmos/cosmos-sdk/compare/errors/v1.0.0-beta.7...log/v1.0.0) --- updated-dependencies: - dependency-name: cosmossdk.io/errors dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * update swagger (#2590) Co-authored-by: Milan Mulji <98309852+mmulji-ic@users.noreply.github.com> * Fix: sim genesis account validation (#2690) * fix: app: make SimGenesisAccount.Validate error if .BaseAccount is nil This change ensures that an error is returned, instead of panicking, when SimGenesisAccount.BaseAccount is nil, after invoking .Validate. Found by fuzzing and added the tests in here to catch future regressions. Fixes #2586 * merge fix FuzzGenesisAccountValidate test * fix: lint --------- Co-authored-by: Emmanuel T Odeke Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * docs: release testnet upgraded to v11 (#2668) * testnet upgraded to v11 * replace v11.0.0-rc0 with v11.0.0 * docs: Updating the quickstart, joining mainnet & upgrade docs for v11 (#2670) * add upgrade instructions for v11 * update docs for v11 * update proposal number and link * Updated cosmovisor version and a typo --------- Co-authored-by: Milan Mulji <98309852+mmulji-ic@users.noreply.github.com> * deps!: use cosmos-sdk v0.45.16-lsm-ics (#2643) * deps: use cosmos-sdk v0.45.16-lsm-ics * deps&rebase: use cosmos-sdk v0.45.16-lsm-ics * add local testing script * fix: update test_helpers; use latest lsm/ics versions * chore: bump iqlusion:cosmos-sdk to latest * Jstr/lsm e2e tests (#2679) * lsm e2e test work - wip * Add validator bond functionality on lsm happy path * add tokenize share check on lsm test & redeemShare utility function * add bank send lsm tokens test * Add test for transfer reward ownership, and redeem shares * Add staking param query utility & LSM params update process on LSM e2e test * Add IBC transfer test on LSM share tokens & Resolve e2e tests by updating gas configs and result checker * resolve github action bot comments * bring all e2e test items back to enabled * Update tests/e2e/e2e_lsm_test.go Co-authored-by: sampocs * resolve comments * reenable tokenize share record module account balance check --------- Co-authored-by: jstr1121 Co-authored-by: jstr1121 <118450565+jstr1121@users.noreply.github.com> Co-authored-by: sampocs * Add lsm params to upgrade handler (#2686) * set LSM params in upgrade handler * added comments around constants * test: add migrateUBDEntries to upgrade handler — required adding exported.go to sdk * Revert "test: add migrateUBDEntries to upgrade handler — required adding exported.go to sdk" This reverts commit 7bd9727ce734e829ef54538485c3bbf327009345. --------- Co-authored-by: Riley Edmunds * chore: bump cosmos-sdk and ics to latest * Fix staking & distribution e2e test with LSM (#2687) * lsm e2e test work - wip * Add validator bond functionality on lsm happy path * add tokenize share check on lsm test & redeemShare utility function * add bank send lsm tokens test * Add test for transfer reward ownership, and redeem shares * Add staking param query utility & LSM params update process on LSM e2e test * Add IBC transfer test on LSM share tokens & Resolve e2e tests by updating gas configs and result checker * resolve github action bot comments * bring all e2e test items back to enabled * Update tests/e2e/e2e_lsm_test.go Co-authored-by: sampocs * resolve comments * reenable tokenize share record module account balance check * fix staking test affected by other test --------- Co-authored-by: jstr1121 Co-authored-by: jstr1121 <118450565+jstr1121@users.noreply.github.com> * chore: appease lint rules * docs: Add LSM docs (#2683) * docs: validator FAQ updated with LSM docs * docs: validator faq - remove min self delegation references * docs: delegator faq - add lsm docs * docs: address Marius review comments on docs * bump SDK to 0.45.16-ics-lsm-rc0 and ICS to 2.0.0-lsm-rc0 * add .changelog entries * use sdk.Dec * Update constants.go --------- Co-authored-by: riley-stride <104941670+riley-stride@users.noreply.github.com> Co-authored-by: jstr1121 Co-authored-by: jstr1121 <118450565+jstr1121@users.noreply.github.com> Co-authored-by: sampocs Co-authored-by: Riley Edmunds Co-authored-by: Marius Poke Co-authored-by: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> * deps: bump SDK to v0.45.16-ics-lsm and ICS to v2.0.0-lsm (#2695) * bump SDK to v0.45.16-ics-lsm and ICS to v2.0.0-lsm * fix link in .changelog entry * chore(deps): bump cosmossdk.io/math from 1.0.1 to 1.1.0 (#2698) Bumps [cosmossdk.io/math](https://github.com/cosmos/cosmos-sdk) from 1.0.1 to 1.1.0.
Release notes

Sourced from cosmossdk.io/math's releases.

Cosmovisor v1.1.0

Release Notes

New execution model

With this release we are shifting to a new CLI design:

  • in the past, Cosmovisor was designed to act as a wrapper for a Cosmos App. An admin could link it and use it instead of the Cosmos App. When running it will pass all options and configuration parameters to the app. Hence the only way to configure the Cosmovisor was through environment variables.
  • now, we are moving to a more traditional model, where Cosmovisor has it's own command set and is a true supervisor.

New commands have been added:

  • run will start the Cosmos App and pass remaining arguments to the app (similar to npm run)
  • help will display Cosmovisor help
  • version will display both Cosmovisor and the associated app version.

The existing way of starting an app with Cosmovisor has been deprecated (cosmovisor [app params]) and will be removed in the future version. Please use cosmovisor run [app pararms] instead.

New Features

We added a new configuration option: DAEMON_BACKUP_DIR (as env variable). When set, Cosmovisor will create backup the app data backup in that directory (instead of using the app home directory) before running the update. See the README file for more details.

Bug Fixes

  • Fixed cosmovisor version output when installed using 'go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@v1.0.0'.

Changelog

For more details, please see the CHANGELOG.

Commits
  • be5e3aa feat(log): extend logger options (#15956)
  • 851e9e8 docs: update roadmap for q2 (#15952)
  • 91278f6 refactor(x/authz)!: Use KVStoreService, context.Context and return errors ins...
  • 26faee9 refactor: bcrypt key derivation to aead (#509) (#15817)
  • 428e19f refactor(x/distribution)!: Use KVStoreService, context.Context and return err...
  • a6ea094 ci: skip fix registration for linting (#15965)
  • 00b78fa refactor(x/auth): v2 adaptable tx instead of double decode (#15910)
  • 1179285 feat(hubl): cache bech32 prefix (#15954)
  • 6a8251a build(deps): bump cometbft to v0.37.1 (#15955)
  • 6dfe735 refactor!: use KVStoreService and context.Context in x/bank (#15891)
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cosmossdk.io/math&package-manager=go_modules&previous-version=1.0.1&new-version=1.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* chore: mergify and dependabot for v12 (#2701) * update mergify * update dependabot * chore(deps): Bump cosmossdk.io/math from 1.1.0 to 1.1.2 (#2705) Bumps [cosmossdk.io/math](https://github.com/cosmos/cosmos-sdk) from 1.1.0 to 1.1.2.
Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cosmossdk.io/math&package-manager=go_modules&previous-version=1.1.0&new-version=1.1.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* Test: automate upgrade test in ci (#2692) * feat: automate upgrade test * test: update upgrade workflow * test: update upgrade workflow again * test: update update upgrade scripts * test: update binary copying * test: update upgrade dir * test: update upgrade dir path * fix: binary copying * fix: update dir path * debug * fix: upgrade version number * fix: version comparision * fix: version comparision in run_upgrade_commands.sh * fix: use pre-release tag first, then use latest release tag for old binary version * fix: continue-on-error * checkout current pr branch * remove checkout - * release checkout * typo * move gaiad binary to GITHUB_WORKSPACE * debug * debug: update checkout verison * fix test.yml * debug: binary share between steps * debug: checkout present pr branch before run scripts * query proposals * fix cosmovisor dir * fix the upgrade version * formatting * formatting * formatting * debug yml format * typo correction * make old gaiad version hardcoded * chore: add comments * fix typos in release notes template (#2708) * chore: update to v13 (#2707) * update to v13 * update upgrade script * update test upgrade script * update sed command * update app.go * update upgradeFrom version * ci: update goreleaser tag sort options (#2710) * ci: update goreleaser tag sort options * ci: add prerelease suffix * ci: add force tag fetch just in case * ci: use refname with suffix instead of creatordate * ci: use refname with suffix instead of creatordate * docs: schedule testnet upgrade to v12 (#2704) * v12 upgrade height, cosmovisor 1.5.0 * testnet upgraded to v12 * fix: Removal of liquidity module (#2716) * Remove liquidity module * Fix issue found by linter * Update docs * Correction to coding guidlines * docs: Updated docs for v12 release (#2718) * updated docs for v12 release * Review comments regarding installation instructions of cosmovisor * bring v12 changelog from release branch (#2715) * chore(deps): Bump actions/checkout from 3 to 4 (#2721) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
Release notes

Sourced from actions/checkout's releases.

v4.0.0

What's Changed

New Contributors

Full Changelog: https://github.com/actions/checkout/compare/v3...v4.0.0

v3.6.0

What's Changed

New Contributors

Full Changelog: https://github.com/actions/checkout/compare/v3.5.3...v3.6.0

v3.5.3

What's Changed

New Contributors

Full Changelog: https://github.com/actions/checkout/compare/v3...v3.5.3

v3.5.2

What's Changed

Full Changelog: https://github.com/actions/checkout/compare/v3.5.1...v3.5.2

v3.5.1

What's Changed

New Contributors

... (truncated)

Changelog

Sourced from actions/checkout's changelog.

Changelog

v4.0.0

v3.6.0

v3.5.3

v3.5.2

v3.5.1

v3.5.0

v3.4.0

v3.3.0

v3.2.0

v3.1.0

v3.0.2

v3.0.1

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/checkout&package-manager=github_actions&previous-version=3&new-version=4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* chore(deps): Bump actions/cache from 3.3.1 to 3.3.2 (#2719) Bumps [actions/cache](https://github.com/actions/cache) from 3.3.1 to 3.3.2.
Release notes

Sourced from actions/cache's releases.

v3.3.2

What's Changed

New Contributors

Full Changelog: https://github.com/actions/cache/compare/v3...v3.3.2

Changelog

Sourced from actions/cache's changelog.

3.3.1

  • Reduced segment size to 128MB and segment timeout to 10 minutes to fail fast in case the cache download is stuck.

3.3.2

  • Fixes bug with Azure SDK causing blob downloads to get stuck.
Commits
  • 704facf Merge pull request #1236 from actions/bethanyj28/bump-version
  • 17e2888 Add to RELEASES.md
  • 667d8fd bump action version to 3.3.2
  • f7ebb81 Consume latest toolkit and fix dangling promise bug (#1217)
  • 67b839e Merge pull request #1187 from jorendorff/jorendorff/rm-add-to-project
  • 57f0e3f Remove actions to add new PRs and issues to a project board
  • 04f198b Merge pull request #1132 from vorburger/bazel-example
  • bd9b49b Merge branch 'main' into bazel-example
  • ea05037 Merge pull request #1122 from actions/pdotl-patch-1
  • 6a1a45d Merge branch 'main' into pdotl-patch-1
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/cache&package-manager=github_actions&previous-version=3.3.1&new-version=3.3.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* chore(deps): Bump docker/build-push-action from 4.1.1 to 4.2.1 (#2720) Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4.1.1 to 4.2.1.
Release notes

Sourced from docker/build-push-action's releases.

v4.2.1

Note

Buildx v0.10 enables support for a minimal SLSA Provenance attestation, which requires support for OCI-compliant multi-platform images. This may introduce issues with registry and runtime support (e.g. Google Cloud Run and AWS Lambda). You can optionally disable the default provenance attestation functionality using provenance: false.

Full Changelog: https://github.com/docker/build-push-action/compare/v4.2.0...v4.2.1

v4.2.0

Note

Buildx v0.10 enables support for a minimal SLSA Provenance attestation, which requires support for OCI-compliant multi-platform images. This may introduce issues with registry and runtime support (e.g. Google Cloud Run and AWS Lambda). You can optionally disable the default provenance attestation functionality using provenance: false.

Full Changelog: https://github.com/docker/build-push-action/compare/v4.1.1...v4.2.0

Commits
  • 0a97817 Merge pull request #957 from crazy-max/warn-docker-config
  • ec39ef3 chore: update generated content
  • f46044b warn if docker config can't be parsed
  • 4e4ee68 Merge pull request #951 from crazy-max/ci-concurrency
  • e86cf55 ci: missing concurrency checks
  • daa0106 Merge pull request #949 from docker/dependabot/github_actions/actions/checkout-4
  • ce51e90 chore(deps): Bump actions/checkout from 3 to 4
  • 1fde163 Merge pull request #950 from crazy-max/fix-ci
  • ae311c5 ci: fix workflow
  • 9311bf5 Merge pull request #932 from crazy-max/form-templates
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=docker/build-push-action&package-manager=github_actions&previous-version=4.1.1&new-version=4.2.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* docs: fix .md links (#2722) * fix md links * remove proto docs and Makefile target * fix md links * fix ledger-live link (#2724) * fix md links (#2725) * bump ICS to v2.1.0-provider-lsm-rc0 (#2727) * bump ICS to v2.1.0-provider-lsm-rc1 (#2728) * add prop handler to app (#2731) * deps!: bump ICS to v2.1.0-provider-lsm (#2732) * bump ICS to v2.1.0-provider-lsm * add changelog entries * chore(deps): Bump docker/build-push-action from 4.2.1 to 5.0.0 (#2736) Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4.2.1 to 5.0.0.
Release notes

Sourced from docker/build-push-action's releases.

v5.0.0

Full Changelog: https://github.com/docker/build-push-action/compare/v4.2.1...v5.0.0

Commits
  • 0565240 Merge pull request #959 from docker/dependabot/npm_and_yarn/actions/core-1.10.1
  • 3ab07f8 chore: update generated content
  • b9e7e4d chore(deps): Bump @​actions/core from 1.10.0 to 1.10.1
  • 04d1a3b Merge pull request #954 from crazy-max/update-node20
  • 1a4d1a1 chore: node 20 as default runtime
  • 675965c chore: update generated content
  • 58ee34c chore: fix author in package.json
  • c97c406 fix ProxyConfig type when checking length
  • 47d5369 vendor: bump @​docker/actions-toolkit from 0.8.0 to 0.12.0
  • 8895c74 chore: update dev dependencies
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=docker/build-push-action&package-manager=github_actions&previous-version=4.2.1&new-version=5.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* chore(deps): Bump docker/login-action from 2.2.0 to 3.0.0 (#2738) Bumps [docker/login-action](https://github.com/docker/login-action) from 2.2.0 to 3.0.0.
Release notes

Sourced from docker/login-action's releases.

v3.0.0

Full Changelog: https://github.com/docker/login-action/compare/v2.2.0...v3.0.0

Commits
  • 343f7c4 Merge pull request #599 from docker/dependabot/npm_and_yarn/aws-sdk-dependenc...
  • aad0f97 chore: update generated content
  • 2e0cd39 build(deps): bump the aws-sdk-dependencies group with 2 updates
  • 203bc9c Merge pull request #588 from docker/dependabot/npm_and_yarn/proxy-agent-depen...
  • 2199648 chore: update generated content
  • b489376 build(deps): bump the proxy-agent-dependencies group with 1 update
  • 7c309e7 Merge pull request #598 from docker/dependabot/npm_and_yarn/actions/core-1.10.1
  • 0ccf222 chore: update generated content
  • 56d703e Merge pull request #597 from docker/dependabot/github_actions/aws-actions/con...
  • 24d3b35 build(deps): bump @​actions/core from 1.10.0 to 1.10.1
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=docker/login-action&package-manager=github_actions&previous-version=2.2.0&new-version=3.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* chore(deps): Bump docker/metadata-action from 4.6.0 to 5.0.0 (#2737) Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 4.6.0 to 5.0.0.
Release notes

Sourced from docker/metadata-action's releases.

v5.0.0

Full Changelog: https://github.com/docker/metadata-action/compare/v4.6.0...v5.0.0

Upgrade guide

Sourced from docker/metadata-action's upgrade guide.

Upgrade notes

v2 to v3

  • Repository has been moved to docker org. Replace crazy-max/ghaction-docker-meta@v2 with docker/metadata-action@v5
  • The default bake target has been changed: ghaction-docker-meta > docker-metadata-action

v1 to v2

inputs

New Unchanged Removed
tags images tag-sha
flavor sep-tags tag-edge
labels sep-labels tag-edge-branch
tag-semver
tag-match
tag-match-group
tag-latest
tag-schedule
tag-custom
tag-custom-only
label-custom

tag-sha

tags: |
  type=sha

tag-edge / tag-edge-branch

tags: |
  # default branch
</tr></table>

... (truncated)

Commits
  • 96383f4 Merge pull request #320 from docker/dependabot/npm_and_yarn/csv-parse-5.5.0
  • f138b96 chore: update generated content
  • 9cf7015 Bump csv-parse from 5.4.0 to 5.5.0
  • 5a8a5ff Merge pull request #315 from docker/dependabot/npm_and_yarn/handlebars-4.7.8
  • 2279d9a chore: update generated content
  • c659933 Bump handlebars from 4.7.7 to 4.7.8
  • 48d23cc Merge pull request #333 from docker/dependabot/npm_and_yarn/actions/core-1.10.1
  • b83ffb4 chore: update generated content
  • 3207f24 Bump @​actions/core from 1.10.0 to 1.10.1
  • 63f4a26 Merge pull request #328 from crazy-max/update-node20
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=docker/metadata-action&package-manager=github_actions&previous-version=4.6.0&new-version=5.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* chore(deps): Bump goreleaser/goreleaser-action from 4 to 5 (#2739) Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 4 to 5.
Release notes

Sourced from goreleaser/goreleaser-action's releases.

v5.0.0

What's Changed

Full Changelog: https://github.com/goreleaser/goreleaser-action/compare/v4.6.0...v5.0.0

v4.6.0

Reverts the change to node20 runtime.

Full Changelog: https://github.com/goreleaser/goreleaser-action/compare/v4.5.0...v4.6.0

v4.5.0

What's Changed

New Contributors

Full Changelog: https://github.com/goreleaser/goreleaser-action/compare/v4.4.0...v4.5.0

v4.4.0

What's Changed

Full Changelog: https://github.com/goreleaser/goreleaser-action/compare/v4.3.0...v4.4.0

v4.3.0

What's Changed

New Contributors

Full Changelog: https://github.com/goreleaser/goreleaser-action/compare/v4.2.0...v4.3.0

... (truncated)

Commits
  • 7ec5c2b chore(deps): bump @​actions/core from 1.10.0 to 1.10.1 (#434)
  • 3529a65 chore: node 20 as default runtime (#432)
  • d2f6e33 chore(deps): bump crazy-max/ghaction-import-gpg from 5 to 6 (#433)
  • See full diff in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=goreleaser/goreleaser-action&package-manager=github_actions&previous-version=4&new-version=5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* set testnet v13 upgrade height (#2743) * add v13.0.0 changelog section (#2748) * update mergify and dependabot (#2750) * chore: update main to v14 (#2749) * replace v13 with v14 * update test.yml * add v14 upgrade handler * docs: updating release procedure (#2751) * updating release procedure * Update RELEASE_PROCESS.md Co-authored-by: bernd-m <43466467+bermuell@users.noreply.github.com> --------- Co-authored-by: bernd-m <43466467+bermuell@users.noreply.github.com> * fix uninitiated bank keeper passed in crisis keeper (#2753) Co-authored-by: Marius Poke * docs: Added maintainability section, to include vulnerability checking (#2755) * Added maintainability section, to include vulnerability checking * Updated with review comments * testnet upgraded to v13 (#2747) * docs: Updated migration docs for v13 release (#2754) * Migration instructions for v13 * Migration instructions for v13 * Updated with review comments * Added upgrade banner + timeline * docs: Post v13 docs update (#2757) * Added post upgrade docs * Update docs/roadmap/README.md Co-authored-by: Simon Noetzlin * Update docs/roadmap/README.md Co-authored-by: Simon Noetzlin --------- Co-authored-by: Simon Noetzlin * chore(deps): Bump golang.org/x/net from 0.12.0 to 0.17.0 (#2760) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.12.0 to 0.17.0. - [Commits](https://github.com/golang/net/compare/v0.12.0...v0.17.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): Bump github.com/spf13/viper from 1.16.0 to 1.17.0 (#2759) Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.16.0 to 1.17.0. - [Release notes](https://github.com/spf13/viper/releases) - [Commits](https://github.com/spf13/viper/compare/v1.16.0...v1.17.0) --- updated-dependencies: - dependency-name: github.com/spf13/viper dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Updates wallets and explorers (#2770) * chore(deps): Bump github.com/docker/docker from 20.10.24+incompatible to 24.0.7+incompatible (#2777) Bumps [github.com/docker/docker](https://github.com/docker/docker) from 20.10.24+incompatible to 24.0.7+incompatible.
Release notes

Sourced from github.com/docker/docker's releases.

v24.0.7

24.0.7

For a full list of pull requests and changes in this release, refer to the relevant GitHub milestones:

Bug fixes and enhancements

  • Write overlay2 layer metadata atomically. moby/moby#46703
  • Fix "Rootful-in-Rootless" Docker-in-Docker on systemd version 250 and later. moby/moby#46626
  • Fix dockerd-rootless-setuptools.sh when username contains a backslash. moby/moby#46407
  • Fix a bug that would prevent network sandboxes to be fully deleted when stopping containers with no network attachments and when dockerd --bridge=none is used. moby/moby#46702
  • Fix a bug where cancelling an API request could interrupt container restart. moby/moby#46697
  • Fix an issue where containers would fail to start when providing --ip-range with a range larger than the subnet. docker/for-mac#6870
  • Fix data corruption with zstd output. moby/moby#46709
  • Fix the conditions under which the container's MAC address is applied. moby/moby#46478
  • Improve the performance of the stats collector. moby/moby#46448
  • Fix an issue with source policy rules ending up in the wrong order. moby/moby#46441

Packaging updates

Security

v24.0.6

24.0.6

For a full list of pull requests and changes in this release, refer to the relevant GitHub milestones:

Bug fixes and enhancements

  • containerd storage backend: Fix docker ps failing when a container image is no longer present in the content store. moby/moby#46095
  • containerd storage backend: Fix docker ps -s -a and docker container prune failing when a container image config is no longer present in the content store. moby/moby#46097
  • containerd storage backend: Fix docker inspect failing when a container image config is no longer (or was never) present in the content store. moby/moby#46244
  • containerd storage backend: Fix diff and export with the overlayfs snapshotter by using reference-counted rootfs mounts. moby/moby#46266
  • containerd storage backend: Fix a misleading error message when the image platforms available locally do not match the desired platform. moby/moby#46300
  • containerd storage backend: Fix the FROM scratch Dockerfile instruction with the classic builder. moby/moby#46302
  • containerd storage backend: Fix mismatched image rootfs and manifest layers errors with the classic builder. moby/moby#46310

... (truncated)

Commits
  • 311b9ff Merge pull request #46697 from thaJeztah/24.0_backport_restart_nocancel
  • af60804 Merge pull request from GHSA-jq35-85cj-fj4p
  • 3cf363e Merge pull request #46709 from thaJeztah/24.0_backport_bump_compress
  • 05d7386 daemon: daemon.containerRestart: don't cancel restart on context cancel
  • 649c944 Merge pull request #46703 from thaJeztah/24.0_backport_atomic-layer-data-write
  • 9b20b1a Merge pull request #46702 from thaJeztah/24.0_backport_releaseNetwork_Network...
  • dd37b0b vendor: github.com/klauspost/compress v1.17.2
  • 7058c0d vendor: github.com/klauspost/compress v1.16.5
  • 57bd388 daemon: overlay2: Write layer metadata atomically
  • 05d95fd daemon: release sandbox even when NetworkDisabled
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/docker/docker&package-manager=go_modules&previous-version=20.10.24+incompatible&new-version=24.0.7+incompatible)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/cosmos/gaia/network/alerts).
* bump hid and ledger-cosmos deps (#2763) * deps: bump pfm to v4.1.1 (#2779) * bump pfm to 4.1.1 * add changelog entries * bump ics (#2781) * fix "follwing" typo (#2782) Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * deps: bump ICS (#2789) * bump ics * bump ics to new RC * nit * chore(deps): Bump github.com/spf13/cobra from 1.7.0 to 1.8.0 (#2788) Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.7.0 to 1.8.0.
Release notes

Sourced from github.com/spf13/cobra's releases.

v1.8.0

✨ Features

🐛 Bug fixes

🔧 Maintenance

🧪 Testing & CI/CD

✏️ Documentation


Thank you everyone who contributed to this release and all your hard work! Cobra and this community would never be possible without all of you!!!! 🐍

Full Changelog: https://github.com/spf13/cobra/compare/v1.7.0...v1.8.0

Commits
  • a0a6ae0 Improve API to get flag completion function (#2063)
  • 890302a Support usage as plugin for tools like kubectl (#2018)
  • 48cea5c build(deps): bump actions/checkout from 3 to 4 (#2028)
  • 22953d8 Replace all non-alphanumerics in active help env var program prefix (#1940)
  • 00b68a1 Add tests for flag completion registration (#2053)
  • b711e87 Don't complete --help flag when flag parsing disabled (#2061)
  • 8b1eba4 Fix linter errors (#2052)
  • 4cafa37 Allow running persistent run hooks of all parents (#2044)
  • 5c962a2 build(deps): bump github.com/cpuguy83/go-md2man/v2 from 2.0.2 to 2.0.3 (#2047)
  • efe8fa3 build(deps): bump actions/setup-go from 3 to 4 (#1934)
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/spf13/cobra&package-manager=go_modules&previous-version=1.7.0&new-version=1.8.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* chore(deps): Bump github.com/gorilla/mux from 1.8.0 to 1.8.1 (#2787) Bumps [github.com/gorilla/mux](https://github.com/gorilla/mux) from 1.8.0 to 1.8.1.
Release notes

Sourced from github.com/gorilla/mux's releases.

Release v1.8.1

What's Changed

New Contributors

Full Changelog: https://github.com/gorilla/mux/compare/v1.8.0...v1.8.1

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/gorilla/mux&package-manager=go_modules&previous-version=1.8.0&new-version=1.8.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* backport v13.0.1 changelog entries to main (#2791) * add changelog entry for ledger fix (#2792) * dep: bump ics to v2.2.0-provider-lsm (#2795) * bump ics to v2.2.0-provider-lsm * add ICS bump to changelog * Update .changelog/unreleased/features/2781-bump-ics.md Co-authored-by: Marius Poke * Update .changelog/unreleased/api-breaking/2781-bump-ics.md Co-authored-by: Marius Poke --------- Co-authored-by: Marius Poke * cleanup changelog (#2796) * backport v13.0.2 changelog section to main (#2802) * update mergify and dependabot for v14 (#2798) * docs: fix .md links (#2804) * fix .md links * remove false positives * (deps!): bump ICS to v2.3.0-provider-lsm (#2808) (#2809) * bump ics * update changelog entries * bump ics (#2811) * deps: bump ICS to v2.3.0-provider-lsm (#2814) * bump ICS to v2.3.0-provider-lsm * update changelog entries * chore(deps): Bump cosmossdk.io/math from 1.1.2 to 1.2.0 (#2806) Bumps [cosmossdk.io/math](https://github.com/cosmos/cosmos-sdk) from 1.1.2 to 1.2.0.
Release notes

Sourced from cosmossdk.io/math's releases.

Cosmovisor v1.2.0

Release Notes

New Features

With the cosmovisor init command, all the necessary folders for using cosmovisor are automatically created. You do not need to manually symlink the chain binary anymore.

We've added a new configuration option: DAEMON_RESTART_DELAY (as env variable). When set, Cosmovisor will wait that delay between the node halt and backup. See the README file for more details.

Bug Fixes

  • Fix Cosmovisor binary usage for pre-upgrade. Cosmovisor was using the wrong binary when running a pre-upgrade command.

Changelog

For more details, please see the CHANGELOG.

Commits
  • c33b4db chore: prepare log 1.2.0 (#17214)
  • c36c860 refactor(cli): remove duplicate --home flag (#17215)
  • 31f7247 feat(cli): status cmd cli support output text (#17184)
  • 095a641 feat(docker): Add debuging dependencies directly into the dockerfile (#17228)
  • f47749b fix: text output format of block-results cmd cli (#17183)
  • 236fe4c docs: additional fields in context.go to be added to context.md (#17199)
  • 382de33 feat(testutil): adding DefaultContextWithKeys test helper (#17216)
  • 0b7d2d3 fix(log): add fallback to Stringer when type do not implement `json.Marshal...
  • 60ead8d ci: skip fix_registration.go when using LINT_DIFF=1 (#17185)
  • edba186 refactor(keys): remove duplicate --home flag (#17197)
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cosmossdk.io/math&package-manager=go_modules&previous-version=1.1.2&new-version=1.2.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* bring v14.0.0 changelog entries to main (#2817) * bump ICS to v2.4.0-lsm-rc0 (#2819) * update security policy (#2820) * set the min evidence height for neutron-1 and stride-1 (#2821) * chore(deps): Bump docker/build-push-action from 5.0.0 to 5.1.0 (#2822) Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5.0.0 to 5.1.0.
Release notes

Sourced from docker/build-push-action's releases.

v5.1.0

Full Changelog: https://github.com/docker/build-push-action/compare/v5.0.0...v5.1.0

Commits
  • 4a13e50 Merge pull request #1006 from docker/dependabot/npm_and_yarn/docker/actions-t...
  • 7416668 chore: update generated content
  • b4f76a5 chore(deps): Bump @​docker/actions-toolkit from 0.13.0 to 0.14.0
  • b7feb76 Merge pull request #1005 from crazy-max/ci-inspect
  • fae8018 ci: inspect sbom and provenance
  • b625868 Merge pull request #1004 from crazy-max/ci-update-buildx
  • 5193ef1 ci: update buildx to latest
  • d3afd77 Merge pull request #991 from docker/dependabot/npm_and_yarn/babel/traverse-7....
  • 7a786bb Merge pull request #992 from crazy-max/annotations
  • c66ae3a chore: update generated content
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=docker/build-push-action&package-manager=github_actions&previous-version=5.0.0&new-version=5.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* bump ICS to v2.4.0-lsm-rc1 (#2823) * update bots for v14.1.x (#2824) * deps!: bump ICS to v2.4.0-lsm (#2825) * bump ICS to v2.4.0-lsm * add changelog entries and update v14.0.0 section * add changelog entry for #2821 * deprecate v14.0.0 changelog section (#2827) * docs: update Gaia processes (#2818) * update Gaia processes * Update STATE-COMPATIBILITY.md Co-authored-by: Simon Noetzlin * update cosmos sdk link --------- Co-authored-by: Simon Noetzlin * bring changelog 14.1.0 section to main (#2831) * chore(deps): Bump github.com/spf13/cast from 1.5.1 to 1.6.0 (#2835) Bumps [github.com/spf13/cast](https://github.com/spf13/cast) from 1.5.1 to 1.6.0. - [Release notes](https://github.com/spf13/cast/releases) - [Commits](https://github.com/spf13/cast/compare/v1.5.1...v1.6.0) --- updated-dependencies: - dependency-name: github.com/spf13/cast dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): Bump JamesIves/github-pages-deploy-action from 4.4.3 to 4.5.0 (#2836) Bumps [JamesIves/github-pages-deploy-action](https://github.com/jamesives/github-pages-deploy-action) from 4.4.3 to 4.5.0.
Release notes

Sourced from JamesIves/github-pages-deploy-action's releases.

v4.5.0

What's Changed

New Contributors

Full Changelog: https://github.com/JamesIves/github-pages-deploy-action/compare/v4.4.3...v4.5.0

Commits
  • 65b5dfd Deploy Production Code for Commit 32bb2a8d7bda92f28b1fd223fc5793ab27f725eb 🚀
  • 32bb2a8 Merge branch 'dev' into releases/v4
  • 7879c16 feat: update to Node 20
  • 1c34508 build(deps-dev): bump @​types/node from 20.9.0 to 20.10.0 (#1479)
  • b957d05 Bump actions/checkout from 3 to 4 (#1429)
  • 3a4632d build(deps-dev): bump @​types/node from 20.4.9 to 20.9.0 (#1474)
  • 9de0269 build(deps): bump actions/setup-node from 3 to 4 (#1467)
  • 810af53 Update README.md
  • 24c1e2a doc: .gitignore matches not being deployed (#1459)
  • 0769273 fix: remove base.Dockerfile as it's not needed
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=JamesIves/github-pages-deploy-action&package-manager=github_actions&previous-version=4.4.3&new-version=4.5.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* chore(deps): Bump docker/metadata-action from 5.0.0 to 5.2.0 (#2837) Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 5.0.0 to 5.2.0.
Release notes

Sourced from docker/metadata-action's releases.

v5.2.0

Full Changelog: https://github.com/docker/metadata-action/compare/v5.1.0...v5.2.0

v5.1.0

Full Changelog: https://github.com/docker/metadata-action/compare/v5.0.0...v5.1.0

Commits
  • e6428a5 Merge pull request #361 from crazy-max/custom-annotations
  • 26b4721 Merge pull request #359 from favonia/document-annotations
  • 352ce8b chore: update generated content
  • cb0becc custom annotations support
  • 91224bc docs(README): add a hint about multi-arch builds
  • f19c369 Merge pull request #358 from crazy-max/empty-images
  • 4066f0c chore: update generated content
  • d6a296c chore: use anonymous func to generate tags and add tests
  • aacea38 feat: allow the images input to be empty, to output just tags
  • 051f7ea Merge pull request #357 from docker/dependabot/npm_and_yarn/docker/actions-to...
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=docker/metadata-action&package-manager=github_actions&previous-version=5.0.0&new-version=5.2.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
* docs: Updates for Gaia v14 (aka v14.1.0) (#2839) * Updates for Gaia v14 (aka v14.1.0) * Some minor updates * prepare main for v15 (#2807) * Update genesis.md (#2844) * chore(deps): Bump actions/stale from 8.0.0 to 9.0.0 (#2848) Bumps [actions/stale](https://github.com/actions/stale) from 8.0.0 to 9.0.0. - [Release notes](https://github.com/actions/stale/releases) - [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/stale/compare/v8.0.0...v9.0.0) --- updated-dependencies: - dependency-name: actions/stale dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): Bump docker/metadata-action from 5.2.0 to 5.3.0 (#2849) Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 5.2.0 to 5.3.0. - [Release notes](https://github.com/docker/metadata-action/releases) - [Commits](https://github.com/docker/metadata-action/compare/v5.2.0...v5.3.0) --- updated-dependencies: - dependency-name: docker/metadata-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): Bump actions/setup-go from 4 to 5 (#2850) Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4 to 5. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(docs): typo fix (#2845) * typo fix * typo fix * typo fix * typo fix * Enhancements to Documentation Clarity and Precision (#2846) * Fix typo in Pull Request Templates section * Fix repeated word in release process documentation * Fix typo: change 'continous' to 'continuous' * Fix typo in documentation: correct 'before using following this section' to 'before following this section' * Fix redundant 'the' in Previous Releases section and in query.proto comment * fix grammatical errors in documentation * fix typo: change 'to makes' to 'to make' in Cosmos Hub Archives section * fix typo: change 'attacked' to 'attack' in Validator Security section * Correct typos in Fee Parameters: 'importantht', non-negative amount phrasing, and 'Node Nodes' redundancy * Fix typos in document: Correct 'Formating' to 'Formatting' and 'teh' to 'the' * fix: remove duplicate words in documentation --------- Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * chore: update broken install post-merge * fix: revert ValidateGovMsgs() to main definition * chore: appease linter * chore: fix broken merge in .github * chore: update version checking in Makefile --------- Signed-off-by: dependabot[bot] Co-authored-by: Milan Mulji <98309852+mmulji-ic@users.noreply.github.com> Co-authored-by: yaruwangway <69694322+yaruwangway@users.noreply.github.com> Co-authored-by: Marius Poke Co-authored-by: dongsam Co-authored-by: Jacob Gadikian Co-authored-by: Dante Sanchez Co-authored-by: Simon Noetzlin Co-authored-by: Wojciech Małota-Wójcik <59281144+outofforest@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Emmanuel T Odeke Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> Co-authored-by: riley-stride <104941670+riley-stride@users.noreply.github.com> Co-authored-by: jstr1121 Co-authored-by: jstr1121 <118450565+jstr1121@users.noreply.github.com> Co-authored-by: sampocs Co-authored-by: Riley Edmunds Co-authored-by: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Co-authored-by: bernd-m <43466467+bermuell@users.noreply.github.com> Co-authored-by: Puneet <59960662+puneet2019@users.noreply.github.com> Co-authored-by: Jorge Hernandez <3452489+jhernandezb@users.noreply.github.com> Co-authored-by: Kevin Heavey <24635973+kevinheavey@users.noreply.github.com> Co-authored-by: toni <143221387+xyztoni@users.noreply.github.com> Co-authored-by: Frieren <153332328+Frierened@users.noreply.github.com> Co-authored-by: joao <22820692+joaolago1113@users.noreply.github.com> --- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/docker-push.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/nightly-tests.yml | 2 +- .github/workflows/release-sims.yml | 4 +- .github/workflows/release.yml | 2 +- .github/workflows/sim-label.yml | 4 +- .github/workflows/sims.yml | 10 +- .github/workflows/stale.yml | 2 +- .github/workflows/test.yml | 13 +- CONTRIBUTING.md | 2 +- Makefile | 7 +- RELEASE_PROCESS.md | 2 +- ante/ante.go | 5 +- ante/gov_ante.go | 2 +- ante/gov_ante_test.go | 4 +- app/app.go | 33 +- app/app_helpers.go | 3 +- app/app_test.go | 3 +- app/export.go | 1 + app/helpers/test_helpers.go | 9 +- app/keepers/keepers.go | 54 +-- app/keepers/keys.go | 8 +- app/modules.go | 22 +- app/sim/sim_state.go | 7 +- app/sim/sim_utils.go | 3 +- app/sim_bench_test.go | 9 +- app/sim_test.go | 9 +- app/upgrades/v12/upgrades.go | 7 +- app/upgrades/v8/upgrades.go | 4 +- cmd/gaiad/cmd/genaccounts.go | 197 ++++++++++ cmd/gaiad/cmd/root.go | 16 +- cmd/gaiad/cmd/testnet.go | 11 +- docs/governance/formatting.md | 4 +- docs/gtm-interchain.md | 2 +- docs/hub-tutorials/gaiad.md | 2 +- docs/hub-tutorials/join-mainnet.md | 2 +- docs/modules/globalfee.md | 8 +- docs/resources/archives.md | 2 +- docs/resources/genesis.md | 8 +- docs/resources/ledger.md | 2 +- docs/roadmap/README.md | 4 +- docs/validators/security.md | 4 +- docs/validators/validator-faq.md | 47 ++- docs/validators/validator-setup.md | 2 +- go.mod | 2 +- tests/e2e/chain.go | 9 +- tests/e2e/e2e_bypassminfee_test.go | 1 + tests/e2e/e2e_exec_test.go | 9 +- tests/e2e/e2e_gov_test.go | 1 - tests/e2e/e2e_setup_test.go | 20 +- tests/e2e/e2e_staking_test.go | 1 + tests/e2e/genesis.go | 11 +- tests/e2e/query.go | 6 +- tests/e2e/validator.go | 4 +- tests/ics/interchain_security_test.go | 7 +- .../proto/cosmos/staking/v1beta1/query.proto | 348 ++++++++++++++++++ x/globalfee/ante/antetest/fee_test.go | 5 +- x/globalfee/ante/antetest/fee_test_setup.go | 9 +- x/globalfee/ante/fee.go | 5 +- x/globalfee/genesis_test.go | 13 +- .../migrations/v2/v2_test/migration_test.go | 4 +- x/globalfee/module.go | 4 +- x/globalfee/querier_test.go | 9 + x/globalfee/types/params.go | 6 +- 65 files changed, 816 insertions(+), 206 deletions(-) create mode 100644 cmd/gaiad/cmd/genaccounts.go create mode 100644 third_party/proto/cosmos/staking/v1beta1/query.proto diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 887e7a38fd..1d802ca669 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 71ecf62e0a..23af715ba4 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 bac5c0f5b5..7e75883bcd 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 dd78d4a10e..3ed127567f 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 7ef80a8951..337e18c7a3 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 2b3d862591..205994bfa1 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 80a2cae87d..6a09fa1828 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 4813c55525..bb4e39de5c 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 7c5e51b18a..b1e4597e96 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 0d4653439b..037c917e34 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 97ee84b16a..29a022482c 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 6fe8098572..74f0f25bbf 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 499cc6132f..760cb7fded 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 e7eb225745..bfe9dde49a 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 4f39379747..ba91100fc7 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 2564bdc77c..6bd386d2a9 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 3619dad654..744e9987a5 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 6948db79fa..093b3db0b3 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 592613731f..846d249350 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 0570698057..e8423cdd70 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 dcab4eb3b1..9ac54fcc77 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 eb490400d7..b7b2ffb533 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 26e967a723..5996f2437c 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 cee101d5ea..f53e5c99c4 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 f622569cb0..31a52668b6 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 35472831d7..6499ca82a2 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 c6e1f2e083..eb0aad65bb 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 5547c5811f..8f7eb3299f 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 a30204a0ab..f108d81921 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 850ede2be5..f65a97c7ef 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 0000000000..02c9c8405b --- /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 7c0e243cbe..a1cc62eb42 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 bfa6112500..f0ae3f725b 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 0d11e8ce85..4ab6e7ab03 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 ddc3bc094e..2c52ecfc44 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 91013984d5..961fb12cc6 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 6136fa153f..4513e47790 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 688d77cb05..a5ff569f68 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 21afa71d5c..b86cafcf4a 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 5f74ec2aa5..59ebfa16c1 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 0950153fa2..8fc45401e9 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 e104833266..0a10067c98 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 05b62889bc..5feaac7bb6 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 42c6fc266f..be2c026fa2 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 76c73bd35d..b76d3b689a 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 d4a96c78b0..bc4e577648 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 48df134154..774784694e 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 0913b1a8f0..8652cdf0c2 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 e84a8f04f9..85ac056959 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 0756f8277f..316590e8e3 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 09ac482222..63026cd92f 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 f9ffe4f438..483d522d64 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 7e449009f7..acaf2127ca 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 b1f03ae968..4696154cea 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 5969050983..c4fe4af694 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 e063a290a9..debaf00842 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 0000000000..01b88cbb06 --- /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 dee698f5b5..bf754369bd 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 63513162c2..254c555f42 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 aed5203d4c..0679b0aa31 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 f9f3be2e85..6daa4411ca 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 cd56078fe1..9aa03a3fab 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 917ba8e749..909cd36f15 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 58db62280d..9081595b9f 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 0a7cab846e..a7eaed4ab6 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" ) From a91f8cf5a226ad35887a5361908af8a6b98d4553 Mon Sep 17 00:00:00 2001 From: MSalopek Date: Tue, 12 Dec 2023 16:10:22 +0100 Subject: [PATCH 12/43] chore: post-merge cleanup --- app/upgrades/v8/upgrades.go | 4 ---- go.sum | 40 ++++++++++++++++++++----------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/app/upgrades/v8/upgrades.go b/app/upgrades/v8/upgrades.go index 5544cc7607..f65a97c7ef 100644 --- a/app/upgrades/v8/upgrades.go +++ b/app/upgrades/v8/upgrades.go @@ -6,10 +6,6 @@ import ( "errors" "fmt" - icahosttypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types" - icatypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/types" - ibcchanneltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" - "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" diff --git a/go.sum b/go.sum index a2af969b75..82a3c49b0b 100644 --- a/go.sum +++ b/go.sum @@ -639,9 +639,8 @@ github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnG github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= @@ -762,10 +761,14 @@ github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfC github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= -github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= +github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= +github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= -github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= +github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= +github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= +github.com/gobwas/ws v1.1.0 h1:7RFti/xnNkMJnrK7D1yQ/iCIB5OrrY/54/H930kIbHA= +github.com/gobwas/ws v1.1.0/go.mod h1:nzvNcVha5eUziGrbxFCo6qFIojQHjJV5cLYIbezhfL0= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= @@ -919,9 +922,8 @@ github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= -github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -1238,8 +1240,8 @@ github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChl github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= -github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= -github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= +github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= @@ -1346,8 +1348,6 @@ github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1 github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= -github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= -github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= @@ -1358,20 +1358,22 @@ github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcD github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= -github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= +github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.17.0 h1:I5txKw7MJasPL/BrfkbA0Jyo/oELqVmux4pR/UxOMfI= -github.com/spf13/viper v1.17.0/go.mod h1:BmMMMLQXSbcHK6KAOiFLz0l5JHrU89OdIRHvsk0+yVI= +github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= +github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -1394,8 +1396,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= -github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= +github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= @@ -1479,8 +1481,6 @@ go.uber.org/mock v0.2.0 h1:TaP3xedm7JaAgScZO7tlvlKrqT0p7I6OsdGB5YNSMDU= go.uber.org/mock v0.2.0/go.mod h1:J0y0rp9L3xiff1+ZBfKxlC1fz2+aO16tw0tsDOixfuM= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= -go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= @@ -1738,6 +1738,7 @@ golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201207223542-d4d67f95c62d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1803,9 +1804,12 @@ golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9sn golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= From fd63f6e1f3e20916a8c1a2f871548728a14f8dca Mon Sep 17 00:00:00 2001 From: MSalopek Date: Tue, 12 Dec 2023 16:14:58 +0100 Subject: [PATCH 13/43] chore: post-merge cleanup --- docs/gtm-interchain.md | 75 ------------------------------------------ 1 file changed, 75 deletions(-) delete mode 100644 docs/gtm-interchain.md diff --git a/docs/gtm-interchain.md b/docs/gtm-interchain.md deleted file mode 100644 index 2c52ecfc44..0000000000 --- a/docs/gtm-interchain.md +++ /dev/null @@ -1,75 +0,0 @@ -**Introduction** - -IBC and Hub go-to-market is a complex organizational, developmental, and marketing undertaking that involves many entities, software projects, and services. IBC is also intimately bound up to the roadmap, development, and go-to-market of Gaia. Though it is possible to bring IBC to market without Gaia, Gaia should be the primary vehicle and product we are concerned with, since the value of Gaia stems from the utility it brings to the ecosystem of chains connected to and benefiting from its position as a Hub. Thus, this plan will consider go-to-market needs for IBC and Gaia simultaneously. The roadmap will be designed to ensure that IBC is valuable to the Hub and its users, including the many interconnected sovereign blockchains that derive utility from the Hub. - -The IBC and Gaia go-to-market initiatives will be about direct engagement with the products that directly validate the utility of the Hub and IBC. This initiative encompasses the utility of various interoperable and cross-chain Cosmos entities such as application-specific blockchains, Bridges, Relayers, Validators, etc. More importantly, we envision that the market will quickly grasp the meaning and relevance of cross-chain interoperability of which Cosmos is a leading contender. -This is an evolving document and process. Please feel free to contribute where you think something is missing or could be improved! -**How we work** - -These discussions will take place during weekly Gaia team calls. The Hub will determine the value proposition of IBC and how it is integrated into Gaia and how it will serve the larger ecosystem of interconnected blockchains. These discussions will continue to take place with key stakeholders during the bi-weekly Cosmos multi entity call. Importantly, the purpose of the bi-weekly multi entity call will be to consider all technical aspects of IBC launch from a strategic perspective (outlined in 'What's Needed to Successfully Go to Market?'). This will inform the agenda. - -Leading up to Stargate, IBC Development was led by Chris Goes (Interchain Berlin), while Gaia did not have a maintainer. Go-to-market for Stargate was led by Zaki (Iqlusion). Moving forward, we are aiming to organize Cosmos Hub leadership under Shahan Khatchadourian (Interchain Berlin) and go-to-market led by Jelena Djuric (Informal Systems). Both Shahan and Jelena are being onboarded into these roles with the support of previous leads. - -Execution and completion will be tracked via a meta-project dashboard ([Gaia Roadmap](https://github.com/cosmos/gaia/projects/6)) that incorporates the high level objectives for each phase roll out. Each phase (i.e. Phase 1 - Accounts UX, Phase 2 - Interchain Interchange, etc) will have their own project dashboard that will link to the repos, issues, PRs, etc, where development is taking place. - -"_Never doubt that a small group of thoughtful, committed, citizens can change the world. Indeed, it is the only thing that ever has." - Margaret Mead_ - -**What's Needed to Successfully Go to Market?** - -1. **Project management** - -In sum, project management will focus on surfacing issues, dependencies, relative roadmaps, and coordinating across all stakeholders. Questions that will be considered throughout each phase of the Gaia roadmap: - -- What is missing from an integration points perspective with end users? - -- Which relationships are missing? -- What's the highest priority? Least priority? - -2. **Market validation** - -The user is paramount. For Gaia and IBC, we see the users being: - -- ATOM holders -- Existing zones -- New zones -- Validators on hub and zones -- 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 continuous outbound outreach to look for partners that are aligned with the interchain mission. - -3. **Communications** - -Communications should focus on the features of IBC and the Hub that demonstrate the most utility for users. Stories should answer questions such as: - -- How does IBC relate to ATOM and the Hub? -- How does IBC derive its value from the Hub, and vice versa? -- Why should you build your blockchain with IBC? -- How does a blockchain benefit from connecting to the Hub? - -4. **Technical Support** - -We will need technical support for users depending on the phase that is being rolled out. A phase rollout is not complete without proper technical support. - -Further, we will need technical support that goes beyond the different phase rollouts. Importantly, to create an IBC connected blockchain developers will need the following things: - -- A value proposition - - - A State Machine: - - Built on Cosmos SDK - - ABCI - - Cosmos-rs.. etc - - Security: - - Cross chain Validation - - Validator set formation - - Community - - Discoverability Opportunities - - Connectivity - - Visibility - - Wallet, Block Explorer, etc - -5. **METRICS: How do we know when IBC is succeeding? How do we know when Hub is providing value to an interconnected ecosystem of sovereign blockchains?** - -The go-to-market team should be tracking the extent to which IBC is succeeding or failing in terms of key metrics. This will require continuous experimentation and coordination between entities. An example of a metric that best represents IBC go to market would be # of distinct IBC connections that transport x amount of value. To get to these metrics we need the developer resources and proven business models that encourage developers to use this technology. - -The Cosmos-SDK exposes some [existing metrics for IBC](https://docs.cosmos.network/v0.45/core/telemetry.html#supported-metrics). From ce86f31994c1be9d7973d5c52b1943300bbf2bc2 Mon Sep 17 00:00:00 2001 From: MSalopek Date: Tue, 12 Dec 2023 16:17:58 +0100 Subject: [PATCH 14/43] chore: post-merge cleanup --- .../2629-add-query-local-min-gas-prices.md | 3 -- tests/e2e/e2e_setup_test.go | 42 ------------------- 2 files changed, 45 deletions(-) delete mode 100644 .changelog/unreleased/features/2629-add-query-local-min-gas-prices.md diff --git a/.changelog/unreleased/features/2629-add-query-local-min-gas-prices.md b/.changelog/unreleased/features/2629-add-query-local-min-gas-prices.md deleted file mode 100644 index 2ad2b3700d..0000000000 --- a/.changelog/unreleased/features/2629-add-query-local-min-gas-prices.md +++ /dev/null @@ -1,3 +0,0 @@ -- register NodeService to enable query /cosmos/base/node/v1beta1/config - gRPC query to disclose node operator's configured minimum-gas-price. - ([\#2629](https://github.com/cosmos/gaia/issues/2629)) \ No newline at end of file diff --git a/tests/e2e/e2e_setup_test.go b/tests/e2e/e2e_setup_test.go index c4efcc37c5..63026cd92f 100644 --- a/tests/e2e/e2e_setup_test.go +++ b/tests/e2e/e2e_setup_test.go @@ -951,48 +951,6 @@ func (s *IntegrationTestSuite) writeLiquidStakingParamsUpdateProposal(c *chain, s.Require().NoError(err) } -func (s *IntegrationTestSuite) writeLiquidStakingParamsUpdateProposal(c *chain) { - type ParamInfo struct { - Subspace string `json:"subspace"` - Key string `json:"key"` - Value sdk.Dec `json:"value"` - } - - type ParamChangeMessage struct { - Title string `json:"title"` - Description string `json:"description"` - Changes []ParamInfo `json:"changes"` - Deposit string `json:"deposit"` - } - - paramChangeProposalBody, err := json.MarshalIndent(ParamChangeMessage{ - Title: "liquid staking params update", - Description: "liquid staking params update", - Changes: []ParamInfo{ - { - Subspace: "staking", - Key: "GlobalLiquidStakingCap", - Value: sdk.NewDecWithPrec(25, 2), // 25% - }, - { - Subspace: "staking", - Key: "ValidatorLiquidStakingCap", - Value: sdk.NewDecWithPrec(50, 2), // 50% - }, - { - Subspace: "staking", - Key: "ValidatorBondFactor", - Value: sdk.NewDec(250), // -1 - }, - }, - Deposit: "1000uatom", - }, "", " ") - s.Require().NoError(err) - - err = writeFile(filepath.Join(c.validators[0].configDir(), "config", proposalLSMParamUpdateFilename), paramChangeProposalBody) - s.Require().NoError(err) -} - func configFile(filename string) string { filepath := filepath.Join(gaiaConfigPath, filename) return filepath From 1b5484501b3bdd72581b64cf1ea8b996dd7dd5cb Mon Sep 17 00:00:00 2001 From: MSalopek Date: Wed, 13 Dec 2023 16:03:02 +0100 Subject: [PATCH 15/43] deps: update migration to use latest cosmos-sdk/lsm --- app/upgrades/v15/constants.go | 12 ++++++++++++ go.mod | 4 ++-- go.sum | 8 ++++---- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/app/upgrades/v15/constants.go b/app/upgrades/v15/constants.go index 18216ab7dd..31aaf50442 100644 --- a/app/upgrades/v15/constants.go +++ b/app/upgrades/v15/constants.go @@ -1,6 +1,11 @@ package v15 import ( + store "github.com/cosmos/cosmos-sdk/store/types" + + consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types" + crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" + "github.com/cosmos/gaia/v15/app/upgrades" ) @@ -12,4 +17,11 @@ const ( var Upgrade = upgrades.Upgrade{ UpgradeName: UpgradeName, CreateUpgradeHandler: CreateUpgradeHandler, + StoreUpgrades: store.StoreUpgrades{ + Added: []string{ + // v47 modules + crisistypes.ModuleName, + consensustypes.ModuleName, + }, + }, } diff --git a/go.mod b/go.mod index bc4e577648..3cabe446ff 100644 --- a/go.mod +++ b/go.mod @@ -215,10 +215,10 @@ replace ( github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 // Use special SDK release with support for both ICS and LSM - github.com/cosmos/cosmos-sdk => github.com/informalsystems/cosmos-sdk v0.46.0-alpha2.0.20231206144452-5b8e28f3247b + github.com/cosmos/cosmos-sdk => github.com/informalsystems/cosmos-sdk v0.46.0-alpha2.0.20231213145240-817c772e6b80 // Use special ICS release with support for LSM - github.com/cosmos/interchain-security/v3 => github.com/cosmos/interchain-security/v3 v3.3.0-rc0.0.20231207121941-02bc47252590 + github.com/cosmos/interchain-security/v3 => github.com/cosmos/interchain-security/v3 v3.3.0-rc0.0.20231213145932-9a4673505d2f // TODO: remove it: https://github.com/cosmos/cosmos-sdk/issues/13134 github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2 diff --git a/go.sum b/go.sum index 82a3c49b0b..305571ecc1 100644 --- a/go.sum +++ b/go.sum @@ -615,8 +615,8 @@ github.com/cosmos/ibc-go/v7 v7.3.1 h1:bil1IjnHdyWDASFYKfwdRiNtFP6WK3osW7QFEAgU4I github.com/cosmos/ibc-go/v7 v7.3.1/go.mod h1:wvx4pPBofe5ZdMNV3OFRxSI4auEP5Qfqf8JXLLNV04g= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= -github.com/cosmos/interchain-security/v3 v3.3.0-rc0.0.20231207121941-02bc47252590 h1:acEi6tT5Dlnblu6e+2aUuKIsrgtp07lvOPkeZhscWSs= -github.com/cosmos/interchain-security/v3 v3.3.0-rc0.0.20231207121941-02bc47252590/go.mod h1:IB5qv5+siEWIrSWEjtwhzLt3ZPSoZfaXVWWMGQteKp0= +github.com/cosmos/interchain-security/v3 v3.3.0-rc0.0.20231213145932-9a4673505d2f h1:MmWN9ef5QOL8vLLkv0GvKw7e17aJLvmZTSQ5TbsNeno= +github.com/cosmos/interchain-security/v3 v3.3.0-rc0.0.20231213145932-9a4673505d2f/go.mod h1:ZiKBmcg63OIHNPRGtzbX70GiaeRi4qwrT0bK3zzD4ko= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw= @@ -1022,8 +1022,8 @@ github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19y github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= -github.com/informalsystems/cosmos-sdk v0.46.0-alpha2.0.20231206144452-5b8e28f3247b h1:30cT7RklLxEObRhrPNWfxmzpwA7L9wlOZtEQGqwUvkU= -github.com/informalsystems/cosmos-sdk v0.46.0-alpha2.0.20231206144452-5b8e28f3247b/go.mod h1:5XeJ1MRNGiKgoCj/1nWQm0xadHcOP8wqpeCUihzead4= +github.com/informalsystems/cosmos-sdk v0.46.0-alpha2.0.20231213145240-817c772e6b80 h1:oCxPruzvb+O3/Bz8Q2Ff6+aKsoK7OYCZVTfY4tMTI+o= +github.com/informalsystems/cosmos-sdk v0.46.0-alpha2.0.20231213145240-817c772e6b80/go.mod h1:5XeJ1MRNGiKgoCj/1nWQm0xadHcOP8wqpeCUihzead4= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= From c9b7817ec68bc1318dab0b6e0e6c270f8c2e00c9 Mon Sep 17 00:00:00 2001 From: MSalopek Date: Wed, 13 Dec 2023 16:11:43 +0100 Subject: [PATCH 16/43] chore: appease linter --- app/upgrades/v15/constants.go | 1 - 1 file changed, 1 deletion(-) diff --git a/app/upgrades/v15/constants.go b/app/upgrades/v15/constants.go index 31aaf50442..45182937d8 100644 --- a/app/upgrades/v15/constants.go +++ b/app/upgrades/v15/constants.go @@ -2,7 +2,6 @@ package v15 import ( store "github.com/cosmos/cosmos-sdk/store/types" - consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" From 16a9c9785a29a941aeba8da8a71fa0b6c4e7a427 Mon Sep 17 00:00:00 2001 From: MSalopek Date: Wed, 13 Dec 2023 16:30:12 +0100 Subject: [PATCH 17/43] chore!: add min commission rates migration (prop 826) --- app/upgrades/v15/upgrades.go | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/app/upgrades/v15/upgrades.go b/app/upgrades/v15/upgrades.go index ee9c0b485d..0d80525dda 100644 --- a/app/upgrades/v15/upgrades.go +++ b/app/upgrades/v15/upgrades.go @@ -8,6 +8,8 @@ import ( "github.com/cosmos/gaia/v15/app/keepers" ) +// adhere to prop 826 which sets the minimum commission rate to 5% for all validators +// https://www.mintscan.io/cosmos/proposals/826 func CreateUpgradeHandler( mm *module.Manager, configurator module.Configurator, @@ -21,7 +23,21 @@ func CreateUpgradeHandler( return vm, err } - ctx.Logger().Info("Upgrade complete") + params := keepers.StakingKeeper.GetParams(ctx) + params.MinCommissionRate = sdk.NewDecWithPrec(5, 2) + keepers.StakingKeeper.SetParams(ctx, params) + + for _, val := range keepers.StakingKeeper.GetAllValidators(ctx) { + val := val + // update validator commission rate if it is less than 5% + if val.Commission.CommissionRates.Rate.LT(sdk.NewDecWithPrec(5, 2)) { + val.Commission.UpdateTime = ctx.BlockHeader().Time + val.Commission.CommissionRates.Rate = sdk.NewDecWithPrec(5, 2) + keepers.StakingKeeper.SetValidator(ctx, val) + } + } + + ctx.Logger().Info("Upgrade v15 complete") return vm, err } } From ed041cec9d3b28cc5693831b87200fa520c25932 Mon Sep 17 00:00:00 2001 From: MSalopek Date: Thu, 14 Dec 2023 17:54:22 +0100 Subject: [PATCH 18/43] chore: add migration tests for v15 --- app/upgrades/v15/upgrades.go | 32 +++++++++------- app/upgrades/v15/upgrades_test.go | 63 +++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 13 deletions(-) create mode 100644 app/upgrades/v15/upgrades_test.go diff --git a/app/upgrades/v15/upgrades.go b/app/upgrades/v15/upgrades.go index 0d80525dda..bd5b8d7d0a 100644 --- a/app/upgrades/v15/upgrades.go +++ b/app/upgrades/v15/upgrades.go @@ -23,21 +23,27 @@ func CreateUpgradeHandler( return vm, err } - params := keepers.StakingKeeper.GetParams(ctx) - params.MinCommissionRate = sdk.NewDecWithPrec(5, 2) - keepers.StakingKeeper.SetParams(ctx, params) - - for _, val := range keepers.StakingKeeper.GetAllValidators(ctx) { - val := val - // update validator commission rate if it is less than 5% - if val.Commission.CommissionRates.Rate.LT(sdk.NewDecWithPrec(5, 2)) { - val.Commission.UpdateTime = ctx.BlockHeader().Time - val.Commission.CommissionRates.Rate = sdk.NewDecWithPrec(5, 2) - keepers.StakingKeeper.SetValidator(ctx, val) - } - } + V15UpgradeHandler(ctx, keepers) ctx.Logger().Info("Upgrade v15 complete") return vm, err } } + +// V15UpgradeHandler sets the minimum commission rate staking parameter to 5% +// and updates the commission rate for all validators that have a commission rate less than 5% +func V15UpgradeHandler(ctx sdk.Context, keepers *keepers.AppKeepers) { + params := keepers.StakingKeeper.GetParams(ctx) + params.MinCommissionRate = sdk.NewDecWithPrec(5, 2) + keepers.StakingKeeper.SetParams(ctx, params) + + for _, val := range keepers.StakingKeeper.GetAllValidators(ctx) { + val := val + // update validator commission rate if it is less than 5% + if val.Commission.CommissionRates.Rate.LT(sdk.NewDecWithPrec(5, 2)) { + val.Commission.UpdateTime = ctx.BlockHeader().Time + val.Commission.CommissionRates.Rate = sdk.NewDecWithPrec(5, 2) + keepers.StakingKeeper.SetValidator(ctx, val) + } + } +} diff --git a/app/upgrades/v15/upgrades_test.go b/app/upgrades/v15/upgrades_test.go new file mode 100644 index 0000000000..1d0ba865db --- /dev/null +++ b/app/upgrades/v15/upgrades_test.go @@ -0,0 +1,63 @@ +package v15_test + +import ( + "testing" + + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/gaia/v15/app/helpers" + v15 "github.com/cosmos/gaia/v15/app/upgrades/v15" + "github.com/stretchr/testify/require" +) + +type EmptyAppOptions struct{} + +func (ao EmptyAppOptions) Get(_ string) interface{} { + return nil +} + +func TestV15UpgradeHandler(t *testing.T) { + gaiaApp := helpers.Setup(t) + ctx := gaiaApp.NewUncachedContext(true, tmproto.Header{}) + + // set min commission rate to 0 + stakingParams := gaiaApp.StakingKeeper.GetParams(ctx) + stakingParams.MinCommissionRate = sdk.ZeroDec() + gaiaApp.StakingKeeper.SetParams(ctx, stakingParams) + + // confirm all commissions are 0 + stakingKeeper := gaiaApp.StakingKeeper + + for _, val := range stakingKeeper.GetAllValidators(ctx) { + require.Equal(t, val.Commission.CommissionRates.Rate, sdk.ZeroDec(), "non-zero previous commission rate for validator %s", val.GetOperator()) + } + + // pre-test min commission rate is 0 + require.Equal(t, stakingKeeper.GetParams(ctx).MinCommissionRate, sdk.ZeroDec(), "non-zero previous min commission rate") + + // run the test and confirm the values have been updated + v15.V15UpgradeHandler(ctx, &gaiaApp.AppKeepers) + + newStakingParams := gaiaApp.StakingKeeper.GetParams(ctx) + require.NotEqual(t, newStakingParams.MinCommissionRate, sdk.ZeroDec(), "failed to update min commission rate") + require.Equal(t, newStakingParams.MinCommissionRate, sdk.NewDecWithPrec(5, 2), "failed to update min commission rate") + + for _, val := range stakingKeeper.GetAllValidators(ctx) { + require.Equal(t, val.Commission.CommissionRates.Rate, newStakingParams.MinCommissionRate, "failed to update update commission rate for validator %s", val.GetOperator()) + } + + // set one of the validators commission rate to 10% and ensure it is not updated + updateValCommission := sdk.NewDecWithPrec(10, 2) + updateVal := stakingKeeper.GetAllValidators(ctx)[0] + updateVal.Commission.CommissionRates.Rate = updateValCommission + stakingKeeper.SetValidator(ctx, updateVal) + + v15.V15UpgradeHandler(ctx, &gaiaApp.AppKeepers) + for _, val := range stakingKeeper.GetAllValidators(ctx) { + if updateVal.OperatorAddress == val.OperatorAddress { + require.Equal(t, val.Commission.CommissionRates.Rate, updateValCommission, "should not update commission rate for validator %s", val.GetOperator()) + } else { + require.Equal(t, val.Commission.CommissionRates.Rate, newStakingParams.MinCommissionRate, "failed to update update commission rate for validator %s", val.GetOperator()) + } + } +} From ed08c80217f06504398038daeb0362816cb49dc8 Mon Sep 17 00:00:00 2001 From: MSalopek Date: Fri, 15 Dec 2023 14:55:30 +0100 Subject: [PATCH 19/43] chore: rm 3rd party --- .../proto/cosmos/staking/v1beta1/query.proto | 348 ------------------ 1 file changed, 348 deletions(-) delete mode 100644 third_party/proto/cosmos/staking/v1beta1/query.proto diff --git a/third_party/proto/cosmos/staking/v1beta1/query.proto b/third_party/proto/cosmos/staking/v1beta1/query.proto deleted file mode 100644 index 01b88cbb06..0000000000 --- a/third_party/proto/cosmos/staking/v1beta1/query.proto +++ /dev/null @@ -1,348 +0,0 @@ -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]; -} From 304e98258a88de66a690d51201e78111e897166b Mon Sep 17 00:00:00 2001 From: MSalopek Date: Mon, 18 Dec 2023 14:34:18 +0100 Subject: [PATCH 20/43] migration: change MaxRate to match 0.05 if not provided --- app/upgrades/v15/upgrades.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/upgrades/v15/upgrades.go b/app/upgrades/v15/upgrades.go index bd5b8d7d0a..caa71c2a45 100644 --- a/app/upgrades/v15/upgrades.go +++ b/app/upgrades/v15/upgrades.go @@ -39,10 +39,14 @@ func V15UpgradeHandler(ctx sdk.Context, keepers *keepers.AppKeepers) { for _, val := range keepers.StakingKeeper.GetAllValidators(ctx) { val := val - // update validator commission rate if it is less than 5% if val.Commission.CommissionRates.Rate.LT(sdk.NewDecWithPrec(5, 2)) { - val.Commission.UpdateTime = ctx.BlockHeader().Time + // set the commmision rate to 5% val.Commission.CommissionRates.Rate = sdk.NewDecWithPrec(5, 2) + // set the max rate to 5% if it is less than 5% + if val.Commission.CommissionRates.MaxRate.LT(sdk.NewDecWithPrec(5, 2)) { + val.Commission.CommissionRates.MaxRate = sdk.NewDecWithPrec(5, 2) + } + val.Commission.UpdateTime = ctx.BlockHeader().Time keepers.StakingKeeper.SetValidator(ctx, val) } } From 89c5afe7de36a3cda339378d78b81e7d8a97dfa5 Mon Sep 17 00:00:00 2001 From: MSalopek Date: Mon, 18 Dec 2023 14:38:55 +0100 Subject: [PATCH 21/43] nit: add back removed lines from historic v7 migration --- app/upgrades/v7/constants.go | 6 ++++-- app/upgrades/v7/upgrades.go | 4 ---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/upgrades/v7/constants.go b/app/upgrades/v7/constants.go index 803800da45..539fb26e21 100644 --- a/app/upgrades/v7/constants.go +++ b/app/upgrades/v7/constants.go @@ -6,8 +6,6 @@ import ( store "github.com/cosmos/cosmos-sdk/store/types" icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" - store "github.com/cosmos/cosmos-sdk/store/types" - "github.com/cosmos/gaia/v15/app/upgrades" ) @@ -38,6 +36,10 @@ const ( stakingMsgCreateValidator = "/cosmos.staking.v1beta1.MsgCreateValidator" vestingMsgCreateVestingAccount = "/cosmos.vesting.v1beta1.MsgCreateVestingAccount" ibcMsgTransfer = "/ibc.applications.transfer.v1.MsgTransfer" + liquidityMsgSwapWithinBatch = "/tendermint.liquidity.v1beta1.MsgSwapWithinBatch" //#nosec G101 -- This is a false positive + liquidityMsgCreatePool = "/tendermint.liquidity.v1beta1.MsgCreatePool" + liquidityMsgDepositWithinBatch = "/tendermint.liquidity.v1beta1.MsgDepositWithinBatch" + liquidityMsgWithdrawWithinBatch = "/tendermint.liquidity.v1beta1.MsgWithdrawWithinBatch" ) var Upgrade = upgrades.Upgrade{ diff --git a/app/upgrades/v7/upgrades.go b/app/upgrades/v7/upgrades.go index f3d86567ca..161c580963 100644 --- a/app/upgrades/v7/upgrades.go +++ b/app/upgrades/v7/upgrades.go @@ -11,10 +11,6 @@ import ( icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - "github.com/cosmos/gaia/v15/app/keepers" ) From f9e494fb760f9fa941c06918a11bc526b1a7f1ce Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Fri, 5 Jan 2024 11:16:27 +0100 Subject: [PATCH 22/43] save --- app/upgrades/v15/upgrades.go | 33 ++++++++++++++++ app/upgrades/v15/upgrades_test.go | 62 ++++++++++++++++++++++++++++++- 2 files changed, 94 insertions(+), 1 deletion(-) diff --git a/app/upgrades/v15/upgrades.go b/app/upgrades/v15/upgrades.go index caa71c2a45..3cbf07923f 100644 --- a/app/upgrades/v15/upgrades.go +++ b/app/upgrades/v15/upgrades.go @@ -3,6 +3,9 @@ package v15 import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" + "github.com/cosmos/cosmos-sdk/x/slashing/types" + slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" "github.com/cosmos/gaia/v15/app/keepers" @@ -32,6 +35,9 @@ func CreateUpgradeHandler( // V15UpgradeHandler sets the minimum commission rate staking parameter to 5% // and updates the commission rate for all validators that have a commission rate less than 5% +// +// TODO: rename func name +// refactor in multiple function func V15UpgradeHandler(ctx sdk.Context, keepers *keepers.AppKeepers) { params := keepers.StakingKeeper.GetParams(ctx) params.MinCommissionRate = sdk.NewDecWithPrec(5, 2) @@ -50,4 +56,31 @@ func V15UpgradeHandler(ctx sdk.Context, keepers *keepers.AppKeepers) { keepers.StakingKeeper.SetValidator(ctx, val) } } + + // TODO: call ValidatorSigningInfosFix +} + +// UpgradeValidatorSigningInfos upgrades the validators signing infos for which the consensus address +// is missing using their store key, which contains the consensus address of the validator +// TODO: add more context +// , see https://github.com/cosmos/gaia/issues/1734. +func ValidatorSigningInfosFix(ctx sdk.Context, sk slashingkeeper.Keeper) { + signingInfos := []slashingtypes.ValidatorSigningInfo{} + + sk.IterateValidatorSigningInfos(ctx, func(address sdk.ConsAddress, info types.ValidatorSigningInfo) (stop bool) { + if info.Address == "" { + info.Address = address.String() + signingInfos = append(signingInfos, info) + } + + return false + }) + + for _, si := range signingInfos { + addr, err := sdk.ConsAddressFromBech32(si.Address) + if err != nil { + panic(err) + } + sk.SetValidatorSigningInfo(ctx, addr, si) + } } diff --git a/app/upgrades/v15/upgrades_test.go b/app/upgrades/v15/upgrades_test.go index 1d0ba865db..362d95d473 100644 --- a/app/upgrades/v15/upgrades_test.go +++ b/app/upgrades/v15/upgrades_test.go @@ -2,12 +2,18 @@ package v15_test import ( "testing" + "time" + + "github.com/cosmos/cosmos-sdk/testutil/mock" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/slashing/types" + slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + "github.com/stretchr/testify/require" + "github.com/cosmos/gaia/v15/app/helpers" v15 "github.com/cosmos/gaia/v15/app/upgrades/v15" - "github.com/stretchr/testify/require" ) type EmptyAppOptions struct{} @@ -61,3 +67,57 @@ func TestV15UpgradeHandler(t *testing.T) { } } } + +func TestValidatorSigningInfosFix(t *testing.T) { + gaiaApp := helpers.Setup(t) + ctx := gaiaApp.NewUncachedContext(true, tmproto.Header{}) + slashingKeeper := gaiaApp.SlashingKeeper + + signingInfosNum := 8 + emptyAddrCtr := 0 + + // create some dummy signing infos, half of which with an empty address field + for i := 0; i < signingInfosNum; i++ { + pubKey, err := mock.NewPV().GetPubKey() + require.NoError(t, err) + + consAddr := sdk.ConsAddress(pubKey.Address()) + info := slashingtypes.NewValidatorSigningInfo( + consAddr, + 0, + 0, + time.Unix(0, 0), + false, + 0, + ) + + if i <= signingInfosNum/2 { + info.Address = "" + emptyAddrCtr++ + } + + slashingKeeper.SetValidatorSigningInfo(ctx, consAddr, info) + require.NoError(t, err) + } + + // check signing info were correctly created + slashingKeeper.IterateValidatorSigningInfos(ctx, func(address sdk.ConsAddress, info types.ValidatorSigningInfo) (stop bool) { + if info.Address == "" { + emptyAddrCtr-- + } + + return false + }) + require.Zero(t, emptyAddrCtr) + + // upgrade signing infos + v15.UpgradeValidatorSigningInfos(ctx, slashingKeeper) + + // check that all signing info have the address field correctly updated + slashingKeeper.IterateValidatorSigningInfos(ctx, func(address sdk.ConsAddress, info types.ValidatorSigningInfo) (stop bool) { + require.NotEmpty(t, info.Address) + require.Equal(t, address.String(), info.Address) + + return false + }) +} From e75e9b637ea38278d02fd520633478405c402866 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Tue, 9 Jan 2024 16:08:27 +0100 Subject: [PATCH 23/43] lint --- app/upgrades/v15/upgrades.go | 44 +++++++++++++++---------------- app/upgrades/v15/upgrades_test.go | 23 ++++++++-------- 2 files changed, 34 insertions(+), 33 deletions(-) diff --git a/app/upgrades/v15/upgrades.go b/app/upgrades/v15/upgrades.go index 3cbf07923f..0c164e50af 100644 --- a/app/upgrades/v15/upgrades.go +++ b/app/upgrades/v15/upgrades.go @@ -4,15 +4,17 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" - "github.com/cosmos/cosmos-sdk/x/slashing/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" "github.com/cosmos/gaia/v15/app/keepers" ) -// adhere to prop 826 which sets the minimum commission rate to 5% for all validators -// https://www.mintscan.io/cosmos/proposals/826 +// CreateUpgradeHandler returns the upgrade handler for Gaia v15 +// which executes the following migrations: +// * set the MinCommissionRate param of the staking module to %5 +// * update SigningInfos records with missing consensus address in the slashing module states func CreateUpgradeHandler( mm *module.Manager, configurator module.Configurator, @@ -26,24 +28,25 @@ func CreateUpgradeHandler( return vm, err } - V15UpgradeHandler(ctx, keepers) + MigrateMinCommissionRate(ctx, *keepers.StakingKeeper) + MigrateSigningInfos(ctx, keepers.SlashingKeeper) ctx.Logger().Info("Upgrade v15 complete") return vm, err } } -// V15UpgradeHandler sets the minimum commission rate staking parameter to 5% -// and updates the commission rate for all validators that have a commission rate less than 5% -// -// TODO: rename func name -// refactor in multiple function -func V15UpgradeHandler(ctx sdk.Context, keepers *keepers.AppKeepers) { - params := keepers.StakingKeeper.GetParams(ctx) +// MigrateMinCommissionRate adheres to prop 826 https://www.mintscan.io/cosmos/proposals/826 +// by setting the minimum commission rate staking parameter to 5% +// and updating the commission rate for all validators that have a commission rate less than 5% +func MigrateMinCommissionRate(ctx sdk.Context, sk stakingkeeper.Keeper) { + params := sk.GetParams(ctx) params.MinCommissionRate = sdk.NewDecWithPrec(5, 2) - keepers.StakingKeeper.SetParams(ctx, params) + if err := sk.SetParams(ctx, params); err != nil { + panic(err) + } - for _, val := range keepers.StakingKeeper.GetAllValidators(ctx) { + for _, val := range sk.GetAllValidators(ctx) { val := val if val.Commission.CommissionRates.Rate.LT(sdk.NewDecWithPrec(5, 2)) { // set the commmision rate to 5% @@ -53,21 +56,18 @@ func V15UpgradeHandler(ctx sdk.Context, keepers *keepers.AppKeepers) { val.Commission.CommissionRates.MaxRate = sdk.NewDecWithPrec(5, 2) } val.Commission.UpdateTime = ctx.BlockHeader().Time - keepers.StakingKeeper.SetValidator(ctx, val) + sk.SetValidator(ctx, val) } } - - // TODO: call ValidatorSigningInfosFix } -// UpgradeValidatorSigningInfos upgrades the validators signing infos for which the consensus address -// is missing using their store key, which contains the consensus address of the validator -// TODO: add more context -// , see https://github.com/cosmos/gaia/issues/1734. -func ValidatorSigningInfosFix(ctx sdk.Context, sk slashingkeeper.Keeper) { +// MigrateSigningInfos updates validators signing infos for which the consensus address +// is missing using their store key, which contains the consensus address of the validator, +// see https://github.com/cosmos/gaia/issues/1734. +func MigrateSigningInfos(ctx sdk.Context, sk slashingkeeper.Keeper) { signingInfos := []slashingtypes.ValidatorSigningInfo{} - sk.IterateValidatorSigningInfos(ctx, func(address sdk.ConsAddress, info types.ValidatorSigningInfo) (stop bool) { + sk.IterateValidatorSigningInfos(ctx, func(address sdk.ConsAddress, info slashingtypes.ValidatorSigningInfo) (stop bool) { if info.Address == "" { info.Address = address.String() signingInfos = append(signingInfos, info) diff --git a/app/upgrades/v15/upgrades_test.go b/app/upgrades/v15/upgrades_test.go index 362d95d473..618d93046e 100644 --- a/app/upgrades/v15/upgrades_test.go +++ b/app/upgrades/v15/upgrades_test.go @@ -4,13 +4,13 @@ import ( "testing" "time" - "github.com/cosmos/cosmos-sdk/testutil/mock" + "github.com/stretchr/testify/require" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + + "github.com/cosmos/cosmos-sdk/testutil/mock" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/slashing/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - "github.com/stretchr/testify/require" "github.com/cosmos/gaia/v15/app/helpers" v15 "github.com/cosmos/gaia/v15/app/upgrades/v15" @@ -22,14 +22,15 @@ func (ao EmptyAppOptions) Get(_ string) interface{} { return nil } -func TestV15UpgradeHandler(t *testing.T) { +func TestMigrateMinCommisionRate(t *testing.T) { gaiaApp := helpers.Setup(t) ctx := gaiaApp.NewUncachedContext(true, tmproto.Header{}) // set min commission rate to 0 stakingParams := gaiaApp.StakingKeeper.GetParams(ctx) stakingParams.MinCommissionRate = sdk.ZeroDec() - gaiaApp.StakingKeeper.SetParams(ctx, stakingParams) + err := gaiaApp.StakingKeeper.SetParams(ctx, stakingParams) + require.NoError(t, err) // confirm all commissions are 0 stakingKeeper := gaiaApp.StakingKeeper @@ -42,7 +43,7 @@ func TestV15UpgradeHandler(t *testing.T) { require.Equal(t, stakingKeeper.GetParams(ctx).MinCommissionRate, sdk.ZeroDec(), "non-zero previous min commission rate") // run the test and confirm the values have been updated - v15.V15UpgradeHandler(ctx, &gaiaApp.AppKeepers) + v15.MigrateMinCommissionRate(ctx, *gaiaApp.AppKeepers.StakingKeeper) newStakingParams := gaiaApp.StakingKeeper.GetParams(ctx) require.NotEqual(t, newStakingParams.MinCommissionRate, sdk.ZeroDec(), "failed to update min commission rate") @@ -58,7 +59,7 @@ func TestV15UpgradeHandler(t *testing.T) { updateVal.Commission.CommissionRates.Rate = updateValCommission stakingKeeper.SetValidator(ctx, updateVal) - v15.V15UpgradeHandler(ctx, &gaiaApp.AppKeepers) + v15.MigrateMinCommissionRate(ctx, *gaiaApp.AppKeepers.StakingKeeper) for _, val := range stakingKeeper.GetAllValidators(ctx) { if updateVal.OperatorAddress == val.OperatorAddress { require.Equal(t, val.Commission.CommissionRates.Rate, updateValCommission, "should not update commission rate for validator %s", val.GetOperator()) @@ -68,7 +69,7 @@ func TestV15UpgradeHandler(t *testing.T) { } } -func TestValidatorSigningInfosFix(t *testing.T) { +func TestMigrateValidatorsSigningInfos(t *testing.T) { gaiaApp := helpers.Setup(t) ctx := gaiaApp.NewUncachedContext(true, tmproto.Header{}) slashingKeeper := gaiaApp.SlashingKeeper @@ -101,7 +102,7 @@ func TestValidatorSigningInfosFix(t *testing.T) { } // check signing info were correctly created - slashingKeeper.IterateValidatorSigningInfos(ctx, func(address sdk.ConsAddress, info types.ValidatorSigningInfo) (stop bool) { + slashingKeeper.IterateValidatorSigningInfos(ctx, func(address sdk.ConsAddress, info slashingtypes.ValidatorSigningInfo) (stop bool) { if info.Address == "" { emptyAddrCtr-- } @@ -111,10 +112,10 @@ func TestValidatorSigningInfosFix(t *testing.T) { require.Zero(t, emptyAddrCtr) // upgrade signing infos - v15.UpgradeValidatorSigningInfos(ctx, slashingKeeper) + v15.MigrateSigningInfos(ctx, slashingKeeper) // check that all signing info have the address field correctly updated - slashingKeeper.IterateValidatorSigningInfos(ctx, func(address sdk.ConsAddress, info types.ValidatorSigningInfo) (stop bool) { + slashingKeeper.IterateValidatorSigningInfos(ctx, func(address sdk.ConsAddress, info slashingtypes.ValidatorSigningInfo) (stop bool) { require.NotEmpty(t, info.Address) require.Equal(t, address.String(), info.Address) From 4a30eeec30ec09006a59d0c29fb100935d0d034a Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Wed, 10 Jan 2024 11:04:48 +0100 Subject: [PATCH 24/43] nit --- app/upgrades/v15/upgrades.go | 4 ++-- app/upgrades/v15/upgrades_test.go | 8 +------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/app/upgrades/v15/upgrades.go b/app/upgrades/v15/upgrades.go index 0c164e50af..e101512770 100644 --- a/app/upgrades/v15/upgrades.go +++ b/app/upgrades/v15/upgrades.go @@ -11,10 +11,10 @@ import ( "github.com/cosmos/gaia/v15/app/keepers" ) -// CreateUpgradeHandler returns the upgrade handler for Gaia v15 +// CreateUpgradeHandler returns a upgrade handler for Gaia v15 // which executes the following migrations: // * set the MinCommissionRate param of the staking module to %5 -// * update SigningInfos records with missing consensus address in the slashing module states +// * update the slashing module SigningInfos records with empty consensus address func CreateUpgradeHandler( mm *module.Manager, configurator module.Configurator, diff --git a/app/upgrades/v15/upgrades_test.go b/app/upgrades/v15/upgrades_test.go index 618d93046e..f48979d18a 100644 --- a/app/upgrades/v15/upgrades_test.go +++ b/app/upgrades/v15/upgrades_test.go @@ -16,13 +16,7 @@ import ( v15 "github.com/cosmos/gaia/v15/app/upgrades/v15" ) -type EmptyAppOptions struct{} - -func (ao EmptyAppOptions) Get(_ string) interface{} { - return nil -} - -func TestMigrateMinCommisionRate(t *testing.T) { +func TestMigrateMinCommissionRate(t *testing.T) { gaiaApp := helpers.Setup(t) ctx := gaiaApp.NewUncachedContext(true, tmproto.Header{}) From d17159438483345e721926e7f6fc9135863ef0af Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Fri, 12 Jan 2024 09:28:20 +0100 Subject: [PATCH 25/43] draft version --- app/upgrades/v15/upgrades_test.go | 344 +++++++++++++++++++++++++++++- 1 file changed, 342 insertions(+), 2 deletions(-) diff --git a/app/upgrades/v15/upgrades_test.go b/app/upgrades/v15/upgrades_test.go index f48979d18a..66b8b7cdc9 100644 --- a/app/upgrades/v15/upgrades_test.go +++ b/app/upgrades/v15/upgrades_test.go @@ -1,16 +1,31 @@ package v15_test import ( + "fmt" "testing" "time" - "github.com/stretchr/testify/require" + "github.com/cosmos/cosmos-sdk/store/prefix" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + "cosmossdk.io/math" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - + tmtime "github.com/cometbft/cometbft/types/time" "github.com/cosmos/cosmos-sdk/testutil/mock" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/address" + accountkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + vesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + banktestutil "github.com/cosmos/cosmos-sdk/x/bank/testutil" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + distributionkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" + distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + "github.com/cosmos/cosmos-sdk/x/staking/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/stretchr/testify/require" "github.com/cosmos/gaia/v15/app/helpers" v15 "github.com/cosmos/gaia/v15/app/upgrades/v15" @@ -116,3 +131,328 @@ func TestMigrateValidatorsSigningInfos(t *testing.T) { return false }) } + +// undelegations successful - validators have less voting power +// vesting account updated - still vesting tokens are gone +// community pool updated - still vesting tokens are added +// the vesting account still has the already vested tokens +func TestMigrateUnvestedFunds(t *testing.T) { + gaiaApp := helpers.Setup(t) + + now := tmtime.Now() + endTime := now.Add(24 * time.Hour) + + ctx := gaiaApp.NewUncachedContext(true, tmproto.Header{}) + ctx = ctx.WithBlockHeader(tmproto.Header{Time: now}) + + bankKeeper := gaiaApp.BankKeeper + accountKeeper := gaiaApp.AccountKeeper + distrKeeper := gaiaApp.DistrKeeper + stakingKeeper := gaiaApp.StakingKeeper + + validators := stakingKeeper.GetAllValidators(ctx) + validator := validators[0] + + // original vesting coin amount + origCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 100)) + + // create a continuous vesting account + addr := sdk.AccAddress([]byte("addr1_______________")) + require.Error(t, bankKeeper.ValidateBalance(ctx, addr)) + + bacc := authtypes.NewBaseAccountWithAddress(addr) + vacc := vesting.NewContinuousVestingAccount(bacc, origCoins, ctx.BlockHeader().Time.Unix(), endTime.Unix()) + + accountKeeper.SetAccount(ctx, vacc) + vestingCoins := vacc.GetVestingCoins(ctx.BlockTime()) + + require.True(t, vestingCoins.IsEqual(origCoins)) + require.Empty(t, bankKeeper.GetAllBalances(ctx, addr)) + + // fund vesting account + require.NoError(t, banktestutil.FundAccount(bankKeeper, ctx, addr, origCoins)) + require.True(t, origCoins.IsEqual(bankKeeper.GetAllBalances(ctx, addr))) + // err := distrKeeper.FundCommunityPool(ctx, balances, vacc.GetAddress()) + // require.Error(t, err) + + initBal := bankKeeper.GetAllBalances(ctx, vacc.GetAddress()) + require.True(t, initBal.IsEqual(origCoins)) + + oldVP := validator.GetConsensusPower(validator.BondedTokens()) + fmt.Println("oldVp:", oldVP) + oldValTokens := validator.Tokens + + fmt.Println("last power", stakingKeeper.GetLastTotalPower(ctx)) + fmt.Println("0", validator.String()) + + // delegate vested and still vesting tokens + _, err := stakingKeeper.Delegate(ctx, vacc.GetAddress(), origCoins.AmountOf("stake"), stakingtypes.Unbonded, validator, true) + require.NoError(t, err) + + validator = stakingKeeper.GetAllValidators(ctx)[0] + + require.True(t, validator.Tokens.Equal(oldValTokens.Add(origCoins.AmountOf("stake")))) + + consAddr, err := validator.GetConsAddr() + require.NoError(t, err) + + validatorUpdated, found := stakingKeeper.GetValidatorByConsAddr(ctx, consAddr) + require.True(t, found) + fmt.Println("1", validatorUpdated.String()) + + validator = stakingKeeper.GetAllValidators(ctx)[0] + + fmt.Println("2", validator.String()) + + fmt.Println("last power", stakingKeeper.GetLastTotalPower(ctx)) + + del, found := stakingKeeper.GetDelegation(ctx, addr, validator.GetOperator()) + require.True(t, found) + require.Equal(t, validator.TokensFromShares(del.Shares), math.LegacyNewDec(origCoins.AmountOf("stake").Int64())) + + acc := accountKeeper.GetAccount(ctx, addr) + vaccupdated, ok := acc.(banktypes.VestingAccount) + require.True(t, ok) + require.Equal(t, vaccupdated.GetDelegatedVesting(), origCoins) + require.Empty(t, vaccupdated.GetDelegatedFree()) + + // vest half of the tokens + ctx = ctx.WithBlockTime(now.Add(12 * time.Hour)) + + vestingCoinsUpdated := vacc.GetVestingCoins(ctx.BlockTime()) + vestedCoins := vacc.GetVestedCoins(ctx.BlockTime()) + require.True(t, vestingCoinsUpdated.IsEqual(origCoins.QuoInt(math.NewInt(2)))) + require.True(t, vestedCoins.IsEqual(origCoins.QuoInt(math.NewInt(2)))) + + // remove delegations + + returnAmount, err := stakingKeeper.Unbond(ctx, addr, validator.GetOperator(), del.Shares) + require.NoError(t, err) + + nb := bankKeeper.GetAllBalances(ctx, accountKeeper.GetModuleAddress(types.BondedPoolName)) + fmt.Println(" bonded balances", nb.String()) + + // transfer the validator tokens to the not bonded pool + // doing stakingKeeper.bondedTokensToNotBonded + if validator.IsBonded() { + fmt.Println("bonded") + fmt.Println("returnAmount", returnAmount.String()) + coins := sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), returnAmount)) + err = bankKeeper.SendCoinsFromModuleToModule(ctx, types.BondedPoolName, types.NotBondedPoolName, coins) + require.NoError(t, err) + } + + nb = bankKeeper.GetAllBalances(ctx, accountKeeper.GetModuleAddress(types.BondedPoolName)) + fmt.Println(" bonded balances", nb.String()) + + nbp := bankKeeper.GetAllBalances(ctx, accountKeeper.GetModuleAddress(types.NotBondedPoolName)) + fmt.Println("not bonded balances", nbp.String()) + + bondDenom := "stake" // k.GetParams(ctx).BondDenom + amt := sdk.NewCoin(bondDenom, returnAmount) + err = bankKeeper.UndelegateCoinsFromModuleToAccount(ctx, types.NotBondedPoolName, addr, sdk.NewCoins(amt)) + require.NoError(t, err) + + require.True(t, origCoins.IsEqual(bankKeeper.GetAllBalances(ctx, addr))) + + acc = accountKeeper.GetAccount(ctx, addr) + vaccupdated, ok = acc.(banktypes.VestingAccount) + require.True(t, ok) + require.Empty(t, vaccupdated.GetDelegatedVesting()) + require.Empty(t, vaccupdated.GetDelegatedFree()) + + require.Empty(t, distrKeeper.GetFeePoolCommunityCoins(ctx)) + + kvs := gaiaApp.GetKVStoreKey() + + vestingAmt := sdk.NewCoin(amt.Denom, amt.Amount.Quo(math.NewInt(2))) + + FundCommunityPool( + accountKeeper, + distrKeeper, + bankKeeper, + ctx, + sdk.NewCoins(vestingAmt), + addr, + kvs[banktypes.StoreKey], + ) + + // err = bankKeeper.UndelegateCoinsFromModuleToAccount( + // ctx, types.NotBondedPoolName, addr, sdk.NewCoins(amt)) + // require.NoError(t, err) + + // remove + + //// send to community pool + // create fee pool + // distrKeeper.SetFeePool(ctx, types.InitialFeePool()) + + require.NotEmpty(t, distrKeeper.GetFeePoolCommunityCoins(ctx)) + require.True(t, sdk.NewDecCoinsFromCoins(vestingAmt).IsEqual(distrKeeper.GetFeePoolCommunityCoins(ctx))) + + fmt.Println("community pool balances", distrKeeper.GetFeePoolCommunityCoins(ctx)) + fmt.Println("community pool balances 2", bankKeeper.GetAllBalances(ctx, accountKeeper.GetModuleAddress(distributiontypes.ModuleName))) + + fmt.Println("vesting account", bankKeeper.GetAllBalances(ctx, addr)) + + // require.NoError(t, bankKeeper.ValidateBalance(ctx, addr)) + // require.NoError(t, bankKeeper.ValidateBalance(ctx, accountKeeper.GetModuleAddress(distributiontypes.ModuleName))) + + vacc3 := accountKeeper.GetAccount(ctx, addr) + fmt.Println("vesting account 6", vacc3.(*vesting.ContinuousVestingAccount).GetVestingCoins(ctx.BlockTime())) + fmt.Println("vesting account 7 ", vacc3.(*vesting.ContinuousVestingAccount).GetVestedCoins(ctx.BlockTime())) + + vacc4 := vesting.NewContinuousVestingAccount(bacc, sdk.NewCoins(vestingAmt), vacc.StartTime, ctx.BlockTime().Unix()) + + accountKeeper.SetAccount(ctx, vacc4) + + fmt.Println("vesting account 8", vacc4.GetVestingCoins(ctx.BlockTime())) + fmt.Println("vesting account 9 ", vacc4.GetVestedCoins(ctx.BlockTime())) + + require.Equal(t, vacc3.GetAddress().String(), vacc4.Address) + + require.NoError(t, bankKeeper.ValidateBalance(ctx, addr)) + require.NoError(t, bankKeeper.ValidateBalance(ctx, accountKeeper.GetModuleAddress(distributiontypes.ModuleName))) + +} + +// FundCommunityPool allows an account to directly fund the community fund pool. +// The amount is first added to the distribution module account and then directly +// added to the pool. An error is returned if the amount cannot be sent to the +// module account. +func FundCommunityPool( + ak accountkeeper.AccountKeeper, + dk distributionkeeper.Keeper, + bk bankkeeper.Keeper, + ctx sdk.Context, + amount sdk.Coins, + sender sdk.AccAddress, + bs storetypes.StoreKey) error { + + // SendCoinsFromAccountToModule{ + recipientAcc := ak.GetModuleAccount(ctx, distributiontypes.ModuleName) + if recipientAcc == nil { + panic(fmt.Errorf("module account %s does not exist", distributiontypes.ModuleName)) + } + // SendCoins{ + //k.subUnlockedCoins{ + err := SubUnlockedCoins(bk, ctx, sender, amount, bs) + if err != nil { + panic(err) + } + + //}k.subUnlockedCoins + + err = AddCoins(bk, ctx, recipientAcc.GetAddress(), amount, bs) + if err != nil { + panic(err) + } + + // Create account if recipient does not exist. + // + // NOTE: This should ultimately be removed in favor a more flexible approach + // such as delegated fee messages. + accExists := ak.HasAccount(ctx, recipientAcc.GetAddress()) + if !accExists { + fmt.Println("feepool doesn't exist") + ak.SetAccount(ctx, ak.NewAccountWithAddress(ctx, recipientAcc.GetAddress())) + } + // }SendCoins + + //} SendCoinsFromAccountToModule + + feePool := dk.GetFeePool(ctx) + feePool.CommunityPool = feePool.CommunityPool.Add(sdk.NewDecCoinsFromCoins(amount...)...) + dk.SetFeePool(ctx, feePool) + + return nil +} + +func AddCoins(bk bankkeeper.Keeper, ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins, bs storetypes.StoreKey) error { + if !amt.IsValid() { + return fmt.Errorf("invalid coins") //sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, amt.String()) + } + + for _, coin := range amt { + balance := bk.GetBalance(ctx, addr, coin.Denom) + newBalance := balance.Add(coin) + + err := SetBalance(bk, ctx, addr, newBalance, bs) + if err != nil { + return err + } + } + return nil +} + +// setBalance sets the coin balance for an account by address. +func SetBalance(bk bankkeeper.Keeper, ctx sdk.Context, addr sdk.AccAddress, balance sdk.Coin, bs storetypes.StoreKey) error { + if !balance.IsValid() { + return fmt.Errorf(balance.String()) + } + + // accountStore := k.getAccountStore(ctx, addr) + store := ctx.KVStore(bs) + accountStore := prefix.NewStore(store, banktypes.CreateAccountBalancesPrefix(addr)) + + // denomPrefixStore := k.getDenomAddressPrefixStore(ctx, balance.Denom) + denomPrefixStore := prefix.NewStore(store, banktypes.CreateDenomAddressPrefix(balance.Denom)) + + // x/bank invariants prohibit persistence of zero balances + if balance.IsZero() { + accountStore.Delete([]byte(balance.Denom)) + denomPrefixStore.Delete(address.MustLengthPrefix(addr)) + } else { + amount, err := balance.Amount.Marshal() + if err != nil { + return err + } + + accountStore.Set([]byte(balance.Denom), amount) + + // Store a reverse index from denomination to account address with a + // sentinel value. + denomAddrKey := address.MustLengthPrefix(addr) + if !denomPrefixStore.Has(denomAddrKey) { + denomPrefixStore.Set(denomAddrKey, []byte{0}) + } + } + + return nil +} + +// subUnlockedCoins removes the unlocked amt coins of the given account. An error is +// returned if the resulting balance is negative or the initial amount is invalid. +// A coin_spent event is emitted after. +func SubUnlockedCoins(bk bankkeeper.Keeper, ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins, bs storetypes.StoreKey) error { + if !amt.IsValid() { + return fmt.Errorf("amount isn't valid") + } + + lockedCoins := sdk.Coins{} + + for _, coin := range amt { + balance := bk.GetBalance(ctx, addr, coin.Denom) + locked := sdk.NewCoin(coin.Denom, lockedCoins.AmountOf(coin.Denom)) + + spendable, hasNeg := sdk.Coins{balance}.SafeSub(locked) + if hasNeg { + return fmt.Errorf( + "locked amount exceeds account balance funds: %s > %s", locked, balance) + } + + if _, hasNeg := spendable.SafeSub(coin); hasNeg { + return fmt.Errorf("spendable balance %s is smaller than %s", + spendable, coin, + ) + } + + newBalance := balance.Sub(coin) + + if err := SetBalance(bk, ctx, addr, newBalance, bs); err != nil { + return err + } + } + + return nil +} From 846fd80f53e583f6cc52f09c6516e4d81a4b3ffd Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Fri, 12 Jan 2024 14:33:10 +0100 Subject: [PATCH 26/43] wip - refactor --- app/upgrades/v15/upgrades.go | 247 ++++++++++++++++++++++++++++++ app/upgrades/v15/upgrades_test.go | 152 ++++++++---------- 2 files changed, 310 insertions(+), 89 deletions(-) diff --git a/app/upgrades/v15/upgrades.go b/app/upgrades/v15/upgrades.go index e101512770..e7e2f186c6 100644 --- a/app/upgrades/v15/upgrades.go +++ b/app/upgrades/v15/upgrades.go @@ -1,13 +1,28 @@ package v15 import ( + "fmt" + + "github.com/cosmos/cosmos-sdk/store/prefix" + + storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/address" "github.com/cosmos/cosmos-sdk/types/module" + accountkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + vesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + "github.com/cosmos/cosmos-sdk/x/staking/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + distributionkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" + "github.com/cosmos/gaia/v15/app/keepers" ) @@ -30,6 +45,7 @@ func CreateUpgradeHandler( MigrateMinCommissionRate(ctx, *keepers.StakingKeeper) MigrateSigningInfos(ctx, keepers.SlashingKeeper) + MigrateVestingAccount(ctx, sdk.AccAddress{}, keepers) ctx.Logger().Info("Upgrade v15 complete") return vm, err @@ -84,3 +100,234 @@ func MigrateSigningInfos(ctx sdk.Context, sk slashingkeeper.Keeper) { sk.SetValidatorSigningInfo(ctx, addr, si) } } + +func MigrateVestingAccount(ctx sdk.Context, address sdk.AccAddress, keepers *keepers.AppKeepers) { + ak := keepers.AccountKeeper + bk := keepers.BankKeeper + dk := keepers.DistrKeeper + sk := *keepers.StakingKeeper + + // Unbond all delegations from vesting account + err := forceUnbondAllDelegations(sk, bk, ctx, address) + if err != nil { + panic(err) + } + + vacc, ok := ak.GetAccount(ctx, address).(*vesting.ContinuousVestingAccount) + if !ok { + panic(fmt.Errorf("incorrect continuous vesting account")) + } + + // transfers still vesting tokens of BondDenom to community pool + _, vestingCoins := vacc.GetVestingCoins(ctx.BlockTime()).Find(sk.BondDenom(ctx)) + + // Unbond all delegations from vesting account + err = forceFundCommunityPool( + ak, + dk, + bk, + ctx, + vestingCoins, + address, + keepers.GetKey(banktypes.StoreKey), + ) + if err != nil { + panic(err) + } + + // update continuous vesting account in order + // to have all tokens vested + _, vestedCoins := vacc.GetVestedCoins(ctx.BlockTime()).Find(sk.BondDenom(ctx)) + err = updateContinuousVestingAccount( + ak, + ctx, + address, + sdk.NewCoins(vestedCoins), + ) + if err != nil { + panic(err) + } + + // validate vesting account + err = bk.ValidateBalance(ctx, address) + if err != nil { + panic(err) + } +} + +// Unbond vesting account delegations +func forceUnbondAllDelegations( + sk stakingkeeper.Keeper, + bk bankkeeper.Keeper, + ctx sdk.Context, + delegator sdk.AccAddress, +) error { + + dels := sk.GetDelegatorDelegations(ctx, delegator, 100) + + for _, del := range dels { + valAddr := del.GetValidatorAddr() + + validator, found := sk.GetValidator(ctx, valAddr) + if !found { + return fmt.Errorf("unknown validator") + } + + returnAmount, err := sk.Unbond(ctx, delegator, valAddr, del.GetShares()) + if err != nil { + return err + } + + // transfer the validator tokens to the not bonded pool + // doing stakingKeeper.bondedTokensToNotBonded + if validator.IsBonded() { + coins := sdk.NewCoins(sdk.NewCoin(sk.BondDenom(ctx), returnAmount)) + err = bk.SendCoinsFromModuleToModule(ctx, types.BondedPoolName, types.NotBondedPoolName, coins) + if err != nil { + return err + } + } + + bondDenom := sk.GetParams(ctx).BondDenom + amt := sdk.NewCoin(bondDenom, returnAmount) + + // call TrackDelegation() to update vesting account delegations + err = bk.UndelegateCoinsFromModuleToAccount(ctx, types.NotBondedPoolName, delegator, sdk.NewCoins(amt)) + if err != nil { + return err + } + } + + return nil +} + +// CONTRACT: coin are in the bond denom +// Community pool / distribution module account already exists +func forceFundCommunityPool( + ak accountkeeper.AccountKeeper, + dk distributionkeeper.Keeper, + bk bankkeeper.Keeper, + ctx sdk.Context, + amount sdk.Coin, + sender sdk.AccAddress, + bs storetypes.StoreKey, +) error { + // SendCoinsFromAccountToModule{ + recipientAcc := ak.GetModuleAccount(ctx, distributiontypes.ModuleName) + if recipientAcc == nil { + panic(fmt.Errorf("module account %s does not exist", distributiontypes.ModuleName)) + } + // SendCoins{ + //k.subUnlockedCoins{ + senderBal := bk.GetBalance(ctx, sender, amount.Denom) + if _, hasNeg := sdk.NewCoins(senderBal).SafeSub(amount); hasNeg { + return fmt.Errorf("spendable balance %s is smaller than %s", + senderBal, amount, + ) + } + if err := setBalance(bk, ctx, sender, senderBal.Sub(amount), bs); err != nil { + return err + } + //}k.subUnlockedCoins + recipientBal := bk.GetBalance(ctx, recipientAcc.GetAddress(), amount.Denom) + if err := setBalance(bk, ctx, recipientAcc.GetAddress(), recipientBal.Add(amount), bs); err != nil { + return err + } + + // Create account if recipient does not exist. + // + // NOTE: This should ultimately be removed in favor a more flexible approach + // such as delegated fee messages. + accExists := ak.HasAccount(ctx, recipientAcc.GetAddress()) + if !accExists { + ak.SetAccount(ctx, ak.NewAccountWithAddress(ctx, recipientAcc.GetAddress())) + } + // }SendCoins + //} SendCoinsFromAccountToModule + + feePool := dk.GetFeePool(ctx) + feePool.CommunityPool = feePool.CommunityPool.Add(sdk.NewDecCoinsFromCoins(amount)...) + dk.SetFeePool(ctx, feePool) + + return nil +} + +// Update vesting account +func updateContinuousVestingAccount( + ak accountkeeper.AccountKeeper, + ctx sdk.Context, + addr sdk.AccAddress, + OrigCoins sdk.Coins, +) error { + acc := ak.GetAccount(ctx, addr) + vacc, ok := acc.(*vesting.ContinuousVestingAccount) + if !ok { + return fmt.Errorf("inccorect a continuous vesting account") + } + bacc := &authtypes.BaseAccount{ + Address: acc.GetAddress().String(), + AccountNumber: acc.GetAccountNumber(), + Sequence: acc.GetSequence(), + } + + err := bacc.SetPubKey(acc.GetPubKey()) + if err != nil { + return err + } + + newVacc := vesting.NewContinuousVestingAccount(bacc, OrigCoins, vacc.StartTime, ctx.BlockTime().Unix()) + ak.SetAccount(ctx, newVacc) + + return nil +} + +// setBalance sets the coin balance for an account by address. +func setBalance( + bk bankkeeper.Keeper, + ctx sdk.Context, + addr sdk.AccAddress, + balance sdk.Coin, + bs storetypes.StoreKey, +) error { + if !balance.IsValid() { + return fmt.Errorf(balance.String()) + } + + // accountStore := k.getAccountStore(ctx, addr) + store := ctx.KVStore(bs) + accountStore := prefix.NewStore(store, banktypes.CreateAccountBalancesPrefix(addr)) + + // denomPrefixStore := k.getDenomAddressPrefixStore(ctx, balance.Denom) + denomPrefixStore := prefix.NewStore(store, banktypes.CreateDenomAddressPrefix(balance.Denom)) + + // x/bank invariants prohibit persistence of zero balances + if balance.IsZero() { + accountStore.Delete([]byte(balance.Denom)) + denomPrefixStore.Delete(address.MustLengthPrefix(addr)) + } else { + amount, err := balance.Amount.Marshal() + if err != nil { + return err + } + + accountStore.Set([]byte(balance.Denom), amount) + + // Store a reverse index from denomination to account address with a + // sentinel value. + denomAddrKey := address.MustLengthPrefix(addr) + if !denomPrefixStore.Has(denomAddrKey) { + denomPrefixStore.Set(denomAddrKey, []byte{0}) + } + } + + return nil +} + +func getContinuousVestingAccount(ak accountkeeper.AccountKeeper, ctx sdk.Context, addr sdk.AccAddress) *vesting.ContinuousVestingAccount { + acc := ak.GetAccount(ctx, addr) + vacc, ok := acc.(*vesting.ContinuousVestingAccount) + if !ok { + panic(fmt.Errorf("incorrect continuous vesting account")) + } + return vacc +} diff --git a/app/upgrades/v15/upgrades_test.go b/app/upgrades/v15/upgrades_test.go index 66b8b7cdc9..87593efad1 100644 --- a/app/upgrades/v15/upgrades_test.go +++ b/app/upgrades/v15/upgrades_test.go @@ -23,7 +23,6 @@ import ( distributionkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - "github.com/cosmos/cosmos-sdk/x/staking/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/stretchr/testify/require" @@ -153,8 +152,10 @@ func TestMigrateUnvestedFunds(t *testing.T) { validators := stakingKeeper.GetAllValidators(ctx) validator := validators[0] + bondDenom := stakingKeeper.GetParams(ctx).BondDenom + // original vesting coin amount - origCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 100)) + origCoins := sdk.NewCoins(sdk.NewInt64Coin(bondDenom, 100)) // create a continuous vesting account addr := sdk.AccAddress([]byte("addr1_______________")) @@ -172,43 +173,23 @@ func TestMigrateUnvestedFunds(t *testing.T) { // fund vesting account require.NoError(t, banktestutil.FundAccount(bankKeeper, ctx, addr, origCoins)) require.True(t, origCoins.IsEqual(bankKeeper.GetAllBalances(ctx, addr))) - // err := distrKeeper.FundCommunityPool(ctx, balances, vacc.GetAddress()) - // require.Error(t, err) initBal := bankKeeper.GetAllBalances(ctx, vacc.GetAddress()) require.True(t, initBal.IsEqual(origCoins)) - oldVP := validator.GetConsensusPower(validator.BondedTokens()) - fmt.Println("oldVp:", oldVP) oldValTokens := validator.Tokens - fmt.Println("last power", stakingKeeper.GetLastTotalPower(ctx)) - fmt.Println("0", validator.String()) - // delegate vested and still vesting tokens - _, err := stakingKeeper.Delegate(ctx, vacc.GetAddress(), origCoins.AmountOf("stake"), stakingtypes.Unbonded, validator, true) - require.NoError(t, err) - - validator = stakingKeeper.GetAllValidators(ctx)[0] - - require.True(t, validator.Tokens.Equal(oldValTokens.Add(origCoins.AmountOf("stake")))) - - consAddr, err := validator.GetConsAddr() + _, err := stakingKeeper.Delegate(ctx, vacc.GetAddress(), origCoins.AmountOf(bondDenom), stakingtypes.Unbonded, validator, true) require.NoError(t, err) - validatorUpdated, found := stakingKeeper.GetValidatorByConsAddr(ctx, consAddr) - require.True(t, found) - fmt.Println("1", validatorUpdated.String()) - validator = stakingKeeper.GetAllValidators(ctx)[0] - fmt.Println("2", validator.String()) - - fmt.Println("last power", stakingKeeper.GetLastTotalPower(ctx)) + require.True(t, validator.Tokens.Equal(oldValTokens.Add(origCoins.AmountOf(bondDenom)))) del, found := stakingKeeper.GetDelegation(ctx, addr, validator.GetOperator()) require.True(t, found) - require.Equal(t, validator.TokensFromShares(del.Shares), math.LegacyNewDec(origCoins.AmountOf("stake").Int64())) + require.Equal(t, validator.TokensFromShares(del.Shares), math.LegacyNewDec(origCoins.AmountOf(bondDenom).Int64())) acc := accountKeeper.GetAccount(ctx, addr) vaccupdated, ok := acc.(banktypes.VestingAccount) @@ -221,61 +202,74 @@ func TestMigrateUnvestedFunds(t *testing.T) { vestingCoinsUpdated := vacc.GetVestingCoins(ctx.BlockTime()) vestedCoins := vacc.GetVestedCoins(ctx.BlockTime()) + require.True(t, vestingCoinsUpdated.IsEqual(origCoins.QuoInt(math.NewInt(2)))) require.True(t, vestedCoins.IsEqual(origCoins.QuoInt(math.NewInt(2)))) - // remove delegations + v15.MigrateVestingAccount(ctx, addr, &gaiaApp.AppKeepers) - returnAmount, err := stakingKeeper.Unbond(ctx, addr, validator.GetOperator(), del.Shares) - require.NoError(t, err) + require.True(t, sdk.NewDecCoinsFromCoins(vestingCoinsUpdated...).IsEqual(distrKeeper.GetFeePoolCommunityCoins(ctx))) - nb := bankKeeper.GetAllBalances(ctx, accountKeeper.GetModuleAddress(types.BondedPoolName)) - fmt.Println(" bonded balances", nb.String()) + vaccUpdated := accountKeeper.GetAccount(ctx, addr).(*vesting.ContinuousVestingAccount) + vestedUpdated := vaccUpdated.GetVestedCoins(ctx.BlockTime()) + require.Empty(t, vaccUpdated.GetVestingCoins(ctx.BlockTime())) + require.True(t, vestedCoins.IsEqual(vestedUpdated)) + require.True(t, vaccUpdated.OriginalVesting.IsEqual(vestedUpdated)) - // transfer the validator tokens to the not bonded pool - // doing stakingKeeper.bondedTokensToNotBonded - if validator.IsBonded() { - fmt.Println("bonded") - fmt.Println("returnAmount", returnAmount.String()) - coins := sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), returnAmount)) - err = bankKeeper.SendCoinsFromModuleToModule(ctx, types.BondedPoolName, types.NotBondedPoolName, coins) - require.NoError(t, err) - } + // require.NoError(t, bankKeeper.ValidateBalance(ctx, addr)) + // require.NoError(t, bankKeeper.ValidateBalance(ctx, accountKeeper.GetModuleAddress(distributiontypes.ModuleName))) - nb = bankKeeper.GetAllBalances(ctx, accountKeeper.GetModuleAddress(types.BondedPoolName)) - fmt.Println(" bonded balances", nb.String()) + // remove delegations - nbp := bankKeeper.GetAllBalances(ctx, accountKeeper.GetModuleAddress(types.NotBondedPoolName)) - fmt.Println("not bonded balances", nbp.String()) + // returnAmount, err := stakingKeeper.Unbond(ctx, addr, validator.GetOperator(), del.Shares) + // require.NoError(t, err) - bondDenom := "stake" // k.GetParams(ctx).BondDenom - amt := sdk.NewCoin(bondDenom, returnAmount) - err = bankKeeper.UndelegateCoinsFromModuleToAccount(ctx, types.NotBondedPoolName, addr, sdk.NewCoins(amt)) - require.NoError(t, err) + // nb := bankKeeper.GetAllBalances(ctx, accountKeeper.GetModuleAddress(types.BondedPoolName)) + // fmt.Println(" bonded balances", nb.String()) - require.True(t, origCoins.IsEqual(bankKeeper.GetAllBalances(ctx, addr))) + // transfer the validator tokens to the not bonded pool + // doing stakingKeeper.bondedTokensToNotBonded + // if validator.IsBonded() { + // fmt.Println("bonded") + // fmt.Println("returnAmount", returnAmount.String()) + // coins := sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), returnAmount)) + // err = bankKeeper.SendCoinsFromModuleToModule(ctx, types.BondedPoolName, types.NotBondedPoolName, coins) + // require.NoError(t, err) + // } + + // nb = bankKeeper.GetAllBalances(ctx, accountKeeper.GetModuleAddress(types.BondedPoolName)) + // fmt.Println(" bonded balances", nb.String()) + + // nbp := bankKeeper.GetAllBalances(ctx, accountKeeper.GetModuleAddress(types.NotBondedPoolName)) + // fmt.Println("not bonded balances", nbp.String()) + + // amt := sdk.NewCoin(bondDenom, returnAmount) + // err = bankKeeper.UndelegateCoinsFromModuleToAccount(ctx, types.NotBondedPoolName, addr, sdk.NewCoins(amt)) + // require.NoError(t, err) - acc = accountKeeper.GetAccount(ctx, addr) - vaccupdated, ok = acc.(banktypes.VestingAccount) - require.True(t, ok) - require.Empty(t, vaccupdated.GetDelegatedVesting()) - require.Empty(t, vaccupdated.GetDelegatedFree()) + // require.True(t, origCoins.IsEqual(bankKeeper.GetAllBalances(ctx, addr))) + + // acc = accountKeeper.GetAccount(ctx, addr) + // vaccupdated, ok = acc.(banktypes.VestingAccount) + // require.True(t, ok) + // require.Empty(t, vaccupdated.GetDelegatedVesting()) + // require.Empty(t, vaccupdated.GetDelegatedFree()) - require.Empty(t, distrKeeper.GetFeePoolCommunityCoins(ctx)) + // require.Empty(t, distrKeeper.GetFeePoolCommunityCoins(ctx)) - kvs := gaiaApp.GetKVStoreKey() + // kvs := gaiaApp.GetKVStoreKey() - vestingAmt := sdk.NewCoin(amt.Denom, amt.Amount.Quo(math.NewInt(2))) + // vestingAmt := sdk.NewCoin(amt.Denom, amt.Amount.Quo(math.NewInt(2))) - FundCommunityPool( - accountKeeper, - distrKeeper, - bankKeeper, - ctx, - sdk.NewCoins(vestingAmt), - addr, - kvs[banktypes.StoreKey], - ) + // FundCommunityPool( + // accountKeeper, + // distrKeeper, + // bankKeeper, + // ctx, + // sdk.NewCoins(vestingAmt), + // addr, + // kvs[banktypes.StoreKey], + // ) // err = bankKeeper.UndelegateCoinsFromModuleToAccount( // ctx, types.NotBondedPoolName, addr, sdk.NewCoins(amt)) @@ -287,32 +281,12 @@ func TestMigrateUnvestedFunds(t *testing.T) { // create fee pool // distrKeeper.SetFeePool(ctx, types.InitialFeePool()) - require.NotEmpty(t, distrKeeper.GetFeePoolCommunityCoins(ctx)) - require.True(t, sdk.NewDecCoinsFromCoins(vestingAmt).IsEqual(distrKeeper.GetFeePoolCommunityCoins(ctx))) - - fmt.Println("community pool balances", distrKeeper.GetFeePoolCommunityCoins(ctx)) - fmt.Println("community pool balances 2", bankKeeper.GetAllBalances(ctx, accountKeeper.GetModuleAddress(distributiontypes.ModuleName))) - - fmt.Println("vesting account", bankKeeper.GetAllBalances(ctx, addr)) - - // require.NoError(t, bankKeeper.ValidateBalance(ctx, addr)) - // require.NoError(t, bankKeeper.ValidateBalance(ctx, accountKeeper.GetModuleAddress(distributiontypes.ModuleName))) - - vacc3 := accountKeeper.GetAccount(ctx, addr) - fmt.Println("vesting account 6", vacc3.(*vesting.ContinuousVestingAccount).GetVestingCoins(ctx.BlockTime())) - fmt.Println("vesting account 7 ", vacc3.(*vesting.ContinuousVestingAccount).GetVestedCoins(ctx.BlockTime())) - - vacc4 := vesting.NewContinuousVestingAccount(bacc, sdk.NewCoins(vestingAmt), vacc.StartTime, ctx.BlockTime().Unix()) - - accountKeeper.SetAccount(ctx, vacc4) - - fmt.Println("vesting account 8", vacc4.GetVestingCoins(ctx.BlockTime())) - fmt.Println("vesting account 9 ", vacc4.GetVestedCoins(ctx.BlockTime())) + // require.NotEmpty(t, distrKeeper.GetFeePoolCommunityCoins(ctx)) - require.Equal(t, vacc3.GetAddress().String(), vacc4.Address) + // fmt.Println("community pool balances", distrKeeper.GetFeePoolCommunityCoins(ctx)) + // fmt.Println("community pool balances 2", bankKeeper.GetAllBalances(ctx, accountKeeper.GetModuleAddress(distributiontypes.ModuleName))) - require.NoError(t, bankKeeper.ValidateBalance(ctx, addr)) - require.NoError(t, bankKeeper.ValidateBalance(ctx, accountKeeper.GetModuleAddress(distributiontypes.ModuleName))) + // fmt.Println("vesting account", bankKeeper.GetAllBalances(ctx, addr)) } From 24207528dce807793c6ad1eda6b0755fcdf2afd3 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Mon, 15 Jan 2024 16:10:54 +0100 Subject: [PATCH 27/43] refactor --- app/upgrades/v15/upgrades.go | 136 ++++-------- app/upgrades/v15/upgrades_test.go | 334 ++++++------------------------ 2 files changed, 109 insertions(+), 361 deletions(-) diff --git a/app/upgrades/v15/upgrades.go b/app/upgrades/v15/upgrades.go index e7e2f186c6..4dfa8f03cb 100644 --- a/app/upgrades/v15/upgrades.go +++ b/app/upgrades/v15/upgrades.go @@ -1,28 +1,25 @@ package v15 import ( - "fmt" - "github.com/cosmos/cosmos-sdk/store/prefix" - storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/module" accountkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" vesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + distributionkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - distributionkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" - "github.com/cosmos/gaia/v15/app/keepers" ) @@ -30,6 +27,7 @@ import ( // which executes the following migrations: // * set the MinCommissionRate param of the staking module to %5 // * update the slashing module SigningInfos records with empty consensus address +// * send the vesting tokens of a specific account to the community pool func CreateUpgradeHandler( mm *module.Manager, configurator module.Configurator, @@ -45,7 +43,7 @@ func CreateUpgradeHandler( MigrateMinCommissionRate(ctx, *keepers.StakingKeeper) MigrateSigningInfos(ctx, keepers.SlashingKeeper) - MigrateVestingAccount(ctx, sdk.AccAddress{}, keepers) + MigrateVestingAccount(ctx, sdk.MustAccAddressFromBech32("cosmos145hytrc49m0hn6fphp8d5h4xspwkawcuzmx498"), keepers) ctx.Logger().Info("Upgrade v15 complete") return vm, err @@ -107,21 +105,28 @@ func MigrateVestingAccount(ctx sdk.Context, address sdk.AccAddress, keepers *kee dk := keepers.DistrKeeper sk := *keepers.StakingKeeper - // Unbond all delegations from vesting account + // get target account + account := ak.GetAccount(ctx, address) + + // verify that it's a vesting account type + vestAccount, ok := account.(*vesting.ContinuousVestingAccount) + if !ok { + panic( + sdkerrors.Wrap( + sdkerrors.ErrInvalidType, + "account with address %s isn't a vesting account", + ), + ) + } + + // unbond all delegations from vesting account err := forceUnbondAllDelegations(sk, bk, ctx, address) if err != nil { panic(err) } - vacc, ok := ak.GetAccount(ctx, address).(*vesting.ContinuousVestingAccount) - if !ok { - panic(fmt.Errorf("incorrect continuous vesting account")) - } - // transfers still vesting tokens of BondDenom to community pool - _, vestingCoins := vacc.GetVestingCoins(ctx.BlockTime()).Find(sk.BondDenom(ctx)) - - // Unbond all delegations from vesting account + _, vestingCoins := vestAccount.GetVestingCoins(ctx.BlockTime()).Find(sk.BondDenom(ctx)) err = forceFundCommunityPool( ak, dk, @@ -135,34 +140,24 @@ func MigrateVestingAccount(ctx sdk.Context, address sdk.AccAddress, keepers *kee panic(err) } - // update continuous vesting account in order - // to have all tokens vested - _, vestedCoins := vacc.GetVestedCoins(ctx.BlockTime()).Find(sk.BondDenom(ctx)) - err = updateContinuousVestingAccount( - ak, - ctx, - address, - sdk.NewCoins(vestedCoins), - ) - if err != nil { - panic(err) - } + // overwrite vesting account using its embedded base account + ak.SetAccount(ctx, vestAccount.BaseAccount) - // validate vesting account + // validate account balance err = bk.ValidateBalance(ctx, address) if err != nil { panic(err) } } -// Unbond vesting account delegations +// forceUnbondAllDelegations unbonds all the delegations from the given account address +// without unbonding period func forceUnbondAllDelegations( sk stakingkeeper.Keeper, bk bankkeeper.Keeper, ctx sdk.Context, delegator sdk.AccAddress, ) error { - dels := sk.GetDelegatorDelegations(ctx, delegator, 100) for _, del := range dels { @@ -170,7 +165,7 @@ func forceUnbondAllDelegations( validator, found := sk.GetValidator(ctx, valAddr) if !found { - return fmt.Errorf("unknown validator") + return stakingtypes.ErrNoValidatorFound } returnAmount, err := sk.Unbond(ctx, delegator, valAddr, del.GetShares()) @@ -179,8 +174,8 @@ func forceUnbondAllDelegations( } // transfer the validator tokens to the not bonded pool - // doing stakingKeeper.bondedTokensToNotBonded if validator.IsBonded() { + // doing stakingKeeper.bondedTokensToNotBonded coins := sdk.NewCoins(sdk.NewCoin(sk.BondDenom(ctx), returnAmount)) err = bk.SendCoinsFromModuleToModule(ctx, types.BondedPoolName, types.NotBondedPoolName, coins) if err != nil { @@ -191,7 +186,6 @@ func forceUnbondAllDelegations( bondDenom := sk.GetParams(ctx).BondDenom amt := sdk.NewCoin(bondDenom, returnAmount) - // call TrackDelegation() to update vesting account delegations err = bk.UndelegateCoinsFromModuleToAccount(ctx, types.NotBondedPoolName, delegator, sdk.NewCoins(amt)) if err != nil { return err @@ -201,8 +195,10 @@ func forceUnbondAllDelegations( return nil } -// CONTRACT: coin are in the bond denom -// Community pool / distribution module account already exists +// forceFundCommunityPool sends the given coin from the sender account to the community pool +// even if the coin is locked. +// Note that it mostly follows the logic of the FundCommunityPool method in +// https://github.com/cosmos/cosmos-sdk/blob/release%2Fv0.47.x/x/distribution/keeper/keeper.go#L155 func forceFundCommunityPool( ak accountkeeper.AccountKeeper, dk distributionkeeper.Keeper, @@ -212,38 +208,31 @@ func forceFundCommunityPool( sender sdk.AccAddress, bs storetypes.StoreKey, ) error { - // SendCoinsFromAccountToModule{ recipientAcc := ak.GetModuleAccount(ctx, distributiontypes.ModuleName) if recipientAcc == nil { - panic(fmt.Errorf("module account %s does not exist", distributiontypes.ModuleName)) + return sdkerrors.Wrapf(sdkerrors.ErrUnknownAddress, distributiontypes.ModuleName) } - // SendCoins{ - //k.subUnlockedCoins{ + senderBal := bk.GetBalance(ctx, sender, amount.Denom) if _, hasNeg := sdk.NewCoins(senderBal).SafeSub(amount); hasNeg { - return fmt.Errorf("spendable balance %s is smaller than %s", + return sdkerrors.Wrapf( + sdkerrors.ErrInsufficientFunds, + "spendable balance %s is smaller than %s", senderBal, amount, ) } - if err := setBalance(bk, ctx, sender, senderBal.Sub(amount), bs); err != nil { + if err := setBalance(ctx, sender, senderBal.Sub(amount), bs); err != nil { return err } - //}k.subUnlockedCoins recipientBal := bk.GetBalance(ctx, recipientAcc.GetAddress(), amount.Denom) - if err := setBalance(bk, ctx, recipientAcc.GetAddress(), recipientBal.Add(amount), bs); err != nil { + if err := setBalance(ctx, recipientAcc.GetAddress(), recipientBal.Add(amount), bs); err != nil { return err } - // Create account if recipient does not exist. - // - // NOTE: This should ultimately be removed in favor a more flexible approach - // such as delegated fee messages. accExists := ak.HasAccount(ctx, recipientAcc.GetAddress()) if !accExists { ak.SetAccount(ctx, ak.NewAccountWithAddress(ctx, recipientAcc.GetAddress())) } - // }SendCoins - //} SendCoinsFromAccountToModule feePool := dk.GetFeePool(ctx) feePool.CommunityPool = feePool.CommunityPool.Add(sdk.NewDecCoinsFromCoins(amount)...) @@ -252,55 +241,23 @@ func forceFundCommunityPool( return nil } -// Update vesting account -func updateContinuousVestingAccount( - ak accountkeeper.AccountKeeper, - ctx sdk.Context, - addr sdk.AccAddress, - OrigCoins sdk.Coins, -) error { - acc := ak.GetAccount(ctx, addr) - vacc, ok := acc.(*vesting.ContinuousVestingAccount) - if !ok { - return fmt.Errorf("inccorect a continuous vesting account") - } - bacc := &authtypes.BaseAccount{ - Address: acc.GetAddress().String(), - AccountNumber: acc.GetAccountNumber(), - Sequence: acc.GetSequence(), - } - - err := bacc.SetPubKey(acc.GetPubKey()) - if err != nil { - return err - } - - newVacc := vesting.NewContinuousVestingAccount(bacc, OrigCoins, vacc.StartTime, ctx.BlockTime().Unix()) - ak.SetAccount(ctx, newVacc) - - return nil -} - // setBalance sets the coin balance for an account by address. +// Note it follow the same logic of the sendBalance method in +// https://github.com/cosmos/cosmos-sdk/blob/release%2Fv0.47.x/x/bank/keeper/send.go#L337 func setBalance( - bk bankkeeper.Keeper, ctx sdk.Context, addr sdk.AccAddress, balance sdk.Coin, bs storetypes.StoreKey, ) error { if !balance.IsValid() { - return fmt.Errorf(balance.String()) + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, balance.String()) } - // accountStore := k.getAccountStore(ctx, addr) store := ctx.KVStore(bs) accountStore := prefix.NewStore(store, banktypes.CreateAccountBalancesPrefix(addr)) - - // denomPrefixStore := k.getDenomAddressPrefixStore(ctx, balance.Denom) denomPrefixStore := prefix.NewStore(store, banktypes.CreateDenomAddressPrefix(balance.Denom)) - // x/bank invariants prohibit persistence of zero balances if balance.IsZero() { accountStore.Delete([]byte(balance.Denom)) denomPrefixStore.Delete(address.MustLengthPrefix(addr)) @@ -322,12 +279,3 @@ func setBalance( return nil } - -func getContinuousVestingAccount(ak accountkeeper.AccountKeeper, ctx sdk.Context, addr sdk.AccAddress) *vesting.ContinuousVestingAccount { - acc := ak.GetAccount(ctx, addr) - vacc, ok := acc.(*vesting.ContinuousVestingAccount) - if !ok { - panic(fmt.Errorf("incorrect continuous vesting account")) - } - return vacc -} diff --git a/app/upgrades/v15/upgrades_test.go b/app/upgrades/v15/upgrades_test.go index 87593efad1..11be41ead0 100644 --- a/app/upgrades/v15/upgrades_test.go +++ b/app/upgrades/v15/upgrades_test.go @@ -1,27 +1,17 @@ package v15_test import ( - "fmt" "testing" "time" - "github.com/cosmos/cosmos-sdk/store/prefix" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - "cosmossdk.io/math" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" tmtime "github.com/cometbft/cometbft/types/time" "github.com/cosmos/cosmos-sdk/testutil/mock" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/address" - accountkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" vesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" - bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktestutil "github.com/cosmos/cosmos-sdk/x/bank/testutil" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - distributionkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" - distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/stretchr/testify/require" @@ -131,302 +121,112 @@ func TestMigrateValidatorsSigningInfos(t *testing.T) { }) } -// undelegations successful - validators have less voting power -// vesting account updated - still vesting tokens are gone -// community pool updated - still vesting tokens are added -// the vesting account still has the already vested tokens -func TestMigrateUnvestedFunds(t *testing.T) { +func TestMigrateVestingAccount(t *testing.T) { gaiaApp := helpers.Setup(t) now := tmtime.Now() endTime := now.Add(24 * time.Hour) - ctx := gaiaApp.NewUncachedContext(true, tmproto.Header{}) - ctx = ctx.WithBlockHeader(tmproto.Header{Time: now}) - bankKeeper := gaiaApp.BankKeeper accountKeeper := gaiaApp.AccountKeeper distrKeeper := gaiaApp.DistrKeeper stakingKeeper := gaiaApp.StakingKeeper - validators := stakingKeeper.GetAllValidators(ctx) - validator := validators[0] + ctx := gaiaApp.NewUncachedContext(true, tmproto.Header{}) + ctx = ctx.WithBlockHeader(tmproto.Header{Time: now}) + validator := stakingKeeper.GetAllValidators(ctx)[0] bondDenom := stakingKeeper.GetParams(ctx).BondDenom - // original vesting coin amount + // create continuous vesting account origCoins := sdk.NewCoins(sdk.NewInt64Coin(bondDenom, 100)) - - // create a continuous vesting account addr := sdk.AccAddress([]byte("addr1_______________")) - require.Error(t, bankKeeper.ValidateBalance(ctx, addr)) - bacc := authtypes.NewBaseAccountWithAddress(addr) - vacc := vesting.NewContinuousVestingAccount(bacc, origCoins, ctx.BlockHeader().Time.Unix(), endTime.Unix()) + vestingAccount := vesting.NewContinuousVestingAccount( + authtypes.NewBaseAccountWithAddress(addr), + origCoins, + now.Unix(), + endTime.Unix(), + ) + + require.True(t, vestingAccount.GetVestingCoins(now).IsEqual(origCoins)) - accountKeeper.SetAccount(ctx, vacc) - vestingCoins := vacc.GetVestingCoins(ctx.BlockTime()) + accountKeeper.SetAccount(ctx, vestingAccount) - require.True(t, vestingCoins.IsEqual(origCoins)) + // check vesting account balance was set correctly + require.NoError(t, bankKeeper.ValidateBalance(ctx, addr)) require.Empty(t, bankKeeper.GetAllBalances(ctx, addr)) - // fund vesting account + // send original vesting coin amount require.NoError(t, banktestutil.FundAccount(bankKeeper, ctx, addr, origCoins)) require.True(t, origCoins.IsEqual(bankKeeper.GetAllBalances(ctx, addr))) - initBal := bankKeeper.GetAllBalances(ctx, vacc.GetAddress()) + initBal := bankKeeper.GetAllBalances(ctx, vestingAccount.GetAddress()) require.True(t, initBal.IsEqual(origCoins)) + // save validator tokens oldValTokens := validator.Tokens - // delegate vested and still vesting tokens - _, err := stakingKeeper.Delegate(ctx, vacc.GetAddress(), origCoins.AmountOf(bondDenom), stakingtypes.Unbonded, validator, true) + // delegate all vesting account tokens + _, err := stakingKeeper.Delegate( + ctx, vestingAccount.GetAddress(), + origCoins.AmountOf(bondDenom), + stakingtypes.Unbonded, + validator, + true) require.NoError(t, err) + // check that the validator's tokens and shares increased validator = stakingKeeper.GetAllValidators(ctx)[0] - - require.True(t, validator.Tokens.Equal(oldValTokens.Add(origCoins.AmountOf(bondDenom)))) - del, found := stakingKeeper.GetDelegation(ctx, addr, validator.GetOperator()) require.True(t, found) - require.Equal(t, validator.TokensFromShares(del.Shares), math.LegacyNewDec(origCoins.AmountOf(bondDenom).Int64())) + require.True(t, validator.Tokens.Equal(oldValTokens.Add(origCoins.AmountOf(bondDenom)))) + require.Equal( + t, + validator.TokensFromShares(del.Shares), + math.LegacyNewDec(origCoins.AmountOf(bondDenom).Int64()), + ) - acc := accountKeeper.GetAccount(ctx, addr) - vaccupdated, ok := acc.(banktypes.VestingAccount) - require.True(t, ok) - require.Equal(t, vaccupdated.GetDelegatedVesting(), origCoins) - require.Empty(t, vaccupdated.GetDelegatedFree()) + // check vesting account delegations + vestingAccount = accountKeeper.GetAccount(ctx, addr).(*vesting.ContinuousVestingAccount) + require.Equal(t, vestingAccount.GetDelegatedVesting(), origCoins) + require.Empty(t, vestingAccount.GetDelegatedFree()) // vest half of the tokens ctx = ctx.WithBlockTime(now.Add(12 * time.Hour)) - vestingCoinsUpdated := vacc.GetVestingCoins(ctx.BlockTime()) - vestedCoins := vacc.GetVestedCoins(ctx.BlockTime()) + currVestingCoins := vestingAccount.GetVestingCoins(ctx.BlockTime()) + currVestedCoins := vestingAccount.GetVestedCoins(ctx.BlockTime()) - require.True(t, vestingCoinsUpdated.IsEqual(origCoins.QuoInt(math.NewInt(2)))) - require.True(t, vestedCoins.IsEqual(origCoins.QuoInt(math.NewInt(2)))) + require.True(t, currVestingCoins.IsEqual(origCoins.QuoInt(math.NewInt(2)))) + require.True(t, currVestedCoins.IsEqual(origCoins.QuoInt(math.NewInt(2)))) + // execute migration script v15.MigrateVestingAccount(ctx, addr, &gaiaApp.AppKeepers) - require.True(t, sdk.NewDecCoinsFromCoins(vestingCoinsUpdated...).IsEqual(distrKeeper.GetFeePoolCommunityCoins(ctx))) - - vaccUpdated := accountKeeper.GetAccount(ctx, addr).(*vesting.ContinuousVestingAccount) - vestedUpdated := vaccUpdated.GetVestedCoins(ctx.BlockTime()) - require.Empty(t, vaccUpdated.GetVestingCoins(ctx.BlockTime())) - require.True(t, vestedCoins.IsEqual(vestedUpdated)) - require.True(t, vaccUpdated.OriginalVesting.IsEqual(vestedUpdated)) - - // require.NoError(t, bankKeeper.ValidateBalance(ctx, addr)) - // require.NoError(t, bankKeeper.ValidateBalance(ctx, accountKeeper.GetModuleAddress(distributiontypes.ModuleName))) - - // remove delegations - - // returnAmount, err := stakingKeeper.Unbond(ctx, addr, validator.GetOperator(), del.Shares) - // require.NoError(t, err) - - // nb := bankKeeper.GetAllBalances(ctx, accountKeeper.GetModuleAddress(types.BondedPoolName)) - // fmt.Println(" bonded balances", nb.String()) - - // transfer the validator tokens to the not bonded pool - // doing stakingKeeper.bondedTokensToNotBonded - // if validator.IsBonded() { - // fmt.Println("bonded") - // fmt.Println("returnAmount", returnAmount.String()) - // coins := sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), returnAmount)) - // err = bankKeeper.SendCoinsFromModuleToModule(ctx, types.BondedPoolName, types.NotBondedPoolName, coins) - // require.NoError(t, err) - // } - - // nb = bankKeeper.GetAllBalances(ctx, accountKeeper.GetModuleAddress(types.BondedPoolName)) - // fmt.Println(" bonded balances", nb.String()) - - // nbp := bankKeeper.GetAllBalances(ctx, accountKeeper.GetModuleAddress(types.NotBondedPoolName)) - // fmt.Println("not bonded balances", nbp.String()) - - // amt := sdk.NewCoin(bondDenom, returnAmount) - // err = bankKeeper.UndelegateCoinsFromModuleToAccount(ctx, types.NotBondedPoolName, addr, sdk.NewCoins(amt)) - // require.NoError(t, err) - - // require.True(t, origCoins.IsEqual(bankKeeper.GetAllBalances(ctx, addr))) - - // acc = accountKeeper.GetAccount(ctx, addr) - // vaccupdated, ok = acc.(banktypes.VestingAccount) - // require.True(t, ok) - // require.Empty(t, vaccupdated.GetDelegatedVesting()) - // require.Empty(t, vaccupdated.GetDelegatedFree()) - - // require.Empty(t, distrKeeper.GetFeePoolCommunityCoins(ctx)) - - // kvs := gaiaApp.GetKVStoreKey() - - // vestingAmt := sdk.NewCoin(amt.Denom, amt.Amount.Quo(math.NewInt(2))) - - // FundCommunityPool( - // accountKeeper, - // distrKeeper, - // bankKeeper, - // ctx, - // sdk.NewCoins(vestingAmt), - // addr, - // kvs[banktypes.StoreKey], - // ) - - // err = bankKeeper.UndelegateCoinsFromModuleToAccount( - // ctx, types.NotBondedPoolName, addr, sdk.NewCoins(amt)) - // require.NoError(t, err) - - // remove - - //// send to community pool - // create fee pool - // distrKeeper.SetFeePool(ctx, types.InitialFeePool()) - - // require.NotEmpty(t, distrKeeper.GetFeePoolCommunityCoins(ctx)) - - // fmt.Println("community pool balances", distrKeeper.GetFeePoolCommunityCoins(ctx)) - // fmt.Println("community pool balances 2", bankKeeper.GetAllBalances(ctx, accountKeeper.GetModuleAddress(distributiontypes.ModuleName))) - - // fmt.Println("vesting account", bankKeeper.GetAllBalances(ctx, addr)) - -} - -// FundCommunityPool allows an account to directly fund the community fund pool. -// The amount is first added to the distribution module account and then directly -// added to the pool. An error is returned if the amount cannot be sent to the -// module account. -func FundCommunityPool( - ak accountkeeper.AccountKeeper, - dk distributionkeeper.Keeper, - bk bankkeeper.Keeper, - ctx sdk.Context, - amount sdk.Coins, - sender sdk.AccAddress, - bs storetypes.StoreKey) error { - - // SendCoinsFromAccountToModule{ - recipientAcc := ak.GetModuleAccount(ctx, distributiontypes.ModuleName) - if recipientAcc == nil { - panic(fmt.Errorf("module account %s does not exist", distributiontypes.ModuleName)) - } - // SendCoins{ - //k.subUnlockedCoins{ - err := SubUnlockedCoins(bk, ctx, sender, amount, bs) - if err != nil { - panic(err) - } - - //}k.subUnlockedCoins - - err = AddCoins(bk, ctx, recipientAcc.GetAddress(), amount, bs) - if err != nil { - panic(err) - } - - // Create account if recipient does not exist. - // - // NOTE: This should ultimately be removed in favor a more flexible approach - // such as delegated fee messages. - accExists := ak.HasAccount(ctx, recipientAcc.GetAddress()) - if !accExists { - fmt.Println("feepool doesn't exist") - ak.SetAccount(ctx, ak.NewAccountWithAddress(ctx, recipientAcc.GetAddress())) - } - // }SendCoins - - //} SendCoinsFromAccountToModule - - feePool := dk.GetFeePool(ctx) - feePool.CommunityPool = feePool.CommunityPool.Add(sdk.NewDecCoinsFromCoins(amount...)...) - dk.SetFeePool(ctx, feePool) - - return nil -} - -func AddCoins(bk bankkeeper.Keeper, ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins, bs storetypes.StoreKey) error { - if !amt.IsValid() { - return fmt.Errorf("invalid coins") //sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, amt.String()) - } - - for _, coin := range amt { - balance := bk.GetBalance(ctx, addr, coin.Denom) - newBalance := balance.Add(coin) - - err := SetBalance(bk, ctx, addr, newBalance, bs) - if err != nil { - return err - } - } - return nil -} - -// setBalance sets the coin balance for an account by address. -func SetBalance(bk bankkeeper.Keeper, ctx sdk.Context, addr sdk.AccAddress, balance sdk.Coin, bs storetypes.StoreKey) error { - if !balance.IsValid() { - return fmt.Errorf(balance.String()) - } - - // accountStore := k.getAccountStore(ctx, addr) - store := ctx.KVStore(bs) - accountStore := prefix.NewStore(store, banktypes.CreateAccountBalancesPrefix(addr)) - - // denomPrefixStore := k.getDenomAddressPrefixStore(ctx, balance.Denom) - denomPrefixStore := prefix.NewStore(store, banktypes.CreateDenomAddressPrefix(balance.Denom)) - - // x/bank invariants prohibit persistence of zero balances - if balance.IsZero() { - accountStore.Delete([]byte(balance.Denom)) - denomPrefixStore.Delete(address.MustLengthPrefix(addr)) - } else { - amount, err := balance.Amount.Marshal() - if err != nil { - return err - } - - accountStore.Set([]byte(balance.Denom), amount) - - // Store a reverse index from denomination to account address with a - // sentinel value. - denomAddrKey := address.MustLengthPrefix(addr) - if !denomPrefixStore.Has(denomAddrKey) { - denomPrefixStore.Set(denomAddrKey, []byte{0}) - } - } - - return nil -} - -// subUnlockedCoins removes the unlocked amt coins of the given account. An error is -// returned if the resulting balance is negative or the initial amount is invalid. -// A coin_spent event is emitted after. -func SubUnlockedCoins(bk bankkeeper.Keeper, ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins, bs storetypes.StoreKey) error { - if !amt.IsValid() { - return fmt.Errorf("amount isn't valid") - } - - lockedCoins := sdk.Coins{} - - for _, coin := range amt { - balance := bk.GetBalance(ctx, addr, coin.Denom) - locked := sdk.NewCoin(coin.Denom, lockedCoins.AmountOf(coin.Denom)) - - spendable, hasNeg := sdk.Coins{balance}.SafeSub(locked) - if hasNeg { - return fmt.Errorf( - "locked amount exceeds account balance funds: %s > %s", locked, balance) - } - - if _, hasNeg := spendable.SafeSub(coin); hasNeg { - return fmt.Errorf("spendable balance %s is smaller than %s", - spendable, coin, - ) - } - - newBalance := balance.Sub(coin) - - if err := SetBalance(bk, ctx, addr, newBalance, bs); err != nil { - return err - } - } - - return nil + // check that the validator's delegation is removed and that + // the total tokens decreased + validator = stakingKeeper.GetAllValidators(ctx)[0] + _, found = stakingKeeper.GetDelegation(ctx, addr, validator.GetOperator()) + require.False(t, found) + require.Equal( + t, + validator.TokensFromShares(validator.DelegatorShares), + math.LegacyNewDec(oldValTokens.Int64()), + ) + + // check that the resulting account is of BaseAccount type now + account, ok := accountKeeper.GetAccount(ctx, addr).(*authtypes.BaseAccount) + require.True(t, ok) + // check that the account values are still the same + require.EqualValues(t, account, vestingAccount.BaseAccount) + + // check that the account's balance still has the vested tokens + require.True(t, bankKeeper.GetAllBalances(ctx, addr).IsEqual(currVestedCoins)) + // check that the community pool balance received the vesting tokens + require.True( + t, + distrKeeper.GetFeePoolCommunityCoins(ctx). + IsEqual(sdk.NewDecCoinsFromCoins(currVestingCoins...)), + ) } From 1516387dea93310e5a73cb116857ce062d5b06b1 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Wed, 17 Jan 2024 17:47:31 +0100 Subject: [PATCH 28/43] refactoring --- app/upgrades/v15/upgrades.go | 12 ++++---- app/upgrades/v15/upgrades_test.go | 50 +++++++++++++++++-------------- 2 files changed, 35 insertions(+), 27 deletions(-) diff --git a/app/upgrades/v15/upgrades.go b/app/upgrades/v15/upgrades.go index caa71c2a45..12f1303db4 100644 --- a/app/upgrades/v15/upgrades.go +++ b/app/upgrades/v15/upgrades.go @@ -23,22 +23,24 @@ func CreateUpgradeHandler( return vm, err } - V15UpgradeHandler(ctx, keepers) + UpgradeCommissionRate(ctx, keepers) ctx.Logger().Info("Upgrade v15 complete") return vm, err } } -// V15UpgradeHandler sets the minimum commission rate staking parameter to 5% +// UpgradeCommissionRate sets the minimum commission rate staking parameter to 5% // and updates the commission rate for all validators that have a commission rate less than 5% -func V15UpgradeHandler(ctx sdk.Context, keepers *keepers.AppKeepers) { +func UpgradeCommissionRate(ctx sdk.Context, keepers *keepers.AppKeepers) { params := keepers.StakingKeeper.GetParams(ctx) params.MinCommissionRate = sdk.NewDecWithPrec(5, 2) - keepers.StakingKeeper.SetParams(ctx, params) + err := keepers.StakingKeeper.SetParams(ctx, params) + if err != nil { + panic(err) + } for _, val := range keepers.StakingKeeper.GetAllValidators(ctx) { - val := val if val.Commission.CommissionRates.Rate.LT(sdk.NewDecWithPrec(5, 2)) { // set the commmision rate to 5% val.Commission.CommissionRates.Rate = sdk.NewDecWithPrec(5, 2) diff --git a/app/upgrades/v15/upgrades_test.go b/app/upgrades/v15/upgrades_test.go index 1d0ba865db..9dc659ef68 100644 --- a/app/upgrades/v15/upgrades_test.go +++ b/app/upgrades/v15/upgrades_test.go @@ -3,11 +3,17 @@ package v15_test import ( "testing" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + tmrand "github.com/cometbft/cometbft/libs/rand" + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + "github.com/cosmos/gaia/v15/app/helpers" v15 "github.com/cosmos/gaia/v15/app/upgrades/v15" - "github.com/stretchr/testify/require" ) type EmptyAppOptions struct{} @@ -23,41 +29,41 @@ func TestV15UpgradeHandler(t *testing.T) { // set min commission rate to 0 stakingParams := gaiaApp.StakingKeeper.GetParams(ctx) stakingParams.MinCommissionRate = sdk.ZeroDec() - gaiaApp.StakingKeeper.SetParams(ctx, stakingParams) + err := gaiaApp.StakingKeeper.SetParams(ctx, stakingParams) + require.NoError(t, err) - // confirm all commissions are 0 stakingKeeper := gaiaApp.StakingKeeper + valNum := len(stakingKeeper.GetAllValidators(ctx)) - for _, val := range stakingKeeper.GetAllValidators(ctx) { - require.Equal(t, val.Commission.CommissionRates.Rate, sdk.ZeroDec(), "non-zero previous commission rate for validator %s", val.GetOperator()) + // create 3 new validators + for i := 0; i < 3; i++ { + pk := ed25519.GenPrivKeyFromSecret([]byte{uint8(i)}).PubKey() + val, err := stakingtypes.NewValidator( + sdk.ValAddress(pk.Address()), + pk, + stakingtypes.Description{}, + ) + require.NoError(t, err) + // set random commission rate + val.Commission.CommissionRates.Rate = sdk.NewDecWithPrec(tmrand.Int63n(100), 2) + stakingKeeper.SetValidator(ctx, val) + valNum++ } + validators := stakingKeeper.GetAllValidators(ctx) + require.Equal(t, valNum, len(validators)) + // pre-test min commission rate is 0 require.Equal(t, stakingKeeper.GetParams(ctx).MinCommissionRate, sdk.ZeroDec(), "non-zero previous min commission rate") // run the test and confirm the values have been updated - v15.V15UpgradeHandler(ctx, &gaiaApp.AppKeepers) + v15.UpgradeCommissionRate(ctx, &gaiaApp.AppKeepers) newStakingParams := gaiaApp.StakingKeeper.GetParams(ctx) require.NotEqual(t, newStakingParams.MinCommissionRate, sdk.ZeroDec(), "failed to update min commission rate") require.Equal(t, newStakingParams.MinCommissionRate, sdk.NewDecWithPrec(5, 2), "failed to update min commission rate") for _, val := range stakingKeeper.GetAllValidators(ctx) { - require.Equal(t, val.Commission.CommissionRates.Rate, newStakingParams.MinCommissionRate, "failed to update update commission rate for validator %s", val.GetOperator()) - } - - // set one of the validators commission rate to 10% and ensure it is not updated - updateValCommission := sdk.NewDecWithPrec(10, 2) - updateVal := stakingKeeper.GetAllValidators(ctx)[0] - updateVal.Commission.CommissionRates.Rate = updateValCommission - stakingKeeper.SetValidator(ctx, updateVal) - - v15.V15UpgradeHandler(ctx, &gaiaApp.AppKeepers) - for _, val := range stakingKeeper.GetAllValidators(ctx) { - if updateVal.OperatorAddress == val.OperatorAddress { - require.Equal(t, val.Commission.CommissionRates.Rate, updateValCommission, "should not update commission rate for validator %s", val.GetOperator()) - } else { - require.Equal(t, val.Commission.CommissionRates.Rate, newStakingParams.MinCommissionRate, "failed to update update commission rate for validator %s", val.GetOperator()) - } + require.True(t, val.Commission.CommissionRates.Rate.GTE(newStakingParams.MinCommissionRate), "failed to update update commission rate for validator %s", val.GetOperator()) } } From 8a0b312154973e50d0ec1044ef10e0e836b4d9fa Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Thu, 18 Jan 2024 09:14:15 +0100 Subject: [PATCH 29/43] nits --- Makefile | 1 - ante/ante.go | 1 + app/app_helpers.go | 1 - client/docs/config.json | 2 +- x/globalfee/ante/fee.go | 8 -------- 5 files changed, 2 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index d13359e178..a75a45d3aa 100644 --- a/Makefile +++ b/Makefile @@ -95,7 +95,6 @@ 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." diff --git a/ante/ante.go b/ante/ante.go index 336e23dab1..4970c13591 100644 --- a/ante/ante.go +++ b/ante/ante.go @@ -42,6 +42,7 @@ func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) { if opts.IBCkeeper == nil { return nil, errorsmod.Wrap(gaiaerrors.ErrLogic, "IBC keeper is required for AnteHandler") } + if opts.GlobalFeeSubspace.Name() == "" { return nil, errorsmod.Wrap(gaiaerrors.ErrNotFound, "globalfee param store is required for AnteHandler") } diff --git a/app/app_helpers.go b/app/app_helpers.go index 093b3db0b3..68eaef1487 100644 --- a/app/app_helpers.go +++ b/app/app_helpers.go @@ -1,6 +1,5 @@ package gaia -// TODO: Enable with ICS import ( ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" ibctestingtypes "github.com/cosmos/ibc-go/v7/testing/types" diff --git a/client/docs/config.json b/client/docs/config.json index d4dd765023..8c39603998 100644 --- a/client/docs/config.json +++ b/client/docs/config.json @@ -15,4 +15,4 @@ } } ] -} +} \ No newline at end of file diff --git a/x/globalfee/ante/fee.go b/x/globalfee/ante/fee.go index 0679b0aa31..b3b4c4d39a 100644 --- a/x/globalfee/ante/fee.go +++ b/x/globalfee/ante/fee.go @@ -61,9 +61,6 @@ func (mfd FeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne return ctx, err } - ctx.Logger().Info(fmt.Sprintf("FeeCoins: %v", feeTx.GetFee())) - ctx.Logger().Info(fmt.Sprintf("FeeRequired: %v", feeRequired)) - // reject the transaction early if the feeCoins have more denoms than the fee requirement // feeRequired cannot be empty @@ -107,11 +104,6 @@ func (mfd FeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne doesNotExceedMaxGasUsage := gas <= maxTotalBypassMinFeeMsgGasUsage allBypassMsgs := mfd.ContainsOnlyBypassMinFeeMsgs(ctx, msgs) allowedToBypassMinFee := allBypassMsgs && doesNotExceedMaxGasUsage - ctx.Logger().Info(fmt.Sprintf("gas: %v", gas)) - ctx.Logger().Info(fmt.Sprintf("allBypassMsgs: %v", allBypassMsgs)) - ctx.Logger().Info(fmt.Sprintf("maxTotalBypassMinFeeMsgGasUsage: %v", maxTotalBypassMinFeeMsgGasUsage)) - ctx.Logger().Info(fmt.Sprintf("doesNotExceedMaxGasUsage: %v", doesNotExceedMaxGasUsage)) - ctx.Logger().Info(fmt.Sprintf("allowedToBypassMinFee: %v", allowedToBypassMinFee)) if allowedToBypassMinFee { ctx.Logger().Info("Pass allowedToBypassMinFee check") From 6b0f529ccf33e3d54fed9a5c95cf1b242839c58b Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Thu, 18 Jan 2024 09:27:54 +0100 Subject: [PATCH 30/43] lint --- .../2855-migrate-min-commission-rate.md | 8 +++++++- app/upgrades/v15/upgrades.go | 2 +- app/upgrades/v15/upgrades_test.go | 14 ++++---------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.changelog/unreleased/state-breaking/2855-migrate-min-commission-rate.md b/.changelog/unreleased/state-breaking/2855-migrate-min-commission-rate.md index 7523a939f6..e0a9dc9f05 100644 --- a/.changelog/unreleased/state-breaking/2855-migrate-min-commission-rate.md +++ b/.changelog/unreleased/state-breaking/2855-migrate-min-commission-rate.md @@ -1 +1,7 @@ -- Migrate min commission rate migration to %5 (prop 826) ([\#2855](https://github.com/cosmos/gaia/pull/2855)) \ No newline at end of file +Migrate min commission rate migration rate staking parameter to 5% + ([prop 826](https://www.mintscan.io/cosmos/proposals/826)) +and updates the commission rate for all validators that have a commission +rate less than 5% ([\#2855](https://github.com/cosmos/gaia/pull/2855)) + + + diff --git a/app/upgrades/v15/upgrades.go b/app/upgrades/v15/upgrades.go index 12f1303db4..75c3954977 100644 --- a/app/upgrades/v15/upgrades.go +++ b/app/upgrades/v15/upgrades.go @@ -42,7 +42,7 @@ func UpgradeCommissionRate(ctx sdk.Context, keepers *keepers.AppKeepers) { for _, val := range keepers.StakingKeeper.GetAllValidators(ctx) { if val.Commission.CommissionRates.Rate.LT(sdk.NewDecWithPrec(5, 2)) { - // set the commmision rate to 5% + // set the commission rate to 5% val.Commission.CommissionRates.Rate = sdk.NewDecWithPrec(5, 2) // set the max rate to 5% if it is less than 5% if val.Commission.CommissionRates.MaxRate.LT(sdk.NewDecWithPrec(5, 2)) { diff --git a/app/upgrades/v15/upgrades_test.go b/app/upgrades/v15/upgrades_test.go index 9dc659ef68..01793fed32 100644 --- a/app/upgrades/v15/upgrades_test.go +++ b/app/upgrades/v15/upgrades_test.go @@ -3,25 +3,19 @@ package v15_test import ( "testing" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/stretchr/testify/require" tmrand "github.com/cometbft/cometbft/libs/rand" - "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/cosmos/gaia/v15/app/helpers" v15 "github.com/cosmos/gaia/v15/app/upgrades/v15" ) -type EmptyAppOptions struct{} - -func (ao EmptyAppOptions) Get(_ string) interface{} { - return nil -} - func TestV15UpgradeHandler(t *testing.T) { gaiaApp := helpers.Setup(t) ctx := gaiaApp.NewUncachedContext(true, tmproto.Header{}) From 18db7934897e3688490b513c37af0a5364a7b4e3 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Thu, 18 Jan 2024 09:49:33 +0100 Subject: [PATCH 31/43] nit --- app/upgrades/v15/upgrades_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/upgrades/v15/upgrades_test.go b/app/upgrades/v15/upgrades_test.go index 01793fed32..bbbf4c1f11 100644 --- a/app/upgrades/v15/upgrades_test.go +++ b/app/upgrades/v15/upgrades_test.go @@ -16,7 +16,7 @@ import ( v15 "github.com/cosmos/gaia/v15/app/upgrades/v15" ) -func TestV15UpgradeHandler(t *testing.T) { +func TestUpgradeCommissionRate(t *testing.T) { gaiaApp := helpers.Setup(t) ctx := gaiaApp.NewUncachedContext(true, tmproto.Header{}) From 9bb3ce76265981e347b9f36af4548b27c9002b5a Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Thu, 18 Jan 2024 09:56:05 +0100 Subject: [PATCH 32/43] add .changelog entry --- .../state-breaking/2855-migrate-min-commission-rate.md | 4 ++-- .../unreleased/state-breaking/2866-migrate-signing-infos.md | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .changelog/unreleased/state-breaking/2866-migrate-signing-infos.md diff --git a/.changelog/unreleased/state-breaking/2855-migrate-min-commission-rate.md b/.changelog/unreleased/state-breaking/2855-migrate-min-commission-rate.md index e0a9dc9f05..f8706e9e61 100644 --- a/.changelog/unreleased/state-breaking/2855-migrate-min-commission-rate.md +++ b/.changelog/unreleased/state-breaking/2855-migrate-min-commission-rate.md @@ -1,7 +1,7 @@ Migrate min commission rate migration rate staking parameter to 5% ([prop 826](https://www.mintscan.io/cosmos/proposals/826)) -and updates the commission rate for all validators that have a commission -rate less than 5% ([\#2855](https://github.com/cosmos/gaia/pull/2855)) + and updates the commission rate for all validators that have a commission + rate less than 5% ([\#2855](https://github.com/cosmos/gaia/pull/2855)) diff --git a/.changelog/unreleased/state-breaking/2866-migrate-signing-infos.md b/.changelog/unreleased/state-breaking/2866-migrate-signing-infos.md new file mode 100644 index 0000000000..14d433271c --- /dev/null +++ b/.changelog/unreleased/state-breaking/2866-migrate-signing-infos.md @@ -0,0 +1,6 @@ +Migrate the signing infos of validators for which the consensus address + is missing, see https://github.com/cosmos/gaia/issues/1734 + ([\#2866](https://github.com/cosmos/gaia/pull/2866)) + + + From 2e9e16ae26ef5f85acbf749a51a5ccce0205a130 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Thu, 18 Jan 2024 09:59:36 +0100 Subject: [PATCH 33/43] nits --- .../2855-migrate-min-commission-rate.md | 4 ++-- app/upgrades/v15/upgrades.go | 15 ++++++++------- app/upgrades/v15/upgrades_test.go | 6 +++--- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.changelog/unreleased/state-breaking/2855-migrate-min-commission-rate.md b/.changelog/unreleased/state-breaking/2855-migrate-min-commission-rate.md index e0a9dc9f05..f8706e9e61 100644 --- a/.changelog/unreleased/state-breaking/2855-migrate-min-commission-rate.md +++ b/.changelog/unreleased/state-breaking/2855-migrate-min-commission-rate.md @@ -1,7 +1,7 @@ Migrate min commission rate migration rate staking parameter to 5% ([prop 826](https://www.mintscan.io/cosmos/proposals/826)) -and updates the commission rate for all validators that have a commission -rate less than 5% ([\#2855](https://github.com/cosmos/gaia/pull/2855)) + and updates the commission rate for all validators that have a commission + rate less than 5% ([\#2855](https://github.com/cosmos/gaia/pull/2855)) diff --git a/app/upgrades/v15/upgrades.go b/app/upgrades/v15/upgrades.go index 75c3954977..ef4a53d0de 100644 --- a/app/upgrades/v15/upgrades.go +++ b/app/upgrades/v15/upgrades.go @@ -3,6 +3,7 @@ package v15 import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" "github.com/cosmos/gaia/v15/app/keepers" @@ -23,24 +24,24 @@ func CreateUpgradeHandler( return vm, err } - UpgradeCommissionRate(ctx, keepers) + UpgradeMinCommissionRate(ctx, *keepers.StakingKeeper) ctx.Logger().Info("Upgrade v15 complete") return vm, err } } -// UpgradeCommissionRate sets the minimum commission rate staking parameter to 5% +// UpgradeMinCommissionRate sets the minimum commission rate staking parameter to 5% // and updates the commission rate for all validators that have a commission rate less than 5% -func UpgradeCommissionRate(ctx sdk.Context, keepers *keepers.AppKeepers) { - params := keepers.StakingKeeper.GetParams(ctx) +func UpgradeMinCommissionRate(ctx sdk.Context, sk stakingkeeper.Keeper) { + params := sk.GetParams(ctx) params.MinCommissionRate = sdk.NewDecWithPrec(5, 2) - err := keepers.StakingKeeper.SetParams(ctx, params) + err := sk.SetParams(ctx, params) if err != nil { panic(err) } - for _, val := range keepers.StakingKeeper.GetAllValidators(ctx) { + for _, val := range sk.GetAllValidators(ctx) { if val.Commission.CommissionRates.Rate.LT(sdk.NewDecWithPrec(5, 2)) { // set the commission rate to 5% val.Commission.CommissionRates.Rate = sdk.NewDecWithPrec(5, 2) @@ -49,7 +50,7 @@ func UpgradeCommissionRate(ctx sdk.Context, keepers *keepers.AppKeepers) { val.Commission.CommissionRates.MaxRate = sdk.NewDecWithPrec(5, 2) } val.Commission.UpdateTime = ctx.BlockHeader().Time - keepers.StakingKeeper.SetValidator(ctx, val) + sk.SetValidator(ctx, val) } } } diff --git a/app/upgrades/v15/upgrades_test.go b/app/upgrades/v15/upgrades_test.go index bbbf4c1f11..b381be9100 100644 --- a/app/upgrades/v15/upgrades_test.go +++ b/app/upgrades/v15/upgrades_test.go @@ -16,7 +16,7 @@ import ( v15 "github.com/cosmos/gaia/v15/app/upgrades/v15" ) -func TestUpgradeCommissionRate(t *testing.T) { +func TestUpgradeMinCommissionRate(t *testing.T) { gaiaApp := helpers.Setup(t) ctx := gaiaApp.NewUncachedContext(true, tmproto.Header{}) @@ -51,9 +51,9 @@ func TestUpgradeCommissionRate(t *testing.T) { require.Equal(t, stakingKeeper.GetParams(ctx).MinCommissionRate, sdk.ZeroDec(), "non-zero previous min commission rate") // run the test and confirm the values have been updated - v15.UpgradeCommissionRate(ctx, &gaiaApp.AppKeepers) + v15.UpgradeMinCommissionRate(ctx, *stakingKeeper) - newStakingParams := gaiaApp.StakingKeeper.GetParams(ctx) + newStakingParams := stakingKeeper.GetParams(ctx) require.NotEqual(t, newStakingParams.MinCommissionRate, sdk.ZeroDec(), "failed to update min commission rate") require.Equal(t, newStakingParams.MinCommissionRate, sdk.NewDecWithPrec(5, 2), "failed to update min commission rate") From 0aebe9b8ec883ea8f154e5705ada3f6f8dd3104e Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Thu, 18 Jan 2024 10:25:37 +0100 Subject: [PATCH 34/43] doc --- app/upgrades/v15/upgrades.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/upgrades/v15/upgrades.go b/app/upgrades/v15/upgrades.go index cb50a69534..005424cd24 100644 --- a/app/upgrades/v15/upgrades.go +++ b/app/upgrades/v15/upgrades.go @@ -13,8 +13,10 @@ import ( // CreateUpgradeHandler returns a upgrade handler for Gaia v15 // which executes the following migrations: -// * set the MinCommissionRate param of the staking module to %5 and update all validators accordingly -// * update the slashing module SigningInfos for which the consensus address is empty +// - adhere to prop 826 which sets the minimum commission rate to 5% for all validators, +// see https://www.mintscan.io/cosmos/proposals/826 +// - update the slashing module SigningInfos for which the consensus address is empty, +// see https://github.com/cosmos/gaia/issues/1734. func CreateUpgradeHandler( mm *module.Manager, configurator module.Configurator, @@ -60,8 +62,8 @@ func UpgradeMinCommissionRate(ctx sdk.Context, sk stakingkeeper.Keeper) { } } -// UpgradeSigningInfos updates the signing infos of validators for which the consensus address -// is missing, see https://github.com/cosmos/gaia/issues/1734. +// UpgradeSigningInfos updates the signing infos of validators for which +// the consensus address is missing func UpgradeSigningInfos(ctx sdk.Context, sk slashingkeeper.Keeper) { signingInfos := []slashingtypes.ValidatorSigningInfo{} From 3ed79a292b6c2669905726d6ffaafdcb6fb0d197 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Thu, 18 Jan 2024 11:27:53 +0100 Subject: [PATCH 35/43] add .changelog entry --- .../unreleased/state-breaking/2891-migrate-vesting-funds.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/unreleased/state-breaking/2891-migrate-vesting-funds.md diff --git a/.changelog/unreleased/state-breaking/2891-migrate-vesting-funds.md b/.changelog/unreleased/state-breaking/2891-migrate-vesting-funds.md new file mode 100644 index 0000000000..16c4407436 --- /dev/null +++ b/.changelog/unreleased/state-breaking/2891-migrate-vesting-funds.md @@ -0,0 +1,3 @@ +Migrate vesting funds from "cosmos145hytrc49m0hn6fphp8d5h4xspwkawcuzmx498" + to community pool according to signal prop [860](https://www.mintscan.io/cosmos/proposals/860) + ([\#2891](https://github.com/cosmos/gaia/pull/2891)) \ No newline at end of file From 49a18b7a06540d529f69b47675681698caf6fcbf Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Thu, 18 Jan 2024 15:02:24 +0100 Subject: [PATCH 36/43] add tests --- app/upgrades/v15/upgrades_test.go | 60 ++++++++++++++++++++++++------- 1 file changed, 47 insertions(+), 13 deletions(-) diff --git a/app/upgrades/v15/upgrades_test.go b/app/upgrades/v15/upgrades_test.go index 711d9dce1b..f2373df0c6 100644 --- a/app/upgrades/v15/upgrades_test.go +++ b/app/upgrades/v15/upgrades_test.go @@ -4,6 +4,7 @@ import ( "testing" "time" + abci "github.com/cometbft/cometbft/abci/types" "github.com/stretchr/testify/require" tmrand "github.com/cometbft/cometbft/libs/rand" @@ -77,7 +78,7 @@ func TestUpgradeSigningInfos(t *testing.T) { slashingKeeper := gaiaApp.SlashingKeeper signingInfosNum := 8 - emptyAddrCtr := 0 + emptyAddrSigningInfo := make(map[string]struct{}) // create some dummy signing infos, half of which with an empty address field for i := 0; i < signingInfosNum; i++ { @@ -94,32 +95,34 @@ func TestUpgradeSigningInfos(t *testing.T) { 0, ) - if i <= signingInfosNum/2 { + if i < signingInfosNum/2 { info.Address = "" - emptyAddrCtr++ + emptyAddrSigningInfo[consAddr.String()] = struct{}{} } slashingKeeper.SetValidatorSigningInfo(ctx, consAddr, info) require.NoError(t, err) } - // check signing info were correctly created + require.Equal(t, signingInfosNum/2, len(emptyAddrSigningInfo)) + + // check that signing info are correctly set before migration slashingKeeper.IterateValidatorSigningInfos(ctx, func(address sdk.ConsAddress, info slashingtypes.ValidatorSigningInfo) (stop bool) { - if info.Address == "" { - emptyAddrCtr-- + if _, ok := emptyAddrSigningInfo[address.String()]; ok { + require.Empty(t, info.Address) + } else { + require.NotEmpty(t, info.Address) } return false }) - require.Zero(t, emptyAddrCtr) // upgrade signing infos v15.UpgradeSigningInfos(ctx, slashingKeeper) - // check that all signing info have the expected consensus address + // check that all signing info are updated as expected after migration slashingKeeper.IterateValidatorSigningInfos(ctx, func(address sdk.ConsAddress, info slashingtypes.ValidatorSigningInfo) (stop bool) { require.NotEmpty(t, info.Address) - require.Equal(t, address.String(), info.Address) return false }) @@ -136,8 +139,8 @@ func TestClawbackVestingFunds(t *testing.T) { distrKeeper := gaiaApp.DistrKeeper stakingKeeper := gaiaApp.StakingKeeper - ctx := gaiaApp.NewUncachedContext(true, tmproto.Header{}) - ctx = ctx.WithBlockHeader(tmproto.Header{Time: now}) + ctx := gaiaApp.NewUncachedContext(true, tmproto.Header{Height: 1}) + ctx = ctx.WithBlockHeader(tmproto.Header{Height: ctx.BlockHeight(), Time: now}) validator := stakingKeeper.GetAllValidators(ctx)[0] bondDenom := stakingKeeper.GetParams(ctx).BondDenom @@ -173,7 +176,8 @@ func TestClawbackVestingFunds(t *testing.T) { // delegate all vesting account tokens _, err := stakingKeeper.Delegate( - ctx, vestingAccount.GetAddress(), + ctx, + vestingAccount.GetAddress(), origCoins.AmountOf(bondDenom), stakingtypes.Unbonded, validator, @@ -209,7 +213,7 @@ func TestClawbackVestingFunds(t *testing.T) { v15.ClawbackVestingFunds(ctx, addr, &gaiaApp.AppKeepers) // check that the validator's delegation is removed and that - // the total tokens decreased + // their total tokens decreased validator = stakingKeeper.GetAllValidators(ctx)[0] _, found = stakingKeeper.GetDelegation(ctx, addr, validator.GetOperator()) require.False(t, found) @@ -219,6 +223,17 @@ func TestClawbackVestingFunds(t *testing.T) { math.LegacyNewDec(oldValTokens.Int64()), ) + // verify that all modules can end/begin blocks + gaiaApp.EndBlock(abci.RequestEndBlock{}) + gaiaApp.BeginBlock( + abci.RequestBeginBlock{ + Header: tmproto.Header{ + ChainID: ctx.ChainID(), + Height: ctx.BlockHeight() + 1, + }, + }, + ) + // check that the resulting account is of BaseAccount type now account, ok := accountKeeper.GetAccount(ctx, addr).(*authtypes.BaseAccount) require.True(t, ok) @@ -233,4 +248,23 @@ func TestClawbackVestingFunds(t *testing.T) { distrKeeper.GetFeePoolCommunityCoins(ctx). IsEqual(sdk.NewDecCoinsFromCoins(currVestingCoins...)), ) + + // verify that the tokens are spendable + _, err = stakingKeeper.Delegate( + ctx, addr, + sdk.NewInt(30), + stakingtypes.Unbonded, + validator, + true) + require.NoError(t, err) + + newAddr := sdk.AccAddress([]byte("addr1_______________")) + err = bankKeeper.SendCoins( + ctx, + addr, + newAddr, + sdk.NewCoins(sdk.NewCoin(bondDenom, sdk.NewInt(10))), + ) + require.NoError(t, err) + } From 12af7385005c3eac49a7f48b6513fdbcf0b0abdf Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Mon, 22 Jan 2024 09:47:55 +0100 Subject: [PATCH 37/43] update test --- app/upgrades/v15/upgrades_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/upgrades/v15/upgrades_test.go b/app/upgrades/v15/upgrades_test.go index b6a87b3718..134c0f3f80 100644 --- a/app/upgrades/v15/upgrades_test.go +++ b/app/upgrades/v15/upgrades_test.go @@ -144,7 +144,7 @@ func TestClawbackVestingFunds(t *testing.T) { // create continuous vesting account origCoins := sdk.NewCoins(sdk.NewInt64Coin(bondDenom, 100)) - addr := sdk.AccAddress([]byte("addr1_______________")) + addr := sdk.AccAddress([]byte("cosmos145hytrc49m0hn6fphp8d5h4xspwkawcuzmx498")) vestingAccount := vesting.NewContinuousVestingAccount( authtypes.NewBaseAccountWithAddress(addr), @@ -255,7 +255,7 @@ func TestClawbackVestingFunds(t *testing.T) { true) require.NoError(t, err) - newAddr := sdk.AccAddress([]byte("addr2_______________")) + newAddr := sdk.AccAddress([]byte("cosmos1qqp9myctmh8mh2y7gynlsnw4y2wz3s3089dak6")) err = bankKeeper.SendCoins( ctx, addr, From 919c237b626384349827512b79fc50a37e5f4f07 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Mon, 22 Jan 2024 09:52:08 +0100 Subject: [PATCH 38/43] lint --- app/upgrades/v15/upgrades_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/upgrades/v15/upgrades_test.go b/app/upgrades/v15/upgrades_test.go index 134c0f3f80..942b2a358f 100644 --- a/app/upgrades/v15/upgrades_test.go +++ b/app/upgrades/v15/upgrades_test.go @@ -4,11 +4,15 @@ import ( "testing" "time" - "cosmossdk.io/math" + "github.com/stretchr/testify/require" + abci "github.com/cometbft/cometbft/abci/types" tmrand "github.com/cometbft/cometbft/libs/rand" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" tmtime "github.com/cometbft/cometbft/types/time" + + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" "github.com/cosmos/cosmos-sdk/testutil/mock" sdk "github.com/cosmos/cosmos-sdk/types" @@ -17,7 +21,6 @@ import ( banktestutil "github.com/cosmos/cosmos-sdk/x/bank/testutil" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/stretchr/testify/require" "github.com/cosmos/gaia/v15/app/helpers" v15 "github.com/cosmos/gaia/v15/app/upgrades/v15" From ea30b95f16c6d128db7b36b2dab168ceda721d2d Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Mon, 22 Jan 2024 10:01:02 +0100 Subject: [PATCH 39/43] remove sdkerrors --- app/upgrades/v15/upgrades.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/upgrades/v15/upgrades.go b/app/upgrades/v15/upgrades.go index 89db335f52..d6ae68e662 100644 --- a/app/upgrades/v15/upgrades.go +++ b/app/upgrades/v15/upgrades.go @@ -1,6 +1,8 @@ package v15 import ( + "fmt" + "github.com/cosmos/cosmos-sdk/store/prefix" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -129,7 +131,7 @@ func ClawbackVestingFunds(ctx sdk.Context, address sdk.AccAddress, keepers *keep vestAccount, ok := account.(*vesting.ContinuousVestingAccount) if !ok { panic( - sdkerrors.Wrap( + fmt.Errorf("%s:%s", sdkerrors.ErrInvalidType, "account with address %s isn't a vesting account", ), @@ -229,15 +231,16 @@ func forceFundCommunityPool( ) error { recipientAcc := ak.GetModuleAccount(ctx, distributiontypes.ModuleName) if recipientAcc == nil { - return sdkerrors.Wrapf(sdkerrors.ErrUnknownAddress, distributiontypes.ModuleName) + return fmt.Errorf("%s:%s", sdkerrors.ErrUnknownAddress, distributiontypes.ModuleName) } senderBal := bk.GetBalance(ctx, sender, amount.Denom) if _, hasNeg := sdk.NewCoins(senderBal).SafeSub(amount); hasNeg { - return sdkerrors.Wrapf( + return fmt.Errorf( + "%s: spendable balance %s is smaller than %s", sdkerrors.ErrInsufficientFunds, - "spendable balance %s is smaller than %s", - senderBal, amount, + senderBal, + amount, ) } if err := setBalance(ctx, sender, senderBal.Sub(amount), bs); err != nil { @@ -270,7 +273,7 @@ func setBalance( bs storetypes.StoreKey, ) error { if !balance.IsValid() { - return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, balance.String()) + return fmt.Errorf("%s:%s", sdkerrors.ErrInvalidCoins, balance.String()) } store := ctx.KVStore(bs) From 4e0872e54201047ac1b9e0b4fd0bacb0d0039977 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Mon, 22 Jan 2024 13:31:01 +0100 Subject: [PATCH 40/43] Update app/upgrades/v15/upgrades.go Co-authored-by: Marius Poke --- app/upgrades/v15/upgrades.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/upgrades/v15/upgrades.go b/app/upgrades/v15/upgrades.go index d6ae68e662..3901bff30d 100644 --- a/app/upgrades/v15/upgrades.go +++ b/app/upgrades/v15/upgrades.go @@ -265,7 +265,7 @@ func forceFundCommunityPool( // setBalance sets the coin balance for an account by address. // Note that it follows the same logic of the sendBalance method in -// https://github.com/cosmos/cosmos-sdk/blob/release%2Fv0.47.x/x/bank/keeper/send.go#L337 +// https://github.com/cosmos/cosmos-sdk/blob/v0.47.7/x/bank/keeper/send.go#L337 func setBalance( ctx sdk.Context, addr sdk.AccAddress, From 11eff7c2ac1f6e3216274626019252087f3aef66 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Mon, 22 Jan 2024 14:42:35 +0100 Subject: [PATCH 41/43] remove panics --- app/upgrades/v15/upgrades.go | 78 +++++++++++++++++++------------ app/upgrades/v15/upgrades_test.go | 9 ++-- 2 files changed, 54 insertions(+), 33 deletions(-) diff --git a/app/upgrades/v15/upgrades.go b/app/upgrades/v15/upgrades.go index 3901bff30d..a0bf708af3 100644 --- a/app/upgrades/v15/upgrades.go +++ b/app/upgrades/v15/upgrades.go @@ -45,9 +45,18 @@ func CreateUpgradeHandler( return vm, err } - UpgradeMinCommissionRate(ctx, *keepers.StakingKeeper) - UpgradeSigningInfos(ctx, keepers.SlashingKeeper) - ClawbackVestingFunds(ctx, sdk.MustAccAddressFromBech32("cosmos145hytrc49m0hn6fphp8d5h4xspwkawcuzmx498"), keepers) + if err := UpgradeMinCommissionRate(ctx, *keepers.StakingKeeper); err != nil { + return nil, fmt.Errorf("failed migrating min commission rates: %s", err) + } + if err := UpgradeSigningInfos(ctx, keepers.SlashingKeeper); err != nil { + return nil, fmt.Errorf("failed migrating signing infos: %s", err) + } + if err := ClawbackVestingFunds( + ctx, + sdk.MustAccAddressFromBech32("cosmos145hytrc49m0hn6fphp8d5h4xspwkawcuzmx498"), + keepers); err != nil { + return nil, fmt.Errorf("failed migrating vesting funds: %s", err) + } ctx.Logger().Info("Upgrade v15 complete") return vm, err @@ -58,14 +67,13 @@ func CreateUpgradeHandler( // and updates the commission rate for all validators that have a commission rate less than 5% // adhere to prop 826 which sets the minimum commission rate to 5% for all validators // https://www.mintscan.io/cosmos/proposals/826 -func UpgradeMinCommissionRate(ctx sdk.Context, sk stakingkeeper.Keeper) { +func UpgradeMinCommissionRate(ctx sdk.Context, sk stakingkeeper.Keeper) error { ctx.Logger().Info("Migrating min commission rate...") params := sk.GetParams(ctx) params.MinCommissionRate = sdk.NewDecWithPrec(5, 2) - err := sk.SetParams(ctx, params) - if err != nil { - panic(err) + if err := sk.SetParams(ctx, params); err != nil { + return err } for _, val := range sk.GetAllValidators(ctx) { @@ -82,11 +90,12 @@ func UpgradeMinCommissionRate(ctx sdk.Context, sk stakingkeeper.Keeper) { } ctx.Logger().Info("Finished migrating min commission rate") + return nil } // UpgradeSigningInfos updates the signing infos of validators for which // the consensus address is missing -func UpgradeSigningInfos(ctx sdk.Context, sk slashingkeeper.Keeper) { +func UpgradeSigningInfos(ctx sdk.Context, sk slashingkeeper.Keeper) error { ctx.Logger().Info("Migrating signing infos...") signingInfos := []slashingtypes.ValidatorSigningInfo{} @@ -112,11 +121,12 @@ func UpgradeSigningInfos(ctx sdk.Context, sk slashingkeeper.Keeper) { } ctx.Logger().Info("Finished migrating signing infos") + return nil } // ClawbackVestingFunds transfers the vesting tokens from the given vesting account // to the community pool -func ClawbackVestingFunds(ctx sdk.Context, address sdk.AccAddress, keepers *keepers.AppKeepers) { +func ClawbackVestingFunds(ctx sdk.Context, address sdk.AccAddress, keepers *keepers.AppKeepers) error { ctx.Logger().Info("Migrating vesting funds...") ak := keepers.AccountKeeper @@ -130,23 +140,34 @@ func ClawbackVestingFunds(ctx sdk.Context, address sdk.AccAddress, keepers *keep // verify that it's a vesting account type vestAccount, ok := account.(*vesting.ContinuousVestingAccount) if !ok { - panic( - fmt.Errorf("%s:%s", - sdkerrors.ErrInvalidType, - "account with address %s isn't a vesting account", - ), + ctx.Logger().Error( + "failed migrating vesting funds: %s: %s", + "provided account address isn't a vesting account: ", + address.String(), ) + + return nil + } + + // returns if no coins are vesting + _, vestingCoins := vestAccount.GetVestingCoins(ctx.BlockTime()).Find(sk.BondDenom(ctx)) + if vestingCoins.IsNil() { + ctx.Logger().Info( + "%s: %s", + "no vesting coins to migrate", + "Finished migrating vesting funds", + ) + + return nil } // unbond all delegations from vesting account - err := forceUnbondAllDelegations(sk, bk, ctx, address) - if err != nil { - panic(err) + if err := forceUnbondAllDelegations(sk, bk, ctx, address); err != nil { + return err } // transfers still vesting tokens of BondDenom to community pool - _, vestingCoins := vestAccount.GetVestingCoins(ctx.BlockTime()).Find(sk.BondDenom(ctx)) - err = forceFundCommunityPool( + if err := forceFundCommunityPool( ak, dk, bk, @@ -154,21 +175,20 @@ func ClawbackVestingFunds(ctx sdk.Context, address sdk.AccAddress, keepers *keep vestingCoins, address, keepers.GetKey(banktypes.StoreKey), - ) - if err != nil { - panic(err) + ); err != nil { + return err } // overwrite vesting account using its embedded base account ak.SetAccount(ctx, vestAccount.BaseAccount) // validate account balance - err = bk.ValidateBalance(ctx, address) - if err != nil { - panic(err) + if err := bk.ValidateBalance(ctx, address); err != nil { + return err } ctx.Logger().Info("Finished migrating vesting funds") + return nil } // forceUnbondAllDelegations unbonds all the delegations from the given account address, @@ -194,20 +214,18 @@ func forceUnbondAllDelegations( return err } + coins := sdk.NewCoins(sdk.NewCoin(sk.BondDenom(ctx), returnAmount)) + // transfer the validator tokens to the not bonded pool if validator.IsBonded() { // doing stakingKeeper.bondedTokensToNotBonded - coins := sdk.NewCoins(sdk.NewCoin(sk.BondDenom(ctx), returnAmount)) err = bk.SendCoinsFromModuleToModule(ctx, stakingtypes.BondedPoolName, stakingtypes.NotBondedPoolName, coins) if err != nil { return err } } - bondDenom := sk.GetParams(ctx).BondDenom - amt := sdk.NewCoin(bondDenom, returnAmount) - - err = bk.UndelegateCoinsFromModuleToAccount(ctx, stakingtypes.NotBondedPoolName, delegator, sdk.NewCoins(amt)) + err = bk.UndelegateCoinsFromModuleToAccount(ctx, stakingtypes.NotBondedPoolName, delegator, coins) if err != nil { return err } diff --git a/app/upgrades/v15/upgrades_test.go b/app/upgrades/v15/upgrades_test.go index 942b2a358f..958f8850aa 100644 --- a/app/upgrades/v15/upgrades_test.go +++ b/app/upgrades/v15/upgrades_test.go @@ -72,7 +72,7 @@ func TestUpgradeSigningInfos(t *testing.T) { }) // upgrade signing infos - v15.UpgradeSigningInfos(ctx, slashingKeeper) + require.NoError(t, v15.UpgradeSigningInfos(ctx, slashingKeeper)) // check that all signing info are updated as expected after migration slashingKeeper.IterateValidatorSigningInfos(ctx, func(address sdk.ConsAddress, info slashingtypes.ValidatorSigningInfo) (stop bool) { @@ -117,7 +117,7 @@ func TestUpgradeMinCommissionRate(t *testing.T) { require.Equal(t, stakingKeeper.GetParams(ctx).MinCommissionRate, sdk.ZeroDec(), "non-zero previous min commission rate") // run the test and confirm the values have been updated - v15.UpgradeMinCommissionRate(ctx, *stakingKeeper) + require.NoError(t, v15.UpgradeMinCommissionRate(ctx, *stakingKeeper)) newStakingParams := stakingKeeper.GetParams(ctx) require.NotEqual(t, newStakingParams.MinCommissionRate, sdk.ZeroDec(), "failed to update min commission rate") @@ -200,6 +200,9 @@ func TestClawbackVestingFunds(t *testing.T) { require.Equal(t, vestingAccount.GetDelegatedVesting(), origCoins) require.Empty(t, vestingAccount.GetDelegatedFree()) + // check that migration succeeds when all coins are alreay vested + require.NoError(t, v15.ClawbackVestingFunds(ctx.WithBlockTime(endTime), addr, &gaiaApp.AppKeepers)) + // vest half of the tokens ctx = ctx.WithBlockTime(now.Add(12 * time.Hour)) @@ -210,7 +213,7 @@ func TestClawbackVestingFunds(t *testing.T) { require.True(t, currVestedCoins.IsEqual(origCoins.QuoInt(math.NewInt(2)))) // execute migration script - v15.ClawbackVestingFunds(ctx, addr, &gaiaApp.AppKeepers) + require.NoError(t, v15.ClawbackVestingFunds(ctx, addr, &gaiaApp.AppKeepers)) // check that the validator's delegation is removed and that // their total tokens decreased From 7f50252111930f96c62cb7ba25be0e251fdafa20 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Mon, 22 Jan 2024 14:43:13 +0100 Subject: [PATCH 42/43] Update app/upgrades/v15/upgrades.go Co-authored-by: Marius Poke --- app/upgrades/v15/upgrades.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/upgrades/v15/upgrades.go b/app/upgrades/v15/upgrades.go index a0bf708af3..a89ac094bc 100644 --- a/app/upgrades/v15/upgrades.go +++ b/app/upgrades/v15/upgrades.go @@ -282,7 +282,7 @@ func forceFundCommunityPool( } // setBalance sets the coin balance for an account by address. -// Note that it follows the same logic of the sendBalance method in +// Note that it follows the same logic of the setBalance method in // https://github.com/cosmos/cosmos-sdk/blob/v0.47.7/x/bank/keeper/send.go#L337 func setBalance( ctx sdk.Context, From 6a22eee8e37979864c3991986e2ed16cc09fe05c Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Tue, 23 Jan 2024 11:56:47 +0100 Subject: [PATCH 43/43] refactor --- app/upgrades/v15/upgrades.go | 12 ++++++++---- app/upgrades/v15/upgrades_test.go | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/upgrades/v15/upgrades.go b/app/upgrades/v15/upgrades.go index a89ac094bc..2b07077ed5 100644 --- a/app/upgrades/v15/upgrades.go +++ b/app/upgrades/v15/upgrades.go @@ -149,9 +149,13 @@ func ClawbackVestingFunds(ctx sdk.Context, address sdk.AccAddress, keepers *keep return nil } - // returns if no coins are vesting - _, vestingCoins := vestAccount.GetVestingCoins(ctx.BlockTime()).Find(sk.BondDenom(ctx)) - if vestingCoins.IsNil() { + // returns if the account has no vesting coins of the bond denom + vestingCoinToClawback := sdk.Coin{} + if vc := vestAccount.GetVestingCoins(ctx.BlockTime()); !vc.Empty() { + _, vestingCoinToClawback = vc.Find(sk.BondDenom(ctx)) + } + + if vestingCoinToClawback.IsNil() { ctx.Logger().Info( "%s: %s", "no vesting coins to migrate", @@ -172,7 +176,7 @@ func ClawbackVestingFunds(ctx sdk.Context, address sdk.AccAddress, keepers *keep dk, bk, ctx, - vestingCoins, + vestingCoinToClawback, address, keepers.GetKey(banktypes.StoreKey), ); err != nil { diff --git a/app/upgrades/v15/upgrades_test.go b/app/upgrades/v15/upgrades_test.go index 958f8850aa..5d2c6723b1 100644 --- a/app/upgrades/v15/upgrades_test.go +++ b/app/upgrades/v15/upgrades_test.go @@ -200,7 +200,7 @@ func TestClawbackVestingFunds(t *testing.T) { require.Equal(t, vestingAccount.GetDelegatedVesting(), origCoins) require.Empty(t, vestingAccount.GetDelegatedFree()) - // check that migration succeeds when all coins are alreay vested + // check that migration succeeds when all coins are already vested require.NoError(t, v15.ClawbackVestingFunds(ctx.WithBlockTime(endTime), addr, &gaiaApp.AppKeepers)) // vest half of the tokens