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 00000000000..0288fc07755 --- /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 00000000000..7271151c27d --- /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 00000000000..06b902a1f87 --- /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 00000000000..c4c7acac6b8 --- /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 00000000000..53bc7b40872 --- /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 00000000000..06b902a1f87 --- /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 00000000000..e3f67076284 --- /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 00000000000..53bc7b40872 --- /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 00000000000..114d570d464 --- /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 00000000000..b0ce066b4f1 --- /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 00000000000..803634e7447 --- /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 00000000000..1bfca86072e --- /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 00000000000..093e5b3bf50 --- /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 00000000000..803634e7447 --- /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 00000000000..b0ce066b4f1 --- /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 00000000000..b0ce066b4f1 --- /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 00000000000..803634e7447 --- /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 00000000000..957dea6d0d8 --- /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 00000000000..80d24c0506d --- /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 00000000000..4c861ee7ab5 --- /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 00000000000..4c861ee7ab5 --- /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 00000000000..1d32a4b7916 --- /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 00000000000..eb6a54022f3 --- /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 00000000000..eb6a54022f3 --- /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 00000000000..515fb8e5510 --- /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 00000000000..990c38921f4 --- /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 00000000000..36a2ea69ca4 --- /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 00000000000..f171df2c9f2 --- /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 00000000000..c621f2bb807 --- /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 00000000000..06408cd40e4 --- /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 00000000000..c621f2bb807 --- /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 00000000000..09ecc72ad63 --- /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 00000000000..593251b2898 --- /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 00000000000..78c44554ea1 --- /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 00000000000..00bfa1d910f --- /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 00000000000..1ffe596333e --- /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 00000000000..78c44554ea1 --- /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 00000000000..64a8f95923c --- /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 b04d7ac01de..1aaef755e50 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 576bda07bb7..1296f84bd5d 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 3f9656eee34..887e7a38fd1 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 8d277c69247..71ecf62e0af 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 8af0369a224..257a5851e25 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 ecac0028281..bac5c0f5b51 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 8a5f8f1277c..b9071633b5e 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 23de2453c6e..dd78d4a10e3 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 f37525e3abb..7ef80a89515 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 6afb60fbaa8..2b3d862591c 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 ce6dd57dabf..80a2cae87db 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 ac08bddd5d1..4813c555255 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 f42ebf99ea8..0d4653439b5 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 9b6e8ad4719..6eae92cbe71 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 16e6b85ed1f..be707e42187 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 5de6010b1f4..aac2b9a54ee 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 9ecc6eb6562..571a47462c2 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 b17ad3bca62..97ee84b16ac 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 b77454f0603..6fe80985728 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 12b4ee9e1f4..7930557978d 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 c9317343d6a..499cc6132f6 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 091c31504f2..00000000000 --- 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 636d34e850a..1a7a1d514a4 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 00000000000..262444f45d2 --- /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 be5ceb890cc..e7eb2257451 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 465123795c9..4f39379747f 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 79a147f200e..2564bdc77cd 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 6f1831cdebf..3619dad6543 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 289ea020fb3..592613731fb 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 bf2a44ad9b6..a6daee49210 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 1cf906d1a63..6c7a804a257 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 c4bbbbe2268..0c170ee5894 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 00000000000..79153cec0b1 --- /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 25e4a2dbce8..dcab4eb3b12 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 ad1aa9a94dc..eb490400d7d 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 700ffc819b4..26e967a7230 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 ba3be8ab087..cee101d5ea5 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 fd6b8a24df6..f622569cb04 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 f0b3b4872f5..35472831d7f 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 b83f7a2cdcc..c6e1f2e083d 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 4605b3441ea..5547c5811f6 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 a4b8c3ac3e1..06ba7265b6a 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 c5884c1c0d9..04cfab5f79a 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 908561bf1ef..3e362c138b0 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 13055c67ee7..e9e3685cd00 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 f01ba40b2be..ff2380114ad 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 00000000000..5f255c844eb --- /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 00000000000..a30204a0ab8 --- /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 00000000000..dce0714f357 --- /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 00000000000..ce2cdb6cc66 --- /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 00000000000..72653142932 --- /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 00000000000..9dfc1b0f61c --- /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 00000000000..18216ab7ddb --- /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 00000000000..ee9c0b485d4 --- /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 b5ab2db9679..803800da456 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 3d7e9f2b682..f3d86567ca0 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 827076bc273..a5507ed8d2e 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 898b1c3c7ea..850ede2be56 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 a63bfdad098..d0b8c792a36 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 5cdb6a59fa3..0f26347fdce 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 ab16076a394..283592a54aa 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 473e3f85a6c..00000000000 --- 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 a9bb5cca8db..7c0e243cbec 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 b30bca9382a..52a61bc988f 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 542d2940da6..06aa0743a71 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 00000000000..c307b5c8e7d --- /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 00000000000..9859bb82619 --- /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 00000000000..454cf07e830 --- /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 00000000000..38040780807 --- /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 00000000000..12c110f02d6 --- /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 00000000000..a547cc29186 --- /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 00000000000..bbf11bd7e2f --- /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 c73c97c5d71..30f0b57abf3 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 00000000000..f48e23d8945 --- /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 00000000000..95e5a5886e6 --- /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 59ff06b016b..9f1da5b517f 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 e643b4d7160..016d092832a 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 5f24b6dc254..917646d38a1 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 97768a26c6c..0145e3acfc0 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 6d005526087..9f7c17e47ae 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 00000000000..542cfe76679 --- /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 a71aff0f055..37165fd4635 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 3f3e6d23fdf..b60a898db2f 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 7585d5ab8e0..6e29879a967 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 6a27bde7257..1a35d7069fb 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 f0bb945fd95..82b1e619494 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 15b284e3c30..b878f712183 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 2f908340629..ddc3bc094ed 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 2c5b2548a4d..8bef7f6f29a 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 ce1d31c9c58..ae229cbe435 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 13e3cf945da..91013984d59 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 5fdefcfba5f..6136fa153fe 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 5d96075c215..7ec7c4e061c 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 1aa5b1666a4..570369cdf58 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 16954f26c50..00000000000 --- 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 297d8cb9f13..49fd3c1eeba 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 bef08933f83..36cc1ecaeb9 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 755597eab59..24a583d5cd2 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 ce1bd79b15b..152493c786e 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 00000000000..3d177a85521 --- /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 00000000000..9b43cf34aaf --- /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 00000000000..187721954a6 --- /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 00000000000..f0e898cdf79 --- /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 21ab16097ae..e218e49167b 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 f60d35c956e..1984cb2494d 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 94462b50435..7ee8ceff735 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 4f8eda6bbec..36ef3607f88 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 7d9769258d9..688d77cb05e 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 6a2ef421170..00000000000 --- 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 28201837e5e..00000000000 --- 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 98d8e19ac72..00000000000 --- 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 e7f148a2b98..00000000000 --- 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 db03440a03c..5f74ec2aa52 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 4cdd8a32a64..0950153fa28 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 a8311b553a3..2c8f1458298 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 e2bfd009fc5..e1048332664 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 8ab1c4cdc63..42c6fc266f4 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 548829568a1..76c73bd35d6 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 9db6d827c02..88869e860e1 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 194278c6b34..d4a96c78b01 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 59d100914c5..82a3c49b0b4 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 df064e98d32..454e885d0f6 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 22339a351a7..48df1341546 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 134dfdb909b..e84a8f04f9e 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 bcfffa5b4b0..9de4cdea8de 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 ea90f49ab62..8ac4c31899f 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 00000000000..cb30a9427b7 --- /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 992526387fa..09ac4822227 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 0a616530d28..f9ffe4f438b 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 6f5d231b2ef..92e04590238 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 00ea348bdbe..7e449009f71 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 44d12bb303a..b1f03ae968e 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 ac804aa5dce..59690509838 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 a2235a2b1c2..e063a290a91 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 594fce105e2..505e9da1c10 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 a94c4fc0f4d..dee698f5b54 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 0cc44507963..63513162c22 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 af09e2a2d82..aed5203d4c6 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 fa132e1d8b8..c25151973dc 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 8378e467135..7bf9e914152 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 b3b2056fc37..099eaed32c1 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 073e355ae2a..f9f3be2e850 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 64f08edd3b6..25673874fa7 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 176ff59d6f1..99fd8ec5248 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 7b6e5a2425e..cd56078fe1d 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 d6add4249f1..917ba8e7493 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 4ddd5ac28f7..b905faa0ad8 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 253df889c6a..b0e94687fbe 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 dc21409304f..0a7cab846e9 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 b2c2931674a..78d17ba80aa 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) {